-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Correctly get source for metatdata-only crate type #40542
Conversation
Test please. |
Marking as beta-nominated since this affects the current beta. |
Marking as beta-accepted, once it is r+'d of course (and yes, with test plz). |
Okay, so I've got a minimal case here, involving three crates,
I know about auxiliary builds but how do I force the |
I've posted the reproduction at https://github.com/abonander/rust-issue-40535 |
You can create a run-make test (see src/test/run-make). |
@arielb1 Can that include Cargo invocations or do I have to write out the commands manually? |
Eh I can just copy the output of |
Regression test pushed, it detects the error and confirms the fix correctly (fails on ICE, succeeds otherwise) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! r=me modulo comment
$(RUSTC) bar.rs --emit=metadata --extern baz=libbaz.rmeta | ||
$(RUSTC) foo.rs --emit=metadata -L dependency=. --extern bar=libbar.rmeta 2>&1 | \ | ||
grep -vq "unexpectedly panicked" | ||
# ^ Succeeds if it doesn't find the ICE message |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: add trailing newline (all new files)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really gotta figure out how to get IDEA to add those automatically, it's so easy to forget.
@bors r+ |
📌 Commit e670335 has been approved by |
Not sure how to fix this. |
@abonander The |
Why is it not writing there now then? Weird. |
Not sure -- looks like |
@bors r- |
I'm testing explicitly adding |
$(RUSTC) baz.rs --emit=metadata | ||
$(RUSTC) bar.rs --emit=metadata --extern baz=libbaz.rmeta | ||
$(RUSTC) foo.rs --emit=metadata -L dependency=. --extern bar=libbar.rmeta 2>&1 | \ | ||
$(RUSTC) baz.rs --emit=metadata --out-dir=$(TMPDIR) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--out-dir=$(TMPDIR)
is already included in $(RUSTC)
, would be very strange if adding it again here made a difference...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may need to be after --emit=metadata
, because that's how Cargo writes the command.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cc #40623
@jseyfried Tests passed this time. I guess |
@bors: r=jseyfried What weird bug! |
📌 Commit 3cbdb8f has been approved by |
@bors r- Let me take care of that "(squash me!) ..." commit first, unless you don't care about that showing up in the commit history (which would be pretty funny to come across later, I guess). |
Should I leave a |
all: | ||
$(RUSTC) baz.rs --emit=metadata --out-dir=$(TMPDIR) | ||
$(RUSTC) bar.rs --emit=metadata --extern baz=$(TMPDIR)/libbaz.rmeta --out-dir=$(TMPDIR) | ||
$(RUSTC) foo.rs --emit=metadata -L dependency=. --extern bar=$(TMPDIR)/libbar.rmeta --out-dir=$(TMPDIR) 2>&1 | \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think -L dependency=.
has any effect here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it seemed to before, but now it's fine.
Sure, I'd at least cc the issue -- if I came across this code I'd probably be curious about the @bors delegate=abonander |
✌️ @abonander can now approve this pull request |
@bors: r=jseyfried Tested it locally, forgot to push before I went out for dinner. |
📌 Commit 74d6cce has been approved by |
🔒 Merge conflict |
replace `unwrap()` with `expect()`
@bors r=jseyfried |
📌 Commit 8a6ef50 has been approved by |
Correctly get source for metatdata-only crate type Closes rust-lang#40535 However, I'm not sure how to approach writing a regression test since I'm still working on a reduced test case from the code that caused the ICE in the first place. It's not enough to have an unknown `extern crate` in a metadata crate, it depends on a few extra arguments but I'm not sure which yet. Also replaced the `unwrap()` with a more informative `expect()`. r? @jseyfried
This test is failing on 1.21.0 on Debian on amd64 and ppc64el:
Any clue what's causing it? |
Closes #40535
However, I'm not sure how to approach writing a regression test since I'm still working on a reduced test case from the code that caused the ICE in the first place. It's not enough to have an unknown
extern crate
in a metadata crate, it depends on a few extra arguments but I'm not sure which yet.Also replaced the
unwrap()
with a more informativeexpect()
.r? @jseyfried