HaxeFoundation / haxe

Haxe - The Cross-Platform Toolkit
https://haxe.org
6.19k stars 656 forks source link

Compile error on Mac M1 #11771

Closed onehundredfeet closed 2 months ago

onehundredfeet commented 2 months ago

I'm getting a compile error on the latest development branch. I'm on a Mac m1. I've been able to compile many times before, except now recently.

File "src/macro/eval/evalLuv.ml", line 97, characters 3-11: 97 | | `ENODATA -> 80

dune build --workspace dune-workspace.dev src/haxe.exe
File "src/macro/eval/evalLuv.ml", line 97, characters 3-11:
97 |    | `ENODATA -> 80
          ^^^^^^^^
Error: This pattern matches values of type [? `ENODATA ]
       but a pattern was expected which matches values of type Luv.Error.t
       The second variant type does not allow tag(s) `ENODATA
Simn commented 2 months ago

Sounds like the sequel to #10679.

onehundredfeet commented 2 months ago

Should I be upgrading generally? I'm always afraid to upgrade because I'm assuming you're using specific versions

onehundredfeet commented 2 months ago

I always run:


opam update

# install the haxe package dependencies (as listed in the `opam` file)
opam install haxe --deps-only

But I guess that's not enough.

Simn commented 2 months ago

I have yet to solve this locally myself, but opam upgrade luv is likely a good idea.

onehundredfeet commented 2 months ago
[ERROR] The compilation of luv.0.5.14 failed at "dune build -p luv -j 19".
∗ installed camlp5.8.03.00

#=== ERROR while compiling luv.0.5.14 =========================================#
# context     2.1.5 | macos/arm64 | ocaml.4.14.2 | https://opam.ocaml.org#2d4ed1d357476c1cef4ba85ee4e76e9dfb81f2ee
# path        ~/.opam/default/.opam-switch/build/luv.0.5.14
# command     ~/.opam/opam-init/hooks/sandbox.sh build dune build -p luv -j 19
# exit-code   1
# env-file    ~/.opam/log/luv-87316-a50742.env
# output-file ~/.opam/log/luv-87316-a50742.out
### output ###
# [...]
# c_generated_functions.c:1814:10: warning: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
#    char* x1408 = CTYPES_PTR_OF_OCAML_STRING(x1407);
#          ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# c_generated_functions.c:1835:29: warning: passing 'unsigned char *' to parameter of type 'char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
#    int x1424 = luv_os_uname(x1423);
#                             ^~~~~
# ./helpers.h:180:24: note: passing argument to parameter 'buffer' here
# int luv_os_uname(char *buffer);
#                        ^
# 34 warnings and 2 errors generated.
# (cd _build/default/src/c/vendor/libuv && /opt/homebrew/bin/bash -e -u -o pipefail -c 'sh configure --host `ocamlc -config | awk '\''/^host:/ {print $NF}'\''` '\''CC=cc -O2 -fno-strict-aliasing -fwrapv -pthread'\'' CFLAGS=-DNDEBUG --silent --enable-silent-rules')
# ld: warning: -single_module is obsolete

I'm wiping the opam cache and starting from scratch

Simn commented 2 months ago

I'm wiping the opam cache and starting from scratch

Yeah that sounds a lot of my typical opam upgrading experience...

onehundredfeet commented 2 months ago

Well, full wipe FTW. Thanks Simon.

onehundredfeet commented 2 months ago

5.0.0-alpha.1 is latest correct?

tobil4sk commented 2 months ago

It's possible that you had ctypes pinned to an old version, our ci had issues until we unpinned it: #11765