opam icon indicating copy to clipboard operation
opam copied to clipboard

TODO: Have a look at the patches from Debian

Open kit-ty-kate opened this issue 3 years ago • 10 comments

https://salsa.debian.org/ocaml-team/opam/-/tree/master/debian/patches

kit-ty-kate avatar Feb 15 '22 13:02 kit-ty-kate

https://salsa.debian.org/ocaml-team/opam/-/blob/master/debian/patches/0004-Use-HOME-env-variable-instead-of.patch should really not change anything since the functions called (e.g. OpamFilename.of_string) detect the ~ and rewrite it using HOME in the exact same way the patch does :thinking:

I am guessing the "fix" might come from a lintian check that frowns upons strings like ~/.cache in code.

AltGr avatar Feb 15 '22 15:02 AltGr

cc @glondu

kit-ty-kate avatar Feb 15 '22 15:02 kit-ty-kate

@mehdid did the patch... I don't have more explanation than what's written in the patch :-/ I will try to remove it in the next upload to see what happens.

glondu avatar Feb 16 '22 08:02 glondu

IIRC, it had to do with reproducible builds. Using ~ doesn't ensure the path is the same after each build. So I set HOME in https://salsa.debian.org/ocaml-team/opam/-/blob/master/debian/rules and use it in the code to ensure it remains always the same.

mehdid avatar Feb 17 '22 10:02 mehdid

@mehdid but as @AltGr explained this is already exactly what OpamFilename.Dir.of_string does. What is then the difference?

kit-ty-kate avatar May 16 '24 11:05 kit-ty-kate

I had a look at the patches again and noticed a new patch ported over from Fedora (https://src.fedoraproject.org/rpms/opam/c/b2a3f3e63c552c7fd7060da41c556f77a907d394?branch=rawhide) @jamesjer what is the reason for this patch?

kit-ty-kate avatar May 16 '24 11:05 kit-ty-kate

btw, small question for the Debian maintainers: is there a reason why opam on Debian Stable is stuck at 2.1.2 ? I'm currently releasing 2.1.6 but 2.1.2 is more than 2 years old

kit-ty-kate avatar May 16 '24 13:05 kit-ty-kate

When we introduced dune 3.11 into Fedora, opam started failing to build like this:

Running[1]: (cd _build/default/src/client && /usr/bin/sh -c 'git describe --exact HEAD || echo [dev]') > _build/default/src/client/git-describe 2> /dev/null
Running[2]: (cd _build/default/src/client && /usr/bin/sh -c 'git rev-parse --quiet --verify HEAD || echo .') > _build/default/src/client/git-sha 2> /dev/null
sed -f process.sed opam.install > processed-opam.install
sed: can't read opam.install: No such file or directory

The patch avoids the build failure. I don't know why this didn't happen with dune 3.10 and earlier.

jamesjer avatar May 16 '24 20:05 jamesjer

I don't believe the patch does the right thing but in any case this failure with dune 3.11 was fixed in 2.1.6 so you should be able to remove this patch

kit-ty-kate avatar May 17 '24 10:05 kit-ty-kate

Thank you. I will do so.

jamesjer avatar May 17 '24 17:05 jamesjer

The Debian patches were all removed in https://salsa.debian.org/ocaml-team/opam/-/merge_requests/14 last year, so closing.

kit-ty-kate avatar Aug 26 '25 12:08 kit-ty-kate