Closed Bug 1365488 Opened 7 years ago Closed 7 years ago

stylo doesn't build on OpenBSD

Categories

(Core :: CSS Parsing and Computation, defect, P5)

Unspecified
OpenBSD
defect

Tracking

()

VERIFIED FIXED
Tracking Status
firefox-esr52 --- unaffected
firefox53 --- unaffected
firefox54 --- wontfix
firefox55 --- fixed

People

(Reporter: gaston, Assigned: emilio)

References

Details

Right now an --enable-stylo build fails on OpenBSD:

123:01.03 error: failed to run custom build command for `style v0.0.1 (file:///home/landry/src/m-c/servo/components/style)`    123:01.05 process didn't exit successfully: `/usr/obj/m-c/toolkit/library/release/build/style-b9424eefd2764b2a/build-script-build` (exit code: 101)                                                                                                           123:01.05 --- stdout      

123:01.27 --- stderr                                                                                                           123:01.27 thread '<unnamed>' panicked at 'Unable to find libclang: "couldn\'t find any of [\'libclang.so\'], set the LIBCLANG_PATH environment variable to a path where one of these files can be found (skipped: [])"', /usr/obj/ports/rust-1.17.0/rustc-1.17.0-src/src/libcore/result.rs:859                                                                                               123:01.27 stack backtrace:                                                                                                     123:01.27    0: <unknown>                                                                                                      123:01.27    1: <unknown>                                                                                                      123:01.27    2: <unknown>   

On OpenBSD, we dont have 'libclang.so' symlinks by policy.

Manually doing a symlink (which isnt an acceptable solution), i get this (interleaved with many other unrelated warnings, which makes it hard to get what comes from rust/cargo or other parts of the tree being built):

 0:58.39    Compiling style_traits v0.0.1 (file:///home/landry/src/m-c/servo/components/style_traits)
 0:58.41    Compiling style v0.0.1 (file:///home/landry/src/m-c/servo/components/style)

 4:11.55 error: Could not compile `style`.
 4:11.57                                                                                             
 4:11.57 To learn more, run the command again with --verbose.                          
 4:11.57 gmake[5]: *** [/home/landry/src/m-c/config/rules.mk:1021: force-cargo-library-build] Error 101


I have absolutely no knowledge about rust or cargo, but :jbeich pointed me to https://github.com/KyleMayes/clang-sys/blob/ec6da7fa6357/build.rs#L220 and :semarie (our rust/cargo maintainer) fixed that part in https://github.com/KyleMayes/clang-sys/pull/55 which was merged upstream in clang-sys 0.18.0;

While i'm not 100% sure this fixes the stylo build, how can this be merged into m-c ? And how can isolate the build of the style rust crate, having a way to pass verbose options and figure out what's wrong ?
about the initial error:
- under OpenBSD, I am able to reproduce the error "Unable to find libclang".
- making a symlink from libclang.so.5.0 to libclang.so corrects the build, and it is able to finish successfully.

:landry, I don't reproduce the second error you had. You could pass the --verbose flag to cargo by running mach build with CARGOFLAGS=--verbose in environment: env CARGOFLAGS=--verbose mach build

about clang-sys:0.18.0, I tested it with m-c build, and it works. Now I need to figure how to make clang-sys:0.18.0 to be vendored. I suppose servo should be involved in the update.
AFAIU, revendoring happens automatically[1] based on Servo commits[2] which are mirrored under servo/ directory via autoland branch. In this case: clang-sys -> bindgen -> Servo -> Gecko. bindgen already pulled clang-sys 0.18.0, so we're waiting on Servo then a weekday for autoland -> mozilla-central merge.

[1] https://hg.mozilla.org/mozilla-central/rev/305d9e751c24
[2] https://github.com/servo/servo/pull/16778/commits/e6fc0aae1475
[3] https://github.com/servo/rust-bindgen/pull/703
So much magic happening there. Too much magic ? Oh well, soon it'll build and this can be closed.
(In reply to Sebastien Marie from comment #1)

> :landry, I don't reproduce the second error you had. You could pass the
> --verbose flag to cargo by running mach build with CARGOFLAGS=--verbose in
> environment: env CARGOFLAGS=--verbose mach build

That was due to having 1.5Gb in ulimit -d . With 3Gb (and the libclang.so symlink) it *finally* succeeds
Landry and semarie, is the remaining build problem just the symlink from libclang.so.5.0 to libclang.so? If OpenBSD doesn't allow 'libclang.so' symlinks by policy, does the Firefox build configuration need to specify the exact libclang version or path on OpenBSD?
Blocks: stylo
Priority: -- → P5
Summary: stylo doesnt build on OpenBSD → stylo doesn't build on OpenBSD
(In reply to Chris Peterson [:cpeterson] from comment #5)
> Landry and semarie, is the remaining build problem just the symlink from
> libclang.so.5.0 to libclang.so? If OpenBSD doesn't allow 'libclang.so'
> symlinks by policy, does the Firefox build configuration need to specify the
> exact libclang version or path on OpenBSD?

clang-sys:0.18.0 fixes the symlink problem by searching libclang.so.* file instead of an hardcoded libclang.so filename.

and Servo compoment, rust-bindgen, has been fixed to use this version of clang-sys. We are waiting the automagic merge of the latest version of rust-bindgen which will correct the problem in m-c.
I'm not sure there's an automagic merge, rust-bindgen needs to be updated in servo github repo (via a pr on some Cargo.toml file) and then it'll get merged to m-c.  I think that's the "process"..
:landry you are right.

- clang-sys:0.18.0 has the fix
- rust-bindgen incorported the dependency of clang-sys:0.18.0, but has *not* be released with the fix: latest version 0.25.0 don't have it
- servo depends of rust-bindgen:0.25.0
I can make a new bindgen release + update, didn't know it was blocking this.
https://github.com/servo/rust-bindgen/pull/709 is the first step. Will update bindgen as soon as it lands.
Assignee: nobody → emilio+bugs
I landed the bump in servo (https://hg.mozilla.org/integration/autoland/rev/e3efc7fb48df). This should be fixed once that merges into central.

If someone could verify it, that'd be rad :)
Will do !
https://hg.mozilla.org/mozilla-central/rev/e3efc7fb48df
Status: NEW → RESOLVED
Closed: 7 years ago
Flags: needinfo?(landry)
Resolution: --- → FIXED
Confirmed building fine with --enable-stylo, after fightning with rustc hitting datasize ulimit. Runtime testing to be done... i suppose there's an about:config knob somewhere to enable it.
Status: RESOLVED → VERIFIED
Flags: needinfo?(landry)
You need to log in before you can comment on or make changes to this bug.