Menu

#1500 Preview: Problems with programs outside regular paths

unverified
closed-fixed
nobody
None
5
2017-02-13
2016-10-04
No

I know hat BibDesk does not really biber, still, I was able to use it for years. Preview would work for most cases, if I just entered /Library/TeX/texbin/biber as bibtex Path in the prefs.

This still works, but what does not seem to work, is if I use a programm outside of the regular texbin path. When I build biber from GitHub, it is installed in /opt/local/bin/biber. I can call this build from bash or from TeXShop, but BibDesk seems to ignore it. Preview fails, and biber does not appear in the log.

Discussion

1 2 > >> (Page 1 of 2)
  • Christiaan Hofman

    I don't see why it would not work, we just use the command as su[plied. What does the log output in the separate preview window say?

     
  • Simon Spiegel

    Simon Spiegel - 2016-10-04

    The log says nothing about biber, it is not mentioned except that biblatex says it can't find the required .bcf and therefore advises to run biber. When the path is /Library/TeX/texbin/biber I also get log for biber.

     
    • Christiaan Hofman

      We really do not care about the paths, we just use what we are told. So it must be some problem with your installation. Perhaps you have something set up in your shell initialization file(s) that make things work? In that case, you also need to do that setup in other places that we can learn about, such as in envirnment.plist.

      I know nothing about any of these things (like non-custom installations, biber, and biblatex), so I don't know what is needed to make it work. But it must be something about your setup, because we don't care.

       
  • Simon Spiegel

    Simon Spiegel - 2016-10-04

    The .log file gives me the following:

    environment:
    SHELL = "/bin/bash"
    BIBINPUTS = "(null)"
    BSTINPUTS = "(null)"
    TEXINPUTS = "(null)"
    TEXCONFIG = "(null)"
    TEXMFCONFIG = "(null)"
    PATH = "/usr/bin:/bin:/usr/sbin:/sbin" }

    /opt/local/bin is defined as path in .bash_profile, but if I understand the log correctly, BibDesk does not seem to pick this up (even though the full path is given in the prefs). Where can I define the paths for BibDesk-

     
    • Christiaan Hofman

      There's your problem, I guess. BibDesk, or any app for that matter, does not load your initialization files. Those are only loaded when you run the command line yourself. So we don't know the PATH and other environment variables that may be needed for your setup.

      If any app (like BibDesk) needs special environment variables, you can set them in the file ~/.MacOSX/environment.plist, which you may need to create if it doesn't yet exists.

       
      • Simon Spiegel

        Simon Spiegel - 2016-10-04

        I'll look into that. What I don't get is why the PATH is relevant when I give the whole path to biber in the prefs.

         
        • Christiaan Hofman

          Probably because the command uses other commands and files that it needs to find.

           
          • Simon Spiegel

            Simon Spiegel - 2016-10-04

            But judging from the log, biber isn't even called, Anyway, your solution does not seem to work, ~/.MacOSX/environment.plist has been deprecated.

             
            • Christiaan Hofman

              If biber isn't run, than it must go wrong already in the first or second tex run. If the command fails, the rest isn't called. I don't know why it fails, it may be again because your PATH isn't pointing to your custom location.

               
            • Christiaan Hofman

              It looks like the environment variables we report in the log aren't exactly the ones that are used (even though they should be the same, somehow the various methods give us inonsistent results). That will be fixed in the next nightly build. But the actual variables we use won't be affected by your initialization file, and apparently also not environment.plst anymore, unfortunately. However, for me the PATH does include /Library/TeX/texbin, so there is some initialization file that sets this, and the tex installer has set that properly. I guess your custom installation did not do that, which means your instalation isn't complete (that's the risk of using custom installations). I'm not sure where the path needs to be set nowaday though.

               
              • Simon Spiegel

                Simon Spiegel - 2016-10-04

                It's not really a "custom installation". It's a regular MacTeX installation with the paths of mapcorts added to bash.

                Anyway, I finally was able to do it. The trick is to add a .plist file to ~/Library/LaunchAgents which contains something like this:

                <plist version="1.0">
                <dict>
                <key>Label</key>
                <string>osx-env-sync</string>
                <key>ProgramArguments</key>
                <array>
                <string>bash</string>
                <string>-l</string>
                <string>-c</string>
                <string>
                export PATH="/opt/local/bin:/opt/local/sbin:$PATH" </string>
                </array>
                <key>RunAtLoad</key>
                <true>
                </true></dict>
                </plist>

                 
  • Christiaan Hofman

    • status: open --> closed-wont-fix
     
  • Christiaan Hofman

    It seems like mactex adds a file in /etc/paths.d that contains the tex library, so you could also add a file with the required path there.

     
    • Christiaan Hofman

      Ignore thast, this does not seem to affect app environments.

       
  • Adam Maxwell

    Adam Maxwell - 2016-10-04

    Environment.plist has been dead since 10.7, thankfully! NSTask environments are bare-bones, and only inherit from the calling process (BibDesk, in this case, which usually inherits from Launch Services). In TeX Live Utility, I have to do a bunch of work to ensure a sane PATH since users kept breaking things by mixing MacTeX/fink/macports.

    https://github.com/amaxwell/tlutility/blob/master/TLMEnvironment.m#L398

    The best way to log the actual environment is to run env with NSTask and dump it to stdout; then you can see what Apple's doing, and anything Launch Services is doing.

    https://github.com/amaxwell/tlutility/blob/master/TLMEnvironment.m#L648

    In general, it's best not to do mix distributions or encourage it; anything using kpsewhich, for instance, will have problems, and you'll have bugs that are damn near impossible to track down. Simon's best workaround is probably to create a symlink to his biber in the TL directory or just install it into his TeX Live.

     
    • Simon Spiegel

      Simon Spiegel - 2016-10-04

      I am not mixing distributions. I think my reference to macports was confusing. I do not use the macports TeX distribution. I merely build biber from GitHub and since it needs a newer version of Perl than macOS offers, I need to install Perl first. This is where macports comes in and that's why my biber build resides in /opt/local/bin/biber (I also like the side effect that the biber version installed by MacTeX remains untouched. So I can always switch back). But macport's "TeX activitities" are confined to biber, everything else is MacTeX.

       
      • Christiaan Hofman

        I have to correct something I said. In fact, /Library/TeX/texbin is not in the PATH for the app. We add it ourselves, more precisely the directory of the tex command. We don't do that for the bibtex command, but normally it's tye same. So the problem you find is that you use commands located in different locations.

         
        • Christiaan Hofman

          I have now added both binary directories to the PATH for tomorrow's nightlies. Please try it to see if that works for you.

           
          • Simon Spiegel

            Simon Spiegel - 2016-10-05

            I have downloaded the latest nightly, but I am not sure what should have changed. It seems that now the correct PATH is displayed in the log, but besides that, everything is the same. I still need to use the solution with a LaunchAgent described above.

             
            • Christiaan Hofman

              Are you sure? As the problem was the PATH, and the PATH now includes the correct path, why shouldn't this work? The one we npw show in the log is the one we use for the command.

               
              • Simon Spiegel

                Simon Spiegel - 2016-10-05

                Not sure we're talking about the same thing here. BibDesk now displays the PATH in its log which has been set outside of BibDesk, with the LaunchAgent approach I described above. But fact is that I stll need to set this PATH. Simply telling BibDesk in the prefs to use /opt/local/bin/biber is not enough, BibDesk wont find the program. Maybe this cannot be helped, I don't know.

                I now have this working, so the problem is solved for me. Still, as a user I find it strange that BibDesk wont find a program even if the exact path is given. This is for me the real issue here

                 
                • Christiaan Hofman

                  The PATH should now contain both the containing path for the tex program and the bibtex program, without the need for a LaunchAgent. Isn't that the case? It does work for me. And do you have build version 4012?

                   
                  • Simon Spiegel

                    Simon Spiegel - 2016-10-05

                    I have build version 4012. Without the LaunchAgent, the log gives me the following:

                    ivars:
                    delegate = "<bdskpreviewer: 0x10c28ba90="">"
                    file name = "bibpreview"
                    template = "/Users/simi/Library/Application Support/BibDesk/previewtemplate.tex"
                    TeX file = "/var/folders/qk/n92ltfdj3wqb88csjgjgw67m0000gn/T/bibdesk.3RenxI/bibpreview/bibpreview.tex"
                    BibTeX file = "/var/folders/qk/n92ltfdj3wqb88csjgjgw67m0000gn/T/bibdesk.3RenxI/bibpreview/bibpreview.bib"
                    TeX binary paths = {(
                    "/Library/TeX/texbin"
                    )}
                    Encoding = "Unicode (UTF-8)"
                    BibTeX style = "jurabib"
                    Helper files = (
                    )</bdskpreviewer:>

                    environment:
                    SHELL = "/bin/bash"
                    BIBINPUTS = "(null)"
                    BSTINPUTS = "(null)"
                    TEXINPUTS = "(null)"
                    TEXCONFIG = "(null)"
                    TEXMFCONFIG = "(null)"
                    PATH = "/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin" }

                    None of this helps BibDesk to find /opt/local/bin/biber.

                     

                    Last edit: Simon Spiegel 2016-10-05
                    • Christiaan Hofman

                      Sorry, you;re right, there was a typo in the code. That will be fixed in the next nightly.

                       
                      • Simon Spiegel

                        Simon Spiegel - 2016-10-06

                        With build 4013 this seems now completely broken. Although BibDesk picks up the correct PATH (see log), biber is still not running. What's worse, LaunchAgents now seem to have no effect anymore. So my solution stopped working.

                        <bdsktextask: 0x1155e0d00=""> {
                        ivars:
                        delegate = "<bdskpreviewer: 0x1155e0b20="">"
                        file name = "bibpreview"
                        template = "/Users/simi/Library/Application Support/BibDesk/previewtemplate.tex"
                        TeX file = "/var/folders/qk/n92ltfdj3wqb88csjgjgw67m0000gn/T/bibdesk.LVYt6j/bibpreview/bibpreview.tex"
                        BibTeX file = "/var/folders/qk/n92ltfdj3wqb88csjgjgw67m0000gn/T/bibdesk.LVYt6j/bibpreview/bibpreview.bib"
                        TeX binary paths = {(
                        "/Library/TeX/texbin",
                        "/opt/local/bin"
                        )}
                        Encoding = "Unicode (UTF-8)"
                        BibTeX style = "jurabib"
                        Helper files = (
                        )</bdskpreviewer:></bdsktextask:>

                        environment:
                        SHELL = "/bin/bash"
                        BIBINPUTS = "(null)"
                        BSTINPUTS = "(null)"
                        TEXINPUTS = "(null)"
                        TEXCONFIG = "(null)"
                        TEXMFCONFIG = "(null)"
                        PATH = "/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/opt/local/bin" }

                         
1 2 > >> (Page 1 of 2)

Log in to post a comment.

MongoDB Logo MongoDB