Uh oh!
There was an error while loading. Please reload this page.
Update to rand 0.9.0 - #136395
Conversation
rustbot
commented
Feb 1, 2025
rustbot has assigned @Mark-Simulacrum. Use |
rustbot
commented
Feb 1, 2025
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. |
This comment has been minimized.
This comment has been minimized.
ChrisDenton
commented
Feb 1, 2025
Oh getrandom updated the wasi dependency and that now includes a dependency on |
rustbot
commented
Feb 1, 2025
The list of allowed third-party dependencies may have been modified! You must ensure that any new dependencies have compatible licenses before merging. |
bors
commented
Feb 3, 2025
☔ The latest upstream changes (presumably #136454) made this pull request unmergeable. Please resolve the merge conflicts. |
Mark-Simulacrum
commented
Feb 8, 2025
Hm, so I don't have any hard objections to wit-bindgen-rt, but it's a pretty weird crate... it has no README on crates.io, and looking at the raw artifacts there seems to be C and some non-source files (wit-bindgen-rt-0.39.0/src/cabi_realloc.o, wit-bindgen-rt-0.39.0/src/libwit_bindgen_cabi_realloc.a) in it? That seems to get linked in on wasm32 targets, which feels somewhat surprising to me -- I wouldn't have expected binary artifacts in crates.io. @alexcrichton could we perhaps add a README to the crate explaining why it has compiled artifacts? I suspect that's just going to reference the comment in https://github.com/bytecodealliance/wit-bindgen/blob/main/ci/rebuild-libcabi-realloc.sh, but since that file isn't shipped with the crate I had to do some hunting to find it :) It's my understanding that at least some upstream consumers of Rust don't want compiled artifacts in the "source" which this would be semi-introducing (it looks like miri already depends on this crate), I'm not sure how much of a problem that is in practice given what this is doing but it feels at least somewhat iffy. @wesleywiser / @davidtwco as T-compiler leads probably worth taking a look. Should we have some policy around this sort of thing? Maybe there's some other way we can help achieve the goal of ~weak symbols this crate wants on stable? |
Mark-Simulacrum
commented
Feb 8, 2025
As one option I wonder if the pre-compiled sources could be replaced with a dependency on (for example) wasm-encoder and just producing them from the build script? That's likely to be slower to build but it would make confirming that the file is what it says it is to some extent easier. |
alexcrichton
commented
Feb 8, 2025
Oh dear apologies if this is causing issues! As an internal implementation detail of wit-bindgen we didn't pay too much attention to public-facing documentation but I'm happy to add a README and/or crate docs pointing to the build script at the bare minimum.
If it helps at all we have documented/automated build instructions for this artifact in CI and it's always ensured that the checked-in copy is always up-to-date. This is intended to show that it's at least reproducible and matches the sources in tree. I realize though that such a setup may still not be sufficient for some consumers.
I can confirm that the feature we're lacking in Rust to avoid this artifact is indeed weak symbols. Specifically we want the ability to have a symbol,
This is indeed possible! That's more-or-less what this build script does for an unrelated part of wasm. We manually assemble a |
Mark-Simulacrum
commented
Feb 8, 2025
Yeah, I agree that manually writing out the bytes is only sort of an improvement. It does feel plausible that in e.g. a reproducible builds or company import policy it would matter. One thought I did have is that you could plausibly produce the object "just in time" with a RUSTC_BOOTSTRAP rustc toolchain, but that doesn't seem like a great idea. Or maybe having some tool (a-la patchelf or a linker script or something) that edits the symbol a stable Rust compiler can produce. I don't personally have a strong objection given the specific context here (and the lack of meaningful code in the blob) but it does seem like somewhat of a slippery slope. In this particular context I suspect this dependency is never(?) actually used since rustc or miri probably never get built for wasm (at least not by us). So maybe we just say that makes this mostly a non-issue. I'll nominate this for T-compiler to make a final call, and whatever we end up deciding we should probably make a policy note somewhere. |
Mark-Simulacrum
commented
Feb 8, 2025
I do think a README would be good to add. I'll also note the published artifact doesn't have a LICENSE file (again, not sure it matters, and is probably not uncommon, but perhaps not strictly ideal). |
alexcrichton
commented
Feb 10, 2025
I've added a README at bytecodealliance/wit-bindgen#1162 and for LICENSE stuff we generally rely on the |
bors
commented
Feb 11, 2025
☔ The latest upstream changes (presumably #136845) made this pull request unmergeable. Please resolve the merge conflicts. |
Would it be possible to have a feature or even a global config so that the compiler can opt-in to using the nightly feature for weak symbols instead of the precompiled artefacts? Generally the compiler is fine with using nightly features that have no stability guarantees but I can understand not wanting to expose your users to that. e.g. for the |
alexcrichton
commented
Feb 14, 2025
I'd be happy to do that yeah, but would want to confirm that would help here? That wouldn't actually remove the binary artifacts, it'd only configure things to not actually use them at compile-time. Is that sufficient for users who would push back against the inclusion of binary artifacts? (it's sort of just a pinky-promise to not use them as opposed to a guarantee) |
bors
commented
Feb 17, 2025
☔ The latest upstream changes (presumably #137164) made this pull request unmergeable. Please resolve the merge conflicts. |
ChrisDenton
commented
Feb 17, 2025
I'll wait for @wesleywiser to comment on that. I can only say that what |
5b7fdb8 to
fff919fCompare
This comment has been minimized.
This comment has been minimized.
ChrisDenton
commented
Mar 2, 2025
I couldn't figure out how to do this robustly. Cargo is designed to support multiple versions of the same dependency. We can lock a direct dependency but if a dependency of a dependency bumps the major wit-bindgen-rt version then I don't think we can protect against that using My counter-counter proposal that I just pushed is to support |
bors
commented
Mar 4, 2025
☔ The latest upstream changes (presumably #137927) made this pull request unmergeable. Please resolve the merge conflicts. |
ChrisDenton
commented
Mar 10, 2025
@bors r=Mark-Simulacrum |
bors
commented
Mar 10, 2025
…acrum Update to rand 0.9.0 Changes include: - `thread_rng` has been renamed to `rng` - `Standard` has been renamed to `StandardUniform` - `gen`, `gen_range`, `gen_bool` have been renamed to `random`, `random_range` and `random_bool` respectively.
…iaskrgr Rollup of 9 pull requests Successful merges: - rust-lang#136395 (Update to rand 0.9.0) - rust-lang#137279 (Make some invalid codegen attr errors structured/translatable) - rust-lang#137585 (Update documentation to consistently use 'm' in atomic synchronization example) - rust-lang#137926 (Add a test for `-znostart-stop-gc` usage with LLD) - rust-lang#138074 (Support `File::seek` for Hermit) - rust-lang#138238 (Fix dyn -> param suggestion in struct ICEs) - rust-lang#138270 (chore: Fix some comments) - rust-lang#138280 (fix ICE in pretty-printing `global_asm!`) - rust-lang#138286 (triagebot.toml: Don't label `test/rustdoc-json` as A-rustdoc-search (…) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#136395 (Update to rand 0.9.0) - rust-lang#137279 (Make some invalid codegen attr errors structured/translatable) - rust-lang#137585 (Update documentation to consistently use 'm' in atomic synchronization example) - rust-lang#137926 (Add a test for `-znostart-stop-gc` usage with LLD) - rust-lang#138074 (Support `File::seek` for Hermit) - rust-lang#138238 (Fix dyn -> param suggestion in struct ICEs) - rust-lang#138270 (chore: Fix some comments) - rust-lang#138286 (triagebot.toml: Don't label `test/rustdoc-json` as A-rustdoc-search (…) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#136395 (Update to rand 0.9.0) - rust-lang#137279 (Make some invalid codegen attr errors structured/translatable) - rust-lang#137585 (Update documentation to consistently use 'm' in atomic synchronization example) - rust-lang#137926 (Add a test for `-znostart-stop-gc` usage with LLD) - rust-lang#138074 (Support `File::seek` for Hermit) - rust-lang#138238 (Fix dyn -> param suggestion in struct ICEs) - rust-lang#138270 (chore: Fix some comments) - rust-lang#138286 (triagebot.toml: Don't label `test/rustdoc-json` as A-rustdoc-search (…) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#136395 (Update to rand 0.9.0) - rust-lang#137279 (Make some invalid codegen attr errors structured/translatable) - rust-lang#137585 (Update documentation to consistently use 'm' in atomic synchronization example) - rust-lang#137926 (Add a test for `-znostart-stop-gc` usage with LLD) - rust-lang#138074 (Support `File::seek` for Hermit) - rust-lang#138238 (Fix dyn -> param suggestion in struct ICEs) - rust-lang#138270 (chore: Fix some comments) - rust-lang#138286 (triagebot.toml: Don't label `test/rustdoc-json` as A-rustdoc-search (…) r? `@ghost` `@rustbot` modify labels: rollup
…acrum Update to rand 0.9.0 Changes include: - `thread_rng` has been renamed to `rng` - `Standard` has been renamed to `StandardUniform` - `gen`, `gen_range`, `gen_bool` have been renamed to `random`, `random_range` and `random_bool` respectively.
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#136395 (Update to rand 0.9.0) - rust-lang#137279 (Make some invalid codegen attr errors structured/translatable) - rust-lang#137585 (Update documentation to consistently use 'm' in atomic synchronization example) - rust-lang#137926 (Add a test for `-znostart-stop-gc` usage with LLD) - rust-lang#138074 (Support `File::seek` for Hermit) - rust-lang#138238 (Fix dyn -> param suggestion in struct ICEs) - rust-lang#138270 (chore: Fix some comments) - rust-lang#138286 (triagebot.toml: Don't label `test/rustdoc-json` as A-rustdoc-search (…) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#136395 - ChrisDenton:rand-0-9, r=Mark-Simulacrum Update to rand 0.9.0 Changes include: - `thread_rng` has been renamed to `rng` - `Standard` has been renamed to `StandardUniform` - `gen`, `gen_range`, `gen_bool` have been renamed to `random`, `random_range` and `random_bool` respectively.
Changes include:
thread_rnghas been renamed torngStandardhas been renamed toStandardUniformgen,gen_range,gen_boolhave been renamed torandom,random_rangeandrandom_boolrespectively.