-
-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
cog: update checksum #162013
cog: update checksum #162013
Conversation
It seems v0.9.4 it was re-tagged again, similar to * Homebrew#158001 This affects * Homebrew#161976 * Homebrew#157782
@stefanb can you also file an upstream issue on this? Thanks! |
Created upstream ticket |
I'm not sure about this one. I'll defer to @mattt and @technillogue 🙏🏼 |
@stefanb @chenrui333 Hey, sorry that Cog seems to be causing problems for y'all. As far as I can tell, this wasn't an intentional change like #158001. I just looked into this and can't account for why we're seeing a checksum mismatch.
Any ideas about what might be happening? |
Looked at the action run against the release commit (v0.9.4), I did not find anything weird either. So weird. I would suggest let's move forward and it is happening again, we can involve with github team to find out why. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not okay with "let's ignore the potentially catastrophic security problem"
I was also checking the workflow to see if it is committing a version number and retagging or some such tricks, but couldn't spot anything obvious. |
@SMillerDev I dont see anything obviously wrong, and nor the maintainers can find anything. What is your suggestion then? |
This is the exact scenario this check is meant to catch, and possibly one of the most concerning one's we've seen in some time since upstream doesn't seem to know why this changed. This PR should not be merged until it's determined what happened here by the upstream maintainers. I'm also strongly against merging any version bumps for this software until this is resolved. Homebrew will not willingly accept a change that upstream can't account for due to he incredibly real threat of a supply chain attack. My hope is that the upstream maintainers are incredibly concerned by this and going to investigate until a cause is found. |
Triaging: We're coming up on a year past https://github.blog/2023-02-21-update-on-the-future-stability-of-source-code-archives-and-hashes/, although not quite (GH made a commitment not to change these hashes until 2024-02-21). So it's possible this is an accident on their side. However, I strongly agree with @p-linnane that we need to treat this as malicious until we confirm that 🙂 |
So this means that in such cases homebrew should fallback to git commit hash and if that matches it should update the archive hash in the formula? |
Most of all we need to find out why it changed. Once that is known we can determine how to move forward. |
This isn't a GitHub change. One can reproduce how a git tarball works via: $ brew install gzip
$ git checkout main
$ git -c tar.tgz.command="$(brew --prefix gzip)/bin/gzip -cn" archive v0.9.4 --prefix=cog-0.9.4/ -o test.tgz
$ shasum -a 256 test.tgz
5f455da636ec6dd6c81fd46fb721e261da1912ec42e2c547496c9cc8bae78773 test.tgz If you reset $ git checkout main
$ git reset --hard v0.9.4
$ git -c tar.tgz.command="$(brew --prefix gzip)/bin/gzip -cn" archive v0.9.4 --prefix=cog-0.9.4/ -o test.tgz
$ shasum -a 256 test.tgz
d3df9a9b9af79f6309f3acf31d6a3363270c0a5a7838ee75d4a02a8ed92fb0ae test.tgz Why? This is because: --- a/python/.git_archival.txt
+++ b/python/.git_archival.txt
@@ -1,4 +1,4 @@
node: d25544500937e9428ffaa0e9e4b37f763b7f7694
node-date: 2024-01-24T13:58:15-08:00
describe-name: v0.9.4
-ref-names: tag: v0.9.4
+ref-names: HEAD -> main, tag: v0.9.4 The
|
Thanks for digging into that @Bo98. I've opened a PR to try to resolve this: replicate/cog#1522 |
Will merging replicate/cog#1522 only affect the hashes of the future cog release archives or also the existing ones (eg current 0.9.4)? |
Thank you, @Bo98, for the throughput check. |
I think I'm missing some context here. You say it's not a GitHub change, but what process created the diff for this pull request? Given that we don't upload our own source tarballs, it seems like there are two possibilities:
I'm guessing it's (1). If so, doesn't that mean that it is a GitHub change? Because they switched from generating the archive on For reference: Generating on
|
Looking into this I'm ever more convinced that this is a change in how GitHub generates the tarballs. According to the history of
Neither of those hashes are correct any more:
So while the solution here for us is to change our |
Aha! Maybe I'm wrong. What appears to matter here is whether So it's possible this has always been broken, and when the latest commit on main is the tag commit, it generates one output (the If that's the case, then this problem will have existed for every cog release for quite some time. Either way, replicate/cog#1522 will fix this for future releases. |
This is correct, yes. It's not a GitHub change as it has always worked this way. Because |
Right, thank you for confirming. We'll make sure that replicate/cog#1522 merges before we cut any new releases. For now I'd say this PR is unblocked and the correct thing to do. |
Upstream fix is now merged. Hopefully between this and us enabling tag protection this shouldn't ever happen again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you all for sorting this out, and being understanding with our need to be extremely cautious in these situations given the footprint of Homebrew.
It seems v0.9.4 it was re-tagged again after #160886, similar to
This affects
cc: @mattt, @zeke: can you confirm that retagging was done on 0.9.4 ?
HOMEBREW_NO_INSTALL_FROM_API=1 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 doingHOMEBREW_NO_INSTALL_FROM_API=1 brew install --build-from-source <formula>
)? If this is a new formula, does it passbrew audit --new <formula>
?