-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make cargo aware of the BROWSER environment variable. #6064
Comments
@d3rped which version of rust are you using and which platform are you on (linux, windows, etc.). The previous behavior (in order of what is attempted):
Starting in rust 1.30 (beta), a new strategy is used which is a bit more complex. |
I'm using Linux (NixOS).
It respects the environment variable. Installing the same version with rustup it works as well.... |
The older nightly version you are referencing (2018-07-24) was before the new behavior was introduced. The latest nightly uses @alexcrichton @Seeker14491 What is the motivation for having the BROWSER environment variable be lowest priority? Normally, to me, environment variables should be highest, overriding all other settings. |
This behavior is the result of #5888, which modified Cargo to use the opener crate I wrote. The idea was to pull out the browser-opening functionality of Cargo and rustup out into a crate to reduce code duplication. There were several factors that influenced the choice of not having the
Anyways, I'd like to hear everyone's thoughts on this. @TheNeikos wrote the pull request to Cargo adding the |
Here are a few reasons why I'd like to use a different browser:
Alternatively I could just add a second profile to firefox. |
I have initially written the PR because I strongly believe that ENV variables configuration should be respected before other programs are consulted. Similar to “$EDITOR”. I personally don’t use xdg-open (unless another’s program forces it) so by having it respect my browser I can be sure that it does what I want at the moment. Configuring xdg-open is a pain though. A possible alternative could be adding a switch specifying the browser? Or maybe return a URL that could be piped. |
I proposed the PR in But the same I think the ENV should be considered each time the code operates on a closed set of options, so that there is some way to escape from the loop in unsupported conditions without messing the PATH. |
It seems reasonable to me to support |
If we want to support this, we should implement it in the |
Somehow it works after I reinstall firefox. |
I've just started out learning rust so I heavily use the documentation of both the std libraries/cates and external crates. For that I use the doc option of rustup and cargo respectively.
rustup checks for the BROWSER environment variable and in my opinion so should cargo.
BROWSER=chromium cargo doc --open
The text was updated successfully, but these errors were encountered: