Closed Bug 1376956 Opened 7 years ago Closed 7 years ago

clang returned by `llvm-config --bindir` needs a .exe on Windows

Categories

(Firefox Build System :: General, defect)

defect
Not set
normal

Tracking

(firefox56 fixed)

RESOLVED FIXED
mozilla56
Tracking Status
firefox56 --- fixed

People

(Reporter: away, Assigned: froydnj)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

.mozbuild/clang/bin/clang returned by `llvm-config --bindir` does not exist.
Assignee: nobody → nfroyd
llvm-config on Windows can return a path for the clang binary which does
not end in ".exe", which then causes failures when attempting to check
for the existence of the file.  Rather than attempting to simply tack
".exe" onto the file if it's not already there, delegate to
moz.configure's `find_program` function, which will take care of that
case and several others besides.

I think this should fix things, though I have not run configure on my
machine to check.
Attachment #8881990 - Flags: review?(giles)
Attachment #8881990 - Flags: feedback?(dmajor)
Comment on attachment 8881990 [details] [diff] [review]
use `find_program` to search for clang for bindgen configuration

Fixes the error for me locally
Attachment #8881990 - Flags: feedback?(dmajor) → feedback+
Although... are you sure you want to do a search in the --with-clang-path case? Seems like, if we don't find the exact thing that was passed, it's the user's problem?
(In reply to David Major [:dmajor] from comment #3)
> Although... are you sure you want to do a search in the --with-clang-path
> case? Seems like, if we don't find the exact thing that was passed, it's the
> user's problem?

We should try to verify that whatever the user passed exists at the earliest possible opportunity.  So we should check in configure, rather than erroring when we try to run something much later in the build.  Searching *should* be OK here, since we have an absolute path, and find_program will simply try tacking on various extensions.
I guess in general my thought process is, if I go to the trouble of specifying my own path, I'd want either that exact thing to be used, or be given an error -- I wouldn't want the system to go and use some other thing. But if tacking on extensions is all that find_program does, I don't really care that much. :)
(In reply to David Major [:dmajor] from comment #5)
> I guess in general my thought process is, if I go to the trouble of
> specifying my own path, I'd want either that exact thing to be used, or be
> given an error -- I wouldn't want the system to go and use some other thing.
> But if tacking on extensions is all that find_program does, I don't really
> care that much. :)

That's fair.  I guess it depends whether we expect people to do:

  --with-clang-path=clang

or:

  --with-clang-path=C:/path/to/clang

and even in the latter case, I think it would be friendly to try extensions.
Attachment #8881990 - Flags: review?(giles) → review+
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/9e4b627fa622
use `find_program` to search for clang for bindgen configuration; r=rillian
https://hg.mozilla.org/mozilla-central/rev/9e4b627fa622
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: