Repository navigation
Do not set library kind to dylib if not specified - #3049
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3049 +/- ##
==========================================
+ Coverage 79.16% 79.26% +0.09%
==========================================
Files 75 75
Lines 46166 46400 +234
==========================================
+ Hits 36548 36779 +231
- Misses 9618 9621 +3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
A library without a kind must stay without one: rustc picks the kind per target (e.g. static with crt-static), so turning it into dylib changes the output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
thanks for looking into this! |
| // aren't copied into the rlib, so they don't change the output. | ||
| let bundled_static = match kind.split_once(':') { | ||
| // Libraries without a kind are never bundled. | ||
| let kind_and_modifiers = kind |
There was a problem hiding this comment.
could be simpler with is_some_and, no?
kind.as_deref().is_some_and(|kind| { let (kind, modifiers) = kind.split_once(':').unwrap_or((kind, "")); kind == "static" && ... })
(fine in a different PR)
I run the tests before the fix and it failed (maybe you started your review before the commit with the test): |
|
ok, please run rustfmt |
|
Thanks for your PR |
* rust: hash static libraries passed with link modifiers (cherry picked from commit b63a6ed) * Do not set library kind to dylib if not specified (mozilla#3049) * Do not set library kind to dylib if not specified * Test that -l arguments reach rustc unchanged A library without a kind must stay without one: rustc picks the kind per target (e.g. static with crt-static), so turning it into dylib changes the output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Simplify parsing bundled link arguments * Fix code formatting --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 153cad6) * rust: treat the -C profile-use file as an input, not an output rustc lists the profile in its dep-info, so its contents already reach the hash key. Listing it as an output made every cache hit write it back, and the new mtime made cargo rebuild every crate that reads it. Fixes mozilla#2960 (cherry picked from commit 60e5268) * rust: parse the profile-use test's arguments with parses! The match's fallback arm only runs when parsing fails, so it was a line of the patch no test could cover. The arguments need no working directory (no response file, no -L path), which is what parses! assumes. (cherry picked from commit 13d7023) * rust: unescape env-dep names and values rustc escapes backslashes, newlines and carriage returns in them. Keys change once for crates whose env-deps contain one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit a9d792d) * rust: preserve native-library input and PGO path semantics across layouts * rust: remove unused formatting import --------- Co-authored-by: tiny-ac <agostina@wyeworks.com> Co-authored-by: Alexander <kovalidis@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: feder-cr <85809106+feder-cr@users.noreply.github.com> Co-authored-by: ghoulspa <331221112+ghoulspa@users.noreply.github.com>
Fixes #3048