Skip to content
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

fix: support package pinning via http+tar #11446

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

maiste
Copy link
Collaborator

@maiste maiste commented Feb 5, 2025

This PR reduces the gap between opam and dune package management functionnalities. It allows users to ping a tar file (gz or bz) using http (and https) protocol.

Closes #10121

maiste and others added 3 commits February 5, 2025 15:13
Signed-off-by: Etienne Marais <[email protected]>
Co-authored-by: ArthurW <[email protected]>
Signed-off-by: Etienne Marais <[email protected]>
Copy link
Collaborator

@Leonidas-from-XIV Leonidas-from-XIV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. The ZIP file changes can be added in a separate PR if you want, but I think that it would be useful to support it given it is a rather common format, especially on Windows.

bin/pkg/pkg_common.ml Outdated Show resolved Hide resolved
src/dune_pkg/mount.ml Outdated Show resolved Hide resolved
src/dune_pkg/opamUrl0.ml Show resolved Hide resolved
@@ -30,10 +30,16 @@ let is_version_control t =

let is_local t = String.equal t.transport "file"

let local_or_git_only url loc =
let is_tarball t =
let supported_compress_format = [ "tar.gz"; "tgz"; "tar.bz2"; "tbz" ] in
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably should also include "tar".

src/dune_pkg/opamUrl0.ml Outdated Show resolved Hide resolved
src/dune_pkg/source.ml Outdated Show resolved Hide resolved
test/blackbox-tests/test-cases/pkg/pin-depends.t Outdated Show resolved Hide resolved
src/dune_pkg/opamUrl0.mli Show resolved Hide resolved
test/blackbox-tests/test-cases/pkg/pin-depends.t Outdated Show resolved Hide resolved
Co-authored-by: Marek Kubica <[email protected]>
Signed-off-by: Etienne Marais <[email protected]>
- bar.1.0.0
(version 1.0.0)
(dev)
(source (fetch (url http://0.0.0.0:1/tarball.tgz) (checksum md5=ecfb12cd56789e48aaa4eef289c85c40))) (dev)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be nice to determine the MD5 of the tarball that was created and make sure that it matches the one in the lock file. Otherwise it's not reproducible.

Copy link
Collaborator Author

@maiste maiste Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have done it using grep as the tar headers can make the hash different.

Signed-off-by: Etienne Marais <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support pinning packages with an archive url
2 participants