Skip to content

Test failure: maketest: compiler-lookup-paths #20376

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

Closed
retep998 opened this issue Dec 31, 2014 · 5 comments · Fixed by #20382
Closed

Test failure: maketest: compiler-lookup-paths #20376

retep998 opened this issue Dec 31, 2014 · 5 comments · Fixed by #20382

Comments

@retep998
Copy link
Member

$ make check
cfg: build triple x86_64-pc-windows-gnu
cfg: host triples x86_64-pc-windows-gnu
cfg: target triples x86_64-pc-windows-gnu
cfg: enabling more debugging (CFG_ENABLE_DEBUG)
cfg: host for x86_64-pc-windows-gnu is x86_64
cfg: os for x86_64-pc-windows-gnu is pc-windows-gnu
cfg: good valgrind for x86_64-pc-windows-gnu is
cfg: using CC=gcc (CFG_CC)
cfg: enabling valgrind run-pass tests (CFG_ENABLE_VALGRIND_RPASS)
cfg: no lualatex found, deferring to xelatex
cfg: no xelatex found, deferring to pdflatex
cfg: no pdflatex found, disabling LaTeX docs
cfg: no pandoc found, omitting PDF and EPUB docs
cfg: including test rules
cfg: valgrind-path set to
cfg: valgrind-path set to
cfg: valgrind-path set to
cfg: valgrind-path set to
cfg: javac not available, skipping lexer test...
maketest: compiler-lookup-paths
----- A:/msys64/home/retep998/rust2/src/test/run-make/compiler-lookup-paths/ --------------------
------ stdout ---------------------------------------------
make[1]: Entering directory '/home/retep998/rust2/src/test/run-make/compiler-lookup-paths'
gcc -Wall -Werror -g -m64 -D_WIN32_WINNT=0x0600  -L /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths -c -o /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths/libnative.o native.c
ar crus /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths/libnative.a /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths/libnative.o
mkdir -p /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths/crate
mkdir -p /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths/native
mv /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths/libnative.a /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths/native
PATH="/A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths:/A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/stage2/bin:/mingw64/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/usr/bin:/c/WINDOWS/system32:/c/WINDOWS:/a/cmake/bin:/a/git/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl" /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/stage2/bin/rustc.exe --out-dir /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths -L /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths a.rs
mv /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths/liba.rlib /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths/crate
PATH="/A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths:/A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/stage2/bin:/mingw64/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/usr/bin:/c/WINDOWS/system32:/c/WINDOWS:/a/cmake/bin:/a/git/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl" /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/stage2/bin/rustc.exe --out-dir /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths -L /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths b.rs -L /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths/crate:native && exit 1 || exit 0
PATH="/A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths:/A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/stage2/bin:/mingw64/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/usr/bin:/c/WINDOWS/system32:/c/WINDOWS:/a/cmake/bin:/a/git/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl" /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/stage2/bin/rustc.exe --out-dir /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths -L /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths b.rs -L /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths/crate:dependency && exit 1 || exit 0
PATH="/A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths:/A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/stage2/bin:/mingw64/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/usr/bin:/c/WINDOWS/system32:/c/WINDOWS:/a/cmake/bin:/a/git/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl" /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/stage2/bin/rustc.exe --out-dir /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths -L /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths b.rs -L /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths/crate:crate
Makefile:4: recipe for target 'all' failed
rm /A/msys64/home/retep998/rust2/x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths/libnative.o
make[1]: Leaving directory '/home/retep998/rust2/src/test/run-make/compiler-lookup-paths'

------ stderr ---------------------------------------------
b.rs:12:1: 12:16 error: can't find crate for `a`
b.rs:12 extern crate a;
        ^~~~~~~~~~~~~~~
error: aborting due to previous error
b.rs:12:1: 12:16 error: can't find crate for `a`
b.rs:12 extern crate a;
        ^~~~~~~~~~~~~~~
error: aborting due to previous error
b.rs:12:1: 12:16 error: can't find crate for `a`
b.rs:12 extern crate a;
        ^~~~~~~~~~~~~~~
error: aborting due to previous error
make[1]: *** [all] Error 101

------        ---------------------------------------------

/home/retep998/rust2/mk/tests.mk:1041: recipe for target 'x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths-2-T-x86_64-pc-windows-gnu-H-x86_64-pc-windows-gnu.ok' failed
make: *** [x86_64-pc-windows-gnu/test/run-make/compiler-lookup-paths-2-T-x86_64-pc-windows-gnu-H-x86_64-pc-windows-gnu.ok] Error 2
@retep998
Copy link
Member Author

This test was added by #19941
cc @alexcrichton

@alexcrichton
Copy link
Member

Well then, you learn something every day!

It turns out that when you're using msys, path-like arguments are silently translated to windows paths away from unix-like paths. For example I wrote a small C program which just printed all its arguments:

$ ./a.exe /c/msys64
0 C:\msys64\home\alex\a.exe
1 C:/msys64
$ ./a.exe /c/msys64:foo
0 C:\msys64\home\alex\a.exe
1 /c/msys64:foo

So now that we're appending :foo to the end of the argument, it no longer looks "path-like", so msys2 is no longer silently translating it, so the test is failing. I suspect that this is passing on the bots because the current directory for make is a windows-like path, so we're passing in a windows-like path (not a unix like path). When you execute it locally the current directory is unix-like, causing the failure.

I'm... a bit flabbergasted I've never seen this until now.

@alexcrichton
Copy link
Member

Gonna need to change -L, working on a patch now.

@alexcrichton
Copy link
Member

And ironically enough msys2 will rewrite arguments of the form --foo=path! (making --extern foo=$path safe I believe)

alexcrichton added a commit to alexcrichton/rust that referenced this issue Jan 1, 2015
As discovered in rust-lang#20376, the MSYS shell will silently rewrite arguemnts that
look like unix paths into their windows path counterparts for compatibility, but
the recently added `:kind` syntax added to the `-L` flag does not allow for this
form of rewriting. This means that the syntax can be difficult to use at an MSYS
prompt, as well as causing tests to fail when run manuall right now.

This commit takes the other option presented in the original issue to prefix the
path with `kind=` instead of suffixing it with `:kind`. For consistence, the
`-l` flag is also now migrating to `kind=name`.

This is a breaking change due to the *removal* of behavior with `-L`. All code
using `:kind` should now pass `kind=` for `-L` arguments. This is not currently,
but will become, a breaking change for `-l` flags. The old `name:kind` syntax is
still accepted, but all code should update to `kind=name`.

[breaking-change]
Closes rust-lang#20376
@klutzy
Copy link
Contributor

klutzy commented Jan 1, 2015

(Relevant info: http://www.mingw.org/wiki/Posix_path_conversion - this is for msys1, but it's from cygwin so I guess msys2 has similar behavior)

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

Successfully merging a pull request may close this issue.

3 participants