Comments (4)
Thanks for the issue!
This API seems reasonable although unclear if it would be a major improvement over just ENV["whatever"] = "something"
in the formula itself.
Do you have any homebrew/core formulae that would need this?
from brew.
This API seems reasonable although unclear if it would be a major improvement over just ENV["whatever"] = "something" in the formula itself.
I didn't even think of that! Hrm, the simplicity of that might be enough to not bother with changing the completion-helper api.
One downside is the "blast radius" of the ENV=
approach extends beyond only the completion command. But in practice, I assume that helper is typically invoked at the very end of install
anyway, so it's probably fine. (Though I'm not certain how much stuff homebrew does after #install
is invoked that could be affected. It might be weird if #post_install
operates in an environment mutated elsewhere?)
Do you have any homebrew/core formulae that would need this?
The only two formulae I ran into are both private taps. Though I haven't looked in core for other potential candidates.
Honestly, I think I'm satisfied to close this and just set ENV as you suggested. I'll try that in our taps and circle back.
from brew.
One downside is the "blast radius" of the
ENV=
approach extends beyond only the completion command.
There is also with_env
, e.g.
with_env(VAR1: ..., VAR2: ...) do
generate_completions_from_executable(...)
end
Though I'm not certain how much stuff homebrew does after
#install
is invoked that could be affected.
Should be pretty much nothing. Specifically, looks like just writing metadata files which shouldn't have a major impact by ENV
modification (EDIT: you can get the tab to recording a different ENV.compiler
, but that isn't normal usage).
brew/Library/Homebrew/build.rb
Lines 179 to 187 in c3094ac
from brew.
@cho-m oh yeah, that's perfect.
Closing in favor of 'with_env'. thank you both!
from brew.
Related Issues (20)
- sudo timestamp reset may break scripts HOT 6
- Issue installing openJDK HOT 1
- `sudo` not working anymore after running any `brew` command HOT 10
- IRB no longer has irb_at_exit method HOT 2
- Failed to install Homebrew Portable Ruby (and your system version is too old)! HOT 4
- Improve error/warning when `brew install` refuses to install a formula from a tap with the same name as an already installed keg HOT 7
- shellenv.sh: csh/tcsh: Broken code for setting envvar MANPATH HOT 1
- Make `autoremove` idempotent HOT 12
- Run xattr -r -d com.apple.quarantine App.app on casks on Apple Silicon MacOS HOT 20
- Homebrew's brew alias is broken after update this morning on Debian machines HOT 2
- Are all of the `undef`s we use really necessary? HOT 27
- HOMEBREW_PIP_INDEX_URL is misleading and does not work-as-intended with some mirrors
- “Error: comparison of PkgVersion with String failed” when running `brew upgrade` HOT 3
- brew upgrade or install fails with comparison of PkgVersion with String HOT 1
- Brew link step fail if installing multiple formulae with common symlink using a system with symlinked /home HOT 6
- golang not update to 1.23.0 HOT 2
- Happened ruby runtime error on macOS Sequoia HOT 2
- Homebrew no longer correctly reads `HOMEBREW_DOCKER_REGISTRY_BASIC_AUTH_TOKEN` from /etc/homebrew/brew.env
- environment file variables are not honored
- `brew install` call `gh attestation verify` Disrespect `XDG_CACHE_HOME` HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brew.