Skip to content

Conversation

@Enselic
Copy link
Member

@Enselic Enselic commented Jan 26, 2026

Since it does not make sense to do so. If someone prefers no dynamic stuff, the last thing they want to look for is an .so file. Also add a regression test. Without the fix, the test fails with:

error: test compilation failed although it shouldn't!
--- stderr -------------------------------
error: extern location for no_prefer_dynamic_lib does not exist: .../auxiliary/libno_prefer_dynamic_lib.so
  --> .../no-prefer-dynamic-means-no-so.rs:9:5
   |
LL |     no_prefer_dynamic_lib::return_42();
   |     ^^^^^^^^^^^^^^^^^^^^^

Needed by:

Must wait for:

@rustbot rustbot added A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jan 26, 2026
@rust-log-analyzer

This comment has been minimized.

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 2, 2026
…thar

compiletest: Support `--extern` modifiers with `proc-macro` directive

So that the `src/tools/compiletest/src/directives/auxiliary/tests.rs` test does not have to (ab)use the `aux-crate` directive for this purpose.

This is very edge-casey so I don't think we should document this in rustc-dev-guide. Mentioning it will confuse more than it helps. If someone needs to do this they will look at the code and easily find the functionality.

This is a bit hacky since `--extern priv:pm.rs` is not valid, but we can make our directives work however we want. And I think this is a fine pragmatic approach. Doing it "the right way" would be a lot of work for not much gain. Plus, that work can be done incrementally in small steps in the future if wanted.

r? @Zalathar

---

Follow-up to:

- rust-lang#151353
- rust-lang#151670

### Unblocks:
- rust-lang#151691, because without this fix that test fails (see rust-lang#151691 (comment))
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 2, 2026
…thar

compiletest: Support `--extern` modifiers with `proc-macro` directive

So that the `src/tools/compiletest/src/directives/auxiliary/tests.rs` test does not have to (ab)use the `aux-crate` directive for this purpose.

This is very edge-casey so I don't think we should document this in rustc-dev-guide. Mentioning it will confuse more than it helps. If someone needs to do this they will look at the code and easily find the functionality.

This is a bit hacky since `--extern priv:pm.rs` is not valid, but we can make our directives work however we want. And I think this is a fine pragmatic approach. Doing it "the right way" would be a lot of work for not much gain. Plus, that work can be done incrementally in small steps in the future if wanted.

r? @Zalathar

---

Follow-up to:

- rust-lang#151353
- rust-lang#151670

### Unblocks:
- rust-lang#151691, because without this fix that test fails (see rust-lang#151691 (comment))
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Feb 2, 2026
…thar

compiletest: Support `--extern` modifiers with `proc-macro` directive

So that the `src/tools/compiletest/src/directives/auxiliary/tests.rs` test does not have to (ab)use the `aux-crate` directive for this purpose.

This is very edge-casey so I don't think we should document this in rustc-dev-guide. Mentioning it will confuse more than it helps. If someone needs to do this they will look at the code and easily find the functionality.

This is a bit hacky since `--extern priv:pm.rs` is not valid, but we can make our directives work however we want. And I think this is a fine pragmatic approach. Doing it "the right way" would be a lot of work for not much gain. Plus, that work can be done incrementally in small steps in the future if wanted.

r? @Zalathar

---

Follow-up to:

- rust-lang#151353
- rust-lang#151670

### Unblocks:
- rust-lang#151691, because without this fix that test fails (see rust-lang#151691 (comment))
rust-timer added a commit that referenced this pull request Feb 3, 2026
Rollup merge of #151695 - Enselic:proc-macro-priv-v2, r=Zalathar

compiletest: Support `--extern` modifiers with `proc-macro` directive

So that the `src/tools/compiletest/src/directives/auxiliary/tests.rs` test does not have to (ab)use the `aux-crate` directive for this purpose.

This is very edge-casey so I don't think we should document this in rustc-dev-guide. Mentioning it will confuse more than it helps. If someone needs to do this they will look at the code and easily find the functionality.

This is a bit hacky since `--extern priv:pm.rs` is not valid, but we can make our directives work however we want. And I think this is a fine pragmatic approach. Doing it "the right way" would be a lot of work for not much gain. Plus, that work can be done incrementally in small steps in the future if wanted.

r? @Zalathar

---

Follow-up to:

- #151353
- #151670

