Comments (6)
The current support for binaries with requires features is for you to use features
/all-features
/default-features
in workspace.metadata.dist
/package.metadata.dist
(same syntax as cargo dependencies): https://opensource.axo.dev/cargo-dist/book/reference/config.html#features
from cargo-dist.
Also to be clear here, required-features
is a Cargo feature that can only disable a binary being built. It sadly does not tell Cargo "hey if I try to build this binary, flip on these features". I misunderstood it so the comments I made in that issue are unhelpful.😿
from cargo-dist.
(We could read required-features config and flip on features by default but I'm a bit skittish about confusing things happening if we do that automagically.)
from cargo-dist.
Also to be clear here, required-features is a Cargo feature that can only disable a binary being built. It sadly does not tell Cargo "hey if I try to build this binary, flip on these features"
Yes precisely, this is a mechanism to disable including a binary. If the binary feature is not part of the default features, I would expect cargo-dist to not try and package it.
We could read required-features config and flip on features by default
Definitely not, cargo dist should respect the features requested.
from cargo-dist.
Yes precisely, this is a mechanism to disable including a binary. If the binary feature is not part of the default features, I would expect cargo-dist to not try and package it.
Oh I see you want cargo-dist to auto-hide binaries that lack sufficient features. That's... interesting. My impulse is that cargo-dist should definitely error if you require features and it's not specified. I would however be inclined to still require you to manually opt them out of cargo-dist (basically making you say the same thing twice either way to make sure you understand what you're saying, since required-features causes a ton of confusion).
INTERESTING
from cargo-dist.
My impulse is that cargo-dist should definitely error if you require features and it's not specified
I'm not sure if developers would be surprised if a binary isn't packaged if its required features are not enabled, because that would be analogous to the behaviour of cargo itself.
If you are really concerned about it, perhaps a parameter could be added to cargo-dist
like:
[workspace.metadata.dist]
# Targets with required-features are not packaged if their features are not enabled.
skip_disabled_targets = true
Though this seems like a hurdle to me. Because if it is false, cargo dist requires that all targets must be packaged and any required features required must be manually specified (the current behaviour).
from cargo-dist.
Related Issues (20)
- docs rendering issue in custom jobs
- update targets doc HOT 1
- if glibc too old AND no musl build, print error about glibc not absence of musl build HOT 1
- allow user to configure tag "namespace"
- audit for missing transactions
- Configure `features` per target platform HOT 1
- sed error in install script HOT 2
- Allow publishing under bin name instead of package name HOT 3
- Support generating DotSlash manifests HOT 1
- Bug Report: Could not find directory of OpenSSL installation HOT 2
- help users set a macos sdk deployment target
- Specifying channel = "stable" in rust-toolchain.toml doesn't ensure the latest stable is used on BuildJet? HOT 2
- homebrew installation command issue HOT 1
- Homebrew publish fails tests HOT 9
- extra-artifacts uses the full path as the filename
- Support aarch builds in github ci HOT 3
- Homebrew: improve license field handling
- MSI cross compilation for windows
- Support for Raspberry pi platform HOT 1
- set tls v1.2 for powershell installers as well HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cargo-dist.