Skip to content

lake doesn't allow transitive dependencies to use non-default branches? #3167

Closed

Description

@kim-em

I'm not sure I'm diagnosing this correctly, but in the bump-3159 branch of https://github.com/leanprover-community/repl, in the folder test/Mathlib, I can't get lake update to succeed.

The situation here is that we have lakefile with:

  require mathlib from git "https://github.com/leanprover-community/mathlib4" @ "lean-pr-testing-3159"

and the lakefile in that branch of Mathlib itself says

require std from git "https://github.com/leanprover/std4" @ "lean-pr-testing-3159"

Running lake update there persistently gives the error message:

% lake update
mathlib: cloning https://github.com/leanprover-community/mathlib4 to './.lake/packages/mathlib'
std: cloning https://github.com/leanprover/std4 to './.lake/packages/std'
error: > git checkout --detach c70b9499d9af95eea6c5d7073874b7cf2c715afe    # in directory ./.lake/packages/std
error: stderr:
fatal: reference is not a tree: c70b9499d9af95eea6c5d7073874b7cf2c715afe
error: external command `git` exited with code 128

despite c70b9499d9af95eea6c5d7073874b7cf2c715afe being the perfectly good HEAD of the lean-pr-testing-3159 branch at Std.

Activity

  1. added
    bug
    on Jan 12, 2024
  2. digama0 commented on Jan 12, 2024

    @digama0
    Collaborator

    It's not a lake bug, if you check out a fresh copy of https://github.com/leanprover/std4 you also won't be able to find lean-pr-testing-3159. I was able to check this branch out just fine in my local copy of std4, which caused me a lot of confusion, but that's because I have mhuisi's remote, presumably from an earlier PR of theirs. The problem is that lean-pr-testing-3159 is a branch of https://github.com/mhuisi/std4, so you have to use that in mathlib's lakefile.

    EDIT: Actually it's not on https://github.com/mhuisi/std4 either, and my local .git/config for the branch is consistent with this being a leanprover/std4 branch that just got deleted somehow.

  3. mhuisi commented on Jan 12, 2024

    @mhuisi
    Contributor

    Did the branch perhaps get deleted when the corresponding std4 PR got merged into the respective nightly-testing branch (leanprover-community/batteries#521)?

    To be clear, the branch was on leanprover/std4, not mhuisi/std4.

  4. kim-em commented on Jan 12, 2024

    @kim-em
    CollaboratorAuthor

    Indeed, github says @joehendrix deleted it. I've restored it.

  5. kim-em commented on Jan 12, 2024

    @kim-em
    CollaboratorAuthor

    And as lake update now succeeds in the repl repository, this was a false alarm, and I'll close it.

  6. joehendrix commented on Jan 12, 2024

    @joehendrix
    Contributor

    Sorry, I didn't know about the need to keep them around.

  7. nomeata commented on Jan 12, 2024

    @nomeata
    Collaborator

    Maybe lake’s use of git could be made more robust in this respect, by using the idiom shown here: https://stackoverflow.com/a/3489576/946226 (create empty repo, add remote, use git fetch <REV>). This would download less git data that isn't used, and is likely a bit more robust when people delete branches.

    @tydeu, did you consider this?

  8. tydeu commented on Jan 13, 2024

    @tydeu
    Member

    @nomeata No I had not. Sounds like a good idea to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions