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

Search other library paths when loking for link objects #56397

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
6 participants
@petrhosek
Contributor

petrhosek commented Dec 1, 2018

Support the case when link objects are not located in Rust sysroot
but in other locations which could be specify through library paths.

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Dec 1, 2018

r? @cramertj

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive

This comment was marked as resolved.

Collaborator

rust-highfive commented Dec 1, 2018

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:22b8fbb0:start=1543636418742861044,finish=1543636419785893028,duration=1043031984
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@petrhosek petrhosek force-pushed the petrhosek:file-search branch from e6a2533 to 68d88f7 Dec 1, 2018

@Centril

This comment has been minimized.

Contributor

Centril commented Dec 1, 2018

Would it be possible to add a test for this new behavior?

@cramertj

This comment has been minimized.

Member

cramertj commented Dec 3, 2018

I'd also like to see a test added for this, if possible. I'd recommend adding a run-make-fulldeps test like these ones. If it's proving too challenging to manufacture a link object outside of the sysroot to pull in, then I'd be fine landing this without test (though others may have a different opinion?).

@petrhosek petrhosek force-pushed the petrhosek:file-search branch from 68d88f7 to 196f740 Dec 7, 2018

@petrhosek

This comment has been minimized.

Contributor

petrhosek commented Dec 7, 2018

I've tried creating a run-make-fulldeps but I have problem getting to work. I'm getting the following error when trying to run the test:

error[E0463]: can't find crate for `std`
  |
  = note: the `x86_64-fuchsia` target may not be installed

This is expected since I may not have the x86_64-fuchsia installed, but that shouldn't be necessary to run the test. Does rustc have an option to just print out the invocation without running it akin to Clang's -###? I believe that's what's needed here.

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Dec 7, 2018

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:005310c9:start=1544153217852572577,finish=1544153280642527755,duration=62789955178
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---
travis_time:start:test_codegen
Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[00:55:26] 
[00:55:26] running 120 tests
[00:55:29] i..ii...iii..iiii.....i...i..........i..iii.............i.....i.....ii...i..i.ii..............i...i. 100/120
[00:55:29] i.ii.i.....iiii.....
[00:55:29] 
[00:55:29]  finished in 3.524
[00:55:29] travis_fold:end:test_codegen

---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[00:55:44] 
[00:55:44] running 118 tests
[00:56:07] .iiiii...i.....i..i...i..i.i..i.i..i.....i..i....i..........iiii.........i.i....i...i.......ii.i.i.i 100/118
[00:56:11] ......iii.i.....ii
[00:56:11] 
[00:56:11]  finished in 27.777
[00:56:11] travis_fold:end:test_debuginfo

---
travis_time:start:test_run-make-fulldeps
Check compiletest suite=run-make-fulldeps mode=run-make (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:21:44] 
[01:21:44] running 194 tests
[01:22:08] .......................................................................................F............ 100/194
[01:23:06] .............................................................................................test [run-make] run-make-fulldeps/long-linker-command-lines has been running for over 60 seconds
-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--rustdoc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustdoc" "--src-base" "/checkout/src/test/run-make-fulldeps" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/run-make-fulldeps" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "run-make" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-5.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "5.0.0\n" "--system-llvm" "--cc" "cc" "--cxx" "c++" "--cflags" "-ffunction-sections -fdata-sections -fPIC -m64" "--llvm-components" "aarch64 aarch64asmparser aarch64asmprinter aarch64codegen aarch64desc aarch64disassembler aarch64info aarch64utils all all-targets amdgpu amdgpuasmparser amdgpuasmprinter amdgpucodegen amdgpudesc amdgpudisassembler amdgpuinfo amdgpuutils analysis arm armasmparser armasmprinter armcodegen armdesc armdisassembler arminfo asmparser asmprinter binaryformat bitreader bitwriter bpf bpfasmprinter bpfcodegen bpfdes-Wno-comment -ffunction-sections -fdata-sections -O2 -DNDEBUG -g1  -fno-exceptions -DLLVM_BUILD_GLOBAL_ISEL -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" "--ar" "ar" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:26:13] 
[01:26:13] 
[01:26:13] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:26:13] Build completed unsuccessfully in 0:41:19
[01:26:13] Build completed unsuccessfully in 0:41:19
[01:26:13] Makefile:58: recipe for target 'check' failed
[01:26:13] make: *** [check] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:05673348
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Fri Dec  7 04:54:23 UTC 2018
---
travis_time:end:03125622:start=1544158466131307446,finish=1544158466232321014,duration=101013568
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0d4306a6
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:087495b8
$ dmesg | grep -i kill

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

@cramertj

This comment has been minimized.

Member

cramertj commented Dec 7, 2018

@petrhosek No, I don't believe that exists. In any case, you do need the target installed here in order to build fn main() {}, since that has dependencies on the x86_64-fuchsia standard library (which is only installed when that target is installed).

@petrhosek petrhosek force-pushed the petrhosek:file-search branch from 196f740 to b13a130 Dec 7, 2018

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Dec 7, 2018

The job x86_64-gnu-llvm-5.0 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
travis_time:end:033b6e2c:start=1544213093234157703,finish=1544213148633480583,duration=55399322880
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---
travis_time:start:test_codegen
Check compiletest suite=codegen mode=codegen (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[00:53:03] 
[00:53:03] running 120 tests
[00:53:06] i..ii...iii..iiii.....i...i..........i..iii.............i.....i.....ii...i..i.ii..............i...ii 100/120
[00:53:07] ..ii.i.....iiii.....
[00:53:07] 
[00:53:07]  finished in 3.598
[00:53:07] travis_fold:end:test_codegen

---
travis_time:start:test_debuginfo
Check compiletest suite=debuginfo mode=debuginfo-both (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[00:53:21] 
[00:53:21] running 118 tests
[00:53:44] .iiiii...i.....i..i...i..i.i..i.i..i.....i..i....i..........iiii.........i.i....i...i.......ii.i.i.i 100/118
[00:53:48] ......iii.i.....ii
[00:53:48] 
[00:53:48]  finished in 26.928
[00:53:48] travis_fold:end:test_debuginfo

---
travis_time:start:test_run-make-fulldeps
Check compiletest suite=run-make-fulldeps mode=run-make (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:18:27] 
[01:18:27] running 194 tests
[01:18:50] .......................................................................................F............ 100/194
[01:19:48] .............................................................................................test [run-make] run-make-fulldeps/long-linker-command-lines has been running for over 60 seconds
[01:22:31] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:503:22
[01:22:31] failures:
[01:22:31] 
[01:22:31] ---- [run-make] run-make-fulldeps/libs-search-path stdout ----
---
[01:22:31] 
[01:22:31] ------------------------------------------
[01:22:31] stderr:
[01:22:31] ------------------------------------------
[01:22:31] make[1]: *** No targets.  Stop.
[01:22:31] ------------------------------------------
[01:22:31] 
[01:22:31] 
[01:22:31] thread '[run-make] run-make-fulldeps/libs-search-path' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3284:9
[01:22:31] 
[01:22:31] 
[01:22:31] failures:
[01:22:31]     [run-make] run-make-fulldeps/libs-search-path
[01:22:31]     [run-make] run-make-fulldeps/libs-search-path
[01:22:31] 
[01:22:31] test result: FAILED. 193 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out
[01:22:31] 
[01:22:31] 
[01:22:31] 
[01:22:31] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gngondesc hexagondisassembler hexagoninfo instcombine instrumentation interpreter ipo irreader lanai lanaiasmparser lanaiasmprinter lanaicodegen lanaidesc lanaidisassembler lanaiinfo libdriver lineeditor linker lto mc mcdisassembler mcjit mcparser mips mipsasmparser mipsasmprinter mipscodegen mipsdesc mipsdisassembler mipsinfo mirparser msp430 msp430asmprinter msp430codegen msp430desc msp430info native nativecodegen nvptx nvptxasmprinter nvptxcodegen nvptxdesc nvptxinfo objcarcopts object objectyaml option orcjit passes powerpc powerpcasmparser powerpcasmprinter powerpccodegen powerpcdesc powerpcdisassembler powerpcinfo profiledata runtimedyld scalaropts selectiondag sparc sparcasmparser sparcasmprinter sparccodegen sparcdesc sparcdisassembler sparcinfo support symbolize systemz systemzasmparser systemzasmprinter systemzcodegen systemzdesc systemzdisassembler systemzinfo tablegen target transformutils vectorize x86 x86asmparser x86asmprinter x86codegen x86desc x86disassembler x86info x86utils xcore xcoreasmprinter xcorecodegen xcoredesc xcoredisassembler xcoreinfo" "--llvm-cxxflags" "-I/usr/lib/llvm-5.0/include -std=c++0x -fuse-ld=gold -Wl,--no-keep-files-mapped -Wl,--no-map-whole-files -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -W -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor -Wno-comment -ffunction-sections -fdata-sections -O2 -DNDEBUG -g1  -fno-exceptions -DLLVM_BUILD_GLOBAL_ISEL -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS" "--ar" "ar" "--adb-path" "nknown-linux-gnu
58684 ./obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/release/deps
56896 ./src/llvm/test/MC
56648 ./obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps
56108 ./obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/release/build
---
travis_time:end:084cf5eb:start=1544218109914566994,finish=1544218109921618017,duration=7051023
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:08b962db
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

Search other library paths when loking for link objects
Support the case when link objects are not located in Rust sysroot
but in other locations which could be specify through library paths.

@petrhosek petrhosek force-pushed the petrhosek:file-search branch from b13a130 to 22b526e Dec 8, 2018

@cramertj

This comment has been minimized.

Member

cramertj commented Dec 10, 2018

@bors r+

@bors

This comment has been minimized.

Contributor

bors commented Dec 10, 2018

📌 Commit 22b526e has been approved by cramertj

@bors

This comment has been minimized.

Contributor

bors commented Dec 10, 2018

⌛️ Testing commit 22b526e with merge 3751f83...

bors added a commit that referenced this pull request Dec 10, 2018

Auto merge of #56397 - petrhosek:file-search, r=cramertj
Search other library paths when loking for link objects

Support the case when link objects are not located in Rust sysroot
but in other locations which could be specify through library paths.
@bors

This comment has been minimized.

Contributor

bors commented Dec 10, 2018

💔 Test failed - status-appveyor

@kennytm

This comment has been minimized.

Member

kennytm commented Dec 11, 2018

Failed for 32-bit Windows MSVC.

Error: cannot match: /c/projects/rust/build/i686-pc-windows-msvc/test/run-make-fulldeps/libs-search-path/libs-search-path/obj/crt2.o

error: Error loading target specification: Could not find specification for target "x86_64-windows-msvc"
  |
  = help: Use `--print target-list` for a list of built-in targets
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment