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: 2.0.27 -> 3.0.0 #149083

Merged
merged 1 commit into from
Mar 28, 2022

Conversation

r-ryantm
Copy link
Contributor

@r-ryantm r-ryantm commented Dec 6, 2021

Automatic update generated by nixpkgs-update tools. This update was made based on information from https://github.com/emscripten-core/emscripten/releases.

meta.description for emscripten is: "An LLVM-to-JavaScript Compiler"

meta.homepage for emscripten is: "https://github.com/emscripten-core/emscripten"

meta.changelog for emscripten is: ""

Updates performed
  • Version update
To inspect upstream changes
Impact
Checks done (click to expand)
  • built on NixOS
  • The tests defined in passthru.tests, if any, passed
  • /nix/store/fqw2r8kj95rl9ppzs781c1hhbimkv1mm-emscripten-3.0.0/bin/emrun passed the binary check.
  • /nix/store/fqw2r8kj95rl9ppzs781c1hhbimkv1mm-emscripten-3.0.0/bin/emmake passed the binary check.
  • /nix/store/fqw2r8kj95rl9ppzs781c1hhbimkv1mm-emscripten-3.0.0/bin/emcmake passed the binary check.
  • /nix/store/fqw2r8kj95rl9ppzs781c1hhbimkv1mm-emscripten-3.0.0/bin/embuilder.py passed the binary check.
  • Warning: no invocation of /nix/store/fqw2r8kj95rl9ppzs781c1hhbimkv1mm-emscripten-3.0.0/bin/em-config had a zero exit code or showed the expected version
  • /nix/store/fqw2r8kj95rl9ppzs781c1hhbimkv1mm-emscripten-3.0.0/bin/emconfigure passed the binary check.
  • /nix/store/fqw2r8kj95rl9ppzs781c1hhbimkv1mm-emscripten-3.0.0/bin/emar passed the binary check.
  • /nix/store/fqw2r8kj95rl9ppzs781c1hhbimkv1mm-emscripten-3.0.0/bin/emranlib passed the binary check.
  • /nix/store/fqw2r8kj95rl9ppzs781c1hhbimkv1mm-emscripten-3.0.0/bin/emsize passed the binary check.
  • /nix/store/fqw2r8kj95rl9ppzs781c1hhbimkv1mm-emscripten-3.0.0/bin/emscons passed the binary check.
  • /nix/store/fqw2r8kj95rl9ppzs781c1hhbimkv1mm-emscripten-3.0.0/bin/em++ passed the binary check.
  • /nix/store/fqw2r8kj95rl9ppzs781c1hhbimkv1mm-emscripten-3.0.0/bin/emcc passed the binary check.
  • 7 of 12 passed binary check by having a zero exit code.
  • 9 of 12 passed binary check by having the new version present in output.
  • found 3.0.0 with grep in /nix/store/fqw2r8kj95rl9ppzs781c1hhbimkv1mm-emscripten-3.0.0
  • found 3.0.0 in filename of file in /nix/store/fqw2r8kj95rl9ppzs781c1hhbimkv1mm-emscripten-3.0.0

Rebuild report (if merged into master) (click to expand)
33 total rebuild path(s)

31 package rebuild(s)

31 x86_64-linux rebuild(s)
2 x86_64-darwin rebuild(s)


First fifty rebuilds by attrpath
docbookrx
emscripten
faust
faust2
faust2alqt
faust2alsa
faust2csound
faust2firefox
faust2jack
faust2jackrust
faust2jaqt
faust2ladspa
faust2lv2
faustPhysicalModeling
faustStk
faustlive
foo-yc20
kapitonov-plugins-pack
magnetophonDSP.CharacterCompressor
magnetophonDSP.CompBus
magnetophonDSP.ConstantDetuneChorus
magnetophonDSP.LazyLimiter
magnetophonDSP.MBdistortion
magnetophonDSP.RhythmDelay
magnetophonDSP.VoiceOfFaust
magnetophonDSP.faustCompressors
magnetophonDSP.pluginUtils
magnetophonDSP.shelfMultiBand
mooSpace
purePackages.faust
tambura
Instructions to test this update (click to expand)

Either download from Cachix:

nix-store -r /nix/store/fqw2r8kj95rl9ppzs781c1hhbimkv1mm-emscripten-3.0.0 \
  --option binary-caches 'https://cache.nixos.org/ https://nix-community.cachix.org/' \
  --option trusted-public-keys '
  nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
  cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
  '

(The Cachix cache is only trusted for this store-path realization.)
For the Cachix download to work, your user must be in the trusted-users list or you can use sudo since root is effectively trusted.

Or, build yourself:

nix-build -A emscripten https://github.com/r-ryantm/nixpkgs/archive/52b52c1abd9cd0e728fd357bae63c303c2f2049f.tar.gz

After you've downloaded or built it, look at the files and if there are any, run the binaries:

ls -la /nix/store/fqw2r8kj95rl9ppzs781c1hhbimkv1mm-emscripten-3.0.0
ls -la /nix/store/fqw2r8kj95rl9ppzs781c1hhbimkv1mm-emscripten-3.0.0/bin


Pre-merge build results

We have automatically built all packages that will get rebuilt due to
this change.

This gives evidence on whether the upgrade will break dependent packages.
Note sometimes packages show up as failed to build independent of the
change, simply because they are already broken on the target branch.

nixpkgs-review took longer than 45m and timed out


Maintainer pings

cc @qknight @matthewbauer for testing.

@applePrincess
Copy link
Contributor

Result of nixpkgs-review pr 149083 run on x86_64-linux 1

2 packages marked as broken and skipped:
  • foo-yc20
  • purePackages.faust
2 packages failed to build:
  • faustStk
  • magnetophonDSP.ConstantDetuneChorus
25 packages built:
  • emscripten
  • faust (faust2)
  • faust2alqt
  • faust2alsa
  • faust2csound
  • faust2firefox
  • faust2jack
  • faust2jackrust
  • faust2jaqt
  • faust2ladspa
  • faust2lv2
  • faustPhysicalModeling
  • faustlive
  • kapitonov-plugins-pack
  • magnetophonDSP.CharacterCompressor
  • magnetophonDSP.CompBus
  • magnetophonDSP.LazyLimiter
  • magnetophonDSP.MBdistortion
  • magnetophonDSP.RhythmDelay
  • magnetophonDSP.VoiceOfFaust
  • magnetophonDSP.faustCompressors
  • magnetophonDSP.pluginUtils
  • magnetophonDSP.shelfMultiBand
  • mooSpace
  • tambura

@applePrincess
Copy link
Contributor

faustStk and magnetophonDSP.ConstantDetuneChorus fails to build at https://hydra.nixos.org/eval/1745796. This PR is not the breakage.

@applePrincess applePrincess self-requested a review February 26, 2022 09:32
@applePrincess
Copy link
Contributor

applePrincess commented Feb 26, 2022

Seems like fails to build emscripten on aarch64-darwin. Can anyone check?

@willcohen
Copy link
Contributor

@matthewbauer does package.json need to be updated accordingly too?

@willcohen
Copy link
Contributor

@NixOS/darwin-maintainers can any aarch64 users test this out on their machines?

@damien-biasotto
Copy link

damien-biasotto commented Mar 20, 2022

@NixOS/darwin-maintainers can any aarch64 users test this out on their machines?

@willcohen I gave it a try but it fails to download JDK 17 (it looks like the URL is not correct (404)):

 nix-build -A emscripten                                                              [52b52c1abd9]
these 4 derivations will be built:
  /nix/store/3r6lws6wmxlz5a7m6fz7g1xq8y7rhyh0-zulu17.30.19-ca-jdk17.0.1-macosx_aarch64.tar.gz.drv
  /nix/store/329z1k156hiss99wgfaysmf04gr5w1cj-zulu17.30.19-ca-jdk-17.0.1.drv
  /nix/store/f5jz7323ddhcc4kzj5z7wmp8xm1wdxl3-closure-compiler-20210808.drv
  /nix/store/0m1wsd14jvrlkc42mmf87fkh65lnzghn-emscripten-3.0.0.drv
building '/nix/store/3r6lws6wmxlz5a7m6fz7g1xq8y7rhyh0-zulu17.30.19-ca-jdk17.0.1-macosx_aarch64.tar.gz.drv'...

trying https://cdn.azul.com/zulu/bin/zulu17.30.19-ca-jdk17.0.1-macosx_aarch64.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404
error: cannot download zulu17.30.19-ca-jdk17.0.1-macosx_aarch64.tar.gz from any mirror
error: builder for '/nix/store/3r6lws6wmxlz5a7m6fz7g1xq8y7rhyh0-zulu17.30.19-ca-jdk17.0.1-macosx_aarch64.tar.gz.drv' failed with exit code 1;
       last 7 log lines:
       >
       > trying https://cdn.azul.com/zulu/bin/zulu17.30.19-ca-jdk17.0.1-macosx_aarch64.tar.gz
       >   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
       >                                  Dload  Upload   Total   Spent    Left  Speed
       >   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
       > curl: (22) The requested URL returned error: 404
       > error: cannot download zulu17.30.19-ca-jdk17.0.1-macosx_aarch64.tar.gz from any mirror
       For full logs, run 'nix log /nix/store/3r6lws6wmxlz5a7m6fz7g1xq8y7rhyh0-zulu17.30.19-ca-jdk17.0.1-macosx_aarch64.tar.gz.drv'.
error: 1 dependencies of derivation '/nix/store/329z1k156hiss99wgfaysmf04gr5w1cj-zulu17.30.19-ca-jdk-17.0.1.drv' failed to build
error: 1 dependencies of derivation '/nix/store/0m1wsd14jvrlkc42mmf87fkh65lnzghn-emscripten-3.0.0.drv' failed to build

I checked the CDN from where it tries to get the JDK for aarch64-darwin and for the the 17.30 version there is either 17.30.15 or 17.30.51

@willcohen
Copy link
Contributor

Interesting -- if you rebase to master does it still fail?

Looks like this .15 and .19 mess got resolved with 78cad27.

@damien-biasotto
Copy link

damien-biasotto commented Mar 20, 2022 via email

@tricktron
Copy link
Member

tricktron commented Mar 20, 2022

@damien-biasotto After a rebase to master I could successfully build this on aarch64-darwin.

@damien-biasotto
Copy link

Yup, I can confirm it works fine after rebasing on master. Thank you @tricktron for checking it.

@willcohen
Copy link
Contributor

@SuperSandro2000 can this be merged?

@siraben
Copy link
Member

siraben commented Mar 27, 2022

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

4 packages failed to build:
  • emscriptenPackages.json_c
  • emscriptenPackages.libxml2
  • emscriptenPackages.xmlmirror
  • emscriptenPackages.zlib
1 package built:
  • emscripten

@willcohen
Copy link
Contributor

Thanks @siraben -- still need to diagnose.

@SuperSandro2000
Copy link
Member

This is a semi-automatic executed nixpkgs-review with nixpkgs-review-checks extension. It is checked by a human on a best effort basis and does not build all packages (e.g. lumo, tensorflow or pytorch).

Result of nixpkgs-review pr 149083 run on x86_64-linux 1

2 packages marked as broken and skipped:
  • foo-yc20
  • purePackages.faust
2 packages failed to build and already failed to build on hydra master:
25 packages built:
  • emscripten
  • faust (faust2)
  • faust2alqt
  • faust2alsa
  • faust2csound
  • faust2firefox
  • faust2jack
  • faust2jackrust
  • faust2jaqt
  • faust2ladspa
  • faust2lv2
  • faustPhysicalModeling
  • faustlive
  • kapitonov-plugins-pack
  • magnetophonDSP.CharacterCompressor
  • magnetophonDSP.CompBus
  • magnetophonDSP.LazyLimiter
  • magnetophonDSP.MBdistortion
  • magnetophonDSP.RhythmDelay
  • magnetophonDSP.VoiceOfFaust
  • magnetophonDSP.faustCompressors
  • magnetophonDSP.pluginUtils
  • magnetophonDSP.shelfMultiBand
  • mooSpace
  • tambura

@SuperSandro2000 SuperSandro2000 merged commit c81fe81 into NixOS:master Mar 28, 2022
@willcohen
Copy link
Contributor

Thanks @SuperSandro2000, though while emscripten alone is now working for me, I'm also noticing that this is triggering what @siraben noted above. Perhaps related to #139943 (@gebner -- perhaps not EXACTLY the same)

$ nix-env -f $NIXPKGS -iA emscriptenPackages.zlib  
installing 'emscripten-zlib-1.2.11'
this derivation will be built:
  /nix/store/cqrfxgw3wvs8sj5khr1cxk1hr4r126pc-emscripten-zlib-1.2.11.drv
building '/nix/store/cqrfxgw3wvs8sj5khr1cxk1hr4r126pc-emscripten-zlib-1.2.11.drv'...
unpacking sources
unpacking source archive /nix/store/rrzja19jbqxbfryp2zchb2ma5h041rxh-zlib-1.2.11.tar.gz
source root is zlib-1.2.11
setting SOURCE_DATE_EPOCH to timestamp 1484501380 of file zlib-1.2.11/zutil.c
patching sources
configuring
configure: ./configure --prefix=/nix/store/jajb19pry7y7k3yl09xp52pglx5qag34-emscripten-zlib-1.2.11 --shared
Checking for shared library support...
No shared library support; try without defining CC and CFLAGS
Building static library libz.a version 1.2.11 with /nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/bin/emcc.
Checking for size_t... Yes.
Checking for off64_t... Yes.
Checking for fseeko... Yes.
Checking for strerror... No.
Checking for unistd.h... Yes.
Checking for stdarg.h... Yes.
Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf().
Checking for vsnprintf() in stdio.h... No.
  WARNING: vsnprintf() not found, falling back to vsprintf(). zlib
  can build but will be open to possible buffer-overflow security
  vulnerabilities.
Checking for return value of vsprintf()... Yes.
Checking for attribute(visibility) support... Yes.
building
make: make
/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/bin/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN -I. -c -o example.o test/example.c
/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/bin/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN  -c -o adler32.o adler32.c
/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/bin/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN  -c -o crc32.o crc32.c
/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/bin/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN  -c -o deflate.o deflate.c
/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/bin/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN  -c -o infback.o infback.c
/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/bin/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN  -c -o inffast.o inffast.c
/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/bin/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN  -c -o inflate.o inflate.c
/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/bin/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN  -c -o inftrees.o inftrees.c
/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/bin/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN  -c -o trees.o trees.c
/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/bin/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN  -c -o zutil.o zutil.c
/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/bin/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN  -c -o compress.o compress.c
/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/bin/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN  -c -o uncompr.o uncompr.c
/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/bin/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN  -c -o gzclose.o gzclose.c
/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/bin/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN  -c -o gzlib.o gzlib.c
/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/bin/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN  -c -o gzread.o gzread.c
/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/bin/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN  -c -o gzwrite.o gzwrite.c
ar -r libz.a adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o 
ar: creating archive libz.a
/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/bin/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DNO_STRERROR -DNO_vsnprintf -DHAVE_HIDDEN -o example example.o -L. libz.a
cache:INFO: generating system library: sysroot/lib/wasm32-emscripten/libstubs.a... (this will be cached in "/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/share/emscripten/cache/sysroot/lib/wasm32-emscripten/libstubs.a" for subsequent builds)
Traceback (most recent call last):
  File "/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/share/emscripten/emcc.py", line 3863, in <module>
    sys.exit(main(sys.argv))
  File "/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/share/emscripten/emcc.py", line 3856, in main
    ret = run(args)
  File "/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/share/emscripten/emcc.py", line 1114, in run
    phase_calculate_system_libraries(state, linker_arguments, linker_inputs, newargs)
  File "/nix/store/3j4k5ja8zpr7v5xiyfgjwjb8qnl4iycv-python3-3.9.10/lib/python3.9/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/share/emscripten/emcc.py", line 2570, in phase_calculate_system_libraries
    extra_files_to_link += system_libs.calculate([f for _, f in sorted(linker_inputs)] + extra_files_to_link, forced=state.forced_stdlibs)
  File "/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/share/emscripten/tools/system_libs.py", line 1721, in calculate
    add_library('libstubs')
  File "/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/share/emscripten/tools/system_libs.py", line 1681, in add_library
    libs_to_link.append((lib.get_link_flag(), need_whole_archive))
  File "/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/share/emscripten/tools/system_libs.py", line 320, in get_link_flag
    fullpath = self.get_path()
  File "/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/share/emscripten/tools/system_libs.py", line 312, in get_path
    return shared.Cache.get_lib(self.get_filename(), self.build)
  File "/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/share/emscripten/tools/cache.py", line 139, in get_lib
    return self.get(name, *args, **kwargs)
  File "/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/share/emscripten/tools/cache.py", line 167, in get
    creator(cachename)
  File "/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/share/emscripten/tools/system_libs.py", line 391, in build
    utils.safe_ensure_dirs(build_dir)
  File "/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/share/emscripten/tools/utils.py", line 28, in safe_ensure_dirs
    os.makedirs(dirname, exist_ok=True)
  File "/nix/store/3j4k5ja8zpr7v5xiyfgjwjb8qnl4iycv-python3-3.9.10/lib/python3.9/os.py", line 225, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/share/emscripten/cache/build/libstubs'
make: *** [Makefile:289: example] Error 1
emmake: error: 'make' failed (returned 2)
error: builder for '/nix/store/cqrfxgw3wvs8sj5khr1cxk1hr4r126pc-emscripten-zlib-1.2.11.drv' failed with exit code 1;
       last 10 log lines:
       >     creator(cachename)
       >   File "/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/share/emscripten/tools/system_libs.py", line 391, in build
       >     utils.safe_ensure_dirs(build_dir)
       >   File "/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/share/emscripten/tools/utils.py", line 28, in safe_ensure_dirs
       >     os.makedirs(dirname, exist_ok=True)
       >   File "/nix/store/3j4k5ja8zpr7v5xiyfgjwjb8qnl4iycv-python3-3.9.10/lib/python3.9/os.py", line 225, in makedirs
       >     mkdir(name, mode)
       > PermissionError: [Errno 13] Permission denied: '/nix/store/6nfzi581f2bghw21n5jaba7xvh0zz6zx-emscripten-3.0.0/share/emscripten/cache/build/libstubs'
       > make: *** [Makefile:289: example] Error 1
       > emmake: error: 'make' failed (returned 2)
       For full logs, run 'nix log /nix/store/cqrfxgw3wvs8sj5khr1cxk1hr4r126pc-emscripten-zlib-1.2.11.drv'.

@willcohen
Copy link
Contributor

So far for testing purposes, I've tried commenting out the two lines at

# disables cache in user home, use installation directory instead
sed -i '/^def/!s/root_is_writable()/True/' tools/config.py
sed -i "/^def check_sanity/a\\ return" tools/shared.py
to reset emscripten to go back to at first using the home directory for caching, and then adding the following to
configurePhase = args.configurePhase or ''
# FIXME: Some tests require writing at $HOME
HOME=$TMPDIR
runHook preConfigure
emconfigure ./configure --prefix=$out
runHook postConfigure
'';
:

mkdir -p .emscriptencache
export EM_CACHE = $(pwd)/.emscriptencache

From here, the build proceeds much further, though doesn't quite complete:

$ nix-env -f $NIXPKGS -iA emscriptenPackages.zlib
...
/nix/store/9b5n7bz8mdnamzg2x4fiq35y4pgqvmdp-emscripten-3.0.0/bin/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/inflate.o inflate.c
/nix/store/9b5n7bz8mdnamzg2x4fiq35y4pgqvmdp-emscripten-3.0.0/bin/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/inftrees.o inftrees.c
/nix/store/9b5n7bz8mdnamzg2x4fiq35y4pgqvmdp-emscripten-3.0.0/bin/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/trees.o trees.c
/nix/store/9b5n7bz8mdnamzg2x4fiq35y4pgqvmdp-emscripten-3.0.0/bin/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/zutil.o zutil.c
/nix/store/9b5n7bz8mdnamzg2x4fiq35y4pgqvmdp-emscripten-3.0.0/bin/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/compress.o compress.c
/nix/store/9b5n7bz8mdnamzg2x4fiq35y4pgqvmdp-emscripten-3.0.0/bin/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/uncompr.o uncompr.c
/nix/store/9b5n7bz8mdnamzg2x4fiq35y4pgqvmdp-emscripten-3.0.0/bin/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/gzclose.o gzclose.c
/nix/store/9b5n7bz8mdnamzg2x4fiq35y4pgqvmdp-emscripten-3.0.0/bin/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/gzlib.o gzlib.c
/nix/store/9b5n7bz8mdnamzg2x4fiq35y4pgqvmdp-emscripten-3.0.0/bin/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/gzread.o gzread.c
/nix/store/9b5n7bz8mdnamzg2x4fiq35y4pgqvmdp-emscripten-3.0.0/bin/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/gzwrite.o gzwrite.c
/nix/store/9b5n7bz8mdnamzg2x4fiq35y4pgqvmdp-emscripten-3.0.0/bin/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -o libz.1.2.11.dylib adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo zutil.lo compress.lo uncompr.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo  -lc 
emcc: warning: generating an executable with an object extension (.dylib).  If you meant to build an object file please use `-c, `-r`, or `-shared` [-Wemcc]
rm -f libz.dylib libz.1.dylib
ln -s libz.1.2.11.dylib libz.dylib
ln -s libz.1.2.11.dylib libz.1.dylib
/nix/store/9b5n7bz8mdnamzg2x4fiq35y4pgqvmdp-emscripten-3.0.0/bin/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -o examplesh example.o -L. libz.1.2.11.dylib
emcc: warning: unrecognized file type: `libz.1.2.11.dylib`.  Mapping to `-lz.1.2.11` and hoping for the best [-Wmap-unrecognized-libraries]
wasm-ld: error: unknown file type: ./libz.1.2.11.dylib
emcc: error: '/nix/store/vwy1ijhzxzp8a7qg45b6sivqrjsa19ap-emscripten-llvm-3.0.0/bin/wasm-ld -o examplesh.wasm example.o -L. ./libz.1.2.11.dylib -L/private/tmp/nix-build-emscripten-zlib-1.2.11.drv-0/.emscripten_cache/sysroot/lib/wasm32-emscripten -lGL -lal -lhtml5 -lstubs -lc -lcompiler_rt -lc++-noexcept -lc++abi-noexcept -ldlmalloc -lc_rt -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --import-undefined --strip-debug --export-if-defined=main --export-if-defined=stackSave --export-if-defined=stackRestore --export-if-defined=stackAlloc --export-if-defined=__wasm_call_ctors --export-if-defined=__errno_location --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-table -z stack-size=5242880 --initial-memory=16777216 --no-entry --max-memory=16777216 --global-base=1024' failed (returned 1)
make: *** [Makefile:295: examplesh] Error 1
emmake: error: 'make' failed (returned 2)
error: builder for '/nix/store/pk4dhvmf5lx2b5fj2y4f235gd3p8gxrb-emscripten-zlib-1.2.11.drv' failed with exit code 1;
       last 10 log lines:
       > emcc: warning: generating an executable with an object extension (.dylib).  If you meant to build an object file please use `-c, `-r`, or `-shared` [-Wemcc]
       > rm -f libz.dylib libz.1.dylib
       > ln -s libz.1.2.11.dylib libz.dylib
       > ln -s libz.1.2.11.dylib libz.1.dylib
       > /nix/store/9b5n7bz8mdnamzg2x4fiq35y4pgqvmdp-emscripten-3.0.0/bin/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -o examplesh example.o -L. libz.1.2.11.dylib
       > emcc: warning: unrecognized file type: `libz.1.2.11.dylib`.  Mapping to `-lz.1.2.11` and hoping for the best [-Wmap-unrecognized-libraries]
       > wasm-ld: error: unknown file type: ./libz.1.2.11.dylib
       > emcc: error: '/nix/store/vwy1ijhzxzp8a7qg45b6sivqrjsa19ap-emscripten-llvm-3.0.0/bin/wasm-ld -o examplesh.wasm example.o -L. ./libz.1.2.11.dylib -L/private/tmp/nix-build-emscripten-zlib-1.2.11.drv-0/.emscripten_cache/sysroot/lib/wasm32-emscripten -lGL -lal -lhtml5 -lstubs -lc -lcompiler_rt -lc++-noexcept -lc++abi-noexcept -ldlmalloc -lc_rt -lsockets -mllvm -combiner-global-alias-analysis=false -mllvm -enable-emscripten-sjlj -mllvm -disable-lsr --import-undefined --strip-debug --export-if-defined=main --export-if-defined=stackSave --export-if-defined=stackRestore --export-if-defined=stackAlloc --export-if-defined=__wasm_call_ctors --export-if-defined=__errno_location --export-if-defined=__start_em_asm --export-if-defined=__stop_em_asm --export-table -z stack-size=5242880 --initial-memory=16777216 --no-entry --max-memory=16777216 --global-base=1024' failed (returned 1)
       > make: *** [Makefile:295: examplesh] Error 1
       > emmake: error: 'make' failed (returned 2)
       For full logs, run 'nix log /nix/store/pk4dhvmf5lx2b5fj2y4f235gd3p8gxrb-emscripten-zlib-1.2.11.drv'.

@willcohen
Copy link
Contributor

willcohen commented Mar 28, 2022

As a followup, those changes seem to work okay on linux:

...
/nix/store/4imy9v4ldbfv21xyzxv68ydar7m844vk-emscripten-3.0.0/bin/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/gzread.o gzread.c
/nix/store/4imy9v4ldbfv21xyzxv68ydar7m844vk-emscripten-3.0.0/bin/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN  -DPIC -c -o objs/gzwrite.o gzwrite.c
/nix/store/4imy9v4ldbfv21xyzxv68ydar7m844vk-emscripten-3.0.0/bin/emcc -O3 -fPIC -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -o libz.so.1.2.11 adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo zutil.lo compress.lo uncompr.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo  -lc 
emcc: warning: generating an executable with an object extension (.so).  If you meant to build an object file please use `-c, `-r`, or `-shared` [-Wemcc]
rm -f libz.so libz.so.1
ln -s libz.so.1.2.11 libz.so
ln -s libz.so.1.2.11 libz.so.1
/nix/store/4imy9v4ldbfv21xyzxv68ydar7m844vk-emscripten-3.0.0/bin/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -o examplesh example.o -L. libz.so.1.2.11
emcc: warning: unrecognized file type: `libz.so.1.2.11`.  Mapping to `-lz` and hoping for the best [-Wmap-unrecognized-libraries]
/nix/store/4imy9v4ldbfv21xyzxv68ydar7m844vk-emscripten-3.0.0/bin/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -o minigzipsh minigzip.o -L. libz.so.1.2.11
emcc: warning: unrecognized file type: `libz.so.1.2.11`.  Mapping to `-lz` and hoping for the best [-Wmap-unrecognized-libraries]
/nix/store/4imy9v4ldbfv21xyzxv68ydar7m844vk-emscripten-3.0.0/bin/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -I. -D_FILE_OFFSET_BITS=64 -c -o example64.o test/example.c
/nix/store/4imy9v4ldbfv21xyzxv68ydar7m844vk-emscripten-3.0.0/bin/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -o example64 example64.o -L. libz.a
/nix/store/4imy9v4ldbfv21xyzxv68ydar7m844vk-emscripten-3.0.0/bin/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -I. -D_FILE_OFFSET_BITS=64 -c -o minigzip64.o test/minigzip.c
/nix/store/4imy9v4ldbfv21xyzxv68ydar7m844vk-emscripten-3.0.0/bin/emcc -O3 -D_LARGEFILE64_SOURCE=1 -DHAVE_HIDDEN -o minigzip64 minigzip64.o -L. libz.a
running tests
================= testing zlib using node =================
Compiling a custom test
++ emcc -O2 -s EMULATE_FUNCTION_POINTER_CASTS=1 test/example.c -DZ_SOLO -L. libz.so.1.2.11 -I . -o example.js
emcc: warning: unrecognized file type: `libz.so.1.2.11`.  Mapping to `-lz` and hoping for the best [-Wmap-unrecognized-libraries]
++ echo 'Using node to execute the test'
Using node to execute the test
++ /nix/store/46g0dmf6rcpikbzs22y7w4amyg0ciksi-nodejs-16.14.2/bin/node ./example.js
zlib version 1.2.11 = 0x12b0, compile flags = 0x95
inflate(): hello, hello!
large_inflate(): OK
after inflateSync(): hello, hello!
inflate with dictionary: hello, hello!
++ set +x
it seems to work! very good.
================= /testing zlib using node =================
installing
make: make install
rm -f /nix/store/d2svlvzxgps9lzvpahv9k4x8mwjvfcny-emscripten-zlib-1.2.11/lib/libz.a
cp libz.a /nix/store/d2svlvzxgps9lzvpahv9k4x8mwjvfcny-emscripten-zlib-1.2.11/lib
chmod 644 /nix/store/d2svlvzxgps9lzvpahv9k4x8mwjvfcny-emscripten-zlib-1.2.11/lib/libz.a
cp libz.so.1.2.11 /nix/store/d2svlvzxgps9lzvpahv9k4x8mwjvfcny-emscripten-zlib-1.2.11/lib
chmod 755 /nix/store/d2svlvzxgps9lzvpahv9k4x8mwjvfcny-emscripten-zlib-1.2.11/lib/libz.so.1.2.11
rm -f /nix/store/d2svlvzxgps9lzvpahv9k4x8mwjvfcny-emscripten-zlib-1.2.11/share/man/man3/zlib.3
cp zlib.3 /nix/store/d2svlvzxgps9lzvpahv9k4x8mwjvfcny-emscripten-zlib-1.2.11/share/man/man3
chmod 644 /nix/store/d2svlvzxgps9lzvpahv9k4x8mwjvfcny-emscripten-zlib-1.2.11/share/man/man3/zlib.3
rm -f /nix/store/d2svlvzxgps9lzvpahv9k4x8mwjvfcny-emscripten-zlib-1.2.11/lib/pkgconfig/zlib.pc
cp zlib.pc /nix/store/d2svlvzxgps9lzvpahv9k4x8mwjvfcny-emscripten-zlib-1.2.11/lib/pkgconfig
chmod 644 /nix/store/d2svlvzxgps9lzvpahv9k4x8mwjvfcny-emscripten-zlib-1.2.11/lib/pkgconfig/zlib.pc
rm -f /nix/store/d2svlvzxgps9lzvpahv9k4x8mwjvfcny-emscripten-zlib-1.2.11/include/zlib.h /nix/store/d2svlvzxgps9lzvpahv9k4x8mwjvfcny-emscripten-zlib-1.2.11/include/zconf.h
cp zlib.h zconf.h /nix/store/d2svlvzxgps9lzvpahv9k4x8mwjvfcny-emscripten-zlib-1.2.11/include
chmod 644 /nix/store/d2svlvzxgps9lzvpahv9k4x8mwjvfcny-emscripten-zlib-1.2.11/include/zlib.h /nix/store/d2svlvzxgps9lzvpahv9k4x8mwjvfcny-emscripten-zlib-1.2.11/include/zconf.h
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/d2svlvzxgps9lzvpahv9k4x8mwjvfcny-emscripten-zlib-1.2.11
gzipping man pages under /nix/store/d2svlvzxgps9lzvpahv9k4x8mwjvfcny-emscripten-zlib-1.2.11/share/man/
patching script interpreter paths in /nix/store/d2svlvzxgps9lzvpahv9k4x8mwjvfcny-emscripten-zlib-1.2.11
checking for references to /build/ in /nix/store/d2svlvzxgps9lzvpahv9k4x8mwjvfcny-emscripten-zlib-1.2.11...
building '/nix/store/4rkz6icd7xjk63f9556j8i0xzhywr7n4-user-environment.drv'...

@r-ryantm r-ryantm deleted the auto-update/emscripten branch March 29, 2022 00:03
@willcohen
Copy link
Contributor

Note that #172207 seems to address the issues left unresolved here post-merge -- in this case the remaining errors I saw with zlib were addressed by just changing the derivation to look for libz.a instead of libz.so.$VERSION.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants