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

emscripten: 3.0.0 -> 3.1.12 #175358

Closed
wants to merge 5 commits into from
Closed

emscripten: 3.0.0 -> 3.1.12 #175358

wants to merge 5 commits into from

Conversation

yorickvP
Copy link
Contributor

Description of changes

Update emscripten and its dependencies, also fix build dependencies (were complaining about missing archive indices).

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@yorickvP
Copy link
Contributor Author

@ofborg build emscripten emscriptenPackages.xmlmirror

@siraben
Copy link
Member

siraben commented May 30, 2022

Result of nixpkgs-review pr 175358 run on aarch64-darwin 1

6 packages built:
  • binaryen
  • emscripten
  • emscriptenPackages.json_c
  • emscriptenPackages.libxml2
  • emscriptenPackages.xmlmirror
  • emscriptenPackages.zlib

@yorickvP
Copy link
Contributor Author

@ofborg build binaryen

@ofborg ofborg bot added the 8.has: package (new) This PR adds a new package label May 30, 2022
inherit pname version;
sha256 = "sha256-Ae4ye2t0LO0v2eRDGdLXBqRXPl4O5yYZONDeFqd+XAY=";
};

Copy link
Member

@SuperSandro2000 SuperSandro2000 May 30, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing pythonImportsCheck and we should execute tests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pypi source does not package the tests.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that's the case, please use fetchFromGitHub instead of fetchPypi.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would strongly prefer not to, the github repo also uses poetry instead of setuptools.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing to github source is a standard procedure to get tests executed which we should always do if they work in the sandbox.

Building from poetry is easy. Add format = "pyproject"; and check if the project uses poetry or poetry-core and add that to nativeBuildInputs.

@gracicot
Copy link
Contributor

The checks for binaryen don't seem to work on darwin-x86_64. Here's the error output:

[ running validation tests... ]

executing:  /private/tmp/nix-build-binaryen-108.drv-0/source/build/bin/wasm-as /private/tmp/nix-build-binaryen-108.drv-0/source/test/validator/invalid_export.wast -o a.wasm
executing:  /private/tmp/nix-build-binaryen-108.drv-0/source/build/bin/wasm-as /private/tmp/nix-build-binaryen-108.drv-0/source/test/validator/invalid_import.wast -o a.wasm
executing:  /private/tmp/nix-build-binaryen-108.drv-0/source/build/bin/wasm-as --validate=web /private/tmp/nix-build-binaryen-108.drv-0/source/test/validator/invalid_export.wast -o a.wasm
[wasm-validator error in module] i64 == i64: Exported function must not have i64 results, on
export64
Fatal: Error: input module is not valid.

executing:  /private/tmp/nix-build-binaryen-108.drv-0/source/build/bin/wasm-as --validate=web /private/tmp/nix-build-binaryen-108.drv-0/source/test/validator/invalid_import.wast -o a.wasm
[wasm-validator error in module] i64 == i64: Imported function must not have i64 parameters, on
bad
Fatal: Error: input module is not valid.

executing:  /private/tmp/nix-build-binaryen-108.drv-0/source/build/bin/wasm-as --validate=none /private/tmp/nix-build-binaryen-108.drv-0/source/test/validator/invalid_return.wast -o a.wasm
executing:  /private/tmp/nix-build-binaryen-108.drv-0/source/build/bin/wasm-as /private/tmp/nix-build-binaryen-108.drv-0/source/test/validator/invalid_number.wast -o a.wasm
[parse exception: invalid i64 format]Fatal: error in parsing input

[ checking native example testcases...]

build:  clang /private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-hello-world.c -c -o example.o -I/private/tmp/nix-build-binaryen-108.drv-0/source/src -g -L/private/tmp/nix-build-binaryen-108.drv-0/source/build/lib -pthread
clang-11: warning: argument unused during compilation: '-L/private/tmp/nix-build-binaryen-108.drv-0/source/build/lib' [-Wunused-command-line-argument]
   /private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-hello-world.c /private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-hello-world.c /private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-hello-world.txt
link:  clang++ -std=c++17 example.o -L/private/tmp/nix-build-binaryen-108.drv-0/source/build/lib -lbinaryen -I/private/tmp/nix-build-binaryen-108.drv-0/source/t -g -pthread -o example -Wl,-rpath,/private/tmp/nix-build-binaryen-108.drv-0/source/build/lib
run... example
build:  clang /private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-kitchen-sink.c -c -o example.o -I/private/tmp/nix-build-binaryen-108.drv-0/source/src -g -L/private/tmp/nix-build-binaryen-108.drv-0/source/build/lib -pthread
clang-11: warning: argument unused during compilation: '-L/private/tmp/nix-build-binaryen-108.drv-0/source/build/lib' [-Wunused-command-line-argument]
/private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-kitchen-sink.c:190:41: warning: format specifies type 'int' but the argument has type 'BinaryenType' (aka 'unsigned long') [-Wformat]
  printf("  // BinaryenTypeNone: %d\n", none);
                                 ~~     ^~~~
                                 %lu
/private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-kitchen-sink.c:196:48: warning: format specifies type 'int' but the argument has type 'BinaryenType' (aka 'unsigned long') [-Wformat]
  printf("  // BinaryenTypeUnreachable: %d\n", unreachable);
                                        ~~     ^~~~~~~~~~~
                                        %lu
/private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-kitchen-sink.c:202:42: warning: format specifies type 'int' but the argument has type 'BinaryenType' (aka 'unsigned long') [-Wformat]
  printf("  // BinaryenTypeInt32: %d\n", i32);
                                  ~~     ^~~
                                  %lu
/private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-kitchen-sink.c:208:42: warning: format specifies type 'int' but the argument has type 'BinaryenType' (aka 'unsigned long') [-Wformat]
  printf("  // BinaryenTypeInt64: %d\n", i64);
                                  ~~     ^~~
                                  %lu
/private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-kitchen-sink.c:214:44: warning: format specifies type 'int' but the argument has type 'BinaryenType' (aka 'unsigned long') [-Wformat]
  printf("  // BinaryenTypeFloat32: %d\n", f32);
                                    ~~     ^~~
                                    %lu
/private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-kitchen-sink.c:220:44: warning: format specifies type 'int' but the argument has type 'BinaryenType' (aka 'unsigned long') [-Wformat]
  printf("  // BinaryenTypeFloat64: %d\n", f64);
                                    ~~     ^~~
                                    %lu
/private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-kitchen-sink.c:226:43: warning: format specifies type 'int' but the argument has type 'BinaryenType' (aka 'unsigned long') [-Wformat]
  printf("  // BinaryenTypeVec128: %d\n", v128);
                                   ~~     ^~~~
                                   %lu
/private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-kitchen-sink.c:232:44: warning: format specifies type 'int' but the argument has type 'BinaryenType' (aka 'unsigned long') [-Wformat]
  printf("  // BinaryenTypeFuncref: %d\n", funcref);
                                    ~~     ^~~~~~~
                                    %lu
/private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-kitchen-sink.c:238:46: warning: format specifies type 'int' but the argument has type 'BinaryenType' (aka 'unsigned long') [-Wformat]
  printf("  // BinaryenTypeExternref: %d\n", externref);
                                      ~~     ^~~~~~~~~
                                      %lu
/private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-kitchen-sink.c:244:43: warning: format specifies type 'int' but the argument has type 'BinaryenType' (aka 'unsigned long') [-Wformat]
  printf("  // BinaryenTypeAnyref: %d\n", anyref);
                                   ~~     ^~~~~~
                                   %lu
/private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-kitchen-sink.c:250:42: warning: format specifies type 'int' but the argument has type 'BinaryenType' (aka 'unsigned long') [-Wformat]
  printf("  // BinaryenTypeEqref: %d\n", eqref);
                                  ~~     ^~~~~
                                  %lu
/private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-kitchen-sink.c:256:43: warning: format specifies type 'int' but the argument has type 'BinaryenType' (aka 'unsigned long') [-Wformat]
  printf("  // BinaryenTypeI31ref: %d\n", i31ref);
                                   ~~     ^~~~~~
                                   %lu
/private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-kitchen-sink.c:262:44: warning: format specifies type 'int' but the argument has type 'BinaryenType' (aka 'unsigned long') [-Wformat]
  printf("  // BinaryenTypeDataref: %d\n", dataref);
                                    ~~     ^~~~~~~
                                    %lu
/private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-kitchen-sink.c:267:41: warning: format specifies type 'int' but the argument has type 'BinaryenType' (aka 'unsigned long') [-Wformat]
  printf("  // BinaryenTypeAuto: %d\n", BinaryenTypeAuto());
                                 ~~     ^~~~~~~~~~~~~~~~~~
                                 %lu
14 warnings generated.
   /private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-kitchen-sink.c /private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-kitchen-sink.c /private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-kitchen-sink.txt
link:  clang++ -std=c++17 example.o -L/private/tmp/nix-build-binaryen-108.drv-0/source/build/lib -lbinaryen -I/private/tmp/nix-build-binaryen-108.drv-0/source/t -g -pthread -o example -Wl,-rpath,/private/tmp/nix-build-binaryen-108.drv-0/source/build/lib
run... example
[wasm-validator error in function func] local.set's value type must be correct, on
(local.set $0
 (i64.const 1234)
)
build:  clang /private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-multiple-tables.c -c -o example.o -I/private/tmp/nix-build-binaryen-108.drv-0/source/src -g -L/private/tmp/nix-build-binaryen-108.drv-0/source/build/lib -pthread
clang-11: warning: argument unused during compilation: '-L/private/tmp/nix-build-binaryen-108.drv-0/source/build/lib' [-Wunused-command-line-argument]
   /private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-multiple-tables.c /private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-multiple-tables.c /private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-multiple-tables.txt
link:  clang++ -std=c++17 example.o -L/private/tmp/nix-build-binaryen-108.drv-0/source/build/lib -lbinaryen -I/private/tmp/nix-build-binaryen-108.drv-0/source/t -g -pthread -o example -Wl,-rpath,/private/tmp/nix-build-binaryen-108.drv-0/source/build/lib
run... example
build:  clang /private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-relooper-unreachable-if.cpp -c -o example.o -I/private/tmp/nix-build-binaryen-108.drv-0/source/src -g -L/private/tmp/nix-build-binaryen-108.drv-0/source/build/lib -pthread -std=c++17
clang-11: warning: argument unused during compilation: '-L/private/tmp/nix-build-binaryen-108.drv-0/source/build/lib' [-Wunused-command-line-argument]
/private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-relooper-unreachable-if.cpp:4:10: fatal error: 'cassert' file not found
#include <cassert>
         ^~~~~~~~~
1 error generated.
Traceback (most recent call last):
  File "/private/tmp/nix-build-binaryen-108.drv-0/source/build/../check.py", line 416, in <module>
    sys.exit(main())
  File "/private/tmp/nix-build-binaryen-108.drv-0/source/build/../check.py", line 399, in main
    TEST_SUITES[test]()
  File "/private/tmp/nix-build-binaryen-108.drv-0/source/build/../check.py", line 301, in run_example_tests
    subprocess.check_call(extra)
  File "/nix/store/lfayq1vz3szk4ji0s53v0x1ijcdn3qnx-python3-3.9.12/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['clang', '/private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-relooper-unreachable-if.cpp', '-c', '-o', 'example.o', '-I/private/tmp/nix-build-binaryen-108.drv-0/source/src', '-g', '-L/private/tmp/nix-build-binaryen-108.drv-0/source/build/lib', '-pthread', '-std=c++17']' returned non-zero exit status 1.
error: builder for '/nix/store/s7irmilv2768w6dd9j6d7d04plrqdy60-binaryen-108.drv' failed with exit code 1;
       last 10 log lines:
       > Traceback (most recent call last):
       >   File "/private/tmp/nix-build-binaryen-108.drv-0/source/build/../check.py", line 416, in <module>
       >     sys.exit(main())
       >   File "/private/tmp/nix-build-binaryen-108.drv-0/source/build/../check.py", line 399, in main
       >     TEST_SUITES[test]()
       >   File "/private/tmp/nix-build-binaryen-108.drv-0/source/build/../check.py", line 301, in run_example_tests
       >     subprocess.check_call(extra)
       >   File "/nix/store/lfayq1vz3szk4ji0s53v0x1ijcdn3qnx-python3-3.9.12/lib/python3.9/subprocess.py", line 373, in check_call
       >     raise CalledProcessError(retcode, cmd)
       > subprocess.CalledProcessError: Command '['clang', '/private/tmp/nix-build-binaryen-108.drv-0/source/test/example/c-api-relooper-unreachable-if.cpp', '-c', '-o', 'example.o', '-I/private/tmp/nix-build-binaryen-108.drv-0/source/src', '-g', '-L/private/tmp/nix-build-binaryen-108.drv-0/source/build/lib', '-pthread', '-std=c++17']' returned non-zero exit status 1.
       For full logs, run 'nix log /nix/store/s7irmilv2768w6dd9j6d7d04plrqdy60-binaryen-108.drv'.
error: 1 dependencies of derivation '/nix/store/j6zgrvfff66rw6a2grkii7xzpjg1ni60-emscripten-3.1.12.drv' failed to build
error: build of '/nix/store/6hqrmkmdnbhgni36d7w219pf1958vknh-npm-8.11.0.drv', '/nix/store/j6zgrvfff66rw6a2grkii7xzpjg1ni60-emscripten-3.1.12.drv' failed

@SuperSandro2000
Copy link
Member

The checks for binaryen don't seem to work on darwin-x86_64. Here's the error output:

If only checks are broken I would suggest to disable them on darwin. If the entire binary is broken then please mark it broken for darwin.

@gracicot
Copy link
Contributor

Removing the checks made binaryen sucessfully compile, but left emscripten broken with a compilation error.

I tried to research it but I wasn't able to find the solution for now. If we merge this pull request, we might have to mark darwin as broken for the moment.

/nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/system/lib/dlmalloc.c:35:1: error: static_assert failed due to requirement '(__alignof(max_align_t)) == 8' "max_align_t must be 8"
_Static_assert(MALLOC_ALIGNMENT == 8, "max_align_t must be 8");
^              ~~~~~~~~~~~~~~~~~~~~~
1 error generated.
emcc: error: '/nix/store/fkck3950645hfygd3fxjvj056yq6qwfb-emscripten-llvm-3.1.12/bin/clang -target wasm32-unknown-emscripten -DEMSCRIPTEN -D__EMSCRIPTEN_major__=3 -D__EMSCRIPTEN_minor__=1 -D__EMSCRIPTEN_tiny__=12 -fignore-exceptions -fvisibility=default -Werror=implicit-function-declaration -Xclang -iwithsysroot/include/SDL --sysroot=/nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/cache/sysroot -resource-dir=/nix/store/fkck3950645hfygd3fxjvj056yq6qwfb-emscripten-llvm-3.1.12/lib/clang/11.1.0/ -idirafter/nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/cache/sysroot/include -iwithsysroot/include/c++/v1 -Xclang -iwithsysroot/include/compat -O2 -Werror -fno-unroll-loops -fno-builtin -g3 -flto=full -DNDEBUG -c /nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/system/lib/dlmalloc.c -o /nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/cache/build/libdlmalloc/dlmalloc.o' failed (returned 1)
Traceback (most recent call last):
  File "/nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/emcc.py", line 4039, in <module>
    sys.exit(main(sys.argv))
  File "/nix/store/gxnjdv4v6z21n2g5hp4cnnlcysaqcv83-python3-3.9.12/lib/python3.9/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/emcc.py", line 4032, in main
    ret = run(args)
  File "/nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/emcc.py", line 1173, in run
    phase_calculate_system_libraries(state, linker_arguments, linker_inputs, newargs)
  File "/nix/store/gxnjdv4v6z21n2g5hp4cnnlcysaqcv83-python3-3.9.12/lib/python3.9/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/emcc.py", line 2752, in phase_calculate_system_libraries
    extra_files_to_link += system_libs.calculate(all_linker_inputs, newargs, forced=state.forced_stdlibs)
  File "/nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/tools/system_libs.py", line 1906, in calculate
    libs_to_link = get_libs_to_link(args, forced, only_forced)
  File "/nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/tools/system_libs.py", line 1850, in get_libs_to_link
    add_library('libmalloc')
  File "/nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/tools/system_libs.py", line 1798, in add_library
    libs_to_link.append((lib.get_link_flag(), need_whole_archive))
  File "/nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/tools/system_libs.py", line 258, in get_link_flag
    fullpath = self.get_path()
  File "/nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/tools/system_libs.py", line 250, in get_path
    return shared.Cache.get_lib(self.get_filename(), self.build)
  File "/nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/tools/cache.py", line 139, in get_lib
    return self.get(name, *args, **kwargs)
  File "/nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/tools/cache.py", line 167, in get
    creator(cachename)
  File "/nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/tools/system_libs.py", line 335, in build
    create_lib(out_filename, self.build_objects(build_dir))
  File "/nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/tools/system_libs.py", line 322, in build_objects
    run_build_commands(commands)
  File "/nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/tools/system_libs.py", line 77, in run_build_commands
    shared.run_multiple_processes(commands, env=clean_env())
  File "/nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/tools/shared.py", line 211, in run_multiple_processes
    raise Exception('Subprocess %d/%d failed (%s)! (cmdline: %s)' % (idx + 1, len(commands), returncode_to_str(finished_process.returncode), shlex_join(commands[idx])))
Exception: Subprocess 1/2 failed (returned 1)! (cmdline: /nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/bin/emcc -O2 -Werror -fno-unroll-loops -fno-builtin -g -flto=full -DNDEBUG -c /nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/system/lib/dlmalloc.c -o /nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/cache/build/libdlmalloc/dlmalloc.o)
error: builder for '/nix/store/djfkr1xy32hjj0vfh5flbz00h47v023r-emscripten-3.1.12.drv' failed with exit code 1;
       last 10 log lines:
       >     creator(cachename)
       >   File "/nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/tools/system_libs.py", line 335, in build
       >     create_lib(out_filename, self.build_objects(build_dir))
       >   File "/nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/tools/system_libs.py", line 322, in build_objects
       >     run_build_commands(commands)
       >   File "/nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/tools/system_libs.py", line 77, in run_build_commands
       >     shared.run_multiple_processes(commands, env=clean_env())
       >   File "/nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/tools/shared.py", line 211, in run_multiple_processes
       >     raise Exception('Subprocess %d/%d failed (%s)! (cmdline: %s)' % (idx + 1, len(commands), returncode_to_str(finished_process.returncode), shlex_join(commands[idx])))
       > Exception: Subprocess 1/2 failed (returned 1)! (cmdline: /nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/bin/emcc -O2 -Werror -fno-unroll-loops -fno-builtin -g -flto=full -DNDEBUG -c /nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/system/lib/dlmalloc.c -o /nix/store/afv92n878xsw9w82and84ymq7g7p8rza-emscripten-3.1.12/share/emscripten/cache/build/libdlmalloc/dlmalloc.o)
       For full logs, run 'nix log /nix/store/djfkr1xy32hjj0vfh5flbz00h47v023r-emscripten-3.1.12.drv'.

@SuperSandro2000
Copy link
Member

If no one can help here marking it broken is fine @NixOS/darwin-maintainers

@rapenne-s
Copy link
Member

If no one can help here marking it broken is fine @NixOS/darwin-maintainers

If updating emscripten to a newer version prevent it to work on darwin-x86_64, maybe we should report the issue upstream and keep the current version?

Is there a rule written about how to handle this case for multiple architectures? Are there different tiers support (like tier1 = linux amd64, tier 2 = linux arm64, tier 3 = darwin) that would allow to merge a commit breaking a lower tier at the benefit of an upper tier.

When you start supporting many architectures and OS, it's normal to make concessions for less used systems in favor to the more mainstream one if we don't want to multiply packages versions to keep compatibility everywhere.

@prusnak
Copy link
Member

prusnak commented Jun 14, 2022

re there different tiers support (like tier1 = linux amd64, tier 2 = linux arm64, tier 3 = darwin) that would allow to merge a commit breaking a lower tier at the benefit of an upper tier.

Yes, these are defined https://github.com/NixOS/rfcs/blob/master/rfcs/0046-platform-support-tiers.md

@toonn
Copy link
Contributor

toonn commented Jun 14, 2022

Fwiw, this looks like something for upstream to at least investigate. They may be making assumptions based on Linux-specific behavior here.

@rapenne-s
Copy link
Member

re there different tiers support (like tier1 = linux amd64, tier 2 = linux arm64, tier 3 = darwin) that would allow to merge a commit breaking a lower tier at the benefit of an upper tier.

Yes, these are defined https://github.com/NixOS/rfcs/blob/master/rfcs/0046-platform-support-tiers.md

thanks! Given this document, we need to involve @NixOS/darwin-maintainers to know if the update can be merged or not.

@willcohen
Copy link
Contributor

Per emscripten-core/emscripten#10072, emscripten expects tip-of-tree llvm. I see that you bumped llvm to 14 -- is there any chance that this is a yet-unresolved llvm issue? It strikes me as generally unlikely, but at the moment I can't figure out why this error would be re-cropping up under llvm 14, and @gracicot's already followed up with all the obvious leads for similar issues.

@gracicot
Copy link
Contributor

@willcohen The only way I can get clang to have a std::max_align_t of 8 is when it's compiling for a 32 bit target. It makes sense as I think the target emscripten is using for web assembly is a 32 bit target (wasm32-unknown-unknown). Maybe the target argument is not sent correctly to the compiler?

@willcohen
Copy link
Contributor

If there's a pressing reason to get this merged, I suppose okay to break it on darwin for now (though I was finally getting the emscriptenPackages to build again on darwin as of a few weeks ago!). That said, if there's nothing pressing, it'd be great to get another week or two to work on this. I feel odd posing such an open-ended question upstream and suspect that we need to do some bisecting to figure out what broke this -- at least what point release and hopefully what commit -- but I will need probably at least another week to find the time to get into that in a little more detail.

@willcohen
Copy link
Contributor

willcohen commented Jun 15, 2022

Would it work to merge #172741 instead? Then at least we'd be up to 3.1.10 and can work on addressing the LLVM issues needed to get to 3.1.12 after that in this PR after rebasing?

@willcohen
Copy link
Contributor

willcohen commented Jun 15, 2022

@gracicot is your failing darwin build x86 or aarch64? If I turn off checks for binaryen on darwin, I can build this PR on x86:

$ nix-build $NIXPKGS -A emscripten                
/nix/store/bxbxhh88myrpz54ps4409ql00waw89in-emscripten-3.1.12

@gracicot
Copy link
Contributor

@willcohen I confirm I'm able to build it. I'm not sure what went wrong in my previous attempt.

@SuperSandro2000
Copy link
Member

Would it work to merge #172741 instead? Then at least we'd be up to 3.1.10 and can work on addressing the LLVM issues needed to get to 3.1.12 after that in this PR after rebasing?

merged

@willcohen
Copy link
Contributor

Thanks! Now that we've determined that this PR should be okay, looks like this'll just require a rebase to bump from 3.1.10 and include the other emscriptenStdenv fixes, etc!

@bobby285271 bobby285271 added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Jun 18, 2022
@SuperSandro2000 SuperSandro2000 added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jun 20, 2022
@willcohen willcohen mentioned this pull request Jun 22, 2022
13 tasks
@willcohen
Copy link
Contributor

I've rebased this and updated it to 3.1.13 with #178620. Note that 3.1.14 breaks due to #178620 (comment).

@SuperSandro2000
Copy link
Member

Closing in favor of the linked PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: python 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-linux: 11-100 12.approvals: 1 This PR was reviewed and approved by one reputable person
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants