Closed Bug 1398082 Opened 2 years ago Closed 2 years ago

Firefox and Thunderbird builds fail with llvm/clang >= 5.0

Categories

(Firefox Build System :: General, defect)

defect
Not set

Tracking

(firefox57 fixed)

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: janx, Assigned: janx)

References

Details

Attachments

(1 file, 2 obsolete files)

# Steps to reproduce:

# Install llvm/clang/lld 5.0 on Ubuntu 16.04 Xenial
echo "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main" > /etc/apt/sources.list.d/llvm.list
apt-key add /tmp/llvm-snapshot.gpg.key
apt-get update -q
apt-get install -qy clang-5.0 lld-5.0
export CC clang-5.0
export CXX clang++-5.0

# Try to build Firefox or Thunderbird
./mach build
 [...]
 0:05.26 checking for the target C compiler... /usr/bin/clang-5.0
 [...]
 0:05.86 checking for the target C++ compiler... /usr/bin/clang++-5.0
 [...]
 0:06.05 checking for the host C compiler... /usr/bin/clang-5.0
 [...]
 0:06.17 checking for the host C++ compiler... /usr/bin/clang++-5.0
 [...]
 0:06.45 checking for linker... lld
 [...]
 0:12.33 checking for llvm-config... not found
 0:12.34 ERROR: Could not find LLVM/Clang installation for compiling stylo build-time
 0:12.34 bindgen.  Please specify the 'LLVM_CONFIG' environment variable
 0:12.34 (recommended), pass the '--with-libclang-path' and '--with-clang-path'
 0:12.34 options to configure, or put 'llvm-config' in your PATH.  Altering your
 0:12.34 PATH may expose 'clang' as well, potentially altering your compiler,
 0:12.34 which may not be what you intended.
 0:12.38 *** Fix above errors and then restart with\
 0:12.38                "/usr/bin/make -f client.mk build"
 0:12.38 client.mk:360: recipe for target 'configure' failed
 0:12.38 make: *** [configure] Error 1
The command '/bin/sh -c ./mozilla/mach build' returned a non-zero code: 2
Exited with code 2

We suspect that /toolkit/moz.configure isn't able to detect `llvm-config-5.0` as a valid candidate for `llvm-config` because llvm-config >= 5.0 options are missing from llvm_config_paths:

[0] https://dxr.mozilla.org/mozilla-central/source/toolkit/moz.configure#622
Nathan, please have a look.
Attachment #8905881 - Flags: review?(nfroyd)
Please let me know if i should add the following options:

llvm-config-mp-6.0
llvm-config60
llvm-config-mp-5.0
llvm-config50
Assignee: nobody → janx
Comment on attachment 8905881 [details] [diff] [review]
Support compiling stylo with llvm-config-5.0 or llvm-config-6.0.

Maybe it is time to have a list like:
CLANG_SUPPORTED_VERSION = [ "6.0", "5.0 ...
and use it?
Comment on attachment 8905881 [details] [diff] [review]
Support compiling stylo with llvm-config-5.0 or llvm-config-6.0.

Review of attachment 8905881 [details] [diff] [review]:
-----------------------------------------------------------------

Sylvestre's idea of maintaining a list of supported LLVM versions and generating (at least part of) the list from that sounds good, would you do that, please?
Attachment #8905881 - Flags: review?(nfroyd)
> Sylvestre's idea of maintaining a list of supported LLVM versions and generating (at least part of) the list from that sounds good, would you do that, please?

Sure! Done. https://treeherder.mozilla.org/#/jobs?repo=try&revision=5fe440ef0fe8
Attachment #8905881 - Attachment is obsolete: true
Comment on attachment 8907075 [details] [diff] [review]
Support compiling stylo with llvm-config-5.0 or llvm-config-6.0.

Please have another look.
Attachment #8907075 - Flags: review?(nfroyd)
Comment on attachment 8907075 [details] [diff] [review]
Support compiling stylo with llvm-config-5.0 or llvm-config-6.0.

Review of attachment 8907075 [details] [diff] [review]:
-----------------------------------------------------------------

Looks great, thank you!
Attachment #8907075 - Flags: review?(nfroyd) → review+
I would prefer the python way with:
'llvm-config-%s' % version,
> I would prefer the python way with:
> 'llvm-config-%s' % version,

Done! Thanks for your suggestion.
Attachment #8907245 - Flags: review+
Attachment #8907075 - Attachment is obsolete: true
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/781bc2a066f2
Support compiling stylo with llvm-config-5.0 or llvm-config-6.0. r=froydnj
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/781bc2a066f2
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.