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
WIP enhancements #1
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I worked a bit more on this branch, and am in respect of functionality pretty fine, I updated the comment above to reflect reality). |
…er; preserve HOME and PATH for rebuilder
I'm closing this PR. Our fork has a different goal than the initial utility (and both are useful indeed). Maybe one day we should discuss how to move forward (and/or rename our fork and cut a release). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Hi Raja,
I worked a bit on
orb
in a slightly different direction: instead of building multiple times in parallel the same package (in different build paths), the build-path is fixed now, and a package is built twice in sequence. Sorry for the mess. Some things I added to orb: specify repositories via command-line, allow compiler git pins as base.There are two subcommands:
orb
andrebuild
.orb package
is used to initially build a package, and creating a/tmp/bi-<name>-yyy-zzz/
directory populated with data to rebuild the exact same binary (usingorb rebuild
, ororb orb --twice (--diffoscope)
):package.opam-switch
-- a full opam export of the installed switch (requires Include extra-files in switch export iffull
is provided, on import create an overlay directory with the file contents ocaml/opam#4040 to embed files)package.build-environment.0
-- the set environment variables (atm SWITCH_PATH and SOURCE_DATE_EPOCH, as well as OS, OS_VERSION, OS_DISTRIBUTION, OS_FAMILY from opam)package.build-hashes.0
-- containing the hashes of the package (from dirtracking)I encountered DirTrack: check both size and mtime for cached entries ocaml/opam#4038 on the way, which is an actual bug.This information (still slightly incomplete, thinking about host system packages and local pins to git branches / file system -- which imho should be improved in opam export) is sufficient to rebuild an opam package, which will hopefully lead to the same hash:
The subcommand
rebuild
, takes/tmp/bi-package-yyy-zzz
as argument, readspackage.opam-switch
and finds a suitablebuild-environment
(comparing the OS* variables above), and installs the package and outputs anotherpackage.build-environment.N
andpackage.build-hashes.N
. The hashes from the former installation are then compared to the new hashes. If the old build dir is still around anddiffoscope
is installed, it is used to compare all files that are different.With the patches (using the
orb
branch ofopam
in https://github.com/hannesm/opam) below, I did some practical experiments on MirageOS unikernels -- which once configured are an opam package that installs a single ELF binary. A lot of them (using ~150 opam packages) are already reproducible! :)This PR is work in progress, I hope to extend it a bit further before it is really ready to be used. Many thasnk for orb, without it I would not have come so far.TODO (esp. the depext I have no good idea about and welcome any feedback)
opam-depext
allows this)recursive
mode that compares all librariesopam export
to contain unique resources (i.e. no git branches - substitute with commit id / error if any package requires local filesystem references)