Created attachment 242443 [details] patch for devel/ocaml-opam, updating to 2.1.5 Dear ports@, please find attached a git diff against the portstree updating devel/ocaml-opam from 2.1.2 to 2.1.5. I'm the maintainer of that port (thus, maintainer approval is granted). I tested it on a amd64 machine (13.1): make stage make stage-qa make package make install make deinstall make package (as user) I also ran portlint which reports "looks fine.". Also, it works on my poudriere (amd64): http://193.30.40.133:8080/data/builder-default/2023-05-27_11h46m06s/logs/ocaml-opam-2.1.5.log Also, it works in a 32bit jail (i386).
Thank you for your submission. Does this update fix any of the issues from bug #261180?
Also, is there a changelog for this update?
Changelog (from https://github.com/ocaml/opam/blob/2.1/CHANGES): 2.1.5: * [BUG] Variables are now expanded in build-env (as for setenv) [#5352 @dra27] * Correctly handle empty environment variable additions [#5350 @dra27] * Skip empty environment variable additions [#5350 @dra27] * [BUG] Fix passing `archive-mirrors` field from init config file to config [#5315 @hannesm] * git, hg: Use the full SHA1 revision instead of just the 8 first characters [#5342 @reynir] * [BUG] Fix opam installing packages without checking their checksum when the local cache is corrupted in some case [#5538 @kit-ty-kate] 2.1.4: * Add support for OCaml 5.0. Dose3 >= 6.1 and base64 >= 3.1.0 are now required [#5357 @kit-ty-kate @dra27 - fix #5354] * [BUG] Fix all empty conflict explanation messages [#5378 @kit-ty-kate - partial fix #4373] 2.1.3: * [BUG] Fix `opam init` and `opam init --reinit` when the `jobs` variable has been set in the opamrc or the current config. [#5056 @rjbou] * When inferring a 2.1+ switch invariant from 2.0 base packages, don't filter out pinned packages as that causes very wide invariants for pinned compiler packages [#5176 @dra27 - fix #4501] * [BUG] Fix an internal error on repository upgrade from OPAM 1.2 [#4965 @AltGr] * Some optimisations to `opam list --installable` queries combined with other filters [#4882 @AltGr - fix #4311] * Improve performance of some opam list combinations (e.g. `--available`, `--installable`) [#4999 @kit-ty-kate] * Improve performance of `opam list --conflicts-with` when combined with other filters [#4999 @kit-ty-kate] * Improve performance of `opam show` by as much as 300% when the package to show is given explicitly or is unique [#4998 @kit-ty-kate - fix #4997 and partially #4172] * [BUG] `opam var` no longer fails if no switch is set [#5027 @rjbou - fix #5025] * [BUG] Setting a variable with option `--switch <sw>` fails instead of writing an invalid `switch-config` file [#5027 @rjbou] * When a field is defined in switch and global scope, try to determine the scope also by checking switch selection [#5027 @rjbou] * [BUG] Handle external dependencies when updating switch state pin status (all pins), instead as a post pin action (only when called with `opam pin` [#5047 @rjbou - fix #5046] * [BUG] When reinstalling a package that has a dirty source, if uncommitted changes are the same than the ones stored in opam's cache, opam consider that it is up to date and nothing is updated [4879 @rjbou] * Stop Zypper from upgrading packages on updates on OpenSUSE [#4978 @kit-ty-kate] * Clearer error message if a command doesn't exist [#4971 @kit-ty-kat - fix #4112] * [BUG] Remove windows double printing on commands and their output [#4940 @rjbou] * Actually allow multiple state caches to co-exist [#4934 @dra27 - actually fixes #4554] * Update cold compiler to 4.13 to avoid issues with glibc 2.34 on Unix [#5017 @dra27] * Bump opam-file-format to 2.1.4 [#5117 @kit-ty-kate - fix #5116] * Fix some empty conflict explanations [#4982 @kit-ty-kate - partially fix #4373] * Port some tests from master [#4841 #4974 #4861 #4915 #4979 #5004 #5006 #5015 #5024 #5025 #5031 #5131 #5176 @AltGr @dra27 @kit-ty-kate] * Update test engine to allow for additional tests [#4913 #4966 #4979 #5004 #5009 #5024 #5097 @AltGr @kit-ty-kate @rjbou] * Update for git protocol deprecation on GitHub [#5097 @rjbou] * When building opam, do not fail if curl/wget is missing [#5223 #5233 @kit-ty-kate]
(In reply to Robert Clausecker from comment #1) Since I don't have an arm machine, I can't tell for sure. What is the case, though, is that the OCaml version bundled with that opam release, was updated from 4.12 to 4.13.1 -- and this may include fixes for arm32.
Thanks. It's unfortunate that ocaml is still bundled in this port, but perhaps that can be improved in the future. The build still fails on armv7, but now much earlier: ... configure: creating ./config.status config.status: creating Makefile.build_config config.status: creating Makefile.config config.status: creating tools/eventlog_metadata config.status: creating runtime/caml/m.h config.status: creating runtime/caml/s.h config.status: executing libtool commands gmake[2]: Entering directory '/wrkdirs/usr/ports/devel/ocaml-opam/work/opam-full-2.1.5/bootstrap/ocaml-4.13.1' gmake -C runtime sak gmake[3]: Entering directory '/wrkdirs/usr/ports/devel/ocaml-opam/work/opam-full-2.1.5/bootstrap/ocaml-4.13.1/runtime' cc -c -O2 -fno-strict-aliasing -fwrapv -pthread -Wall -Wdeclaration-after-statement -fno-common -g -D_FILE_OFFSET_BITS=64 -DCAML_NAME_SPACE -DCAMLDLLIMPORT= -o sak.o sak.c cc -O2 -fno-strict-aliasing -fwrapv -pthread -Wall -Wdeclaration-after-statement -fno-common -g -Wl,-E -o sak sak.o gmake[3]: Leaving directory '/wrkdirs/usr/ports/devel/ocaml-opam/work/opam-full-2.1.5/bootstrap/ocaml-4.13.1/runtime' Makefile:976: *** The native-code compiler is not supported on this platform. Stop. gmake[2]: Leaving directory '/wrkdirs/usr/ports/devel/ocaml-opam/work/opam-full-2.1.5/bootstrap/ocaml-4.13.1' gmake[1]: *** [Makefile:261: compiler] Error 2 gmake[1]: Leaving directory '/wrkdirs/usr/ports/devel/ocaml-opam/work/opam-full-2.1.5' *** Error code 2 I wonder if this is down to architecture naming. uname -m reports "arm" on FreeBSD, but "armv7" on Linux. Perhaps this needs to be patched?
(In reply to Robert Clausecker from comment #5) OCaml bundling: I'm eager to remove this and depend on lang/ocaml once that one is recent enough to be used. About ARM32 support: in configure, the only host supported for FreeBSD and arm is: [armv6*-*-freebsd*], [arch=arm; model=armv6; system=freebsd], I suspect "getting OCaml to work on FreeBSD/arm32, model armv7" (with recent OCaml & FreeBSD) can be achieved, but this needs some work - I unfortunately won't have time for it (neither hardware). With OCaml 5 - which was released last year - the 32 bit support (for native compilation) was dropped entirely - so another path would be to use the bytecode version for arm32 (but this would likely require substantial changes to devel/ocaml-opam build system). So, for the time being, I suggest to mark that port as broken on arm32 (until someone is motivated to do the porting and testing).
(In reply to Hannes Mehnert from comment #6) I guess adding an extra entry for [armv7*-*-freebsd*], [arch=arm; model=armv7; system=freebsd], should do the trick, but patching this port is kind of nasty due to the patch-in-patch thingy with the bundled ocaml. If you want to provide such a patch I can test it and let you know if it works. > OCaml bundling: I'm eager to remove this and depend on lang/ocaml once that one is recent enough to be used. See bug #262781 for people working on that.
(In reply to Robert Clausecker from comment #7) Thanks for the pointer for the OCaml update (opam at the moment requires 4.08+). Attached is the patchfile to replace the src__ext_ocaml-patches_0001-Fix-relocation-ocaml-32-bit.patch
Created attachment 242446 [details] patches OCaml's configure for (a) 32 bit (linker flags) (b) arm32 armv7
Thanks. Testing that patch now. May take a few hours.
Yeah that didn't fix the build. No problem though. Shall I mark it as BROKEN_armv7?
(In reply to Robert Clausecker from comment #11) yes, marking it as broken sounds good to me. would you mind to report the build log / failure here (or in the other bug)?
(In reply to Hannes Mehnert from comment #12) It's the same issue with invalid relocations in arm_libasmrunpic.o as in bug #261180. That file is just designed to be used as PIC. It wouldn't be hard to patch, but this sort of error makes me skeptical that likely, additional parts too don't like PIC and I lack overall familiarity with ocaml to tell for sure.
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=5ac3886b7616aee99bec227268c08f98068a7a5b commit 5ac3886b7616aee99bec227268c08f98068a7a5b Author: Hannes Mehnert <hannes@mehnert.org> AuthorDate: 2023-05-27 13:37:32 +0000 Commit: Robert Clausecker <fuz@FreeBSD.org> CommitDate: 2023-05-29 23:25:16 +0000 devel/ocaml-opam: update to 2.1.5 - attempt to patch the build for armv7 - realise that it still doesn't build and mark as BROKEN_armv[67] Changelog: https://github.com/ocaml/opam/blob/2.1/CHANGES PR: 271674 devel/ocaml-opam/Makefile | 6 +- devel/ocaml-opam/distinfo | 6 +- devel/ocaml-opam/files/patch-Makefile | 10 ++-- .../files/patch-shell_bootstrap-ocaml.sh | 14 +---- ...-patches_0001-Fix-relocation-ocaml-32-bit.patch | 66 ++++++++-------------- 5 files changed, 38 insertions(+), 64 deletions(-)
Thank you for your contribution.
Thanks for your merge. Unfortunately, upstream rebuild the distribution tarball (to reduce from 50MB to 10MB by removing the .git directory). Please find below the updated distinfo, it would be great to have that merged rather sooner than later: TIMESTAMP = 1685599850 SHA256 (opam-full-2.1.5.tar.gz) = 09f8d9e410b2f5723c2bfedbf7970e3b305f5017895fcd91759f05e753ddcea5 SIZE (opam-full-2.1.5.tar.gz) = 10801367
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/ports/commit/?id=9d96ce8e8e1f8678944ad6043415b20502325c1c commit 9d96ce8e8e1f8678944ad6043415b20502325c1c Author: Hannes Mehnert <hannes@mehnert.org> AuthorDate: 2023-06-01 07:16:48 +0000 Commit: Robert Clausecker <fuz@FreeBSD.org> CommitDate: 2023-06-01 22:29:22 +0000 devel/ocaml-opam: fix distinfo Upstream rerolled its distfile, making it smaller by not shipping the .git directory. PR: 271674 devel/ocaml-opam/distinfo | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Thank you for the hint.