Skip to content

Conversation

@thomcc
Copy link
Contributor

@thomcc thomcc commented Jul 6, 2023

Thanks to @compiler-errors for helping me out here, this is much cleaner too.

Fixes #348 (we still may want to turn lints entirely off when compiling dependencies, but fixing it for real is better, and trying to parse a bunch of things out of the rustc args felt hairy without a bit more testing).

@thomcc
Copy link
Contributor Author

thomcc commented Jul 6, 2023

Note that without the change, the example I added would hit a similar ICE to the rand one. I can't add a dep on rand to the compiletests, and I don't think the plrust test suite supports deps in trusted mode, so this is probably the best option.

@thomcc thomcc requested a review from workingjubilee July 6, 2023 17:05
@eeeebbbbrrrr
Copy link
Contributor

eeeebbbbrrrr commented Jul 6, 2023

I don't think the plrust test suite supports deps in trusted mode

It does. The test suite actually sets up an allow-list so it can test that. Would be no problem to add rand to it and use rand in a unit test.

see

plrust/plrust/src/tests.rs

Lines 1401 to 1411 in 07bec8d

let mut allowed_deps = std::fs::File::create(&file_path).unwrap();
allowed_deps
.write_all(
r#"
owo-colors = "=3.5.0"
tokio = { version = "=1.19.2", features = ["rt", "net"]}
plutonium = "*"
"#
.as_bytes(),
)
.unwrap();

@thomcc
Copy link
Contributor Author

thomcc commented Jul 6, 2023

It does. The test suite actually sets up an allow-list so it can test that. Would be no problem to add rand to it and use rand in a unit test.

Ah, I confused the sandbox feature (no network) with trusted. (I thought somehow it had been renamed and I hadn't noticed).

I've added the test.

Copy link
Contributor

@eeeebbbbrrrr eeeebbbbrrrr left a comment

Choose a reason for hiding this comment

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

This looks good to me. Thanks for the unit test!

@thomcc thomcc merged commit 46705ba into main Jul 6, 2023
@thomcc thomcc deleted the thomcc/no-associated-ice branch July 6, 2023 18:06
thomcc added a commit that referenced this pull request Jul 6, 2023
@thomcc thomcc restored the thomcc/no-associated-ice branch July 6, 2023 20:08
thomcc added a commit that referenced this pull request Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

plrustc panics during compilation when using the rand crate

3 participants