Skip to content

Commit

Permalink
Patch <limits.h> in the release builds
Browse files Browse the repository at this point in the history
musl ships with an incorrect value for NGROUPS_MAX in limits.h. This
affects OCaml's Unix.getgroups function. Fortunately, for the opam
binary, this can be worked around simply by ensuring
/usr/include/limits.h has been patched before OCaml is compiled.

This would not work for Unix.initgroups, but fortunately opam doesn't
need that.
  • Loading branch information
dra27 committed Jan 24, 2023
1 parent 79affca commit 60a2d12
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ users)
* Make the release script setup-less using QEMU, Docker and Rosetta 2 [#4947 @kit-ty-kate]
* Update release notes for messages in opam-repository [#5276 @dra27]
* Speedup the compiler compilation phase for the docker builds [#5387 @kit-ty-kate]
* Workaround incorrect `NGROUPS_MAX` in `<limits.h>` in musl for release builds [#5383 @dra27]

## Admin
*`opam admin cache` now ignores all already present cache files. Option
Expand Down
1 change: 1 addition & 0 deletions release/Dockerfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ FROM multiarch/alpine:%TARGET_TAG%
LABEL Description="opam release builds" Vendor="OCamlPro" Version="1.0"

RUN apk add gcc g++ make coreutils openssl
RUN sed -i -e '/ NGROUPS_MAX /s/32/65536/' /usr/include/limits.h

RUN addgroup -S opam && adduser -S opam -G opam -s /bin/sh

Expand Down

0 comments on commit 60a2d12

Please sign in to comment.