Skip to content

Conversation

@FalkWoldmann
Copy link

@FalkWoldmann FalkWoldmann commented Dec 3, 2025

Description
Right now, we always use once_cell in naga, even when std with LazyLock is available.

Testing
I ran cargo xtask test locally.

Squash or Rebase?

Rebase

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy --tests. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo xtask test to run tests.
  • If this contains user-facing changes, add a CHANGELOG.md entry.

@FalkWoldmann
Copy link
Author

The "cleanest" way of ensuring that once_lock is actually optional for std builds would be to introduce an explicit std feature. This would, however, mean breaking changes for no_std users, as they would then need to add naga with no default features and the once_cell feature. Would this be okay with you?

@ErichDonGubler
Copy link
Member

@FalkWoldmann: Yes, please! Filed #8701 for tracking. 🙂

Copy link
Member

@ErichDonGubler ErichDonGubler left a comment

Choose a reason for hiding this comment

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

This code overall LGTM, but before I merge: What's the motivation for making this change? Is it to eliminate an unused dependency?

@ErichDonGubler
Copy link
Member

Just waiting for an answer to this comment before merging; friendly ping for @FalkWoldmann, in case this fell off the radar.

@FalkWoldmann
Copy link
Author

Hi, yeah, sorry! Missed it :) the main motivation is to use the components which are already available via std to reduce the amount of external code that is run. However, we still bundle the dependency, so one could argue if this really changes a lot. I would say so, since I am of the opinion that the std features should always be preferred if they provide the features we need, which is the case here.

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.

2 participants