-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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-0.8.0 compilation error #21478
Comments
I’ve seen the same on Ubuntu, and was able to work around it by removing old clang/LLVM packages. (Namely 3.9 and 4.0, leaving only 6.0. Try |
Thanks for the pointer. Did anyone encounter this on Mac? I just upgraded to 10.13, and installed brand new "command line tools" which come with their latest version of clang(and nothing was installed as clang right after the system upgrade), and the issue persists... |
by the way and both
also didn't help... |
looks like a dupe of servo/rust-mozjs#435, yet it's noteworthy that the issue persists after upgrading to the latest Mac command line tools. Perhaps it requires the absolutely latest LLVM via a manual install? |
If there are multiple versions installed, the oldest one will often be selected by default. This can be changed via the LIBCLANG_PATH variable. |
Thanks! Ok so Mac users: it worked for me with an install of llvm via homebrew, followed by:
The |
The |
Oh I missed this, disregard me. I would prefer if we find a way to not have to tell people to export environment variables. @qdot Would you consider a bug that |
@KyleMayes, not qdot. |
We may want to see if https://github.com/KyleMayes/clang-sys#supported-versions could force a newer version that's supported. |
Alternatively, calling https://github.com/KyleMayes/clang-sys/blob/67f7d8c25eff694d7ba58ff42da6e5b502413b7d/build.rs#L277 |
it seems to work for me, without the homebrew one actually. Perhaps the |
So without my patch, it builds with LLVM 4 only (AFAIK). With my patch, it builds with everything. I think we should make |
I agree this should be improved. Instead of changing the order in which directories are visited, I think it might be better to collect all The way it works now simply picks the highest version in the first directory in which one or more instances of Thoughts? (since this would be a "breaking" change for users) |
I have implemented what is hopefully an improved selection of versioned binaries in You can read more details in the README. |
the latest |
@tigercosmos there is a PR to update bindgen here: #22221. |
I install clang 6 and remove all other old version. also update bindgen to lastest. But still encounter the same issue. I have no idea. orz |
You may need to remove the mozjs* directories from your build directory to observe changes. |
deleting mozjs* folders is similar to mach clean. Unfortunately, still not work. :( |
I had this same issue on Linux Mint 18 and removing (lib)clang 4.0 and installing 6.0 seems to have fixed it. |
It works by following |
Removing clang 4.0 also worked for me on Ubuntu 16.04. I'm not a fan of needing to set a bunch of system variables, but also not a fan of needing to uninstall software from my computer to get a build working. Would be preferable if the system was smarter about finding the most recent version of libclang. Not sure if @KyleMayes's pull request solves it. I still needed to remove the old version, but maybe that's just because I'm building off of master? |
The current This works well when there is a versioned instance of The ideal solution would be to somehow determine the version of these unversioned instances of An idea I had for this, which would only work when linking dynamically, would be to determine the version of an unversioned instance of For example:
I will look into this further and report back. |
The above idea works, so I have released This should mean that the most recent version of I also implemented an |
Is this fixed? |
We've updated our to mozjs to 0.13.0 with |
This has not been fixed, unfortunately. My attempt at a solution (speculatively loading I had to revert those changes, so I think the process going forward will have to be to either uninstall old However, it would be possible to detect the |
I added support to See here for the method I added. This could be used to ensure that the loaded version of clang_sys::load().unwrap();
let library = clang_sys::get_library().unwrap();
let version = library.version();
if version.map_or(false, |v| v < clang_sys::Version::V6_0) {
let name = version
.map(|v| format!("{:?}", v))
.unwrap_or_else(|| "3.4 or earlier".into());
panic!(
"the loaded version of libclang ({} @ {}) is too old, 6.0 or later is required",
name,
library.path().display(),
);
} Perhaps |
Recently rebased off
master
, now getting an error with./mach check
that strangely arises frommozjs
Am I missing an update command? I tried with
./mach clean
a few times already, also updaterustup
. Could it be that my machine is using an old rust version despite mach?The text was updated successfully, but these errors were encountered: