-
Notifications
You must be signed in to change notification settings - Fork 165
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
Port xetex_layout to Rust #1138
base: master
Are you sure you want to change the base?
Port xetex_layout to Rust #1138
Conversation
Ooh, very exciting! |
3e2484f
to
456507d
Compare
crates/xetex_layout/src/lib.rs
Outdated
@@ -27,6 +27,175 @@ mod linkage { | |||
use tectonic_bridge_icu as clipyrenamehack5; | |||
} | |||
|
|||
macro_rules! cstr { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi. CStr literals have been stabilized recently so they'd fit in nicely here :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like they were delayed by a release, so they're stabilizing in 1.77, the release after the one coming out in a couple days. I'll leave a TODO to fix it then, if this merges before that release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh whoops, right. "Tracking issue closed as stabilized" doesn't mean that the version is stable already ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, we don't have a formal Minimum Supported Rust Version (MSRV) policy, but I think it's generally good to give new stabilizations at least a few features to propagate through the ecosystem before starting to rely on them.
I am so baffled by the linking errors on everything - they aren't happening locally, which makes them pretty hard to diagnose. |
Yep, I saw |
crates/bridge_freetype2/src/lib.rs
Outdated
pub type FT_Generic_Finalizer = extern "C" fn(object: *mut ()); | ||
pub type FT_Pointer = *mut (); | ||
|
||
#[link(name = "freetype", kind = "static")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems like this directive links to a second (static) copy of freetype that doesn't match up with our harfbuzz freetype build. I'm not sure of the consequences but simply dropping the #[link]
line both here and in crates/bridge_harfbuzz/src/lib.rs seems to work for me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good find, I'll try it locally. I'm using a Windows vcpkg dev environment, and it needs some stuff static so I suspect I added it while narrowing down another issue, and either it's only necessary in some cases, or it's not necessary at all and I just left it in by accident.
The icu/unicode stuff is probably because the library does symbol versioning, which you only disable normally on say system installs. I probably, somehow, am locally getting some system installed version pulled in which is providing the symbols. This is... kind of annoying, but I can fix it. |
Found a solution but it will require updates to |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1138 +/- ##
==========================================
+ Coverage 46.35% 46.93% +0.58%
==========================================
Files 184 201 +17
Lines 66222 67768 +1546
==========================================
+ Hits 30695 31808 +1113
- Misses 35527 35960 +433 ☔ View full report in Codecov by Sentry. |
I should look into whether there's an existing |
There's https://github.com/servo/core-foundation-rs ... the crates don't seem as popular as I'd have thought, but a Servo project is probably going to be trustworthy? |
2fa361f
to
cb24a3f
Compare
@pkgw What's your take on dropping support for MacOS < 10.7, OSX Lion? It's more than 10 years old, and some quick googling says the number of mac users on it should be basically negligible. It would allow some minor simplification. |
Related note - the core-foundation-rs crate and similar from servo target 10.7 and above, so it would allow using them. |
@CraftSpider Dropping support for the older macOS seems fine to me. It generally becomes intractable to support the older OSes without paying for your own custom CI setup, anyway. It looks like conda-forge is currently targeting >=10.9, and I'd generally lean towards copying them. |
f5ad6d0
to
ee6af21
Compare
This is a big change - if desired, I can split it out into the primary change to Rust, then the individual library wrappers as follow-ups to the big change, as I made sure to get tests passing between each major change. |
f8dacb6
to
d8a9393
Compare
c5cb2ff
to
8e12e55
Compare
Obviously I'm biased, but I'm tempted to pull in my crate |
ec9e1d4
to
5d3570a
Compare
…d some allocations as a bonus.
aeb720d
to
8d815f9
Compare
Been poking this on and off for a while, finally reached the point where it's... not done, but should pass most tests on Windows and hopefully Linux. Mac will require a bit more love before it works. Opening to see what CI has to say so far.