Skip to content

Conversation

ia0
Copy link
Contributor

@ia0 ia0 commented Jul 5, 2025

This PR does 2 things:

Running cargo +stage1 build on the following program:

unsafe extern "C" {
    fn foo() -> libc::c_int;
}

fn main() {
    let x = unsafe { foo() } as u32;
    // println!("{}", data_encoding::BASE64.encode(&x.to_le_bytes()));
}

Gives the following diff before and after the PR:

-/tmp/foo/target/debug/deps/{liblibc-faf416f178830595.rlib}.rlib
+/tmp/foo/target/debug/deps/liblibc-faf416f178830595.rlib

Running on the same program with the additional dependency, we get the following diff:

-/tmp/foo/target/debug/deps/{liblibc-faf416f178830595.rlib,libdata_encoding-84bb5aadfa9e8839.rlib}.rlib
+/tmp/foo/target/debug/deps/{liblibc-faf416f178830595,libdata_encoding-84bb5aadfa9e8839}.rlib

This PR does 2 things:

- It removes the braces when there's a single element. This is required since brace expansion (at
  least in bash and zsh) only triggers if there's at least 2 elements.

- It removes the extra `.rlib` suffixes of the elements. See
  rust-lang#135707 (comment) for context.

Running `cargo +stage1 build` on the following program:

```rust
unsafe extern "C" {
    fn foo() -> libc::c_int;
}

fn main() {
    let x = unsafe { foo() } as u32;
    // println!("{}", data_encoding::BASE64.encode(&x.to_le_bytes()));
}
```

Gives the following diff before and after the PR:

```diff
-/tmp/foo/target/debug/deps/{liblibc-faf416f178830595.rlib}.rlib
+/tmp/foo/target/debug/deps/liblibc-faf416f178830595.rlib
```

Running on the same program with the additional dependency, we get the following diff:

```diff
-/tmp/foo/target/debug/deps/{liblibc-faf416f178830595.rlib,libdata_encoding-84bb5aadfa9e8839.rlib}.rlib
+/tmp/foo/target/debug/deps/{liblibc-faf416f178830595,libdata_encoding-84bb5aadfa9e8839}.rlib
```

Do we want to add a UI test?
@rustbot
Copy link
Collaborator

rustbot commented Jul 5, 2025

r? @fee1-dead

rustbot has assigned @fee1-dead.
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

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 5, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 5, 2025

Some changes occurred in compiler/rustc_codegen_ssa

cc @WaffleLapkin

@fee1-dead
Copy link
Member

Do we want to add a UI test?

We should definitely test this, but with a run-make test, probably something like the one in #135707

@rustbot rustbot added the A-run-make Area: port run-make Makefiles to rmake.rs label Jul 6, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jul 6, 2025

This PR modifies run-make tests.

cc @jieyouxu

@ia0
Copy link
Contributor Author

ia0 commented Jul 6, 2025

We should definitely test this, but with a run-make test, probably something like the one in #135707

Thanks for the link! I don't know how I missed that. I've updated the test.

Copy link
Member

@fee1-dead fee1-dead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me after nit

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

@bors delegate+

@bors
Copy link
Collaborator

bors commented Jul 7, 2025

✌️ @ia0, you can now approve this pull request!

If @fee1-dead told you to "r=me" after making some further change, please make that change, then do @bors r=@fee1-dead

@ia0
Copy link
Contributor Author

ia0 commented Jul 7, 2025

@bors r=@fee1-dead

@bors
Copy link
Collaborator

bors commented Jul 7, 2025

📌 Commit cdbdd8a has been approved by fee1-dead

It is now in the queue for this repository.

@bors bors 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 7, 2025
@fee1-dead
Copy link
Member

@bors rollup

bors added a commit that referenced this pull request Jul 7, 2025
Rollup of 11 pull requests

Successful merges:

 - #143130 (doc(std): clarify `NonZero<T>` usage limitation in doc comment)
 - #143415 (Get rid of build-powerpc64le-toolchain.sh)
 - #143464 (Make tests/ui/abi/debug.rs cross-compile)
 - #143482 (Fix short linker error output)
 - #143524 (Move `stable_mir` back to its own crate)
 - #143528 (interpret: rename StackPopCleanup)
 - #143551 (Dont resolve instance of root in `mir_callgraph_cyclic`)
 - #143558 (mbe: Refactors and function extractions in `compile_declarative_macro`)
 - #143563 (std: fix typo in `std::path`)
 - #143564 (compiler: Deduplicate `must_emit_unwind_tables()` comments)
 - #143577 (Disable download-rustc for library profile)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 4ba4b5f into rust-lang:master Jul 7, 2025
11 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jul 7, 2025
rust-timer added a commit that referenced this pull request Jul 7, 2025
Rollup merge of #143482 - ia0:fix, r=fee1-dead

Fix short linker error output

This PR does 2 things:

- It removes the braces when there's a single element. This is required since brace expansion (at least in bash and zsh) only triggers if there's at least 2 elements.

- It removes the extra `.rlib` suffixes of the elements. See #135707 (comment) for context.

Running `cargo +stage1 build` on the following program:

```rust
unsafe extern "C" {
    fn foo() -> libc::c_int;
}

fn main() {
    let x = unsafe { foo() } as u32;
    // println!("{}", data_encoding::BASE64.encode(&x.to_le_bytes()));
}
```

Gives the following diff before and after the PR:

```diff
-/tmp/foo/target/debug/deps/{liblibc-faf416f178830595.rlib}.rlib
+/tmp/foo/target/debug/deps/liblibc-faf416f178830595.rlib
```

Running on the same program with the additional dependency, we get the following diff:

```diff
-/tmp/foo/target/debug/deps/{liblibc-faf416f178830595.rlib,libdata_encoding-84bb5aadfa9e8839.rlib}.rlib
+/tmp/foo/target/debug/deps/{liblibc-faf416f178830595,libdata_encoding-84bb5aadfa9e8839}.rlib
```
@ia0 ia0 deleted the fix branch July 7, 2025 17:44
github-actions bot pushed a commit to devnexen/miri that referenced this pull request Jul 8, 2025
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#143130 (doc(std): clarify `NonZero<T>` usage limitation in doc comment)
 - rust-lang/rust#143415 (Get rid of build-powerpc64le-toolchain.sh)
 - rust-lang/rust#143464 (Make tests/ui/abi/debug.rs cross-compile)
 - rust-lang/rust#143482 (Fix short linker error output)
 - rust-lang/rust#143524 (Move `stable_mir` back to its own crate)
 - rust-lang/rust#143528 (interpret: rename StackPopCleanup)
 - rust-lang/rust#143551 (Dont resolve instance of root in `mir_callgraph_cyclic`)
 - rust-lang/rust#143558 (mbe: Refactors and function extractions in `compile_declarative_macro`)
 - rust-lang/rust#143563 (std: fix typo in `std::path`)
 - rust-lang/rust#143564 (compiler: Deduplicate `must_emit_unwind_tables()` comments)
 - rust-lang/rust#143577 (Disable download-rustc for library profile)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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