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.1.64 -> 3.1.73 #343743

Merged
merged 2 commits into from
Nov 30, 2024
Merged

Conversation

willcohen
Copy link
Contributor

Description of changes

Supersedes #340130, embedding that commit as a pre-requisite.

To avoid breakage noted there, also bumps emscripten to latest release.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • 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/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 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
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@willcohen willcohen mentioned this pull request Sep 22, 2024
13 tasks
@ofborg ofborg bot requested review from matthewbauer, asppsa and qknight September 22, 2024 17:22
@ofborg ofborg bot added 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 11-100 10.rebuild-linux: 11-100 labels Sep 22, 2024
@uncenter
Copy link
Member

uncenter commented Oct 15, 2024

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 343743


aarch64-darwin

⏩ 5 packages marked as broken and skipped:
  • faust2alqt
  • faust2alsa
  • faust2jack
  • faust2jaqt
  • faust2sc
❌ 4 packages failed to build:
  • python311Packages.rerun-sdk
  • python311Packages.rerun-sdk.dist
  • python312Packages.rerun-sdk
  • python312Packages.rerun-sdk.dist
✅ 16 packages built:
  • binaryen
  • emscripten
  • faust (faust2)
  • faust2csound
  • faust2firefox
  • faust2jackrust
  • faust2ladspa
  • faust2lv2
  • pagefind
  • rerun
  • teleport (teleport_16)
  • teleport.client (teleport_16.client)
  • teleport_15
  • tel
  • tinygo
  • vlang

Those 4 are failing with the following:

=================================== FAILURES ===================================
___________________________ test_multiprocessing_gc ____________________________

    def test_multiprocessing_gc() -> None:
        rr.init("rerun_example_multiprocessing_gc")

        proc = multiprocessing.Process(
            target=task,
        )
        proc.start()
        proc.join(5)
        if proc.is_alive():
            # Terminate so our test doesn't get stuck
            proc.terminate()
>           assert False, "Process deadlocked during gc.collect()"
E           AssertionError: Process deadlocked during gc.collect()
E           assert False

rerun_py/tests/unit/test_multiprocessing_gc.py:34: AssertionError
=========================== short test summary info ============================
FAILED rerun_py/tests/unit/test_multiprocessing_gc.py::test_multiprocessing_gc - AssertionError: Process deadlocked during gc.collect()

@uncenter
Copy link
Member

Ooh actually I ran it again and no problems this time. Seems to have been a one-off thing.

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 343743


aarch64-darwin

⏩ 5 packages marked as broken and skipped:
  • faust2alqt
  • faust2alsa
  • faust2jack
  • faust2jaqt
  • faust2sc
✅ 20 packages built:
  • binaryen
  • emscripten
  • faust (faust2)
  • faust2csound
  • faust2firefox
  • faust2jackrust
  • faust2ladspa
  • faust2lv2
  • pagefind
  • python311Packages.rerun-sdk
  • python311Packages.rerun-sdk.dist
  • pyt
  • python312Packages.rerun-sdk.dist
  • rerun
  • teleport (teleport_16)
  • teleport.client (teleport_16.client)
  • teleport_15
  • teleport_15.client
  • tinygo
  • vlang

@uncenter uncenter added the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Oct 15, 2024
@kirillrdy
Copy link
Member

i get same build failure on x86_64-linux as ofborg

@wirew0rm
Copy link
Contributor

wirew0rm commented Oct 19, 2024

I'm also very interested in this, since the emscripten toolchain currently in nixpkgs has a version mismatch between emscripten and binaryen that i'm always running into (see here: emscripten-core/emscripten#22249 (comment)). To be able to work I've locally bumped just binaryen and just disabled the the tests, which allowed me to keep working, but I'm looking forward to this being properly fixed, so I did some digging.

I found the cause of this problem, which is that here binaryen added some test files as a git submodule, and since we clone the source without submodules, some parts of the testsuite are missing.

I've changed the configure phase to symlink the testsuite into test/spec/testsuite and got everything working, not sure if there is a more elegant way, it feels a bit clunky. Another way would be to git clone recursively, but that would also pull things like googletest.

With the changed binaryen derivation below I can build binaryen and emscripten without issue on x86_64-linux. I did not yet try to actually use the resulting toolchain.

{ lib, stdenv, cmake, python3, fetchFromGitHub, emscripten,
  gtest, lit, nodejs, filecheck
}:
let
  testsuite = fetchFromGitHub {
    owner = "WebAssembly";
    repo = "testsuite";
    rev = "e05365077e13a1d86ffe77acfb1a835b7aa78422";
    hash = "sha256-yvZ5AZTPUA6nsD3xpFC0VLthiu2CxVto66RTXBXXeJM=";
  };
in
  stdenv.mkDerivation rec {
    pname = "binaryen";
    version = "119";

    src = fetchFromGitHub {
      owner = "WebAssembly";
      repo = "binaryen";
      rev = "version_${version}";
      hash = "sha256-JYXtN3CW4qm/nnjGRvv3GxQ0x9O9wHtNYQLqHIYTTOA=";
    };

    nativeBuildInputs = [ cmake python3 ];

    preConfigure = ''
      if [ $doCheck -eq 1 ]; then
        sed -i '/googletest/d' third_party/CMakeLists.txt
        rmdir test/spec/testsuite
        ln -s ${testsuite} test/spec/testsuite
      else
        cmakeFlagsArray=($cmakeFlagsArray -DBUILD_TESTS=0)
      fi
    '';

    nativeCheckInputs = [ gtest lit nodejs filecheck ];
    checkPhase = ''
      LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/lib python3 ../check.py $tests
    '';

    tests = [
      "version" "wasm-opt" "wasm-dis"
      "crash" "dylink" "ctor-eval"
      "wasm-metadce" "wasm-reduce" "spec"
      "lld" "wasm2js" "validator"
      "example" "unit"
      # "binaryenjs" "binaryenjs_wasm" # not building this
      "lit" "gtest"
    ];
    doCheck = stdenv.isLinux;

    meta = with lib; {
      homepage = "https://github.com/WebAssembly/binaryen";
      description = "Compiler infrastructure and toolchain library for WebAssembly, in C++";
      platforms = platforms.all;
      maintainers = with maintainers; [ asppsa willcohen ];
      license = licenses.asl20;
    };
    passthru.tests = {
      inherit emscripten;
    };
  }

@uncenter
Copy link
Member

I'm also very interested in this, since the emscripten toolchain currently in nixpkgs has a version mismatch between emscripten and binaryen that i'm always running into (see here: emscripten-core/emscripten#22249 (comment)). To be able to work I've locally bumped just binaryen and just disabled the the tests, which allowed me to keep working, but I'm looking forward to this being properly fixed, so I did some digging.

Same here! Happy to test whatever on darwin to get this through :)

@uncenter
Copy link
Member

@wirew0rm would you like to maybe add those changes into a new PR instead of this? Looks like OP hasn't been actively recently, really hoping we can get this through.

@willcohen
Copy link
Contributor Author

I am VERY sorry that I missed that you found the fixes. I can incorporate this weekend if that works!

@willcohen
Copy link
Contributor Author

Rebased and testing locally on darwin now. If it builds I'll see if we can bump past .67 without bigger LLVM changes, which can wait for a later PR.

@willcohen willcohen changed the title emscripten: 3.1.64 -> 3.1.67 emscripten: 3.1.64 -> 3.1.72 Nov 23, 2024
@willcohen
Copy link
Contributor Author

Looks good locally. If we're green across the board on ofborg we might be good to go!

@willcohen willcohen requested a review from uncenter November 23, 2024 14:21
@fabianhjr
Copy link
Member

and since we clone the source without submodules

That is configurable via fetchSubmodules option; doing rg fetchSubmodules -C 10 shows several examples on nixpkgs.

@willcohen willcohen force-pushed the emscripten-3.1.67 branch 3 times, most recently from 8d45a95 to 409ecf6 Compare November 23, 2024 19:40
@fabianhjr
Copy link
Member

fabianhjr commented Nov 23, 2024

Running nixpkgs-review on this PR on x86_64-linux NixOS

@willcohen
Copy link
Contributor Author

If the nixpkgs-review is clean on Linux and ofborg comes back green I’ll merge, thanks!

@fabianhjr
Copy link
Member

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 343743


x86_64-linux

⏩ 1 package marked as broken and skipped:
  • magnetophonDSP.ConstantDetuneChorus
❌ 53 packages failed to build:
  • binaryen
  • emscripten
  • emscriptenPackages.json_c
  • emscriptenPackages.json_c.dev
  • emscriptenPackages.libxml2
  • emscriptenPackages.libxml2.bin
  • emscriptenPackages.libxml2.dev
  • emscriptenPackages.libxml2.devdoc
  • emscriptenPackages.xmlmirror
  • emscriptenPackages.xmlmirror.doc
  • emscriptenPackages.zlib
  • faust
  • faust2alqt
  • faust2alsa
  • faust2csound
  • faust2firefox
  • faust2jack
  • faust2jackrust
  • faust2jaqt
  • faust2ladspa
  • faust2lv2
  • faust2sc
  • faustPhysicalModeling
  • faustlive
  • guitarix
  • kapitonov-plugins-pack
  • lldap
  • magnetophonDSP.CharacterCompressor
  • magnetophonDSP.CompBus
  • magnetophonDSP.LazyLimiter
  • magnetophonDSP.MBdistortion
  • magnetophonDSP.RhythmDelay
  • magnetophonDSP.VoiceOfFaust
  • magnetophonDSP.faustCompressors
  • magnetophonDSP.pluginUtils
  • magnetophonDSP.shelfMultiBand
  • mooSpace
  • open-music-kontrollers.mephisto
  • pagefind
  • python311Packages.rerun-sdk
  • python311Packages.rerun-sdk.dist
  • python312Packages.rerun-sdk
  • python312Packages.rerun-sdk.dist
  • rerun
  • tambura
  • teleport (teleport_16)
  • teleport.client (teleport_16.client)
  • teleport_15
  • teleport_15.client
  • tetrio-plus
  • tinygo
  • tpsecore
  • vlang

@fabianhjr
Copy link
Member

fabianhjr commented Nov 23, 2024

Log of binaryen build failure.

binaryen.log

[ 97%] �[32m�[1mLinking CXX executable ../../bin/binaryen-unittests�[0m
/nix/store/va7kw1i822h95im4jacci19v0cqajfyf-binutils-2.43.1/bin/ld: CMakeFiles/binaryen-unittests.dir/binary-reader.cpp.o: in function `_GLOBAL__sub_I_binary_reader.cpp':
binary-reader.cpp:(.text.startup+0x152): undefined reference to `testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, testing::internal::CodeLocation, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)'
/nix/store/va7kw1i822h95im4jacci19v0cqajfyf-binutils-2.43.1/bin/ld: CMakeFiles/binaryen-unittests.dir/cfg.cpp.o: in function `__static_initialization_and_destruction_0()':
cfg.cpp:(.text.startup+0x25e): undefined reference to `testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, testing::internal::CodeLocation, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)'
/nix/store/va7kw1i822h95im4jacci19v0cqajfyf-binutils-2.43.1/bin/ld: cfg.cpp:(.text.startup+0x31b): undefined reference to `testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, testing::internal::CodeLocation, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)'
/nix/store/va7kw1i822h95im4jacci19v0cqajfyf-binutils-2.43.1/bin/ld: cfg.cpp:(.text.startup+0x3d8): undefined reference to `testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, testing::internal::CodeLocation, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)'
/nix/store/va7kw1i822h95im4jacci19v0cqajfyf-binutils-2.43.1/bin/ld: cfg.cpp:(.text.startup+0x495): undefined reference to `testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, testing::internal::CodeLocation, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)'
/nix/store/va7kw1i822h95im4jacci19v0cqajfyf-binutils-2.43.1/bin/ld: CMakeFiles/binaryen-unittests.dir/cfg.cpp.o:cfg.cpp:(.text.startup+0x552): more undefined references to `testing::internal::MakeAndRegisterTestInfo(char const*, char const*, char const*, char const*, testing::internal::CodeLocation, void const*, void (*)(), void (*)(), testing::internal::TestFactoryBase*)' follow
collect2: error: ld returned 1 exit status
make[2]: *** [test/gtest/CMakeFiles/binaryen-unittests.dir/build.make:322: bin/binaryen-unittests] Error 1
make[1]: *** [CMakeFiles/Makefile2:1003: test/gtest/CMakeFiles/binaryen-unittests.dir/all] Error 2

@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one reputable person label Nov 24, 2024
@willcohen willcohen marked this pull request as draft November 29, 2024 15:58
@willcohen willcohen marked this pull request as ready for review November 29, 2024 16:01
@willcohen willcohen changed the title emscripten: 3.1.64 -> 3.1.72 emscripten: 3.1.64 -> 3.1.73 Nov 29, 2024
@willcohen
Copy link
Contributor Author

Re-factored again to apply the method from @wirew0rm. If ofborg is green with x86-linux, this may be solved. @fabianhjr if you're able to run nixpkgs-review to confirm, that would be helpful as well!

@willcohen willcohen requested a review from fabianhjr November 29, 2024 16:04
@fabianhjr
Copy link
Member

Running nixpkgs-review 🙌

@fabianhjr
Copy link
Member

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 343743


x86_64-linux

⏩ 1 package marked as broken and skipped:
  • magnetophonDSP.ConstantDetuneChorus
❌ 6 packages failed to build:
  • emscriptenPackages.libxml2
  • emscriptenPackages.libxml2.bin
  • emscriptenPackages.libxml2.dev
  • emscriptenPackages.libxml2.devdoc
  • emscriptenPackages.xmlmirror
  • emscriptenPackages.xmlmirror.doc
✅ 47 packages built:
  • binaryen
  • emscripten
  • emscriptenPackages.json_c
  • emscriptenPackages.json_c.dev
  • emscriptenPackages.zlib
  • faust
  • faust2alqt
  • faust2alsa
  • faust2csound
  • faust2firefox
  • faust2jack
  • faust2jackrust
  • faust2jaqt
  • faust2ladspa
  • faust2lv2
  • faust2sc
  • faustPhysicalModeling
  • faustlive
  • guitarix
  • kapitonov-plugins-pack
  • lldap
  • magnetophonDSP.CharacterCompressor
  • magnetophonDSP.CompBus
  • magnetophonDSP.LazyLimiter
  • magnetophonDSP.MBdistortion
  • magnetophonDSP.RhythmDelay
  • magnetophonDSP.VoiceOfFaust
  • magnetophonDSP.faustCompressors
  • magnetophonDSP.pluginUtils
  • magnetophonDSP.shelfMultiBand
  • mooSpace
  • open-music-kontrollers.mephisto
  • pagefind
  • python311Packages.rerun-sdk
  • python311Packages.rerun-sdk.dist
  • python312Packages.rerun-sdk
  • python312Packages.rerun-sdk.dist
  • rerun
  • tambura
  • teleport (teleport_16)
  • teleport.client (teleport_16.client)
  • teleport_15
  • teleport_15.client
  • tetrio-plus
  • tinygo
  • tpsecore
  • vlang

@willcohen
Copy link
Contributor Author

Thank you! I’ll wait for ofborg to pass and merge from there.

@uncenter
Copy link
Member

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 343743


aarch64-darwin

❌ 12 packages failed to build:
  • emscriptenPackages.libxml2
  • emscriptenPackages.libxml2.bin
  • emscriptenPackages.libxml2.dev
  • emscriptenPackages.libxml2.devdoc
  • emscriptenPackages.xmlmirror
  • emscriptenPackages.xmlmirror.doc
  • faust
  • faust2csound
  • faust2firefox
  • faust2jackrust
  • faust2ladspa
  • faust2lv2
✅ 17 packages built:
  • binaryen
  • emscripten
  • emscriptenPackages.json_c
  • emscriptenPackages.json_c.dev
  • emscriptenPackages.zlib
  • pagefind
  • python311Packages.rerun-sdk
  • python311Packages.rerun-sdk.dist
  • python312Packages.rerun-sdk
  • python312Packages.rerun-sdk.dist
  • rerun
  • teleport (teleport_16)
  • teleport.client (teleport_16.client)
  • teleport_15
  • teleport_15.client
  • tinygo
  • vlang

@willcohen
Copy link
Contributor Author

Thanks @uncenter. Since that’s the last hanging ofborg build I think this is good to go.

@willcohen willcohen merged commit 337b082 into NixOS:master Nov 30, 2024
40 of 41 checks passed
@willcohen willcohen deleted the emscripten-3.1.67 branch November 30, 2024 22:36
@willcohen willcohen mentioned this pull request Dec 4, 2024
13 tasks
@willcohen
Copy link
Contributor Author

Just as a quick note here, 3.1.74 will require https://github.com/llvm/llvm-project/commit/c3536b263f253a69fb336fb0617ee33a01a5c5dd.patch to either be backported to LLVM 19, or will need to wait to depend the LLVM 20 release. Now that emscripten's working again, I don't think this smaller version bump is totally critical. Additionally, the release after this will be emscripten 4.0, so I'm inclined to focus my effort on working on that in the new year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 11-100 10.rebuild-linux: 11-100 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants