-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
grafana: fix build with yarn 1.0 #17863
Conversation
Formula/grafana.rb
Outdated
@@ -23,7 +23,9 @@ def install | |||
|
|||
cd grafana_path do | |||
system "go", "run", "build.go", "build" | |||
system "yarn", "install" | |||
|
|||
ENV.prepend_path "PATH", "#{Formula["node"].opt_libexec}/lib/node_modules/npm/bin/node-gyp-bin" |
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 prefer to see a fix in the node formula for 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.
This is not a node issue. It just yarn not being aware of homebrew and not looking into the libexec
folder when trying to find node-gyp
relative to the node
executable. This is one of the fixes I wanted to upstream, but I didn't found time to do so yet.
(After that the global node-gyp installation fallback will fail because of sandbox restrictions.)
I can revert this fix if you want, because it fixes only an optional development dependency and I'm still not sure if you want to proper fix yarn configuration on a per formula basis or do something like what was proposed in Homebrew/brew#2962.
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.
Let's try to either tweak the layout of the node formula or get something upstreamed to yarn.
it fixes only an optional development dependency
I assume it just reinstalls node-gyp, right?
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 assume it just reinstalls node-gyp, right?
The install node-gyp
globally fallback is failing to because of sandbox restrictions and us not configuring yarn correctly to work with the sandbox. Compiling native addons with yarn does not work at all inside the homebrew sandbox as of now. It just skips the optional build dependency fsevents
in our case.
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.
If you set
ENV["PREFIX"] = ENV["HOME"]
and invoke yarn as Formula["yarn"].opt_libexec/"bin/yarn"
does it work?
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.
It should, but it's a hack to fix the fallback.
It shouldn't be an issue to leave the unimportant optional build only dependency broken for now (it was broken since the formula started using yarn anyway and it's not the only formula affected by it).
The best way forward is to fix all issues with yarn and homebrew properly, which involves both upstreaming fixes and doing build-time configuration for yarn in homebrew.
Thanks @chrmoritz! |
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingbrew install <formula>
)?The upgrade to yarn 1.0 has broken the ability to build
grafana
against latestnode
from source, because yarn 1.0 has enabled/fixed strict top level engine checks.Refs: Homebrew/brew#2962
The PR adds a workaround which restores the ability to build
grafana
against the latestnode
version(and fixes the warning about not being able to find.node-gyp
)