-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
shallow_since appears to be broken #10292
Comments
We got the same issue on macOS, but it seems to be a problem with git (tried with |
Yeah, seems like it. Though I'd say Bazel is still responsible for avoiding recommending |
@aehlig Do you know what causes it? |
I did some digging here, and reported an upstream bug to The upshot is that The bug I reported results in For now, the workaround for bazel users -- where available -- is to switch your For Bazel itself, it might be nice to recognize this situation and adjust the |
It turns out that the workaround proposed here doesn't work either. The shallow_since bug is even worse than I expected. It stops at the first commit which has any parents before the cutoff time. This means we have the following horrible scenario:
This is completely unusable and I don't see a workaround. |
Yeah, I agree with @asuffield's analysis -- I ran into that situation since posting #10292 (comment). In light of this and of #12857 it really seems like the right path forward is to stop suggesting |
I'm piecing together an alternative solution - for cases where a tag or commit hash is given, we can use point fetch with --depth=1 as long as we verify the results and correctly fallback to deep fetch if we don't get what we needed. It doesn't work on all git versions, but I don't believe there is a solution other than deep fetch for older git. |
If you auto-detect GitHub URLs you can instead just suggest HTTPS cloning. It's probably a good suggestion in any case; we switched to that as it's faster too. |
This is an interesting idea which would likely be best implemented in git itself - the protocol's rich enough to pull it off. |
|
I would like to get some progress on this issue. Would it be fine if I create a PR to remove the debug log saying:
The issue with this log is that one a user see it the first thing will do is to set up the shallow_since, but because of this bug it is something that should consider twice. |
Git's `--shallow-since` feature can lead to broken checkouts and a fix isn't likely to happen: https://public-inbox.org/git/CAPSG9dZV2EPpVKkOMcjv5z+NF7rUu=V-ZkZNx47rCv122HsiKg@mail.gmail.com/T/#u This commit removes `shallow_since` from the canonical reproducible form of `git_repository` unless the attribute is provided explicitly. In cases where Bazel's attempt at fetching with `--depth=1` fail, e.g. if there is no server support for shallow fetches of arbitrary commits, the progress message is now used to inform the user about this potential for fetch time optimizations. Fixes bazelbuild#10292 Fixes bazelbuild#12857
Git's `--shallow-since` feature can lead to broken checkouts and a fix isn't likely to happen: https://public-inbox.org/git/CAPSG9dZV2EPpVKkOMcjv5z+NF7rUu=V-ZkZNx47rCv122HsiKg@mail.gmail.com/T/#u This commit removes `shallow_since` from the canonical reproducible form of `git_repository` unless the attribute is provided explicitly. In cases where Bazel's attempt at fetching with `--depth=1` fail, e.g. if there is no server support for shallow fetches of arbitrary commits, the progress message is now used to inform the user about this potential for fetch time optimizations. Fixes bazelbuild#10292 Fixes bazelbuild#12857
Git's `--shallow-since` feature can lead to broken checkouts and a fix isn't likely to happen: https://public-inbox.org/git/CAPSG9dZV2EPpVKkOMcjv5z+NF7rUu=V-ZkZNx47rCv122HsiKg@mail.gmail.com/T/#u This commit removes `shallow_since` from the canonical reproducible form of `git_repository` unless the attribute is provided explicitly. In cases where Bazel's attempt at fetching with `--depth=1` fail, e.g. if there is no server support for shallow fetches of arbitrary commits, the progress message is now used to inform the user about this potential for fetch time optimizations. Fixes bazelbuild#10292 Fixes bazelbuild#12857
Git's `--shallow-since` feature can lead to broken checkouts and a fix isn't likely to happen: https://public-inbox.org/git/CAPSG9dZV2EPpVKkOMcjv5z+NF7rUu=V-ZkZNx47rCv122HsiKg@mail.gmail.com/T/#u This commit removes `shallow_since` from the canonical reproducible form of `git_repository` unless the attribute is provided explicitly. In cases where Bazel's attempt at fetching with `--depth=1` fail, e.g. if there is no server support for shallow fetches of arbitrary commits, the progress message is now used to inform the user about this potential for fetch time optimizations. Fixes #10292 Fixes #12857 Closes #17356. PiperOrigin-RevId: 508569071 Change-Id: I01e6662e38c236d1800d427f66d48a05df818800
Git's `--shallow-since` feature can lead to broken checkouts and a fix isn't likely to happen: https://public-inbox.org/git/CAPSG9dZV2EPpVKkOMcjv5z+NF7rUu=V-ZkZNx47rCv122HsiKg@mail.gmail.com/T/#u This commit removes `shallow_since` from the canonical reproducible form of `git_repository` unless the attribute is provided explicitly. In cases where Bazel's attempt at fetching with `--depth=1` fail, e.g. if there is no server support for shallow fetches of arbitrary commits, the progress message is now used to inform the user about this potential for fetch time optimizations. Fixes #10292 Fixes #12857 Closes #17356. PiperOrigin-RevId: 508569071 Change-Id: I01e6662e38c236d1800d427f66d48a05df818800 Co-authored-by: Fabian Meumertzheim <[email protected]>
Description of the problem / feature request:
shallow_since
appears to be broken.Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
Try to build
//:BUILD.boost
from nelhage/rules_boost@df90835. You'll receive a recommendation forshallow_since
. Insert that recommendation, and suddenly Bazel fails to find that commit at all.What operating system are you running Bazel on?
Windows
What's the output of
bazel info release
?release 1.1.0
What's the output of
git remote get-url origin ; git rev-parse master ; git rev-parse HEAD
?N/A
Have you found anything relevant by searching the web?
No
Any other information, logs, or outputs that you want to share?
Create an empty
BUILD.bazel
alongside the followingWORKSPACE
:Now run
bazel --ignore_all_rc_files query "deps(@rules_boost//:BUILD.boost)"
:It outputs something like the following (after formatting/redactions):
Now add
shallow_since="1569511515 +0200"
as recommended and re-run the query:Suddenly Bazel seems to be unable to find the commit altogether.
The text was updated successfully, but these errors were encountered: