-
-
Notifications
You must be signed in to change notification settings - Fork 12.3k
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
haskell-stack
conflicts with llvm
#122863
Comments
For what it's worth, I did a trivial grep through the Formula directory of Homebrew core and I'm pretty sure this problem is unique (might exist in another tap somewhere I guess): runtimeverification/k#3145 (comment) |
I note also that with this dance I can successfully build the minimal example: old_path = ENV["PATH"]
ENV["PATH"] = ENV["PATH"].sub "#{Formula["llvm"].bin}:", ""
system "stack", "setup"
ENV["PATH"] = old_path Is there any way to make this hack a bit cleaner? |
I can't speak to this being the correct permanent solution, but your hack could be made a bit cleaner using with_env(PATH: ENV["PATH"].sub("#{Formula["llvm"].bin}:", "")) do
system "stack", "setup"
end This could possibly be golfed down more but it should help with at least the scoping aspect. |
This looks suspicious:
Does |
Yes, it looks like I believe this makes it mistakenly assume it's using GNU ld (because |
Just a guess, but doing ENV["LD"] = "ld" might work. |
I think this is fixed upstream in GHC. Unfortunately, the fix isn't due until GHC 9.6. In the meantime, Alternatively, you can use a Homebrew-built GHC which (probably) shouldn't be affected by this problem. (Pass Given this, I'm relatively confident that this is a bug in There isn't really a conflict between |
Thanks all, that's really helpful advice. I suspect the best thing for us to do is keep some version of the scoped |
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputVerification
brew doctor
output" saysYour system is ready to brew.
and am still able to reproduce my issue.brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
We have a formula in a non-core tap that depends on both
haskell-stack
andllvm
to build different components of a larger application; the problem manifests when trying to build the formula in our regular CI workflow.What happened (include all command output)?
A recent upgrade of the GHC version in our Stack resolver seems to have triggered a known failure mode in GHC / stack, where an LLVM installation on the system path conflicts with what stack expects to find, generating obscure linker errors:
This is a known issue for several stack versions, but it's not clear to us why it's only started happening with this upgrade to stack.
What did you expect to happen?
The
stack setup
command should succeed.Step-by-step reproduction instructions (by running
brew
commands)Repo with demonstration: https://github.com/Baltoli/homebrew-issue
The reproduction for this issue is a bit tricky; I haven't been able to get it to reproduce on my local machine (owing to previous brew or stack installations cluttering up whatever PATH stack is looking at), so I have set up a demo repository that exhibits the problem in a minimal formula.
This repo contains a formula depending on
haskell-stack
and (optionally) LLVM. I have set up Github actions to build the problematic formula with and without the optional LLVM dependency, demonstrating the same error message we have been experiencing. The brew environment on these runners is not totally fresh (there's a few packages preinstalled), butbrew doctor
reports it's ready to brew.In case the logs aren't visible (this run is the interesting one), the repro. boils down to observing that for the linked formula, this command succeeds:
while this fails:
Please let me know if I can improve the format of this reproduction at all.
I suspect that the general solution for this is a
conflicts_with
marker for these packages, but I'd be grateful to know if there is any way to cut the LLVM-installed PATH entries out when runningstack setup
, and reinstate them for the rest of the build. Nothing jumped out at me from the API docs (perhaps reasonably).The text was updated successfully, but these errors were encountered: