Closed tech-meppem closed 4 weeks ago
I found a solution:
/mnt/c/msys64/mingw64/bin
is in $PATH.
Removing that has worked!
I added this to my .bashrc file:
# remove `/mnt/c/msys64/mingw64/bin` from PATH
export PATH=$(echo $PATH | sed -e 's/:\/mnt\/c\/msys64\/mingw64\/bin//')
So I guess the issue is that it can prioritise the $PATH in different places, and doesn't prioritise it in others?
This appears to be more an issue of how Windows and WSL interact than an issue in the SDK.
This appears to be more an issue of how Windows and WSL interact than an issue in the SDK.
For that specific case, windows+wsl explains it, sort of.
However, I think the directories in the PATH env shouldn't be prioritised over the individual directories passed in via args. We're now having issues with our build toolchain (not on WSL) due to this same problem, where it pulls the crypto lib from the PATH over pulling from any arguments passed in.
After all, if specifying -Dcrypto_LIBRARY=
& -Dcrypto_INCLUDE_DIR=
, it should probably always use those, not any directories in PATH.
Especially as it's not actually using the direct path in lib, but rather, an adjacent path.
I had /mnt/c/msys64/mingw64/bin
in my PATH env, but it was causing libcrypto to be linked to /mnt/c/msys64/mingw64/lib
, which is a different path.
Describe the bug
I am building on wsl, using the
-DUSE_OPENSSL=ON
, as I am building for openwrt. We have a toolchain setup, and are trying to use the libs from the toolchain. It builds fine without-DUSE_OPENSSL
, but then causes errors due to conflicts.When running the command with
-DUSE_OPENSSL
, there are lots of errors with thecmake --build . --target install
step.I noticed that even though it prints out the correct paths in:
later it still prints out:
I have tried using
-Dcrypto_INCLUDE_DIR
&-Dcrypto_LIBRARY
as well, they made no difference. And alsoCMAKE_IGNORE_PATH
doesn't work.I'm unsure what's likely to cause this disparity.
Also, I'm unsure if this is actually the thing causing all the errors or not, but it certainly is wrong.
Expected Behavior
It to use libcrypto from where it found it, not from the windows when using wsl.
Current Behavior
Prints
and many many errors in build output, such as:
Reproduction Steps
Command I am using:
cmake.cross file:
command:
output:
Possible Solution
Edit:
/mnt/c/msys64/mingw64/bin
is in $PATH. I will try removing and testing if that works.Edit 2: That has worked! I added this to my .bashrc file:
So I guess there's an issue where it can prioritise the $PATH over what was previously printed out, and specified using the arguments?
Additional Information/Context
No response
SDK version used
1.33.0
Environment details (OS name and version, etc.)
WSL version: 2.3.24.0 Kernel version: 5.15.153.1-2 WSLg version: 1.0.65 MSRDC version: 1.2.5620 Direct3D version: 1.611.1-81528511 DXCore version: 10.0.26100.1-240331-1435.ge-release Windows version: 10.0.19045.5011