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

feat(build): allow disabling git info collection #100

Merged
merged 1 commit into from
Jun 25, 2024

Conversation

tranzystorekk
Copy link
Contributor

When packaging for linux, some distros (e.g. Void Linux) do not use git to obtain package source, but download source archives directly. That makes any git repository info unavailable and currently requires either adding unnecessary libgit2 dependency or patching the code out.

This change allows using --no-default-features --features=cli,wasm to disable the git portion if needed.

Copy link
Owner

@Enter-tainer Enter-tainer left a comment

Choose a reason for hiding this comment

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

thank you!

@Enter-tainer Enter-tainer enabled auto-merge (squash) June 25, 2024 10:35
@Enter-tainer
Copy link
Owner

I will publish a new version that includes this change when I leave work.

@Enter-tainer Enter-tainer merged commit 1d5f4a1 into Enter-tainer:master Jun 25, 2024
11 checks passed
@tranzystorekk tranzystorekk deleted the git-info branch June 25, 2024 10:50
@Enter-tainer
Copy link
Owner

maybe our AUR maintainer is interested in this cc @Jisu-Woniu

@Enter-tainer
Copy link
Owner

Hi @tranzystorekk I just released v0.11.28 which includes this commit. The tag is already pushed to github and the release will be created when the ci is finished.

@Jisu-Woniu
Copy link

Thank you for this PR. I will use that feature gate in typstyle package, once the new version is released.

@Jisu-Woniu
Copy link

Hopefully that will fix the warnings like this:

build warning

@Jisu-Woniu
Copy link

Jisu-Woniu commented Jun 25, 2024

Is it possible to make git-info disabled by default? So when new default features are introduced, they will be enabled without changing build command. @Enter-tainer

@tranzystorekk
Copy link
Contributor Author

Is it possible to make git-info disabled by default? So when new default features are introduced, they will be enabled without changing build command. @Enter-tainer

That would probably be a bit of a breaking change for the CI builds

@Enter-tainer
Copy link
Owner

Is it possible to make git-info disabled by default? So when new default features are introduced, they will be enabled without changing build command. @Enter-tainer

I'm not sure. I personally prefer enable it by default. This is useful for people who use cargo install or cargo build to install typstyle

@Jisu-Woniu
Copy link

As far as I know, features are difficult to opt-out, once they are made default, so unnecessary features may be set as non-default. I would suggest a new feature like recommended for non-necessary features.

For now, I suggest keeping it "as is", and make the decision later.

@Enter-tainer
Copy link
Owner

As far as I know, features are difficult to opt-out, once they are made default

Do you mean feature flags in rust? They are designed to be pluggable and widely used by tokio, clap... I dont get why it is hard to opt out.

@Jisu-Woniu
Copy link

For example, I want to compile a crate with default features f1, f2, ..., f100, and I only want to exclude f50 since it is not supported on my machine. I would have to declare --no-default-features with -F=f1,f2,...,f49,f51,...,f100.

@Enter-tainer
Copy link
Owner

Make sense. It like we need to group features flags in some way like what you've mentioned. Maybe we can consider this once we have a sufficient large number of features.

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