### Unblocks:
- #151691, because without this fix that test fails (see #151691 (comment))
@Enselic Enselic force-pushed the dylib-only-for-prefer-dynamic-v2 branch from 74f2d21 to 50622c9 Compare February 3, 2026 05:00
…r-dynamic`

Since it does not make sense to do so. If someone prefers no dynamic
stuff, the last thing they want to look for is an `.so` file. Also add a
regression test. Without the fix, the test fails with:

    error: test compilation failed although it shouldn't!
    --- stderr -------------------------------
    error: extern location for no_prefer_dynamic_lib does not exist: .../auxiliary/libno_prefer_dynamic_lib.so
      --> .../no-prefer-dynamic-means-no-so.rs:9:5
       |
    LL |     no_prefer_dynamic_lib::return_42();
       |     ^^^^^^^^^^^^^^^^^^^^^
@Enselic Enselic force-pushed the dylib-only-for-prefer-dynamic-v2 branch from 50622c9 to f14e3ee Compare February 3, 2026 05:00
@Enselic Enselic changed the title compiletest: Don't look for aux-crate .so if //@ no-prefer-dynamic compiletest: Don't assume aux-crate becomes a *.so with no-prefer-dynamic Feb 3, 2026
@Enselic
Copy link
Member Author

Enselic commented Feb 3, 2026

Ready for review.

@Enselic Enselic marked this pull request as ready for review February 3, 2026 06:40
@rustbot
Copy link
Collaborator

rustbot commented Feb 3, 2026

Some changes occurred in src/tools/compiletest

cc @jieyouxu

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Feb 3, 2026
@rustbot
Copy link
Collaborator

rustbot commented Feb 3, 2026

r? @jdonszelmann

rustbot has assigned @jdonszelmann.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@jdonszelmann
Copy link
Contributor

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 3, 2026

📌 Commit f14e3ee has been approved by jdonszelmann

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 3, 2026
jhpratt added a commit to jhpratt/rust that referenced this pull request Feb 3, 2026
…mic-v2, r=jdonszelmann

compiletest: Don't assume `aux-crate` becomes a `*.so` with `no-prefer-dynamic`

Since it does not make sense to do so. If someone prefers no dynamic stuff, the last thing they want to look for is an .so file. Also add a regression test. Without the fix, the test fails with:

    error: test compilation failed although it shouldn't!
    --- stderr -------------------------------
    error: extern location for no_prefer_dynamic_lib does not exist: .../auxiliary/libno_prefer_dynamic_lib.so
      --> .../no-prefer-dynamic-means-no-so.rs:9:5
       |
    LL |     no_prefer_dynamic_lib::return_42();
       |     ^^^^^^^^^^^^^^^^^^^^^

### Needed by:
-  rust-lang#150591 because of rust-lang#151271. But IMHO this PR makes sense on its own.

### Must wait for:
- [x] rust-lang#151695
jhpratt added a commit to jhpratt/rust that referenced this pull request Feb 3, 2026
…mic-v2, r=jdonszelmann

compiletest: Don't assume `aux-crate` becomes a `*.so` with `no-prefer-dynamic`

Since it does not make sense to do so. If someone prefers no dynamic stuff, the last thing they want to look for is an .so file. Also add a regression test. Without the fix, the test fails with:

    error: test compilation failed although it shouldn't!
    --- stderr -------------------------------
    error: extern location for no_prefer_dynamic_lib does not exist: .../auxiliary/libno_prefer_dynamic_lib.so
      --> .../no-prefer-dynamic-means-no-so.rs:9:5
       |
    LL |     no_prefer_dynamic_lib::return_42();
       |     ^^^^^^^^^^^^^^^^^^^^^

### Needed by:
-  rust-lang#150591 because of rust-lang#151271. But IMHO this PR makes sense on its own.

### Must wait for:
- [x] rust-lang#151695
rust-bors bot pushed a commit that referenced this pull request Feb 3, 2026
Rollup of 6 pull requests

Successful merges:

 - #152008 (`rust-analyzer` subtree update)
 - #151109 (fN::BITS constants for feature float_bits_const)
 - #151976 (Rename `collect_active_jobs` to several distinct names)
 - #151691 (compiletest: Don't assume `aux-crate` becomes a `*.so` with `no-prefer-dynamic`)
 - #151919 (fix: Make `--color always` always print color with `--explain`)
 - #152028 (Convert to inline diagnostics in `rustc_driver_impl`)
rust-bors bot pushed a commit that referenced this pull request Feb 3, 2026
Rollup of 7 pull requests

Successful merges:

 - #152008 (`rust-analyzer` subtree update)
 - #151109 (fN::BITS constants for feature float_bits_const)
 - #151976 (Rename `collect_active_jobs` to several distinct names)
 - #151691 (compiletest: Don't assume `aux-crate` becomes a `*.so` with `no-prefer-dynamic`)
 - #151919 (fix: Make `--color always` always print color with `--explain`)
 - #152017 (Remove `with_no_trimmed_paths` use in query macro)
 - #152028 (Convert to inline diagnostics in `rustc_driver_impl`)
@rust-bors rust-bors bot merged commit 6d064d9 into rust-lang:main Feb 3, 2026
11 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 3, 2026
rust-timer added a commit that referenced this pull request Feb 3, 2026
Rollup merge of #151691 - Enselic:dylib-only-for-prefer-dynamic-v2, r=jdonszelmann

compiletest: Don't assume `aux-crate` becomes a `*.so` with `no-prefer-dynamic`

Since it does not make sense to do so. If someone prefers no dynamic stuff, the last thing they want to look for is an .so file. Also add a regression test. Without the fix, the test fails with:

    error: test compilation failed although it shouldn't!
    --- stderr -------------------------------
    error: extern location for no_prefer_dynamic_lib does not exist: .../auxiliary/libno_prefer_dynamic_lib.so
      --> .../no-prefer-dynamic-means-no-so.rs:9:5
       |
    LL |     no_prefer_dynamic_lib::return_42();
       |     ^^^^^^^^^^^^^^^^^^^^^

### Needed by:
-  #150591 because of #151271. But IMHO this PR makes sense on its own.

### Must wait for:
- [x] #151695
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants