GithubHelp home page GithubHelp logo

Comments (7)

carlocab avatar carlocab commented on July 30, 2024 1

One workaround is to do

cargo install --no-default-features --features=gix-features/zlib-stock

but it's not clear at all how much this disables relative to the default configuration. Ideally it should be simple to choose features so that they are identical to the default max configuration except for the zlib-ng backend.

Another workaround is to replace zlib-ng in this line

max-performance = [ "max-performance-safe", "gix-features/zlib-ng", "fast-sha1" ]

with zlib-stock, which results in the desired behaviour from

cargo install --features=gix-features/zlib-stock

However, it would be nice to not have to hack up a Cargo.toml here.

For reference, this is related to Homebrew/homebrew-core#129719, where we're trying to package gitoxide for Homebrew.

from gitoxide.

Byron avatar Byron commented on July 30, 2024 1

My only other request is for you to avoid changing these flags in future releases.

I will do my best to keep them those working and won't change them lightheartedly. Fortunately it seems like these flags are stabilizing, especially after the recent push, as they seem to now fit their purpose pretty well.

Besides that, it's exciting to see gitoxide on homebrew, thanks for all your work :).

from gitoxide.

Byron avatar Byron commented on July 30, 2024

Thank you so much for reporting this and most importantly, provide a workaround. What's astonishing here is that I was not aware that it's possible to specify any features that are defined in dependencies of the crate. This makes cargo features so much more powerful!

With that said, the way features are currently organized it's hard to reproduce exactly what the default is, minus zlib-ng, + zlib-stock, but being able to specify it from the command-line might be a game-changer for future iterations of how features are exposed by the crate.

As for the actual issue described here, there is nothing that can be done as cargo features are additive, and the default choice happens to optimize for performance. However, I think it could make a safer choice, as to not choose anything people usually want to override. Thus a better choice might be something like max-pure and then build on top of that. Thinking about it, I don't see a way yet to make it usable by everyone, it's really just about trying to find a local minimum that serves most.

Maybe for now, you can maintain a patch file to make the changes directly where you need them? cargo build --features=gix-features/zlib-stock isn't recommended for the reasons you mention, it's unclear what you get and I don't see a way to fix that.

I will think about better ways to organize features, but can't know for sure I will manage to make significant improvements.

from gitoxide.

Byron avatar Byron commented on July 30, 2024

In the linked PR (and soon in main) you find the improvements needed more more easily build something like max but with difference choices for zlib or hashing. Please let me know if this works for you. Please find attached the rendered docs, those will be up on docs.rs when there is a new gitoxide release.

gitoxide - Rust.pdf - jump right to the Package Maintainers section.

Thank you

from gitoxide.

carlocab avatar carlocab commented on July 30, 2024

This works great, thanks!

❯ cargo tree --no-default-features --features=max-control,gix-features/zlib-stock,gitoxide-core-blocking-client,http-client-curl | rg libz
│   │   │   │   │   │   ├── libz-sys v1.1.8
│   │   │   │   │   │   └── libz-sys v1.1.8 (*)

Will this be in your next release?

from gitoxide.

Byron avatar Byron commented on July 30, 2024

Yes, it will be, and I think it's worth waiting as it will contain gix status or something like it.

from gitoxide.

carlocab avatar carlocab commented on July 30, 2024

What's astonishing here is that I was not aware that it's possible to specify any features that are defined in dependencies of the crate.

Yes, the --features flag of cargo is woefully underdocumented. The gix-features/zlib-stock syntax is mentioned here, but I don't think it really gives you a clear idea of how it works.

Yes, it will be, and I think it's worth waiting as it will contain gix status or something like it.

Great, thanks!

My only other request is for you to avoid changing these flags in future releases. We only have a small team of maintainers at Homebrew for ~6000 packages, so we rarely have the time to check updates carefully for changes to the build configuration. We often only notice that configurations need to change when packages fail loudly while building.

from gitoxide.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.