-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
The documented .git_archival.txt
causes git archives to change hash after first post-release commit is made
#806
Comments
Thanks for the heads up Is there a suggested way to get that data |
I don't really know. I didn't even know such a thing is possible before setuptools_scm implemented it ;-). |
Based on the git docs it's impossible to opt out of the problem details Is there any reason why you don't use the release artifacts from pypi? |
In a lot of cases it's because they're missing something, e.g. tests (Edit: otherwise Gentoo does prefer pypi tarballs). Ideally everyone would include them but it's not always so easy. |
That's unfortunate, in particular since setuptools_scm typically enforces that all files go in |
Yes, it is. It's been last debated in https://discuss.python.org/t/should-sdists-include-docs-and-tests/14578, with no definite conclusion. Unfortunately, some people believe that "sdist is only for pip" and so including files that pip (or a PEP517 build system, more generally) doesn't use is a waste of space. |
@mgorny I've been pointing people at my action https://github.com/re-actors/checkout-python-sdist to try to bring better standard into the ecosystem FYI. Projects that would use this, would probably be more downstream-friendly, as a result. |
Isn't the need for Maybe the template recommendation can simply phase out the old and unreliable ref-names formatter? |
I have the impression that
Thus I fear that in practice removing |
When locally building from a git repository the primary data source should be git itself, not the .git_archival.txt file... I wonder why this is triggering a warning. |
Yes, that's a very good question, and I'd like to look into that. But in any case, I'm still concerned about the prevalence of Git versions which don't support |
In theory it should only matter in cases where you are not building from a git checkout, and you're not building from a PyPI sdist, and you are only building from the output of running The main situation where that happens is on servers such as github.com, gitlab.com, git.sr.ht, codeberg.org, etc. and those tend to roll out new git updates much more often than new Ubuntu LTSes. It is a good question, how often that will cause issues for local workflows. But I'm hoping the answer might be "not very". |
I also find it hard to imagine a use case for using a |
It's definitely time to go down the road of slimmer data there Just recently I experimented with using the apis better The new way is definitely the way to go It still may be helpful to have ref names if limit to Tags is possible for broken forges But those need to come forward |
It's suffering from the setuptools-scm `.git_archival.txt` problem. Bug: pypa/setuptools-scm#806 Closes: https://bugs.gentoo.org/927140 Signed-off-by: Michał Górny <[email protected]>
We have been seeing this issue in quite a few upstreams when packaging for Arch Linux by now and it significantly increases contributor time spent on figuring out what is going on and communicate with upstreams each time the reproducibility of a package is broken. I suggest to either entirely remove the problematic
|
It should be documented which git hosts support The downsides of |
Context: pypa/setuptools-scm#806 Signed-off-by: burgholzer <[email protected]>
Some time ago, it was discovered that Git archives having `ref-names: $Format:%D$` in `.git_archival.txt` may change when references existing in the repository change over time [[1]]. This means that downloading an archive for a commit from an immutable URL may start yielding slightly different results. This hurts the ability of downstreams to source projects from Git archive URLs. With that in mind, modern `setuptools-scm` advises against having this entry in the `.git_archival.txt` template [[2]]. And this patch implements said recommendation. [1]: pypa/setuptools-scm#806 [2]: https://setuptools-scm.readthedocs.io/en/latest/usage/#git-archives
Some time ago, it was discovered that Git archives having `ref-names: $Format:%D$` in `.git_archival.txt` may change when references existing in the repository change over time [[1]]. This means that downloading an archive for a commit from an immutable URL may start yielding slightly different results. This hurts the ability of downstreams to source projects from Git archive URLs. With that in mind, modern `setuptools-scm` advises against having this entry in the `.git_archival.txt` template [[2]]. And this patch implements said recommendation. [1]: pypa/setuptools-scm#806 [2]: https://setuptools-scm.readthedocs.io/en/latest/usage/#git-archives
Some time ago, it was discovered that Git archives having `ref-names: $Format:%D$` in `.git_archival.txt` may change when references existing in the repository change over time [[1]]. This means that downloading an archive for a commit from an immutable URL may start yielding slightly different results. This hurts the ability of downstreams to source projects from Git archive URLs. With that in mind, modern `setuptools-scm` advises against having this entry in the `.git_archival.txt` template [[2]]. And this patch implements said recommendation. [1]: pypa/setuptools-scm#806 [2]: https://setuptools-scm.readthedocs.io/en/latest/usage/#git-archives
The documentation suggests using the following content for the
.git_archival.txt
file:This means that if a tag is created on top of the main branch, the file initially contains e.g.:
but once another commit is added and
main
no longer corresponds to the tag, it changes to:This causes the git archive hash to change. This is a problem for distributions like Gentoo that are using git archives generated by GitHub. The initial archive that we fetch once the release is made changes once upstream makes new commits.
See e.g.: https://bugs.gentoo.org/895910, https://bugs.gentoo.org/895712
The text was updated successfully, but these errors were encountered: