Closed Bug 1451931 Opened 6 years ago Closed 6 years ago

The spidermonkey-sm-rust-bindings-linux64/debug job fails if C++14 relaxed constexpr is used

Categories

(Firefox Build System :: General, defect)

3 Branch
defect
Not set
normal

Tracking

(firefox61 fixed)

RESOLVED FIXED
mozilla61
Tracking Status
firefox61 --- fixed

People

(Reporter: emk, Assigned: emk)

References

Details

Attachments

(2 files)

See <https://groups.google.com/forum/#!topic/mozilla.dev.platform/OQ-4nVQ0P2s> for the context.

I found js/rust/CMakeLists.txt had the explicit `-std=c++11` switch to enabled the "latest" C++ features. But if I try to bump the C++ version, I got the following error:
https://treeherder.mozilla.org/logviewer.html#?job_id=172184002&repo=try&lineNumber=552
> [task 2018-04-05T21:50:08.059Z]      Running `/builds/worker/workspace/build/src/target/debug/deps/callback-4ce8a82da6acbfdf`
> [task 2018-04-05T21:50:08.061Z] /builds/worker/workspace/build/src/target/debug/deps/callback-4ce8a82da6acbfdf: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /builds/worker/workspace/build/src/target/debug/deps/callback-4ce8a82da6acbfdf)
> [task 2018-04-05T21:50:08.062Z] error: test failed, to rerun pass '--test callback'
> [taskcluster 2018-04-05 21:50:08.366Z] === Task Finished ===
> [taskcluster 2018-04-05 21:50:08.485Z] Artifact "public/build" not found at "/builds/worker/artifacts/"
> [taskcluster 2018-04-05 21:50:09.294Z] Unsuccessful task run with exit code: 1 completed in 364.169 seconds

How to fix this error?
Flags: needinfo?(mh+mozilla)
Flags: needinfo?(jgilbert)
I don't know.
Flags: needinfo?(jgilbert)
Nobody has responded to the dev-platform thread. One option would be to simply land bug 1451278 and see if anyone complains about this job breaking.
(In reply to Masatoshi Kimura [:emk] from comment #0)
> See
> <https://groups.google.com/forum/#!topic/mozilla.dev.platform/OQ-4nVQ0P2s>
> for the context.
> 
> I found js/rust/CMakeLists.txt had the explicit `-std=c++11` switch to
> enabled the "latest" C++ features. But if I try to bump the C++ version, I
> got the following error:
> https://treeherder.mozilla.org/logviewer.
> html#?job_id=172184002&repo=try&lineNumber=552
> > [task 2018-04-05T21:50:08.059Z]      Running `/builds/worker/workspace/build/src/target/debug/deps/callback-4ce8a82da6acbfdf`
> > [task 2018-04-05T21:50:08.061Z] /builds/worker/workspace/build/src/target/debug/deps/callback-4ce8a82da6acbfdf: /usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by /builds/worker/workspace/build/src/target/debug/deps/callback-4ce8a82da6acbfdf)
> > [task 2018-04-05T21:50:08.062Z] error: test failed, to rerun pass '--test callback'
> > [taskcluster 2018-04-05 21:50:08.366Z] === Task Finished ===
> > [taskcluster 2018-04-05 21:50:08.485Z] Artifact "public/build" not found at "/builds/worker/artifacts/"
> > [taskcluster 2018-04-05 21:50:09.294Z] Unsuccessful task run with exit code: 1 completed in 364.169 seconds
> 
> How to fix this error?

Set LD_LIBRARY_PATH to the gcc/lib64 directory from the toolchain package. Kind of like we do in build/unix/mozconfig.stdcxx
Flags: needinfo?(mh+mozilla)
(In reply to Mike Hommey [:glandium] from comment #3)
> Set LD_LIBRARY_PATH to the gcc/lib64 directory from the toolchain package.
> Kind of like we do in build/unix/mozconfig.stdcxx

Thanks you, it works:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=83af1488cfa7be239cc14ba64f14ec51746714a4
Assignee: nobody → VYV03354
Status: NEW → ASSIGNED
Comment on attachment 8965678 [details]
Bug 1451931 - Add gcc/lib64 to the LD_LIBRARY_PATH of sm-rust-binding.

https://reviewboard.mozilla.org/r/234528/#review240812
Attachment #8965678 - Flags: review?(mh+mozilla) → review+
Comment on attachment 8965679 [details]
Bug 1451931 - Enable C++14 for SpiderMonkey Rust Bindings.

https://reviewboard.mozilla.org/r/234530/#review240814

::: js/rust/CMakeLists.txt:29
(Diff revision 1)
>    endif()
>    if(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
>      add_definitions(-Wno-c++0x-extensions -Wno-return-type-c-linkage -Wno-invalid-offsetof)
>    endif()
>    add_definitions(-fPIC -fno-rtti)
> -  add_definitions(-std=c++11 -DJS_NO_JSVAL_JSID_STRUCT_TYPES)
> +  add_definitions(-DJS_NO_JSVAL_JSID_STRUCT_TYPES)

For one, this is third party code, so this would need to be updated in the corresponding rust crate first, otherwise, it will end up being reverted.

Second, removing -std=c++11 is going to break things with compilers where C++14 is not the default, so you actually want -std=c++14.
Attachment #8965679 - Flags: review?(mh+mozilla)
Nick, I'm asking you because I found you in the commit log. Where is the upstream repo of the `js` crate?
Flags: needinfo?(nfitzgerald)
OK, so I'll have to
1. fix the upstream rust-mozjs to require C++14,
2. update the in-tree copy of rust-mozjs to the latest, and
3. land changes in this bug.

I'd rather unblock bug 1451278 and 1451722 and simply land them. Spidermonkey-sm-rust-bindings-linux64/debug is tier 2, after all.
It's fine if you don't do 2, as long as you ensure 1 is done, so that if 2 happens in the future, the changes from this bug are not reverted.
The upstream is https://github.com/servo/rust-mozjs, but they have also forked a bit.
Flags: needinfo?(nfitzgerald)
(In reply to Mike Hommey [:glandium] from comment #8)
> Second, removing -std=c++11 is going to break things with compilers where
> C++14 is not the default, so you actually want -std=c++14.

Adding -std=c++14 broke compilers that do not support C++14 such as travis-ci :(
Flags: needinfo?(mh+mozilla)
The travis image they use is trusty, and that contains GCC 4.8. Which hasn't been supported to build js for a while... How outdated is upstream rust-mozjs?
Flags: needinfo?(mh+mozilla) → needinfo?(nfitzgerald)
It is 1.5 to 2 years old SM at this point. IIRC, the travis config adds a custom apt source with a newer GCC, though.
Flags: needinfo?(nfitzgerald)
Here is an example of what the travis config to use a newer GCC looks like: https://github.com/fitzgen/mozjs/blob/smup-smup-smup/.travis.yml#L14-L27
If their mozjs is that old, then I guess it doesn't make sense to have them use -std=c++14. And their build will fail with -std=c++11 when they try to update to a more current mozjs, so I guess we're fine with the status quo?
OK, then, please review this patch.
Comment on attachment 8965679 [details]
Bug 1451931 - Enable C++14 for SpiderMonkey Rust Bindings.

https://reviewboard.mozilla.org/r/234530/#review242090
Attachment #8965679 - Flags: review?(mh+mozilla) → review+
Pushed by VYV03354@nifty.ne.jp:
https://hg.mozilla.org/integration/autoland/rev/2852286117d3
Add gcc/lib64 to the LD_LIBRARY_PATH of sm-rust-binding. r=glandium
https://hg.mozilla.org/integration/autoland/rev/b50c6e4262d1
Enable C++14 for SpiderMonkey Rust Bindings. r=glandium
https://hg.mozilla.org/mozilla-central/rev/2852286117d3
https://hg.mozilla.org/mozilla-central/rev/b50c6e4262d1
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Version: Version 3 → 3 Branch
You need to log in before you can comment on or make changes to this bug.