Skip to content

./mach test-compiletest breaks when there are multiple versions of libplugins present in the build directory #9945

Closed

Description

@jdm

As far as I can tell, this is due to the way the compiletest helper invokes rustc in tests/compiletest/helper/lib.rs:

    let mode = env::var("BUILD_MODE").expect("BUILD_MODE environment variable must be set");
    let debug_path = base_path.join(PathBuf::from(format!("target/{}", mode)));
    let deps_path = base_path.join(PathBuf::from(format!("target/{}/deps", mode)));

    config.target_rustcflags = Some(format!("-L {} -L {}",  debug_path.display(), deps_path.display()));

I assume Cargo passes references to specific versions of the libraries and therefore avoids this?

running 5 tests
test [compile-fail] compile-fail/ban.rs ... FAILED
test [compile-fail] compile-fail/transmute_type.rs ... FAILED
test [compile-fail] compile-fail/unrooted_must_root.rs ... FAILED
test [compile-fail] compile-fail/str_to_string.rs ... FAILED
test [compile-fail] compile-fail/privatize.rs ... FAILED

failures:

---- [compile-fail] compile-fail/ban.rs stdout ----

error: unexpected compiler error or warning: 'compile-fail/ban.rs:6:11: 6:18 error: multiple matching crates for `plugins` [E0464]'
status: exit code: 101
command: rustc compile-fail/ban.rs -L /tmp --target=x86_64-apple-darwin -L /tmp/ban.stage3libaux -C prefer-dynamic -o /tmp/ban.stage3 -L /Users/jdm/src/dev-servo/target/debug -L /Users/jdm/src/dev-servo/target/debug/deps
stdout:
------------------------------------------

------------------------------------------
stderr:
------------------------------------------
compile-fail/ban.rs:6:11: 6:18 error: multiple matching crates for `plugins` [E0464]
compile-fail/ban.rs:6 #![plugin(plugins)]
                                ^~~~~~~
note: candidates:
note: path: /Users/jdm/src/dev-servo/target/debug/deps/libplugins-ca2d28dc2c872d09.dylib
note: crate name: plugins
note: path: /Users/jdm/src/dev-servo/target/debug/deps/libplugins-f61f2893313906d8.dylib
note: crate name: plugins
note: path: /Users/jdm/src/dev-servo/target/debug/deps/libplugins-097291f72d7896a8.dylib
note: crate name: plugins
compile-fail/ban.rs:6:11: 6:18 error: can't find crate for `plugins` [E0463]
compile-fail/ban.rs:6 #![plugin(plugins)]
                                ^~~~~~~
error: aborting due to 2 previous errors

Activity

  1. jdm commented on Mar 9, 2016

    @jdm
    MemberAuthor

    For example, ./mach test-unit -p net --verbose shows this in the output when building net_tests: --extern plugins=/Users/jdm/src/dev-servo/target/debug/deps/libplugins-ca2d28dc2c872d09.dylib

  2. jdm commented on Mar 9, 2016

    @jdm
    MemberAuthor

    I expect this can be worked around by removing all the libplugins and running ./mach build as usual before continuing with ./mach test-compiletest, but this will bite developers locally every time we change the plugins crate or upgrade rustc.

  3. added a commit that references this issue on Nov 22, 2017
    5213e2a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions