Comments (6)
I think --all --exclude piet-cairo
might be a temporary workaround, but we probably want a more systematic solution.
from piet.
Sure, I'm happy to take a look at it this weekend. At the very least there should be a way to print a nicer error message, along the lines of "cairo library not installed, try --all --exclude cairo
" when cargo build
or cargo test
fails. The current behavior I believe is just a normal ugly looking link error.
from piet.
@dianarg no pressure, but if you wanted to look into this you'd be very welcome! I see you'd already thought of this issue (https://github.com/linebender/piet/pull/97/files#r341583903).
I do think that by default, on windows, piet should just be building direct-write. I dunno. Maybe piet should always require an explicit backend? I'm not sure what the perfect structure for the piet project is, but I am confident that we haven't found it yet. 😆
from piet.
I started looking into this today. I am struggling to figure out if it's even possible to make Cargo do what I want (a nicer error message at the time it checks the cairo dependency, instead of the long error from link.exe). The error when you build on Windows without cairo installed looks like this:
error: linking with `link.exe` failed: exit code: 1181
[huge link.exe command with LIBPATH]
= note: LINK : fatal error LNK1181: cannot open input file 'cairo.lib'
The output on Linux is similar but I didn't get around testing it yet.
I would have expected that adding links = "cairo"
to the package settings would do something but it seems the cairo-rs crate has already specified the dependency:
> cargo build
error: failed to select a version for `cairo-sys-rs`.
... required by package `cairo-rs v0.7.1`
... which is depended on by `cairo_test v0.1.0 (C:\Users\Diana\cairo_test)`
versions that meet the requirements `= 0.9.0` are: 0.9.0
the package `cairo-sys-rs` links to the native library `cairo`, but it conflicts with a previous package which links to `cairo` as well:
package `cairo_test v0.1.0 (C:\Users\Diana\cairo_test)`
failed to select a version for `cairo-sys-rs` which could resolve this conflict
Here is a smaller reproducer for the problem:
Cargo.toml
[package]
name = "cairo_test"
version = "0.1.0"
# specify that we link to native library cairo
# this doesn't work
#links = "cairo"
[dependencies]
cairo-rs = { version = "0.7.1", default_features = false }
src/main.rs
extern crate cairo;
use cairo::{Context, Format, ImageSurface};
fn main() {
let surface = ImageSurface::create(Format::ARgb32, 10, 10)
.expect("Can't create surface");
let mut cr = Context::new(&surface);
cr.scale(3.3, 3.3);
}
from piet.
The hacky way to do this might be with a custom build.rs
script, and that feels a bit bad. I'd personally perfer to not require cairo on windows, since I just don't expect many folks to have it? Not sure how fair this is, very much an assumption.
from piet.
#109 should fix that. I agree cairo should not be required on Windows, since it seems direct2d just works. That patch didn't need to be bundled with the Azure testing.
from piet.
Related Issues (20)
- coregraphics on macos 11.x does not respect wght axis values above 900
- The documentation for the `new_text_layout` is inaccurate HOT 4
- Document clear() is not affected by clip() HOT 1
- `draw_text` docs out of date?
- Support Blend2D as an additional backend? HOT 1
- TextAttribute::Superscript HOT 1
- Some questions regarding this project HOT 4
- vertical text support HOT 2
- Looking to accomplish "reverse" clip
- Clarifying project status HOT 2
- Better text render method for piet-svg with <path> HOT 1
- `piet_common` with winit HOT 3
- Allow IntoBrush to be implemented by outside crates HOT 4
- More flexible `RenderContext::make_image` HOT 5
- panic occurred in file 'gradient.rs' at line 408 HOT 6
- Use only free fonts in the samples HOT 2
- piet-cairo doesn't event pass check HOT 1
- Nightly compilation of `piet-svg` fails.
- Can't resume drawing after calling `BitmapTarget::copy_raw_pixels`.
- examples seem broken
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from piet.