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

  1. clone zama-ai/tfhe-rs repository
  2. run make build_web_js_api_parallel and check content of tfhe/pkg/snippets/wasm-bindgen-rayon-<hash>/src
  3. change version constraint for wasm-bindgen to 0.2.95
  4. remove tfhe/pkg folder
  5. 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

https://github.com/RReverser/wasm-bindgen-rayon/issues/17

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 17 (7 by maintainers)

Commits related to this issue

Most upvoted comments

@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!

But yes, for easier and less hacky support in the future there are definitely things that could be done on the wasm-bindgen side that I never got around to working on. If you have spare time, I’d love to get together and discuss them as well (like, in a 30 min Google Meet call?) - I think they’d simplify wasm-bindgen-rayon’s job substantionally in a few areas.

Wrote you an email!

Thanks for answering!

Unfortunately, the official Semver guidlines don’t mention bugfixes.

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.95 incurs more risk to the project than migrating to 0.2.93 did, 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 update would 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 in Cargo.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.