Cross compilation: Also generate 'root'/'rootexec' sections for installation - #14600
Cross compilation: Also generate 'root'/'rootexec' sections for installation#14600WardBrian wants to merge 2 commits into
Conversation
…install files Signed-off-by: Brian Ward <bward@flatironinstitute.org>
75f8ebd to
c1c5272
Compare
|
I'm less sure about duplicating install entries, why not move entirely to the new sections? AFAIK it will be |
In, e.g., opam-cross-windows, this was not true. As a work around, @kit-ty-kate recommended using dune install instead, but this required editing most of our opam files and some ugly hacks like actually deleting the generated .install file (which I don’t entirely understand, but was willing to accept as a hotfix) It would be reasonable to remove the old generation after opam is released, but it’s also harmless to leave for compatibility IMO |
|
Are we OK with dropping support for older versions of opam here? @toots can you comment on this feature? |
To be clear, this PR does not currently drop support for older versions of |
toots
left a comment
There was a problem hiding this comment.
The approach is sound and with a wide backward compatibility. Thanks for working on this on both fronts @WardBrian
I did not know that. Thanks for letting me know. However, I still think this change is essentially breaking? If we stop generating the |
We don't stop generating them, which is the trick. Assuming ocaml/opam#6938 is accepted before opam 2.6 is released, the only version of opam which won't accept anything in these files is 2.5.1, the current release |
|
The other open question is if we'd like to support |
|
@WardBrian the idea itself looks good to me. Let me know when it's ready for review. |
Signed-off-by: Brian Ward <bward@flatironinstitute.org>
d2326f1 to
42cb704
Compare
|
@rgrinberg I believe this is now ready for review. The main reason I was waiting was for confirmation of the name of the new field from the opam developers, and @rjbou got back to me to say they do indeed prefer |
|
So has there been an opam release with these new field names? Let's wait until there's such a release if not. |
|
ocaml/opam#6938 has been merged. I've been told to expect an alpha release of 2.6 in the next few days |
|
@rgrinberg I've updated the original post with more details, but to summarize: Opam 2.6.0-alpha1 is out now, with support for the new |
Would close #14393. Relies on ocaml/opam#6938
In summary:
Opam 2.5.1+ will ignore any target in an
.installfile that starts with../, which was previously used by dune's-xto place files in the<prefix>/<target>-sysrootdirectory.To allow for this use case while preserving the security benefits of disallowing parent access, opam is considering adding
rootandrootexecto the .install file syntax, which I have implemented in ocaml/opam#6938This PR updates dune to generate the new
rootandrootexecsections in addition to the../..used before. Why both? Because of the way that opam ignores things, this means that the same generated .install files would be compatibile with any opam besides 2.5.1Update (2026-07-24):
Opam 2.5.2 was released that re-allowed
..in.installfiles (ocaml/opam#7009) for now.Opam 2.6.x also allows these (github.com/ocaml/opam/pull/7008), as well as the new sections (ocaml/opam#6938) utilized by this PR
Opam 2.7.0 will disallow
..againThe approach here of generating both is still recommended, the above just buys some time...