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

mingw-w64: Many run-make-fulldeps tests fail due to some change in library search #49785

Closed
petrochenkov opened this issue Apr 8, 2018 · 8 comments
Assignees
Labels
O-windows-gnu Toolchain: GNU, Operating system: Windows P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone

Comments

@petrochenkov
Copy link
Contributor

This is a regression from the last 1-2 weeks.
Not sure who is the right person to ping, @alexcrichton @michaelwoerister maybe.

Failing tests:

[run-make] run-make-fulldeps\a-b-a-linker-guard
[run-make] run-make-fulldeps\c-dynamic-dylib
[run-make] run-make-fulldeps\c-static-dylib
[run-make] run-make-fulldeps\dylib-chain
[run-make] run-make-fulldeps\extern-fn-reachable
[run-make] run-make-fulldeps\issue-15460
[run-make] run-make-fulldeps\issue-19371
[run-make] run-make-fulldeps\mixing-deps
[run-make] run-make-fulldeps\prefer-dylib
[run-make] run-make-fulldeps\simple-dylib
[run-make] run-make-fulldeps\static-nobundle

Typical failure looks like

---- [run-make] run-make-fulldeps\c-dynamic-dylib stdout ----

error: make failed
status: exit code: 2
command: "make"
stdout:
------------------------------------------
gcc.exe -ffunction-sections -fdata-sections -m64 -c -o /home/we/rust/build/x86_64-pc-windows-gnu/test/run-make-fulldeps/c-dynamic-dylib.stage2-x86_64-pc-windows-gnu/libcfoo.o cfoo.c
gcc.exe -ffunction-sections -fdata-sections -m64 -o /home/we/rust/build/x86_64-pc-windows-gnu/test/run-make-fulldeps/c-dynamic-dylib.stage2-x86_64-pc-windows-gnu/cfoo.dll /home/we/rust/build/x86_64-pc-windows-gnu/test/run-make-fulldeps/c-dynamic-dylib.stage2-x86_64-pc-windows-gnu/libcfoo.o -shared
PATH="/home/we/rust/build/x86_64-pc-windows-gnu/test/run-make-fulldeps/c-dynamic-dylib.stage2-x86_64-pc-windows-gnu:C:/msys64/home/we/rust/build\x86_64-pc-windows-gnu\stage2\bin:/home/we/rust/build/x86_64-pc-windows-gnu/stage0-tools/x86_64-pc-windows-gnu/release/deps:/home/we/rust/build/x86_64-pc-windows-gnu/stage0-sysroot/lib/rustlib/x86_64-pc-windows-gnu/lib:/mingw64/bin:/c/Users/we/.cargo/bin:/c/Program Files/CMake/bin:/c/Program Files/Git/cmd:/c/mingw-w64/x86_64-7.2.0-posix-seh-rt_v5-rev1/mingw64/bin:/c/ProgramData/chocolatey/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/usr/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl" 'C:/msys64/home/we/rust/build\x86_64-pc-windows-gnu\stage2\bin\rustc.exe' --out-dir /home/we/rust/build/x86_64-pc-windows-gnu/test/run-make-fulldeps/c-dynamic-dylib.stage2-x86_64-pc-windows-gnu -L /home/we/rust/build/x86_64-pc-windows-gnu/test/run-make-fulldeps/c-dynamic-dylib.stage2-x86_64-pc-windows-gnu  foo.rs -C prefer-dynamic
PATH="/home/we/rust/build/x86_64-pc-windows-gnu/test/run-make-fulldeps/c-dynamic-dylib.stage2-x86_64-pc-windows-gnu:C:/msys64/home/we/rust/build\x86_64-pc-windows-gnu\stage2\bin:/home/we/rust/build/x86_64-pc-windows-gnu/stage0-tools/x86_64-pc-windows-gnu/release/deps:/home/we/rust/build/x86_64-pc-windows-gnu/stage0-sysroot/lib/rustlib/x86_64-pc-windows-gnu/lib:/mingw64/bin:/c/Users/we/.cargo/bin:/c/Program Files/CMake/bin:/c/Program Files/Git/cmd:/c/mingw-w64/x86_64-7.2.0-posix-seh-rt_v5-rev1/mingw64/bin:/c/ProgramData/chocolatey/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/usr/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl" 'C:/msys64/home/we/rust/build\x86_64-pc-windows-gnu\stage2\bin\rustc.exe' --out-dir /home/we/rust/build/x86_64-pc-windows-gnu/test/run-make-fulldeps/c-dynamic-dylib.stage2-x86_64-pc-windows-gnu -L /home/we/rust/build/x86_64-pc-windows-gnu/test/run-make-fulldeps/c-dynamic-dylib.stage2-x86_64-pc-windows-gnu  bar.rs
PATH="/home/we/rust/build/x86_64-pc-windows-gnu/stage0-tools/x86_64-pc-windows-gnu/release/deps:/home/we/rust/build/x86_64-pc-windows-gnu/stage0-sysroot/lib/rustlib/x86_64-pc-windows-gnu/lib:/mingw64/bin:/c/Users/we/.cargo/bin:/c/Program Files/CMake/bin:/c/Program Files/Git/cmd:/c/mingw-w64/x86_64-7.2.0-posix-seh-rt_v5-rev1/mingw64/bin:/c/ProgramData/chocolatey/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/usr/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:C:/msys64/home/we/rust/build\x86_64-pc-windows-gnu\stage2\lib\rustlib\x86_64-pc-windows-gnu\lib" /home/we/rust/build/x86_64-pc-windows-gnu/test/run-make-fulldeps/c-dynamic-dylib.stage2-x86_64-pc-windows-gnu/bar
rm /home/we/rust/build/x86_64-pc-windows-gnu/test/run-make-fulldeps/c-dynamic-dylib.stage2-x86_64-pc-windows-gnu/libcfoo.o

------------------------------------------
stderr:
------------------------------------------
C:/msys64/home/we/rust/build/x86_64-pc-windows-gnu/test/run-make-fulldeps/c-dynamic-dylib.stage2-x86_64-pc-windows-gnu/bar.exe: error while loading shared libraries: foo.dll: cannot open shared object file: No such file or directory
make: *** [Makefile:11: all] Error 127

------------------------------------------
@petrochenkov petrochenkov added A-linkage Area: linking into static, shared libraries and binaries regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. O-windows-gnu Toolchain: GNU, Operating system: Windows labels Apr 8, 2018
@michaelwoerister
Copy link
Member

Hm, I don't really know what could cause this.

@alexcrichton
Copy link
Member

Sorry I'm not sure either :(

@pnkfelix pnkfelix added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 12, 2018
@nikomatsakis
Copy link
Contributor

@petrochenkov if you can readily reproduce, can you try https://github.com/rust-lang-nursery/cargo-bisect-rustc ?

@pnkfelix
Copy link
Member

triage: P-high

@petrochenkov
Copy link
Contributor Author

@nikomatsakis
I'll try to bisect/investigate this weekend.

@petrochenkov petrochenkov self-assigned this Apr 19, 2018
@nikomatsakis nikomatsakis added the P-high High priority label Apr 26, 2018
@pietroalbini pietroalbini added this to the 1.27 milestone Apr 30, 2018
@petrochenkov
Copy link
Contributor Author

So the offending commit is 84b5b34 (cc @Mark-Simulacrum )

As a result of that commit RustBuild.build_dir -> BUILD_DIR -> config.out -> ... -> TARGET_RPATH_DIR turn (in my case) from C:\msys64\home\we\rust\build into C:/msys64/home/we/rust/build (Python's getcwd behaves differently from previously used Rust's env::current_dir).
As a result PATH for run-make-fulldeps tests becomes broken and doesn't contain correct library directories.

We need to "normalize" separators for this path at some point, either at the beginning or in the end.

@petrochenkov petrochenkov added T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) and removed A-linkage Area: linking into static, shared libraries and binaries labels May 1, 2018
@Mark-Simulacrum
Copy link
Member

I'm happy to take a patch, I think fixing this on my end will be somewhat difficult since it's presumably environment-specific and windows-only.

@petrochenkov
Copy link
Contributor Author

Yeah, I'll try to come up with something today.

petrochenkov added a commit to petrochenkov/rust that referenced this issue May 1, 2018
bors added a commit that referenced this issue May 1, 2018
rustbuild: Normalize paths coming from Python slightly

Fixes #49785
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-windows-gnu Toolchain: GNU, Operating system: Windows P-high High priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants