-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Zola: Add --locked flag to cargo install command, update sha256 checksum #45839
Conversation
Would you be willing to check all other homebrew formulae for this oversight? |
I looked through the other formulae and, of the ones that use I checked the source for each of the relevant formulae and compiled a table, listing if a
* With geckodriver.rb, the ** With rust.rb, Rust and Racer each have a For the ones with a If you need me to go through these formulae and add the
Depending on the answer, I can close this PR if it's preferred to do these changes all in one PR. Past that, we could create issues on the repos without a Lastly, I can also open an issue in the Homebrew/brew repo, asking if |
@Homebrew/maintainers please have a look here. @samfordThanks for the detailed information. I have very little knowledge about rust but I hope one of the other maintainers does. |
If there is a
Yes, binaries should always have the |
I created If any of the other projects add a Cargo.lock file, I'll update the table in the previous comment. Edit: The creator of shellharden added a I took another pass through these formulae and created a list of projects that have both
Of this list, only the dssim and svgcleaner projects lack a
|
I don't think so. Great work so far! |
Thanks @samford, great work here. Do you think this would be worth a |
I think this will solve itself, because we need the full |
I'll leave this question up to you and the other Homebrew members, since I don't have enough domain knowledge of Homebrew yet to determine when it is or isn't appropriate to add an audit for something. I ran a test and, at least on my system (macOS 10.15), As such, it may be fine to always include the Modifying the boilerplate It would be good for folks to check my work here (running their own tests, identifying any other files that would need to be modified, etc.) and to weigh in on how best to proceed. If a consensus is reached on how to handle this and you need me to take care of any of the changes, just let me know. |
Definitely sounds like an audit would be desirable then 👍 |
@samford Are you sure that's the case?:
At least to documentation states:
However it will also look in parent directories for it. |
I noticed that in the Cargo Book and fully expected Cargo to produce an error and exit when the I've tried this in and outside of Homebrew using projects with and without a Regardless, it would be safer to simply take the Cargo documentation at its word. With that in mind, it could be better to not have If an audit for the The part that may be tricky is accurately determining if a As mentioned, I'm rather naive about Homebrew's inner workings, so take all this with a grain of salt. I'm glad for the discussion around this, as I don't wish to be the arbiter of how this should work or be implemented and I'm merely putting forth observations and ideas to fuel the conversation. |
No, unfortunately not. They can only evaluate the text of the formula or the post-install files but not the pre-install files/source. I think we'd rather have a |
Great discussions about audits and formula_creator! I don't want to distract/detract from that, but in the interest of getting this formula update merged, could the other open Zola PR with sha256 update be combined with this change? (And check if there's a new release of zola, we can bump the version at the same time if there is.) |
There is no newer Zola release. Upstream talks about the checksum here, which was also mentioned in the first comment of this PR. Simply updating the checksum here should be fine I think. |
I'll wait to continue the general discussion about the
Zola releases are a bit sporadic and I don't imagine there will be a new one for a little while, which is why I moved forward with these PRs (to fix the formula in the interim time). I'm working on a feature that could be notable enough to warrant releasing a new version but it will be at least a week before it could technically be published and merged (i.e., I'm waiting for the release of Rust 1.39.0 and certain crates finalizing their currently-alpha releases). Usually a release isn't published immediately after a notable change lands and instead happens whenever Zola's author decides it's time (I don't know the particular reasoning behind when a release is deemed ready). The sha256 update commit is now in this PR's branch and I've closed the other pull request. Edit: Only the audit tests are failing now, which is to be expected due to the sha256 change here. Does the Zola formula need a revision bump or are these changes fine without one? If it's relevant to that question, I feel like the bottles for formulae that don't have the Besides Zola, there's also another formula with an open issue (pijul) that is stuck on a certain version (since their website hasn't added tar.gz files for newer versions) and needs the Past that, should this discussion be continued in an issue (so that it's still visible after this PR is merged) or should we simply continue on in this PR? |
The `--locked` flag is necessary to ensure that `cargo install` uses the dependency versions in the `Cargo.lock` file.
e2fadd0
to
35531e2
Compare
Yes, it does since upstream changed the release assets on us. Not sure what changed within those assets, but a revision bump will ensure that users get the version of Zola that upstream intended to release. |
35531e2
to
6510b24
Compare
I reworked the commit updating the sha256 to also bump the revision. Does this PR need anything else? |
PR looks good to me! Audits may still fail, we'll see if the rev bump prevents it or not. Since we've confirmed with upstream already that they pulled the src and then republished it, we can safely ignore the audit if it complains about the changed SHA256 checksum. |
lol. Client side UI hiccup. Didn't mean to spam approve the PR. |
The sha256-related audits still fail with the revision bump but everything else seems fine. I've created a new issue (#46025) to continue the discussion around the Thanks to everyone for all their help here. |
Thanks for your contribution to Homebrew! 🎉 🥇 Without awesome contributors like you, it would be impossible to maintain Homebrew to the high level of quality users have come to expect. Thank you @samford!!! |
brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew test <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingbrew install <formula>
)?Building Zola from source currently fails since
cargo install
doesn't use the dependency versions specified in theCargo.lock
file by default. A dependency released a breaking change between the time Zola 0.9.0 was released and now, so the build now fails with errors. This commit adds the--locked
flag tocargo install
to ensure that theCargo.lock
file is used when building from source.At least to me, it makes sense to use the
--locked
flag anyway, as it ensures that the build is predictable/reproducible and won't vary over time due to dependency updates. It looks like other formulas usingcargo install
don't use the--locked
flag either, so this may be something to consider on a larger scale.Past that, it's expected for the builds to fail here, since the sha256 checksum changed between release and the current tar.gz for Zola 0.9.0, as mentioned in #45819.