On Tue, Feb 18, 2020 at 11:49:43PM -0500, Kurt Mosiejczuk wrote:
> On Wed, Feb 19, 2020 at 11:48:28AM +1000, Jonathan Matthew wrote:
>
> > > I thought I'd have a look at this, since I'm actually using erlang
> > > on sparc64 now. The erlang21 flavor built, but the escriptized file
> > > ends up looking like this:
>
> > > -r-x--S--- 1 4087335480 1892169536 209098 Feb 19 07:36 rebar
>
> > > which looks like erlang21 is screwing up its chown and chmod syscalls.
>
> > This is fixed in otp 21.2.1, by this change:
> > https://github.com/erlang/otp/commit/df0638e021eb18a4271a02fdae08aa1779867209
>
> Based upon this information, here is a patch for lang/erlang/21 to add
> this patch to the current version.
>
> ok?
Looks good to me, and I built a package with this and it managed to build rebar
with correct ownership and permissions.
>
> --Kurt
>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/lang/erlang/21/Makefile,v
> retrieving revision 1.4
> diff -u -p -r1.4 Makefile
> --- Makefile 25 Jun 2019 20:25:21 -0000 1.4
> +++ Makefile 19 Feb 2020 04:47:02 -0000
> @@ -13,8 +13,8 @@ PKGNAME= erlang-$V
> PKGNAME-main= erlang-$V
> PKGNAME-wx= erlang-wx-$V
>
> -REVISION-main= 2
> -REVISION-wx= 2
> +REVISION-main= 3
> +REVISION-wx= 3
>
> VERSION_SPEC= >=21v0,<22v0
> PKGSPEC-main= erlang-${VERSION_SPEC}
> Index: patches/patch-erts_emulator_nifs_common_prim_file_nif_c
> ===================================================================
> RCS file: patches/patch-erts_emulator_nifs_common_prim_file_nif_c
> diff -N patches/patch-erts_emulator_nifs_common_prim_file_nif_c
> --- /dev/null 1 Jan 1970 00:00:00 -0000
> +++ patches/patch-erts_emulator_nifs_common_prim_file_nif_c 19 Feb 2020
> 04:47:02 -0000
> @@ -0,0 +1,26 @@
> +$OpenBSD$
> +
> +erts: Fix warning and potential big-endian-bug in prim_file
> +https://github.com/erlang/otp/commit/df0638e021eb18a4271a02fdae08aa1779867209
> +
> +Index: erts/emulator/nifs/common/prim_file_nif.c
> +--- erts/emulator/nifs/common/prim_file_nif.c.orig
> ++++ erts/emulator/nifs/common/prim_file_nif.c
> +@@ -933,7 +933,7 @@ static ERL_NIF_TERM set_permissions_nif(ErlNifEnv *env
> + posix_errno_t posix_errno;
> +
> + efile_path_t path;
> +- Uint permissions;
> ++ unsigned int permissions;
> +
> + if(argc != 2 || !enif_get_uint(env, argv[1], &permissions)) {
> + return enif_make_badarg(env);
> +@@ -952,7 +952,7 @@ static ERL_NIF_TERM set_owner_nif(ErlNifEnv *env, int
> + posix_errno_t posix_errno;
> +
> + efile_path_t path;
> +- Sint uid, gid;
> ++ int uid, gid;
> +
> + if(argc != 3 || !enif_get_int(env, argv[1], &uid)
> + || !enif_get_int(env, argv[2], &gid)) {