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

Doesn't handle multiple versions of rust nicely #4

Closed
Nemo157 opened this issue Mar 26, 2016 · 2 comments · Fixed by #11
Closed

Doesn't handle multiple versions of rust nicely #4

Nemo157 opened this issue Mar 26, 2016 · 2 comments · Fixed by #11

Comments

@Nemo157
Copy link

Nemo157 commented Mar 26, 2016

If you build using both stable and nightly (or I assume if you build with one version of stable then update to a newer version) then skeptic errors out as rustc can't choose which copy of the dependencies to build the tests against. This can be worked around by running cargo clean whenever changing rust versions, but is annoying if you need to test on both stable and nightly as it will have to keep rebuilding all the dependencies.

I guess skeptic needs to somehow pull in the --extern DEP=./target/debug/deps/libDEP-HASH.rlib flags from cargo, maybe there's a way to use cargo rustc to do this?


Output of running multirust run stable cargo test && multirust run nightly cargo test in a fresh repository:

   Compiling getopts v0.2.14
   Compiling libc v0.2.8
   Compiling rand v0.3.14
   Compiling pulldown-cmark v0.0.3
   Compiling tempdir v0.3.4
   Compiling skeptic v0.4.0 (file:///Users/Nemo157/sources/rust-skeptic)
   Compiling skeptic-readme v0.1.0 (file:///Users/Nemo157/sources/rust-skeptic)
     Running target/debug/skeptic-fd99135708fd17da

running 8 tests
test readme_1 ... ignored
test readme_3 ... ignored
test readme_4 ... ignored
test hashtag_test_0 ... ok
Calm your skepticism. This example is verified.
test readme_2 ... ok
thread '<main>' panicked at 'assertion failed: 1 == 100', /var/folders/p8/qd22z3cn44dfxcsrm1t4wrfh0000gn/T/rust-skeptic.MS7jL2uR9ioP/test.rs:2
test readme_5 ... ok
test readme_0 ... ok
test template_example_0 ... ok

test result: ok. 5 passed; 0 failed; 3 ignored; 0 measured

     Running target/debug/skeptic_readme-9c562216c8cf102a

running 1 test
test it_works ... ok

test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured

   Doc-tests skeptic-readme

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured

   Compiling libc v0.2.8
   Compiling getopts v0.2.14
   Compiling rand v0.3.14
   Compiling pulldown-cmark v0.0.3
   Compiling tempdir v0.3.4
   Compiling skeptic v0.4.0 (file:///Users/Nemo157/sources/rust-skeptic/src/skeptic)
   Compiling skeptic-readme v0.1.0 (file:///Users/Nemo157/sources/rust-skeptic)
     Running target/debug/skeptic-8a5efd214ff8fc6d

running 8 tests
test readme_1 ... ignored
test readme_3 ... ignored
test readme_4 ... ignored
/var/folders/p8/qd22z3cn44dfxcsrm1t4wrfh0000gn/T/rust-skeptic.r7miBUSs62TU/test.rs:1:1: 1:22 error: multiple matching crates for `skeptic` [E0464]
/var/folders/p8/qd22z3cn44dfxcsrm1t4wrfh0000gn/T/rust-skeptic.r7miBUSs62TU/test.rs:1 extern crate skeptic;
                                                                                     ^~~~~~~~~~~~~~~~~~~~~
note: candidates:
note: path: /Users/Nemo157/sources/rust-skeptic/target/debug/deps/libskeptic-18c04baf0ef4beeb.rlib
note: crate name: skeptic
note: path: /Users/Nemo157/sources/rust-skeptic/target/debug/deps/libskeptic-a6ff64dffa800a1f.rlib
note: crate name: skeptic
/var/folders/p8/qd22z3cn44dfxcsrm1t4wrfh0000gn/T/rust-skeptic.r7miBUSs62TU/test.rs:1:1: 1:22 error: can't find crate for `skeptic` [E0463]
/var/folders/p8/qd22z3cn44dfxcsrm1t4wrfh0000gn/T/rust-skeptic.r7miBUSs62TU/test.rs:1 extern crate skeptic;
                                                                                     ^~~~~~~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
test readme_0 ... FAILED
test hashtag_test_0 ... ok
Calm your skepticism. This example is verified.
test readme_2 ... ok
thread '<main>' panicked at 'assertion failed: 1 == 100', /var/folders/p8/qd22z3cn44dfxcsrm1t4wrfh0000gn/T/rust-skeptic.b7mtUFfxza75/test.rs:2
note: Run with `RUST_BACKTRACE=1` for a backtrace.
test readme_5 ... ok
/var/folders/p8/qd22z3cn44dfxcsrm1t4wrfh0000gn/T/rust-skeptic.sc7tmsNV7Mn5/test.rs:2:1: 2:22 error: multiple matching crates for `skeptic` [E0464]
/var/folders/p8/qd22z3cn44dfxcsrm1t4wrfh0000gn/T/rust-skeptic.sc7tmsNV7Mn5/test.rs:2 extern crate skeptic;
                                                                                     ^~~~~~~~~~~~~~~~~~~~~
note: candidates:
note: path: /Users/Nemo157/sources/rust-skeptic/target/debug/deps/libskeptic-a6ff64dffa800a1f.rlib
note: crate name: skeptic
note: path: /Users/Nemo157/sources/rust-skeptic/target/debug/deps/libskeptic-18c04baf0ef4beeb.rlib
note: crate name: skeptic
/var/folders/p8/qd22z3cn44dfxcsrm1t4wrfh0000gn/T/rust-skeptic.sc7tmsNV7Mn5/test.rs:2:1: 2:22 error: can't find crate for `skeptic` [E0463]
/var/folders/p8/qd22z3cn44dfxcsrm1t4wrfh0000gn/T/rust-skeptic.sc7tmsNV7Mn5/test.rs:2 extern crate skeptic;
                                                                                     ^~~~~~~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
test template_example_0 ... FAILED

failures:

---- readme_0 stdout ----
    thread 'readme_0' panicked at 'command failed', src/skeptic/lib.rs:335
note: Run with `RUST_BACKTRACE=1` for a backtrace.

---- template_example_0 stdout ----
    thread 'template_example_0' panicked at 'command failed', src/skeptic/lib.rs:335


failures:
    readme_0
    template_example_0

test result: FAILED. 3 passed; 2 failed; 3 ignored; 0 measured
@brson
Copy link
Collaborator

brson commented Mar 28, 2016

Thanks for the detailed report. I'm not sure how to fix it offhand.

@brson
Copy link
Collaborator

brson commented Aug 2, 2016

I don't see a way to solve this correctly today but I filed a cargo issue: rust-lang/cargo#2952

In the meantime, I think it would make sense to use a heuristic. Look in the appropriate directory for skeptic rlibs, pick the one with the most recent mtime, pass that via --extern.

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.

2 participants