Prepend build_bindir to LLVM_CONFIG_PATH_FIX rather than append #39275
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Prepend rather than append
$(build_bindir)
to thePATH
forLLVM_CONFIG_PATH_FIX
on Windows to avoid using libraries from an older Julia install.Background
Windows requires that the environmental variable
PATH
include thebuild_bindir
. Currently this is appended to thePATH
making thebuild_bindir
the the lowest priority directory to search.Also on Windows, the installer for a Julia release will append the bin directory to the
PATH
.This creates a scenario where some tools may use libraries in the binary release rather than libraries in the current source tree. For example this occurs with
usr/tools/llvm-config.exe
when using cygwin. In the example below,llvm-config.exe
is dynamically linked toLLVM.dll
in a Julia 1.5.0 install despite trying to build Juila master (1.7.0-DEV) causingllvm-config.exe
to silently fail with a return code of 127:The proposed fix is simple. Prepend rather than append
$(build_binddir)
so that$(build_binddir)
is searched for the relevant for the relevant libraries first.Further fixes may involve checking the return code of of
llvm-config.exe
to ensure that execution has not failed silently. Currently a problem is only detected when parsing "libllvm_version" inbase/version.jl
. In this case Julia attempts to parse an empty string, which fails.