Skip to content
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

Record the absolute path of llvm-config when found in PATH #19229

Closed
wants to merge 2 commits into from

Conversation

jberdine
Copy link
Contributor

@jberdine jberdine commented Aug 9, 2021

When conf-llvm finds the llvm-config executable in PATH, currently the config var only records the basename of the executable. If the PATH later changes, dependent packages can fail to build, or be built with the wrong llvm-config. This patch adds the absolute path the the found llvm-config executable to the config var to avoid this instability.

Cc: @kit-ty-kate

@jberdine
Copy link
Contributor Author

Thanks for the update @kit-ty-kate! This LGTM, though I haven't tested the old versions.

@mseri
Copy link
Member

mseri commented Oct 12, 2021

The few that we can test, llvm 9 10 and 11 are failing as follows

#=== ERROR while installing llvm.11.0.0 =======================================#
# context              2.0.9 | linux/x86_64 | ocaml-base-compiler.4.12.0 | file:///home/opam/opam-repository
# path                 ~/.opam/4.12/.opam-switch/build/llvm.11.0.0
# command              ~/.opam/opam-init/hooks/sandbox.sh install bash -ex install.sh  /home/opam/.opam/4.12/lib cmake make
# exit-code            1
# env-file             ~/.opam/log/llvm-4466-0a5907.env
# output-file          ~/.opam/log/llvm-4466-0a5907.out
### output ###
# + llvm_config=
# + libdir=/home/opam/.opam/4.12/lib
# + cmake=cmake
# + make=make
# + '' --link-static --libs
# install.sh: line 36: : command not found
# + '' --link-static --libs
# install.sh: line 40: : command not found
# + '' --link-shared --libs
# install.sh: line 43: : command not found
# + echo WTF...
# WTF...
# + exit 1

i think they used to work, are you sure about the fix?

@jberdine
Copy link
Contributor Author

I have been using conf-llvm pinned to this change without trouble. It seems that no llvm_config is being found at all for you, but there isn't enough info in the error message to know why. What do you see from running e.g. bash -ex configure.sh 11.0.0 in an environment where the desired llvm-config executable is configured? For example with PATH="/usr/local/opt/llvm@11/bin:$PATH" bash -ex configure.sh 11.0.0 |& grep "llvm_version=." I see + llvm_version=11.1.0.

@github-actions github-actions bot added the Stale label Jan 19, 2022
@github-actions github-actions bot closed this Feb 18, 2022
@kit-ty-kate kit-ty-kate added persist and removed Stale labels Feb 18, 2022
@kit-ty-kate kit-ty-kate reopened this Feb 18, 2022
@jberdine
Copy link
Contributor Author

@kit-ty-kate, there are extra quote characters that prevent ${llvm_config} from being evaluated. I fixed version 11.0.0 and tested, but wonder if you have some automation for propagating across all the versions?

@jberdine
Copy link
Contributor Author

@mseri if you wanted to test to see if this resolves the failure you observed, it would be very helpful.

@avsm
Copy link
Member

avsm commented May 28, 2023

@jberdine might you have a view on how to progress this? The opam-repo maintainers are all a bit overloaded with PRs at the moment...

@jberdine
Copy link
Contributor Author

jberdine commented Jun 1, 2023

In the projects I am involved in that use llvm, a vendored version of conf-llvm using this change is used with no trouble. As far as I understand, @mseri saw some issues with just the first commit ea11b7e of this PR after it was force-pushed, but I am unaware of any issue with the PR including both commits.

For how to proceed, I would merge unless someone volunteers more testing.

@mseri
Copy link
Member

mseri commented Jun 1, 2023

Shouldn’t the quotes be removed from all the configuree.sh files? I would imagine the same failure may happen with the others on certain systems (cannot check the logs anynlonger unfortunately)

@jberdine
Copy link
Contributor Author

jberdine commented Jun 1, 2023

Oh yes, you are right. I forgot that I only removed them in the latest version to get feedback from @kit-ty-kate as I was changing her code. This makes me realize that a few versions have been released in the meantime that also need updating.

@shonfeder
Copy link
Contributor

Hello! I hope this isn't an unwelcome ping, but I wonder if we can either mover this PR forward or close it. WDYT?

@mseri
Copy link
Member

mseri commented Jul 3, 2024

I’d be fine for merging it if it is fixed and the new patches are moved to the opam-source-archive in agreement with the new policy

@shonfeder
Copy link
Contributor

I am going to close this issue, provisionally. Given the accrued merge conflicts, and the fact that it has been stalled for 2 years, it seems pretty clear no one has the motivation or bandwidth to land this as is.

If I am in error, please re-open, open will an alternative fix, or open an issue to track the unmet need here.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants