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

failed to run custom build command for mozjs_sys v0.61.5 #22384

Open
jankeromnes opened this issue Dec 8, 2018 · 9 comments · May be fixed by JanitorTechnology/dockerfiles#218
Open

failed to run custom build command for mozjs_sys v0.61.5 #22384

jankeromnes opened this issue Dec 8, 2018 · 9 comments · May be fixed by JanitorTechnology/dockerfiles#218
Labels
A-build Related to or part of the build process

Comments

@jankeromnes
Copy link

jankeromnes commented Dec 8, 2018

Dear Servo team,

Our automated Servo build for https://janitor.technology has been broken for a while, sadly. I’m trying to fix it, but I’m not exactly sure what’s happening.

Currently, our CircleCI build is failing like so:

$ ./mach build -d
[...]
   Compiling debugger v0.0.1 (/home/user/servo/components/debugger)
   Compiling winit v0.18.0
error: failed to run custom build command for `mozjs_sys v0.61.5`
process didn't exit successfully: `/home/user/servo/target/debug/build/mozjs_sys-e71c6453903c8264/build-script-build` (exit code: 101)
[...]
/usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include/emmintrin.h:389:10: error: use of undeclared identifier '__builtin_ia32_cvtps2pd', err: true
/usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include/emmintrin.h:395:10: error: use of undeclared identifier '__builtin_ia32_cvtdq2pd', err: true
/usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include/emmintrin.h:601:3: error: use of undeclared identifier '__builtin_ia32_storeupd', err: true
/usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include/emmintrin.h:686:19: error: use of undeclared identifier '__builtin_ia32_pavgb128', err: true
/usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include/emmintrin.h:692:19: error: use of undeclared identifier '__builtin_ia32_pavgw128', err: true
/usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include/emmintrin.h:1234:3: error: use of undeclared identifier '__builtin_ia32_storedqu', err: true
/usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include/emmintrin.h:1255:3: error: use of undeclared identifier '__builtin_ia32_movntpd', err: true
/usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include/emmintrin.h:1261:3: error: use of undeclared identifier '__builtin_ia32_movntdq', err: true
/usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include/emmintrin.h:1279:1: error: static declaration of '_mm_clflush' follows non-static declaration, err: true
/usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include/emmintrin.h:1285:1: error: static declaration of '_mm_lfence' follows non-static declaration, err: true
/usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include/emmintrin.h:1291:1: error: static declaration of '_mm_mfence' follows non-static declaration, err: true
/usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include/emmintrin.h:1482:1: error: static declaration of '_mm_pause' follows non-static declaration, err: true
/usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include/smmintrin.h:146:20: error: use of undeclared identifier '__builtin_ia32_movntdqa', err: true
fatal error: too many errors emitted, stopping now [-ferror-limit=], err: true
thread 'main' panicked at 'Should generate JSAPI bindings OK: ()', libcore/result.rs:1009:5
note: Run with `RUST_BACKTRACE=1` for a backtrace.

warning: build failed, waiting for other jobs to finish...
error: build failed
[Warning] Could not generate notification! Optional Python module 'dbus' is not installed.
Build FAILED in 0:44:49
The command '/bin/sh -c ./mach build -d' returned a non-zero code: 101
Exited with code 101

I’m not sure why Servo is trying to build these old clang 3.8 headers.

Note: Janitor’s containers normally use clang-6.0/clang++-6.0 as default compilers, but for Servo we revert to gcc/g++ because clang is (or used to be) unsupported.

@jdm
Copy link
Member

jdm commented Dec 8, 2018

Clang should be fully supported and would be preferable in this case.

@jankeromnes
Copy link
Author

Switching to clang-6.0 and clang++-6.0 didn't fix the issue. The build still fails with errors in /usr/lib/llvm-3.8/bin/../lib/clang/3.8.0/include/.

I wonder if there is a way to point Servo to newer 6.0 includes instead of the 3.8 ones its using. I seem to remember some LLVM path environment variable, but I can't find its name again.

@jankeromnes
Copy link
Author

Or maybe I need to sudo apt-get install llvm-dev (as suggested in #22267, but that'd be surprising since my OS is Ubuntu 16.04 and not 18.04).

@hgallagher1993
Copy link
Contributor

I had something very similar (if not the exact same) What I did was delete all versions of Clang, Libclang and llvm except version 6.0 of each.

@cdeler
Copy link
Contributor

cdeler commented Dec 10, 2018

I had a similar issue on my machine. I had clang3.8 and clang6.0 installed on my PC.

What helped for me:

  • At first I removed clang3.8
  • Then I ran build as
CC=clang-6.0 CXX=clang++-6.0 ./mach build -d
  • Optionally you might also set CLANG_BASE=/usr/lib/llvm-6.0/lib/ env for the build. I found that in mozjs source, but have lost the link.

@cdeler
Copy link
Contributor

cdeler commented Dec 11, 2018

UPD info about the mozjs build could be found in the mozjs README :-)

https://github.com/servo/mozjs#building

If you have more than one version of Clang installed, you can set the LIBCLANG_PATH environment variable ...

@jankeromnes
Copy link
Author

Thanks a lot for these helpful details! I will try to figure out where the old LLVM/Clang 3.8 in my Docker image comes from, and see if I can get rid of it. Otherwise, I’ll forcefully point Servo to LLVM/Clang 6.0.

I’ll report back here with progress (but please ping me if I forget).

@tigercosmos tigercosmos added the A-build Related to or part of the build process label Dec 14, 2018
@jankeromnes
Copy link
Author

jankeromnes commented Jan 10, 2019

So, I do install LLVM/Clang 6.0 in my base Dockerfile, however my Servo Dockerfile also installs clang from apt-get (which defaults to 3.8 on Ubuntu 16.04 Xenial), because I copy/pasted that from Servo's Debian build dependencies.

Additionally, in my testing, it seemed that even with a single LLVM/Clang version installed, setting CLANG_BASE=/usr/lib/llvm-6.0/lib/ was still necessary. I speculate that's because mozjs looks in /usr/lib/llvm/lib/ by default, and not in version-suffixed directories.

@jdm
Copy link
Member

jdm commented Jan 10, 2019

Yes, that's likely a limitation of the current implementation of clang-sys, as discussed in #21478 (comment).

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

Successfully merging a pull request may close this issue.

5 participants