Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle non-existent/empty .cargo/registry/src and empty env vars #119445

Closed
wants to merge 2 commits into from

Conversation

akiernan
Copy link

No description provided.

If remap-debuginfo is set but cargo isn't vendored into
.cargo/registry/src, don't panic:

| thread 'main' panicked at src/core/builder.rs:1795:26:
| std::fs::read_dir(registry_src) failed with No such file or directory (os error 2)

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
If RUSTC_DEBUGINFO_MAP or RUSTC_CARGO_REGISTRY_SRC_TO_REMAP are empty,
avoid inserting `--remap-path-prefix` with no associated argument.

Signed-off-by: Alex Kiernan <alex.kiernan@gmail.com>
@rustbot
Copy link
Collaborator

rustbot commented Dec 30, 2023

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon.

Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (S-waiting-on-review and S-waiting-on-author) stays updated, invoking these commands when appropriate:

  • @rustbot author: the review is finished, PR author should check the comments and take action accordingly
  • @rustbot review: the author is ready for a review, this PR will be queued again in the reviewer's queue

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Dec 30, 2023
@Mark-Simulacrum
Copy link
Member

Handle non-existent/empty .cargo/registry/src

What is the use case for this? The compiler and standard library both use crates.io dependencies today, so presumably you are providing those somehow. My worry is that landing this as-is will perhaps fix a particular panic or w/e in your case, but presumably does not help with actually getting remapping working, so it feels like an incomplete fix at best.

@akiernan
Copy link
Author

akiernan commented Jan 2, 2024

Sorry, context is everything and I didn't add the context...

Searching issues, it's this one:

#117885

Only in this case I'm bringing up 1.75.0 in for Openembedded-Core (Yocto).

I thought with this I'd resolved the remapping issues, but it we're still seeing build paths leak into the resulting rustc binary.

pothos added a commit to flatcar/scripts that referenced this pull request Jan 4, 2024
The compilation of rustc fails when a folder is missing. Pick the fix
from rust-lang/rust#119445
pothos added a commit to flatcar/scripts that referenced this pull request Jan 4, 2024
The compilation of rustc fails when a folder is missing. Pick the fix
from rust-lang/rust#119445
@arlosi
Copy link
Contributor

arlosi commented Jan 4, 2024

@akiernan I posted another PR with a different approach to fixing this issue in #119582, does that also work for your use case here?

pothos added a commit to flatcar/scripts that referenced this pull request Jan 4, 2024
The compilation of rustc fails when a folder is missing. Pick the fix
from rust-lang/rust#119445
pothos added a commit to flatcar/scripts that referenced this pull request Jan 5, 2024
The compilation of rustc fails when a folder is missing. Pick the fix
from rust-lang/rust#119445
@akiernan
Copy link
Author

akiernan commented Jan 5, 2024

@akiernan I posted another PR with a different approach to fixing this issue in #119582, does that also work for your use case here?

Yes, fixes the crash, though we're still seeing build paths leak into debug info though.

@akiernan akiernan closed this Jan 5, 2024
pothos added a commit to flatcar/scripts that referenced this pull request Apr 17, 2024
The patch rust-lang/rust#119582 got merged some
releases ago as alternative to the patch
rust-lang/rust#119445 we included in the ebuild
file. We currently use both because the unneeded patch got changed to
apply again but it's not needed and may cause strange behavior.
Therefore, drop the alternative patch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants