servo: Compiling libservo as a dependency fails
Importing libservo from the latest commit with a Cargo.toml like
[package]
name = "servo-embedder"
version = "0.1.0"
[dependencies]
libservo = { git = "https://github.com/servo/servo.git", rev = "84185eb" }
and then running cargo check results in a conflict:
Updating git repository `https://github.com/servo/servo.git`
Updating git repository `https://github.com/servo/media`
Updating crates.io index
Updating git repository `https://github.com/servo/devices`
Updating git repository `https://github.com/jrmuizel/raqote`
Updating git repository `https://github.com/pcwalton/signpost.git`
Updating git repository `https://github.com/servo/rust-mozjs`
Updating git repository `https://github.com/gfx-rs/wgpu`
Updating git repository `https://github.com/servo/mozjs`
error: failed to select a version for `freetype-sys`.
... required by package `freetype v0.5.1`
... which is depended on by `font-kit v0.9.0`
... which is depended on by `raqote v0.8.1-alpha.0 (https://github.com/jrmuizel/raqote#4b947efa)`
... which is depended on by `canvas v0.0.1 (https://github.com/servo/servo.git?rev=84185eb#84185eb1)`
... which is depended on by `compositing v0.0.1 (https://github.com/servo/servo.git?rev=84185eb#84185eb1)`
... which is depended on by `constellation v0.0.1 (https://github.com/servo/servo.git?rev=84185eb#84185eb1)`
... which is depended on by `libservo v0.0.1 (https://github.com/servo/servo.git?rev=84185eb#84185eb1)`
... which is depended on by `servim v0.1.0 (/home/noah/src/servim)`
versions that meet the requirements `^0.11.0` are: 0.11.0
the package `freetype-sys` links to the native library `freetype`, but it conflicts with a previous package which links to `freetype` as well:
package `freetype-sys v0.13.1`
... which is depended on by `freetype v0.7.0`
... which is depended on by `font-kit v0.10.0`
... which is depended on by `canvas v0.0.1 (https://github.com/servo/servo.git?rev=84185eb#84185eb1)`
... which is depended on by `compositing v0.0.1 (https://github.com/servo/servo.git?rev=84185eb#84185eb1)`
... which is depended on by `constellation v0.0.1 (https://github.com/servo/servo.git?rev=84185eb#84185eb1)`
... which is depended on by `libservo v0.0.1 (https://github.com/servo/servo.git?rev=84185eb#84185eb1)`
... which is depended on by `servim v0.1.0 (/home/noah/src/servim)`
failed to select a version for `freetype-sys` which could resolve this conflict
Compiling servo using mach directly works fine though, how is the conflict solved then? Am I compiling it correctly as an embedder or is there an alternative method?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 18 (8 by maintainers)
@jdm I think you are correct, I forgot that the lock file may be overwritten. Copying the lock file again fixes this error but another one about media_platform arises:
Examining the lib.rs file, it’s clear that the module only gets declared if “media-gstreamer” or “media-dummy” is enabled. So adding the “media-gstreamer” feature to libservo solves this error.
Now it finally fully builds, thank you very much for the help. In summary it was resolved by
adding the rustc-dev component (with e.g.
rustup component add rustc-dev),copying Cargo.lock from servo, make sure it’s not overwritten before every build,
performing the following changes to Cargo.toml:
layout-2013orlayout-2020as a feature to libservo.media-dummyormedia-gstreameras feature to libservo.My Cargo.toml then looks like:
Ah yes, this worked. Unfortunately, I am getting another error:
EDIT: Adding the
llvm-tools-previewcomponent fixed it.Try
cargo +nightly-2020-07-27 buildinstead.I got to a similar and @hellux solution didn’t work. I made some small changes It worked fine. After copping the Cargo.lock file to my dir I alter some Information on the Cargo.toml the file look like this:
but thank you, It helped very much
Maybe add the rustup component rustc-dev?
You may need to coy those cargo overrides as well, in that case. The error shows that you are not using our fork of raqote.