Skip to content
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 passing of enabled features to cargo build #77

Merged
merged 15 commits into from
Aug 8, 2023

Conversation

morosanmihail
Copy link
Contributor

This allows cargo_build to take a list of strings (features) to pass onto the build task and enable them during compilation.

Despite some examples online recommending to wrap all comma-separated features in a pair of quotes ("abc, bcd"), the official documentation does not mention this as a requirement. To be revisited if problematic.

@@ -322,6 +323,11 @@ def cargo_build(
additional_args.append(crate)
if mode == "release":
additional_args.append("--release")
if features:
Copy link
Contributor

Choose a reason for hiding this comment

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

out of interest, why are you seeking to enable these features in Kraken, rather than making them be default features in the root project. Basically, what's the use case for this functionality?

Copy link
Contributor

Choose a reason for hiding this comment

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

@morosanmihail, I am keen to understand the use case as well :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Capturing for posterity: this would be useful to enable platform-specific features (a workaround exists, but it's not great), as well as to have multiple cargo build tasks to produce variants of a binary, with different features combinations.

@ntrinquier ntrinquier merged commit 2a5b241 into kraken-build:develop Aug 8, 2023
12 of 13 checks passed
@morosanmihail morosanmihail deleted the cargo_features branch August 8, 2023 11:55
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.

None yet

3 participants