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

opam: 1.2.2 -> 2.0.0 #45806

Merged
merged 1 commit into from Sep 6, 2018
Merged

opam: 1.2.2 -> 2.0.0 #45806

merged 1 commit into from Sep 6, 2018

Conversation

xplat
Copy link
Contributor

@xplat xplat commented Aug 30, 2018

Motivation for this change

OPAM 2.0.0 is the new released version and some ocaml projects are already recommending or requiring it.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Fits CONTRIBUTING.md.

@xplat
Copy link
Contributor Author

xplat commented Aug 30, 2018

FWIW, this is just a merge of changes in upstream OPAM 1.2.2 with an OPAM 2.0 derivation we've been testing and improving at Obsidian Systems for weeks.

@vbgl
Copy link
Contributor

vbgl commented Aug 31, 2018

@GrahamcOfBorg build opam

@GrahamcOfBorg
Copy link

No attempt on x86_64-darwin (full log)

The following builds were skipped because they don't evaluate on x86_64-darwin: opam

Partial log (click to expand)


a) For `nixos-rebuild` you can set
  { nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.

b) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
  { allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.


@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: opam

Partial log (click to expand)

stripping (with command strip and flags -S) in /nix/store/nssw0a4qbr491p3lf98dz1zgfvv9iffm-opam-2.0.0/lib  /nix/store/nssw0a4qbr491p3lf98dz1zgfvv9iffm-opam-2.0.0/bin
patching script interpreter paths in /nix/store/nssw0a4qbr491p3lf98dz1zgfvv9iffm-opam-2.0.0
checking for references to /build in /nix/store/nssw0a4qbr491p3lf98dz1zgfvv9iffm-opam-2.0.0...
shrinking RPATHs of ELF executables and libraries in /nix/store/5pbc9503cpah61nfs17sdv3bdp2hi7hk-opam-2.0.0-installer
shrinking /nix/store/5pbc9503cpah61nfs17sdv3bdp2hi7hk-opam-2.0.0-installer/bin/opam-installer
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/5pbc9503cpah61nfs17sdv3bdp2hi7hk-opam-2.0.0-installer/lib  /nix/store/5pbc9503cpah61nfs17sdv3bdp2hi7hk-opam-2.0.0-installer/bin
patching script interpreter paths in /nix/store/5pbc9503cpah61nfs17sdv3bdp2hi7hk-opam-2.0.0-installer
checking for references to /build in /nix/store/5pbc9503cpah61nfs17sdv3bdp2hi7hk-opam-2.0.0-installer...
/nix/store/nssw0a4qbr491p3lf98dz1zgfvv9iffm-opam-2.0.0

@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: opam

Partial log (click to expand)

make[3]: *** [../Makefile:74: unix.cmxs] Error 2
make[3]: Leaving directory '/build/ocaml-4.05.0/otherlibs/unix'
make[2]: *** [Makefile:1055: otherlibrariesopt] Error 2
make[2]: Leaving directory '/build/ocaml-4.05.0'
make[1]: *** [Makefile:465: opt.opt] Error 2
make[1]: Leaving directory '/build/ocaml-4.05.0'
make: *** [Makefile:531: world.opt] Error 2
builder for '/nix/store/p1lp5bg6y0cyzxxhg5520lzj74vln086-ocaml-4.05.0.drv' failed with exit code 2
cannot build derivation '/nix/store/b6cp8cf27ryf9nixkr5qss0xh0xqav7k-opam-2.0.0.drv': 1 dependencies couldn't be built
error: build of '/nix/store/b6cp8cf27ryf9nixkr5qss0xh0xqav7k-opam-2.0.0.drv' failed

@xplat
Copy link
Contributor Author

xplat commented Aug 31, 2018

Eugh. Not sure what's up with aarch64-linux, but the Darwin failure is due to my attempt to merge in 06c7d4d ... semantically, the assumption that OPAM will try to pull in the stuff it needs for a successful default opam init instead of leaving that up to the user. OPAM 2 uses a different sandboxing method on Darwin...

@vbgl
Copy link
Contributor

vbgl commented Aug 31, 2018

Regarding Aarch, you should remove the line

inherit (ocaml-ng.ocamlPackages_4_05) ocaml;
that forces to use OCaml 4.05 to build opam.

Regarding Darwin, I don’t think opam-2 can be built on this platform with nixpkgs: it depends on mccs, which has been broken for a while (see bug report: ocaml-opam/ocaml-mccs#12).

@xplat xplat force-pushed the xplat/opam2 branch 3 times, most recently from 7f01db1 to cc37208 Compare August 31, 2018 22:54
@xplat
Copy link
Contributor Author

xplat commented Aug 31, 2018

@vbgl i think this version should work aith Aarch and mostly-work with Darwin. I don't know where to find sandbox-exec to put it in the path, but everything else opam needs should be there, and if it happens to be in the path anyway opam will find it. I haven't been able to try actual builds of OPAM packages on Darwin yet because I only have limited access to suitable machines right now.

@xplat
Copy link
Contributor Author

xplat commented Aug 31, 2018

Just to be clear -- the latest version of this does fix the ocaml-mccs build problem on Darwin...

@vbgl
Copy link
Contributor

vbgl commented Sep 1, 2018

@GrahamcOfBorg build opam

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: opam

Partial log (click to expand)

stripping (with command strip and flags -S) in /nix/store/y1v7gdkfddzkmncnsdrd4bmy90x43mi7-opam-2.0.0/lib  /nix/store/y1v7gdkfddzkmncnsdrd4bmy90x43mi7-opam-2.0.0/bin
patching script interpreter paths in /nix/store/y1v7gdkfddzkmncnsdrd4bmy90x43mi7-opam-2.0.0
checking for references to /build in /nix/store/y1v7gdkfddzkmncnsdrd4bmy90x43mi7-opam-2.0.0...
shrinking RPATHs of ELF executables and libraries in /nix/store/9f3zj809qf5yiyakizfwcfx5fmr32mga-opam-2.0.0-installer
shrinking /nix/store/9f3zj809qf5yiyakizfwcfx5fmr32mga-opam-2.0.0-installer/bin/opam-installer
strip is /nix/store/h0lbngpv6ln56hjj59i6l77vxq25flbz-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/9f3zj809qf5yiyakizfwcfx5fmr32mga-opam-2.0.0-installer/lib  /nix/store/9f3zj809qf5yiyakizfwcfx5fmr32mga-opam-2.0.0-installer/bin
patching script interpreter paths in /nix/store/9f3zj809qf5yiyakizfwcfx5fmr32mga-opam-2.0.0-installer
checking for references to /build in /nix/store/9f3zj809qf5yiyakizfwcfx5fmr32mga-opam-2.0.0-installer...
/nix/store/y1v7gdkfddzkmncnsdrd4bmy90x43mi7-opam-2.0.0

@GrahamcOfBorg
Copy link

Success on aarch64-linux (full log)

Attempted: opam

Partial log (click to expand)

stripping (with command strip and flags -S) in /nix/store/7mib3v4lccpggaa3swgg38f08iv94y1j-opam-2.0.0/lib  /nix/store/7mib3v4lccpggaa3swgg38f08iv94y1j-opam-2.0.0/bin
patching script interpreter paths in /nix/store/7mib3v4lccpggaa3swgg38f08iv94y1j-opam-2.0.0
checking for references to /build in /nix/store/7mib3v4lccpggaa3swgg38f08iv94y1j-opam-2.0.0...
shrinking RPATHs of ELF executables and libraries in /nix/store/ycnh6xlrykr66hnl5faycavpc9z3ghln-opam-2.0.0-installer
shrinking /nix/store/ycnh6xlrykr66hnl5faycavpc9z3ghln-opam-2.0.0-installer/bin/opam-installer
strip is /nix/store/y4ymnvgxygpq05h03kyzbj572zmh6zla-binutils-2.30/bin/strip
stripping (with command strip and flags -S) in /nix/store/ycnh6xlrykr66hnl5faycavpc9z3ghln-opam-2.0.0-installer/lib  /nix/store/ycnh6xlrykr66hnl5faycavpc9z3ghln-opam-2.0.0-installer/bin
patching script interpreter paths in /nix/store/ycnh6xlrykr66hnl5faycavpc9z3ghln-opam-2.0.0-installer
checking for references to /build in /nix/store/ycnh6xlrykr66hnl5faycavpc9z3ghln-opam-2.0.0-installer...
/nix/store/7mib3v4lccpggaa3swgg38f08iv94y1j-opam-2.0.0

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: opam

Partial log (click to expand)

post-installation fixup
moving /nix/store/rxpv16ms499sbsd90xqn7qskwrzbi2xy-opam-2.0.0/doc to /nix/store/rxpv16ms499sbsd90xqn7qskwrzbi2xy-opam-2.0.0/share/doc
gzipping man pages under /nix/store/rxpv16ms499sbsd90xqn7qskwrzbi2xy-opam-2.0.0/share/man/
strip is /nix/store/df6k4mgdjxciy0f637lryp7c9ln7n1m3-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/rxpv16ms499sbsd90xqn7qskwrzbi2xy-opam-2.0.0/lib  /nix/store/rxpv16ms499sbsd90xqn7qskwrzbi2xy-opam-2.0.0/bin
patching script interpreter paths in /nix/store/rxpv16ms499sbsd90xqn7qskwrzbi2xy-opam-2.0.0
strip is /nix/store/df6k4mgdjxciy0f637lryp7c9ln7n1m3-cctools-binutils-darwin/bin/strip
stripping (with command strip and flags -S) in /nix/store/lab1m8pr421z285i8ic4v9kgr5jfwa0m-opam-2.0.0-installer/lib  /nix/store/lab1m8pr421z285i8ic4v9kgr5jfwa0m-opam-2.0.0-installer/bin
patching script interpreter paths in /nix/store/lab1m8pr421z285i8ic4v9kgr5jfwa0m-opam-2.0.0-installer
/nix/store/rxpv16ms499sbsd90xqn7qskwrzbi2xy-opam-2.0.0

@vbgl
Copy link
Contributor

vbgl commented Sep 1, 2018

Thanks for the fixes. Should the mccs patch be upstreamed?

What is the purpose of the 1.2.2.nix file? It seems to be never referenced.

@xplat
Copy link
Contributor Author

xplat commented Sep 1, 2018

Yeah, the mccs patch should be upstreamed, i'll probably send a PR on Tuesday since it's less time-sensitive... as far as the 1.2.2.nix I left it there in case there was need for a downgraded version, but if you don't see a use for that it could certainly be removed.

@xplat
Copy link
Contributor Author

xplat commented Sep 4, 2018

ocaml-opam/ocaml-mccs#15 -- mccs patch on master
ocaml/opam#3529 -- mccs patch backported to opam

However, there's still a need to have it patched here as OPAM 2.0.0 is already released.

@xplat
Copy link
Contributor Author

xplat commented Sep 5, 2018

@vbgl Is there anything you're waiting on me to do here?

@vbgl
Copy link
Contributor

vbgl commented Sep 5, 2018

Please sort out the case of the 1.2.2.nix file. Either you think that it is useful to keep it live in nixpkgs, in which case you should add an attribute (say opam_1_2) that points to it; or you consider that the new version is good for all uses, in which case that file should be removed from the repository.

Notice that thanks to the git history, the old derivation is not lost: it is still possible to access to an old version of nixpkgs.

@xplat
Copy link
Contributor Author

xplat commented Sep 5, 2018

OK, done.

(I went with opam_1_2.)

@vbgl
Copy link
Contributor

vbgl commented Sep 6, 2018

@GrahamcOfBorg build opam_1_2

@GrahamcOfBorg
Copy link

Success on x86_64-linux (full log)

Attempted: opam_1_2

Partial log (click to expand)

these paths will be fetched (3.10 MiB download, 19.40 MiB unpacked):
  /nix/store/bjv02xbrsywd9jbdcpfnfa564p4l8n32-clasp-3.1.4
  /nix/store/lxm1hcqjqplj3rgwic9r0h6l7gcqgmvv-aspcud-1.9.4
  /nix/store/r6xyhnchmq15ln9gjqc4sn3zh2pp3dcw-opam-1.2.2
  /nix/store/zksyxh2pjv4x856fsg69v6mqihysv8mz-gringo-4.5.4
copying path '/nix/store/bjv02xbrsywd9jbdcpfnfa564p4l8n32-clasp-3.1.4' from 'https://cache.nixos.org'...
copying path '/nix/store/zksyxh2pjv4x856fsg69v6mqihysv8mz-gringo-4.5.4' from 'https://cache.nixos.org'...
copying path '/nix/store/lxm1hcqjqplj3rgwic9r0h6l7gcqgmvv-aspcud-1.9.4' from 'https://cache.nixos.org'...
copying path '/nix/store/r6xyhnchmq15ln9gjqc4sn3zh2pp3dcw-opam-1.2.2' from 'https://cache.nixos.org'...
/nix/store/r6xyhnchmq15ln9gjqc4sn3zh2pp3dcw-opam-1.2.2

@vbgl vbgl merged commit 3fc7c5b into NixOS:master Sep 6, 2018
@GrahamcOfBorg
Copy link

Failure on aarch64-linux (full log)

Attempted: opam_1_2

Partial log (click to expand)

make[3]: *** [../Makefile:74: unix.cmxs] Error 2
make[3]: Leaving directory '/build/ocaml-4.05.0/otherlibs/unix'
make[2]: *** [Makefile:1055: otherlibrariesopt] Error 2
make[2]: Leaving directory '/build/ocaml-4.05.0'
make[1]: *** [Makefile:465: opt.opt] Error 2
make[1]: Leaving directory '/build/ocaml-4.05.0'
make: *** [Makefile:531: world.opt] Error 2
builder for '/nix/store/a7br4i8030if6yd6sgfmyjd6qr5q9g8n-ocaml-4.05.0.drv' failed with exit code 2
cannot build derivation '/nix/store/i6z134gqcvnj63h1jci5l43ls779bq6x-opam-1.2.2.drv': 1 dependencies couldn't be built
error: build of '/nix/store/i6z134gqcvnj63h1jci5l43ls779bq6x-opam-1.2.2.drv' failed

@GrahamcOfBorg
Copy link

Success on x86_64-darwin (full log)

Attempted: opam_1_2

Partial log (click to expand)

these paths will be fetched (3.03 MiB download, 19.83 MiB unpacked):
  /nix/store/4v6g8i5wmws506hs21xl9ybmzqskym5h-opam-1.2.2
  /nix/store/qdi6hzlikkw29v78qmia7lisjl33ghgh-gringo-4.5.4
  /nix/store/w6jvi8667nqyf3lqb0jri1ipqc81bd40-clasp-3.1.4
  /nix/store/zzh67s1sm64apg1a737xjbw2j7k06y45-aspcud-1.9.4
copying path '/nix/store/w6jvi8667nqyf3lqb0jri1ipqc81bd40-clasp-3.1.4' from 'https://cache.nixos.org'...
copying path '/nix/store/qdi6hzlikkw29v78qmia7lisjl33ghgh-gringo-4.5.4' from 'https://cache.nixos.org'...
copying path '/nix/store/zzh67s1sm64apg1a737xjbw2j7k06y45-aspcud-1.9.4' from 'https://cache.nixos.org'...
copying path '/nix/store/4v6g8i5wmws506hs21xl9ybmzqskym5h-opam-1.2.2' from 'https://cache.nixos.org'...
/nix/store/4v6g8i5wmws506hs21xl9ybmzqskym5h-opam-1.2.2

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.

None yet

4 participants