rust-lang / rust-lang/rust

compiletest: the `aux-crate` directive can't deal with more complex paths it seems

Open
#123,766 0 comments 0 reactions 1 assignee View on GitHub

@jieyouxu is already working on this.

Since Apr 11, 2024.

A-compiletest A-testsuite C-bug P-low T-compiler
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

I've chatted with @jieyouxu and we've come to the conclusion that it's worthwhile to track compiletest issues even though we plan on fully migrating to ui_test eventually since that might still take a while.


While //@ aux-build:../helper.rs[^1] works as one would expect (compiletest finds ./auxiliary/../helper.rs aka ./helper.rs), //@ aux-crate:helper=../helper.rs does not. It leads to the following rustc error:

error: extern location for helper does not exist: <REDACTED>/test/ui/dummy/auxiliary/lib../helper.so
  --> <REDACTED>/tests/ui/dummy.rs:4:1
   |
LL | extern crate helper;
   | ^^^^^^^^^^^^^^^^^^^^

error: aborting due to 1 previous error

Reproducer:

tests/ui/helper.rs: empty.

tests/ui/dummy.rs:

//@ aux-crate:helper=../helper.rs
//@ check-pass
extern crate helper;
fn main() {}

[^1]: Indeed, this pattern is used inside tests/ui/!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.