wasm-bindgen: Linked JS file not being built properly (regression after 0.2.93)
Describe the Bug
A file linked to using link_to! is not being bundled properly starting with 0.2.94.
Steps to Reproduce
- clone zama-ai/tfhe-rs repository
- run make build_web_js_api_parallel and check content of tfhe/pkg/snippets/wasm-bindgen-rayon-<hash>/src
- change version constraint for wasm-bindgen to 0.2.95
- remove tfhe/pkg folder
- run again make build_web_js_api_parallel and check content of tfhe/pkg/snippets/wasm-bindgen-rayon-<hash>/src -> you’ll see that workerHelpers.worker.js file is missing
Expected Behavior
Should work as in 0.2.93.
Actual Behavior
File is not bundled.
Additional Context
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 17 (7 by maintainers)
@daxpedda: even if “it’s a feature, not a bug”… isn’t this a semver break?
My bad, hadn’t seen that discussion thread, I understand better now, thanks. I’ll stay on 0.2.93 for now (unfortunately some of my deps specify 0.2.95 so I have to patch them until wasm-bindgen-rayon is itself fixed)
Thank you both for all your work on these awesome Rust crates!
Wrote you an email!
Thanks for answering!
Semver’s purpose is to help consumers manage their change and migration risk. The guidelines are just listing example changes that might break consumers’ code, and hoping you’ll see the pattern underlying the examples. Whether you consider a change to be a bugfix or not is irrelevant to whether that change introduces migration risk to downstream projects.
Migrating a project to
0.2.95incurs more risk to the project than migrating to0.2.93did, so ideally the version numbers would be chosen to communicate this risk in a way that Cargo understands.If the release had bumped the minor version instead of the patch,
cargo updatewould not automatically bring in this release at the same time as all the other packages whose patch numbers had updated. I would then manually update the package in isolation inCargo.toml, and when my code broke, I would know what the breakage was and what caused it.It’s very cheap to bump a minor or even major number instead of always bumping the patch number with every release. I would love to see more projects default to bumping higher numbers, leaving patch number bumps free to communicate which changes we know for sure are very low-risk.