Skip to content

Hard-coded strip path breaks Linux -> Darwin builds #131206

Description

@rvolosatovs

I cross-compile code for Darwin from Linux, which now fails due to the strip path being hard-coded in latest nightly, which I believe is caused by this PR #130781

I expected to see this happen: successful compilation

Instead, this happened:

error: unable to run `/usr/bin/strip`: No such file or directory (os error 2)

https://github.com/rvolosatovs/nixify/actions/runs/11163623704/job/31031050404?pr=265

I'm not sure why /usr/bin/strip was chosen as the strip to use, as an end user - that is surprising, in fact I would have expected the strip from the environment to be used by default. If the intention is to set a default to a hardcoded path, then it looks like a configuration option must be provided.

Alternatively, perhaps cargo could use /usr/bin/strip if found and otherwise use strip from environment?

Version it worked on

It most recently worked on: 1.80.1

Version with regression

rustc --version --verbose:

cargo 1.83.0-nightly (80d82ca22 2024-09-27)

Activity

  1. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    and removed
    regression-untriagedUntriaged performance or correctness regression.
    on Oct 3, 2024
  2. taiki-e commented on Oct 3, 2024

    @taiki-e
    Member

    Duplicate of #114411

    (The results are not exactly the same, but things are broken for the same cause.)

  3. rvolosatovs commented on Oct 3, 2024

    @rvolosatovs
    Author

    Duplicate of #114411

    @taiki-e no, that's a different issue, since strip does work fine on Linux to strip Darwin binaries. The issue here is the hardcoded path introduced a week ago

  4. taiki-e commented on Oct 3, 2024

    @taiki-e
    Member

    Oh, sorry, I missed the information that that used to work.

    (In any case, I think the correct solution to these problems is the same one: #123151)

  5. rvolosatovs commented on Oct 3, 2024

    @rvolosatovs
    Author

    Oh, sorry, I missed the information that that used to work.

    (In any case, I think the correct solution to these problems is the same one: #123151)

    indeed, LLVM strip works great for my use case, on current nightly, however, there is no way to make sure it's used other than explicitly putting the binary in /usr/bin/strip.

    Will #123151 land before 1.83? I don't think #130781 should land in a release and seems that it currently targets 1.83

  6. added a commit that references this issue on Oct 3, 2024
  7. jieyouxu commented on Oct 3, 2024

    @jieyouxu
    Member

    #130781 cc @monkeydbobo and @davidtwco
    Not sure how to solve the strip situation...

  8. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Oct 3, 2024
  9. 10 remaining items

  10. removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Oct 7, 2024
  11. self-assigned this
    on Oct 8, 2024
  12. madsmtm commented on Oct 10, 2024

    @madsmtm
    Member

    Opened #131480 to fix this directly, in case #131405 ends up taking some time.

  13. added a commit that references this issue on Oct 10, 2024
  14. added a commit that references this issue on Oct 10, 2024
  15. added a commit that references this issue on Nov 5, 2024
    8dee3e9
  16. added a commit that references this issue on Nov 6, 2024
    55a0545
  17. added 2 commits that reference this issue on Mar 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.O-linuxOperating system: LinuxO-macosOperating system: macOSP-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions