-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Update documentation for brew install
and FAQ regarding HOMEBREW_NO_INSTALL_FROM_API
#14570
Conversation
Library/Homebrew/cmd/install.rb
Outdated
|
||
Unless `HOMEBREW_NO_INSTALL_FROM_API` is set, `brew install` will ignore your locally edited formula | ||
done using `brew edit`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be documented in brew edit
instead. Most users of brew install
probably aren't interested in this information, but all users of brew edit
will probably need to know it.
Maybe brew edit
can print a warning that can be silenced with HOMEBREW_NO_ENV_HINTS
? We could probably also drop the reference to HOMEBREW_NO_INSTALL_FROM_API
in the FAQ below if we do this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have removed the message from install
and added the warning in edit
in 34a19cf.
I still think the FAQ should be updated since the command mentioned in it is flat-out wrong; I suppose people might notice the warning when they run brew edit
but still...
But let me know if you'd like me to / feel free to drop 14927bb
Library/Homebrew/dev-cmd/edit.rb
Outdated
Unless `HOMEBREW_NO_INSTALL_FROM_API` is set when running | ||
`brew install`, it will ignore your locally edited formula. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless `HOMEBREW_NO_INSTALL_FROM_API` is set when running | |
`brew install`, it will ignore your locally edited formula. | |
For your changes to take effect, you must set `HOMEBREW_NO_INSTALL_FROM_API`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd also mention this only applies to core formulae/casks too.
Ideally this message would also only display if you pass an arg to a core formula/cask and not when you edit a tap one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This definitely needs to be updated. Thanks for taking a stab at it.
docs/FAQ.md
Outdated
@@ -140,7 +140,7 @@ If all maintainer feedback has been addressed and all tests are passing, bump it | |||
|
|||
## Can I edit formulae myself? | |||
|
|||
Yes! It’s easy! Just `brew edit <formula>`. You don’t have to submit modifications back to `homebrew/core`, just edit the formula to what you personally need and `brew install <formula>`. As a bonus, `brew update` will merge your changes with upstream so you can still keep the formula up-to-date **with** your personal modifications! | |||
Yes! It’s easy! Just `brew edit <formula>`. You don’t have to submit modifications back to `homebrew/core`, just edit the formula to what you personally need and `HOMEBREW_NO_INSTALL_FROM_API=1 brew install <formula>`. As a bonus, `brew update` will merge your changes with upstream so you can still keep the formula up-to-date **with** your personal modifications! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stupid question: does brew update
need HOMEBREW_NO_INSTALL_FROM_API=1
here too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, HOMEBREW_NO_INSTALL_FROM_API
needs to be set only for the install
.
I don't think it does anything to update
.
I misunderstood and also now question if the local changes are also kept (like the FAQ entry claimed) when update
is done with the API 🤔
However I think this could be a separate issue/pr if turns out to be incorrect
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This piece of documentation is out-of-date so I'm not sure I would trust it in this case. The brew update
command doesn't update the homebrew/core
and homebrew/cask
taps when using the API so your changes shouldn't get overwritten but no upstream changes will get merged in either.
brew/Library/Homebrew/cmd/update-report.rb
Line 159 in 1cf53b4
next if (tap.core_tap? || tap == "homebrew/cask") && Homebrew::EnvConfig.install_from_api? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be clear I'm not sure that changing that is within the scope of this PR but it does make me wonder how we should handle these things going forward. Passing HOMEBREW_NO_INSTALL_FROM_API
implicitly every time the brew edit
command is called seems to make sense until you realize that it causes unexpected behavior when using other commands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@apainintheneck @EricFromCanada any suggestions on how to update this documentation to be both correct and helpful would be handy.
Passing
HOMEBREW_NO_INSTALL_FROM_API
implicitly every time thebrew edit
command is called seems to make sense until you realize that it causes unexpected behavior when using other commands.
Agreed this could be tweaked/improved. Don't think it's worth reverting this, though.
Thanks for the PR @s4nji, you rock! |
brew style
with your changes locally?brew typecheck
with your changes locally?brew tests
with your changes locally?I was very confused why
brew install
was seemingly ignoring the changes I did throughbrew edit
, only to find out after quite some time that it doesn't use the local git repository/formula anymore unless a flag is provided: #14473This PR:
HOMEBREW_NO_INSTALL_FROM_API
tobrew install
help documentationHOMEBREW_NO_INSTALL_FROM_API=1
flag to thebrew install
snippet.