-
-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow selecting owned identifier memory representation via regular environment variable #1458
Comments
Doesn't this require a |
Yes, is that problematic? |
I don't think so, but just making sure |
What is the benefit over using cargo features? |
Cargo features are additive and can be enabled from any place in the dependency tree. For the owned identifier representation, one specific value must be set (it wouldn't make sense to activate multiple ones). |
It can become a compiler error to activate multiple ones. This has potential to make some libraries unusable with each other, but I think in practice all libraries will delegate this decision to the main binary (specially when docs encourage that). I would prefer cargo features for better tooling support and less problems like this, but YMMV. |
If it'll become a compiler error, then multiple libraries will become mutually exclusively incompatible with eachother, which is not what we want |
Currently, it is only possible to select the memory representation (
Box
orArc
) for identifiers (docs) via aRUSTFLAGS
--cfg
setting. ChangingRUSTFLAGS
leads to the entire dependency chain being recompiled. As a cheaper solution, we can read an environment variable inruma-common
s build script, and emit(docs)
Then when people change the environment variable, only ruma-common and its dependents will be rebuilt.
The text was updated successfully, but these errors were encountered: