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

mozjs_sys compilation failures after #31829 #31851

Closed
Loirooriol opened this issue Mar 25, 2024 · 8 comments
Closed

mozjs_sys compilation failures after #31829 #31851

Loirooriol opened this issue Mar 25, 2024 · 8 comments
Labels
A-build Related to or part of the build process

Comments

@Loirooriol
Copy link
Contributor

I can't build mozjs_sys after #31829. I'm on Ubuntu 22.04.4

https://gist.github.com/Loirooriol/3d01a2edcf4a24202a09a4bd04125f2a

@Loirooriol Loirooriol added the A-build Related to or part of the build process label Mar 25, 2024
@mukilan
Copy link
Member

mukilan commented Mar 25, 2024

I see .mozbuild in the logs. Is this the usual configuration that you use for servo builds?

  In file included from /home/oriol/src/.mozbuild/sysroot-x86_64-linux-gnu/usr/lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/cmath:45:
  In file included from /home/oriol/src/.mozbuild/sysroot-x86_64-linux-gnu/usr/include/math.h:45:

@Loirooriol
Copy link
Contributor Author

Oh, I guess that's from Firefox. I have moved it

$ ./mach build -r
   Compiling mozjs_sys v0.115.9-0 (https://github.com/servo/mozjs#b695c63b)
   Compiling servoshell v0.0.1 (/home/oriol/src/servo/ports/servoshell)
error: failed to run custom build command for `mozjs_sys v0.115.9-0 (https://github.com/servo/mozjs#b695c63b)`

Caused by:
  process didn't exit successfully: `/home/oriol/src/servo/target/release/build/mozjs_sys-6efcbef4d879745b/build-script-build` (exit status: 101)
  --- stdout
  cargo:outdir=/home/oriol/src/servo/target/release/build/mozjs_sys-670a39cd7069e792/out/build
  [[ '/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs'/js/src/configure -ot '/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs'/js/src/configure.in ]] && touch '/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs'/js/src/configure || true
  [[ '/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs'/js/src/old-configure -ot '/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs'/js/src/old-configure.in ]] && touch '/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs'/js/src/old-configure || true
  ! [[ '/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs'/js/src/configure.in -ot '/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs'/js/src/configure ]] && touch '/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs'/js/src/configure || true
  ! [[ '/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs'/js/src/old-configure.in -ot '/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs'/js/src/old-configure ]] && touch '/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs'/js/src/old-configure || true
  if [[ '/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs'/js/src/configure -nt config.status ]] ; then \
    CC="clang" CFLAGS="" \
    CPP="cc -E" CPPFLAGS="-I/home/oriol/.cargo/registry/src/index.crates.io-6f17d22bba15001f/encoding_c_mem-0.2.6/include -I/usr/include " \
    CXX="clang++" CXXFLAGS="" \
    AS="" AR="ar" \
    '/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs'/js/src/configure --disable-jemalloc --disable-js-shell --disable-tests --disable-export-js --disable-shared-js --build-backends=RecursiveMake --enable-js-streams || (cat config.log && exit 1) ; \
  fi
  make -f Makefile
  make[1]: Entering directory '/home/oriol/src/servo/target/release/build/mozjs_sys-670a39cd7069e792/out/build'
  make[2]: Entering directory '/home/oriol/src/servo/target/release/build/mozjs_sys-670a39cd7069e792/out/build'
  make recurse_pre-export
  make[3]: Entering directory '/home/oriol/src/servo/target/release/build/mozjs_sys-670a39cd7069e792/out/build'
  /home/oriol/src/servo/target/release/build/mozjs_sys-670a39cd7069e792/out/build/_virtualenvs/build/bin/python -m mozbuild.action.process_install_manifest --track install_dist_include.track dist/include _build_manifests/install/dist_include
  /home/oriol/src/servo/target/release/build/mozjs_sys-670a39cd7069e792/out/build/_virtualenvs/build/bin/python -m mozbuild.action.process_install_manifest --track install_dist_public.track dist/public _build_manifests/install/dist_public
  /home/oriol/src/servo/target/release/build/mozjs_sys-670a39cd7069e792/out/build/_virtualenvs/build/bin/python -m mozbuild.action.process_install_manifest --track install_dist_private.track dist/private _build_manifests/install/dist_private
  /home/oriol/src/servo/target/release/build/mozjs_sys-670a39cd7069e792/out/build/_virtualenvs/build/bin/python -m mozbuild.action.process_install_manifest --track install__tests.track _tests _build_manifests/install/_tests
  /home/oriol/src/servo/target/release/build/mozjs_sys-670a39cd7069e792/out/build/_virtualenvs/build/bin/python -m mozbuild.action.process_install_manifest --track install_dist_bin.track dist/bin _build_manifests/install/dist_bin
  Elapsed: 0.00s; From dist/bin: Kept 1 existing; Added/updated 0; Removed 0 files and 0 directories.
  BUILDTASK {"argv": ["/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs/python/mozbuild/mozbuild/action/process_install_manifest.py", "--track", "install_dist_bin.track", "dist/bin", "_build_manifests/install/dist_bin"], "start": 5569371.472711076, "end": 5569371.475486678, "context": null}
  Elapsed: 0.00s; From dist/public: Kept 0 existing; Added/updated 0; Removed 0 files and 0 directories.
  BUILDTASK {"argv": ["/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs/python/mozbuild/mozbuild/action/process_install_manifest.py", "--track", "install_dist_public.track", "dist/public", "_build_manifests/install/dist_public"], "start": 5569371.485808638, "end": 5569371.487796037, "context": null}
  Elapsed: 0.00s; From dist/private: Kept 0 existing; Added/updated 0; Removed 0 files and 0 directories.
  BUILDTASK {"argv": ["/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs/python/mozbuild/mozbuild/action/process_install_manifest.py", "--track", "install_dist_private.track", "dist/private", "_build_manifests/install/dist_private"], "start": 5569371.486558359, "end": 5569371.488425453, "context": null}
  Elapsed: 0.03s; From dist/include: Kept 544 existing; Added/updated 0; Removed 0 files and 0 directories.
  BUILDTASK {"argv": ["/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs/python/mozbuild/mozbuild/action/process_install_manifest.py", "--track", "install_dist_include.track", "dist/include", "_build_manifests/install/dist_include"], "start": 5569371.486251659, "end": 5569371.517485326, "context": null}
  Elapsed: 0.06s; From _tests: Kept 467 existing; Added/updated 0; Removed 0 files and 0 directories.
  BUILDTASK {"argv": ["/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs/python/mozbuild/mozbuild/action/process_install_manifest.py", "--track", "install__tests.track", "_tests", "_build_manifests/install/_tests"], "start": 5569371.488172081, "end": 5569371.547799292, "context": null}
  make[3]: Leaving directory '/home/oriol/src/servo/target/release/build/mozjs_sys-670a39cd7069e792/out/build'
  make[2]: Leaving directory '/home/oriol/src/servo/target/release/build/mozjs_sys-670a39cd7069e792/out/build'
  make[2]: Entering directory '/home/oriol/src/servo/target/release/build/mozjs_sys-670a39cd7069e792/out/build'
  make recurse_export
  make[3]: Entering directory '/home/oriol/src/servo/target/release/build/mozjs_sys-670a39cd7069e792/out/build'
  make[4]: Entering directory '/home/oriol/src/servo/target/release/build/mozjs_sys-670a39cd7069e792/out/build/config'
  config/host_nsinstall.o
  /usr/lib/ccache/clang --sysroot /home/oriol/src/.mozbuild/sysroot-x86_64-linux-gnu -std=gnu99 -o host_nsinstall.o -c  -DXP_UNIX -O3 -DNDEBUG=1 -DTRIMMED=1 -DUNICODE -D_UNICODE -I/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs/config -I/home/oriol/src/servo/target/release/build/mozjs_sys-670a39cd7069e792/out/build/config -I/home/oriol/src/servo/target/release/build/mozjs_sys-670a39cd7069e792/out/build/dist/include -MD -MP -MF .deps/host_nsinstall.o.pp  /home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs/config/nsinstall.c
  config/host_pathsub.o
  /usr/lib/ccache/clang --sysroot /home/oriol/src/.mozbuild/sysroot-x86_64-linux-gnu -std=gnu99 -o host_pathsub.o -c  -DXP_UNIX -O3 -DNDEBUG=1 -DTRIMMED=1 -DUNICODE -D_UNICODE -I/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs/config -I/home/oriol/src/servo/target/release/build/mozjs_sys-670a39cd7069e792/out/build/config -I/home/oriol/src/servo/target/release/build/mozjs_sys-670a39cd7069e792/out/build/dist/include -MD -MP -MF .deps/host_pathsub.o.pp  /home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs/config/pathsub.c
  make[4]: Leaving directory '/home/oriol/src/servo/target/release/build/mozjs_sys-670a39cd7069e792/out/build/config'
  make[3]: Leaving directory '/home/oriol/src/servo/target/release/build/mozjs_sys-670a39cd7069e792/out/build'
  make[2]: Leaving directory '/home/oriol/src/servo/target/release/build/mozjs_sys-670a39cd7069e792/out/build'
  make[1]: Leaving directory '/home/oriol/src/servo/target/release/build/mozjs_sys-670a39cd7069e792/out/build'

  --- stderr
  gmake: *** No targets specified and no makefile found.  Stop.
  /home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs/config/pathsub.c:10:10: fatal error: 'assert.h' file not found
  #include <assert.h>
           ^~~~~~~~~~
  /home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs/config/nsinstall.c:10:10: fatal error: 'stdio.h' file not found
  #include <stdio.h> /* OSF/1 requires this before grp.h, so put it first */
           ^~~~~~~~~
  1 error generated.
  1 error generated.
  make[4]: *** [/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs/config/rules.mk:565: host_pathsub.o] Error 1
  make[4]: *** Waiting for unfinished jobs....
  make[4]: *** [/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs/config/rules.mk:565: host_nsinstall.o] Error 1
  make[3]: *** [/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs/config/recurse.mk:72: config/host-objects] Error 2
  make[2]: *** [/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs/config/recurse.mk:34: export] Error 2
  make[1]: *** [/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs/config/rules.mk:361: default] Error 2
  make: *** [/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/makefile.cargo:146: all] Error 2
  thread 'main' panicked at /home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/build.rs:261:5:
  assertion failed: result.success()
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
      Timing report saved to /home/oriol/src/servo/target/cargo-timings/cargo-timing-20240325T122240Z.html
Failed in 0:00:01

Lack of stdio sounds concerning, maybe my PC is broken.

@mukilan
Copy link
Member

mukilan commented Mar 25, 2024

Look like clang is invoked with a custom sysroot that is still inside .mozbuild

  /usr/lib/ccache/clang --sysroot /home/oriol/src/.mozbuild/sysroot-x86_64-linux-gnu -std=gnu99 -o host_pathsub.o -c  -DXP_UNIX -O3 -DNDEBUG=1 -DTRIMMED=1 -DUNICODE -D_UNICODE -I/home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs/config -I/home/oriol/src/servo/target/release/build/mozjs_sys-670a39cd7069e792/out/build/config -I/home/oriol/src/servo/target/release/build/mozjs_sys-670a39cd7069e792/out/build/dist/include -MD -MP -MF .deps/host_pathsub.o.pp  /home/oriol/.cargo/git/checkouts/mozjs-fa11ffc7d4f1cc2d/b695c63/mozjs-sys/mozjs/config/pathsub.c

Maybe some PATH or other environment variable is forcing the use of .mozbuild?

@Loirooriol
Copy link
Contributor Author

Yeah, thanks for the help, it's MOZBUILD_STATE_PATH.
It's annoying because I used it for Firefox, but I think direnv will do the trick.

@fabricedesre
Copy link
Contributor

fabricedesre commented Mar 25, 2024

Yeah, thanks for the help, it's MOZBUILD_STATE_PATH. It's annoying because I used it for Firefox, but I think direnv will do the trick.

@Loirooriol : how did you fix it on your side? I'm having the same issue.

@Loirooriol
Copy link
Contributor Author

@fabricedesre I commented out MOZBUILD_STATE_PATH from ~/.bashrc, installed direnv, hooked it into my shell, and then followed the example in https://direnv.net/#quick-demo to set MOZBUILD_STATE_PATH just for firefox.

@Loirooriol
Copy link
Contributor Author

It seems that you can keep MOZBUILD_STATE_PATH by adding export LIBZ_SYS_STATIC="1", it avoids rust-lang/libz-sys@be2ddb4

@sagudev
Copy link
Member

sagudev commented Mar 26, 2024

export LIBZ_SYS_STATIC="1" works for me, but I do not have any MOZ* env var set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build Related to or part of the build process
Projects
None yet
Development

No branches or pull requests

4 participants