Skip to content

Pinning a git repo should record the hash of the repository in the lock #13110

@Leonidas-from-XIV

Description

@Leonidas-from-XIV

Desired Behavior

When we pin a git repo:

(lang dune 3.21)
(pin
  (url "git+file://$PWD/_repo")
  (package (name foo)))
(package
  (name main)
  (depends foo))

then at the moment locking will lock the repo URL. But it will not record the revision:

(version dev)
 
(build (all_platforms ((dune))))

(source
  (fetch
    (url git+file:///$PWD/_repo)))

(dev)

This means that lock files containing a git repo will

  1. Not be reproducible
  2. Require pulling the pinned git repo every time

What we want is to is that the revision is fixed at lock-time thus build will always use the same locked revision.

Example

This is how the pin of a git-repo should be recorded in a lock file:

(version dev)
 
(build (all_platforms ((dune))))

(source
  (fetch
    (url git+file:///$PWD/_repo#0123456789abcdef)))

(dev)

Metadata

Metadata

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions