Closed Bug 1557030 Opened 5 years ago Closed 5 years ago

"ERROR: Could not find libclang to generate rust bindings for C/C++"

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1413234

People

(Reporter: smaug, Unassigned)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(2 files)

After bug 1526857 I get the following:
ERROR: Could not find libclang to generate rust bindings for C/C++. Please install the necessary packages, run mach bootstrap, or use --with-libclang-path to give the path containing it.

Running ./mach bootstrap does not help

ac_add_options --with-libclang-path=/home/smaug/.mozbuild/clang/lib
in .mozconfig seems to help, but that really shouldn't be needed.
(since I don't even know if that is the right clang lib)

:mceier in irc also hit this today.

glandium, can you help?

Flags: needinfo?(mh+mozilla)
Blocks: mach-busted

Can you attach $objdir/config.log?

Flags: needinfo?(mh+mozilla)
Attached file config.log
Attachment #9070065 - Attachment mime type: text/x-log → text/plain

what is the output for /usr/lib64/ccache/clang++ -print-search-dirs?

(Unrelated: Note that your clang is picked from /usr/lib64/ccache, which means it's ccache-wrapped, and that you're building with --with-ccache=sccache, which is going to wrap everything with sccache, so in practice, that means two levels of caching... you probably don't want that)

/usr/lib64/ccache/clang++ -print-search-dirs

programs: =/usr/bin:/usr/bin/../lib/gcc/x86_64-redhat-linux/8/../../../../x86_64-redhat-linux/bin
libraries: =/usr/lib64/clang/7.0.1:/usr/bin/../lib/gcc/x86_64-redhat-linux/8:/usr/bin/../lib/gcc/x86_64-redhat-linux/8/../../../../lib64:/usr/bin/../lib64:/lib/../lib64:/usr/lib/../lib64:/usr/bin/../lib/gcc/x86_64-redhat-linux/8/../../..:/usr/bin/../lib:/lib:/usr/lib

Can you attach config.log from a configure run with bug 1526857 backed out, and MOZ_CONFIGURE_TRACE set to 1 in the environment? I'm actually surprised your setup worked before.

(and without --with-libclang-path)

That is too large file to attach (30MB). I'll send it to you

Attached file config.log.zip

ah, looks like it compresses well.

Oh, so this is why it worked before:

  • clang is picked from the system
  • llvm-config is not installed on the system, so it's picked from ~/.mozbuild
  • so libclang was found in ~/.mozbuild

llvm-config being found from a different clang was the main problem, and bug 1526857 fixed that by not relying on llvm-config at all. So now, it tries to find the libclang corresponding to your configured clang, which it can't find.

This means there are actually two issues hidden here:

  • we should be picking clang from ~/.mozbuild on local builds. There is a bug on file for that but I can't find it right now. ISTR dmajor was involved in that, David, do you have the bug number handy?
  • we can't find libclang for a system-installed clang on Fedora. That's actually something I saw while working on bug 1526857, and that was already true before, whether a system llvm-config was installed or not. But that was scope bloat.
Flags: needinfo?(dmajor)
  • we should be picking clang from ~/.mozbuild on local builds. There is a
    bug on file for that but I can't find it right now. ISTR dmajor was involved
    in that, David, do you have the bug number handy?

Bug 1519954.

Flags: needinfo?(dmajor)

Olli, can you check whether bug 1519954 fixes the issue for you? I'll leave this bug open for the remaining issue per comment 11.

Flags: needinfo?(bugs)

Yes, it does seem to fix the issue. Thanks.

Flags: needinfo?(bugs)

Turns out the remaining issue is bug 1413234

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → DUPLICATE
Has Regression Range: --- → yes
Keywords: regression
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: