Skip to content

#15006 breaks make check on my linux system in run-make/c-dynamic-dylib #15103

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
ben0x539 opened this issue Jun 23, 2014 · 4 comments · Fixed by #15114
Closed

#15006 breaks make check on my linux system in run-make/c-dynamic-dylib #15103

ben0x539 opened this issue Jun 23, 2014 · 4 comments · Fixed by #15114

Comments

@ben0x539
Copy link
Contributor

#15006 seems to break make check for me. I'm not sure why it's ok for the buildbots but not my 64bit linux system but now run-make/c-dynamic-dylib consistently fails for me trying to run the bar.rs binary, with $(TMPDIR) not being included in LD_LIBRARY_PATH at all.

I'm pretty clueless about Makefiles and our particular setup so I'm not actually sure where that is supposed to happen. The bar.rs binary has a RUNPATH that includes $ORIGIN/., but the foo.rs dynamic library doesn't, so if I understand correctly, this is going to need an LD_LIBRARY_PATH of some sort to work.

I'm using Gentoo Linux like the author of #11742 which apparently addressed a similar problem, so that's probably related.

The build output for complenetess:


maketest: c-dynamic-dylib
----- [...]/rust/src/test/run-make/c-dynamic-dylib/ --------------------
------ stdout ---------------------------------------------
make[1]: Entering directory '[...]/rust/src/test/run-make/c-dynamic-dylib'
gcc -Wall -Werror -g -fPIC -m64 -L [...]/rust/build/x86_64-unknown-linux-gnu/test/run-make/c-dynamic-dylib -c -o [...]/rust/build/x86_64-unknown-linux-gnu/test/run-make/c-dynamic-dylib/libcfoo.o cfoo.c
gcc -Wall -Werror -g -fPIC -m64 -L [...]/rust/build/x86_64-unknown-linux-gnu/test/run-make/c-dynamic-dylib -o [...]/rust/build/x86_64-unknown-linux-gnu/test/run-make/c-dynamic-dylib/libcfoo.so [...]/rust/build/x86_64-unknown-linux-gnu/test/run-make/c-dynamic-dylib/libcfoo.o -shared
LD_LIBRARY_PATH="[...]/rust/build/x86_64-unknown-linux-gnu/stage2/lib:" [...]/rust/build/x86_64-unknown-linux-gnu/stage2/bin/rustc --out-dir [...]/rust/build/x86_64-unknown-linux-gnu/test/run-make/c-dynamic-dylib -L [...]/rust/build/x86_64-unknown-linux-gnu/test/run-make/c-dynamic-dylib foo.rs
LD_LIBRARY_PATH="[...]/rust/build/x86_64-unknown-linux-gnu/stage2/lib:" [...]/rust/build/x86_64-unknown-linux-gnu/stage2/bin/rustc --out-dir [...]/rust/build/x86_64-unknown-linux-gnu/test/run-make/c-dynamic-dylib -L [...]/rust/build/x86_64-unknown-linux-gnu/test/run-make/c-dynamic-dylib bar.rs
LD_LIBRARY_PATH="[...]/rust/build/x86_64-unknown-linux-gnu/stage1/lib/rustlib/x86_64-unknown-linux-gnu/lib:" [...]/rust/build/x86_64-unknown-linux-gnu/test/run-make/c-dynamic-dylib/bar
Makefile:9: recipe for target 'all' failed
rm [...]/rust/build/x86_64-unknown-linux-gnu/test/run-make/c-dynamic-dylib/libcfoo.o
make[1]: Leaving directory '[...]/rust/src/test/run-make/c-dynamic-dylib'

------ stderr ---------------------------------------------
[...]/rust/build/x86_64-unknown-linux-gnu/test/run-make/c-dynamic-dylib/bar: error while loading shared libraries: libcfoo.so: cannot open shared object file: No such file or directory
make[1]: *** [all] Error 127

[...]/rust/mk/tests.mk:990: recipe for target 'x86_64-unknown-linux-gnu/test/run-make/c-dynamic-dylib-2-T-x86_64-unknown-linux-gnu-H-x86_64-unknown-linux-gnu.ok' failed
make: *** [x86_64-unknown-linux-gnu/test/run-make/c-dynamic-dylib-2-T-x86_64-unknown-linux-gnu-H-x86_64-unknown-linux-gnu.ok] Error 2
@alexcrichton
Copy link
Member

I'm a little clueless why this passed on the bots! If you add $(TMPDIR) to these two lines: https://github.com/rust-lang/rust/blob/master/src/test/run-make/tools.mk#L4-L6 does the test pass for you?

@ben0x539
Copy link
Contributor Author

Yeah, that lets it pass. I can make a PR to that effect if that's the right solution?

@alexcrichton
Copy link
Member

Sure!

ben0x539 added a commit to ben0x539/rust that referenced this issue Jun 23, 2014
It was accidentally removed in rust-lang#15006 and that somehow got past the
build bots, causing `src/test/run-make/c-dynamic-dylib` to fail on at
least my linux system.

This resolves rust-lang#15103 (thanks to @alexcrichton!).
@pnkfelix
Copy link
Member

Hmm.

I wonder whether adding TMPDIR in tools.mk (and thus for all tests) could be more broad than we actually want. Perhaps we should consider overriding the HOST_RPATH_DIR and/orTARGET_RPATH_DIR in the cases that actually need it set would be a bit more robust. I am not sure.

bors added a commit that referenced this issue Jun 24, 2014
It was accidentally removed in #15006 and that somehow got past the
build bots, causing `src/test/run-make/c-dynamic-dylib` to fail on at
least my linux system.

This resolves #15103 (thanks to @alexcrichton!).
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