-
Notifications
You must be signed in to change notification settings - Fork 462
Write commit hashes into the lock dir when locking git repositories #13297
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
Write commit hashes into the lock dir when locking git repositories #13297
Conversation
d669f81 to
64a79d3
Compare
Alizter
left a comment
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.
Can you add test cases for branches and tags?
64a79d3 to
c3fbe74
Compare
b0992b8 to
b8da39b
Compare
|
Currently blocked by #13333 to figure out what to do with the failing tests. |
67ff831 to
22f9289
Compare
|
I've added tests for tags & branches and a solution for the issue that's described in #13333. This should solve the problem with failing tests. |
…13396) In `rev_store.ml` we currently try to create the rev-store folder and if it exists then we assume that it is a bare repo. This is not necessarily the case and if the folder is e.g. empty (because a previous `init --bare` failed) the rev-store is permanently bricked with no way to recover (bar the user removing it but it is unclear from the error what the user can do, as `git` points at somewhere else). Noticed this behavior when pairing on a strange test failure on #13297 with @Alizter and paired with @Sudha247 to create a repro case. This PR is a variant of #13392 which reproduces the same behavior using a different approach which does not require the changes from #13297. Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
22f9289 to
0eaf154
Compare
Signed-off-by: Marek Kubica <marek@tarides.com>
Signed-off-by: Marek Kubica <marek@tarides.com>
| @@ -0,0 +1,55 @@ | |||
| #!/bin/bash | |||
|
|
|||
| # dummy implementation of just enough git to be able to create a lock file | |||
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.
A bit surprised that you need this. Isn't it possible to use a remote that is on the local file system? Or does that not test everything?
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.
The opam-source-conversions.t test tries multiple types of remotes:
git+filewhich can be tested by redirecting it to an existing local repo (see the second commit in this PR)git+httpwhich would need to be redirected to a local HTTP server. Possible but given how many issues the one-shot HTTP server had, I'd rather not launch and interact with an HTTP server in Cram tests.git+foobarcan't really be tested locally.
I've created #13333 to discuss this issue and it seemed to me that fitting in a fake git in the git+http and git+foobar cases would be the best course of action.
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.
Okay, so the tests are using the real git binary for git+file then?
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.
Yes, it is only used in the git+http and git+foobar cases where our fake git binary in _bin/git is injected via
$ PATH=_bin:$PATH solve testpkg
The git+file case uses the real git binary provided by the system. I've specifically tested that it resolves correctly because I remember that there is some weirdness when setting environment variables in front of function calls on sh. But given we run with bash this issue is not happening.
Signed-off-by: Marek Kubica <marek@tarides.com>
src/dune_pkg/opam_solver.ml
Outdated
| resolve_package name (OpamPackage.version opam_package) | ||
| in | ||
| let+ resolved_pkgs = | ||
| resolve_opam_packages opam_packages_to_lock ~resolve_package |
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.
How about passing the table instead of the function? I prefer first order code when possible.
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 agree, however the resolve_package function is used further down, where in computes ocaml, so I can't completely eliminate it without major rewriting.
Signed-off-by: Marek Kubica <marek@tarides.com>
This PR applies #13176 and adds the remaining code to implement the behavior discussed in #13110. The tests change accordingly with the changed semantics of
gitURLs.Closes #13110