From 871a185ad846db2d9b874c7988d6c1fcf0a6e723 Mon Sep 17 00:00:00 2001 From: Jim McGrath Date: Tue, 16 Jul 2019 20:04:04 -0500 Subject: [PATCH 1/7] ensure test reference files are checked out with LF line endings --- .gitattributes | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..0cc12a36f --- /dev/null +++ b/.gitattributes @@ -0,0 +1,6 @@ +*.log eol=lf +*.out eol=lf +*.fot eol=lf +*.tex eol=lf +*.bbl eol=lf +*.blg eol=lf From bf44db9e274853cb87df2388fa2cdaa219632e56 Mon Sep 17 00:00:00 2001 From: CrLF0710 Date: Fri, 21 Jun 2019 23:28:29 +0800 Subject: [PATCH 2/7] Do necessary changes to load the dependencies using vcpkg-rs. Squash merge of commits by @CrLF0710 and @mcgoo. --- Cargo.lock | 132 ++++++++++++------------ Cargo.toml | 1 + build.rs | 75 +++++++++++--- tectonic/xetex-XeTeXFontMgr.cpp | 2 +- tectonic/xetex-XeTeXLayoutInterface.cpp | 6 +- tectonic/xetex-core.h | 4 +- 6 files changed, 134 insertions(+), 86 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a53044fa2..637ec50f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -45,7 +45,7 @@ name = "atty" version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -61,8 +61,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "backtrace-sys 0.1.31 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-demangle 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -70,8 +70,8 @@ name = "backtrace-sys" version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -137,7 +137,7 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -199,7 +199,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -305,7 +305,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", "synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -316,13 +316,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "flate2" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)", - "miniz_oxide_c_api 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "miniz_oxide 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -348,7 +348,7 @@ name = "fs2" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -395,11 +395,12 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", + "wasi 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -451,7 +452,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -541,7 +542,7 @@ name = "iovec" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -566,7 +567,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.60" +version = "0.2.62" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -574,8 +575,8 @@ name = "libz-sys" version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cc 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", "vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -644,23 +645,12 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.3.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "miniz_oxide_c_api" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cc 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)", - "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", - "miniz_oxide 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "mio" version = "0.6.19" @@ -670,7 +660,7 @@ dependencies = [ "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", @@ -695,7 +685,7 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "openssl 0.10.24 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -712,7 +702,7 @@ version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -726,7 +716,7 @@ name = "num_cpus" version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -752,7 +742,7 @@ dependencies = [ "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "openssl-sys 0.9.48 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -767,8 +757,8 @@ version = "0.9.48" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "cc 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", "vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -795,7 +785,7 @@ name = "parking_lot_core" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -856,7 +846,7 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "autocfg 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -873,8 +863,8 @@ name = "rand" version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "getrandom 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "rand_chacha 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -916,7 +906,7 @@ name = "rand_core" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "getrandom 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "getrandom 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -948,7 +938,7 @@ name = "rand_jitter" version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -960,7 +950,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1030,7 +1020,7 @@ dependencies = [ "cookie 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "cookie_store 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "encoding_rs 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", - "flate2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", "http 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.12.33 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1055,7 +1045,7 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1097,7 +1087,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "core-foundation 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", "core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "security-framework-sys 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1137,7 +1127,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1222,7 +1212,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "syn" -version = "0.15.42" +version = "0.15.44" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1237,7 +1227,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)", "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1247,14 +1237,14 @@ version = "0.1.12-dev" dependencies = [ "aho-corasick 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)", "app_dirs 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cc 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)", + "cc 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "error-chain 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)", - "flate2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", "fs2 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "headers 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "md-5 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1264,7 +1254,8 @@ dependencies = [ "tectonic_xdv 0.1.9-dev", "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", - "toml 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "toml 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "vcpkg 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "zip 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1282,7 +1273,7 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1318,7 +1309,7 @@ name = "time" version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1448,7 +1439,7 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "serde 1.0.98 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1549,6 +1540,11 @@ dependencies = [ "try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "wasi" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "winapi" version = "0.2.8" @@ -1623,7 +1619,7 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "flate2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)", "podio 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1645,7 +1641,7 @@ dependencies = [ "checksum byteorder 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5" "checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" "checksum c2-chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7d64d04786e0f528460fc884753cf8dddcc466be308f6026f8e355c41a0e4101" -"checksum cc 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)" = "ce400c638d48ee0e9ab75aef7997609ec57367ccfe1463f21bf53c3eca67bf46" +"checksum cc 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)" = "b548a4ee81fccb95919d4e22cfea83c7693ebfd78f0495493178db20b3139da7" "checksum cfg-if 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "b486ce3ccf7ffd79fdeb678eac06a9e6c09fc88d33836340becb8fffe87c5e33" "checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" "checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" @@ -1666,7 +1662,7 @@ dependencies = [ "checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2" "checksum failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1" "checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" -"checksum flate2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "550934ad4808d5d39365e5d61727309bf18b3b02c6c56b729cb92e7dd84bc3d8" +"checksum flate2 1.0.11 (registry+https://github.com/rust-lang/crates.io-index)" = "2adaffba6388640136149e18ed080b77a78611c1e1d6de75aedcdf78df5d4682" "checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" "checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" "checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" @@ -1677,7 +1673,7 @@ dependencies = [ "checksum futures 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "45dc39533a6cae6da2b56da48edae506bb767ec07370f86f70fc062e9d435869" "checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" "checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" -"checksum getrandom 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "34f33de6f0ae7c9cb5e574502a562e2b512799e32abb801cd1e79ad952b62b49" +"checksum getrandom 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "2512b3191f22e2763a5db387f1c9409379772e2050841722eb4a8c4f497bf096" "checksum h2 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462" "checksum headers 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dc6e2e51d356081258ef05ff4c648138b5d3fe64b7300aaad3b820554a2b7fb6" "checksum headers-core 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "967131279aaa9f7c20c7205b45a391638a83ab118e6509b2d0ccbe08de044237" @@ -1693,7 +1689,7 @@ dependencies = [ "checksum itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum lazy_static 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bc5729f27f159ddd61f4df6228e827e86643d4d3e7c32183cb30a1c08f604a14" -"checksum libc 0.2.60 (registry+https://github.com/rust-lang/crates.io-index)" = "d44e80633f007889c7eff624b709ab43c92d708caad982295768a7b13ca3b5eb" +"checksum libc 0.2.62 (registry+https://github.com/rust-lang/crates.io-index)" = "34fcd2c08d2f832f376f4173a231990fa5aef4e99fb569867318a227ef4c06ba" "checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe" "checksum lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "62ebf1391f6acad60e5c8b43706dde4582df75c06698ab44511d15016bc2442c" "checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" @@ -1703,8 +1699,7 @@ dependencies = [ "checksum memoffset 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ce6075db033bbbb7ee5a0bbd3a3186bbae616f57fb001c485c7ff77955f8177f" "checksum mime 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)" = "3e27ca21f40a310bd06d9031785f4801710d566c184a6e15bad4f1d9b65f9425" "checksum mime_guess 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1a0ed03949aef72dbdf3116a383d7b38b4768e6f960528cd6a6044aa9ed68599" -"checksum miniz_oxide 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c061edee74a88eb35d876ce88b94d77a0448a201de111c244b70d047f5820516" -"checksum miniz_oxide_c_api 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6c675792957b0d19933816c4e1d56663c341dd9bfa31cb2140ff2267c1d8ecf4" +"checksum miniz_oxide 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7108aff85b876d06f22503dcce091e29f76733b2bfdd91eebce81f5e68203a10" "checksum mio 0.6.19 (registry+https://github.com/rust-lang/crates.io-index)" = "83f51996a3ed004ef184e16818edc51fadffe8e7ca68be67f9dee67d84d0ff23" "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" "checksum native-tls 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4b2df1a4c22fd44a62147fd8f13dd0f95c9d8ca7b2610299b2a2f9cf8964274e" @@ -1746,7 +1741,7 @@ dependencies = [ "checksum regex-syntax 0.6.11 (registry+https://github.com/rust-lang/crates.io-index)" = "b143cceb2ca5e56d5671988ef8b15615733e7ee16cd348e064333b251b89343f" "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" "checksum reqwest 0.9.19 (registry+https://github.com/rust-lang/crates.io-index)" = "1d0777154c2c3eb54f5c480db01de845652d941e47191277cc673634c3853939" -"checksum rustc-demangle 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "a7f4dccf6f4891ebcc0c39f9b6eb1a83b9bf5d747cb439ec6fba4f3b977038af" +"checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum ryu 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c92464b447c0ee8c4fb3824ecc8383b81717b9f1e74ba2e72540aef7b9f82997" "checksum schannel 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "f2f6abf258d99c3c1c5c2131d99d064e94b7b3dd5f416483057f308fea253339" @@ -1768,7 +1763,7 @@ dependencies = [ "checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" "checksum string 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" "checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" -"checksum syn 0.15.42 (registry+https://github.com/rust-lang/crates.io-index)" = "eadc09306ca51a40555dd6fc2b415538e9e18bc9f870e47b1a524a79fe2dcf5e" +"checksum syn 0.15.44 (registry+https://github.com/rust-lang/crates.io-index)" = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" "checksum synstructure 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "02353edf96d6e4dc81aea2d8490a7e9db177bf8acb0e951c24940bf866cb313f" "checksum tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" "checksum termcolor 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "96d6098003bde162e4277c70665bd87c326f5a0c3f3fbfb285787fa482d54e6e" @@ -1785,7 +1780,7 @@ dependencies = [ "checksum tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1d14b10654be682ac43efee27401d792507e30fd8d26389e1da3b185de2e4119" "checksum tokio-threadpool 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "90ca01319dea1e376a001e8dc192d42ebde6dd532532a5bad988ac37db365b19" "checksum tokio-timer 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "f2106812d500ed25a4f38235b9cae8f78a09edf43203e16e59c3b769a342a60e" -"checksum toml 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b8c96d7873fa7ef8bdeb3a9cda3ac48389b4154f32b9803b4bc26220b677b039" +"checksum toml 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c7aabe75941d914b72bf3e5d3932ed92ce0664d49d8432305a8b547c37227724" "checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" "checksum try_from 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "283d3b89e1368717881a9d51dad843cc435380d8109c9e47d38780a324698d8b" "checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" @@ -1800,6 +1795,7 @@ dependencies = [ "checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" "checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" "checksum want 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" +"checksum wasi 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fd5442abcac6525a045cc8c795aedb60da7a2e5e89c7bf18a0d5357849bb23c7" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f10e386af2b13e47c89e7236a7a14a086791a2b88ebad6df9bf42040195cf770" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" diff --git a/Cargo.toml b/Cargo.toml index d339a3d62..5cc01c74d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,6 +37,7 @@ cc = "^1.0" pkg-config = "^0.3" # note: sync dist/docker/*/pkg-config-rs.sh with the version in Cargo.lock regex = "^1.1" sha2 = "^0.8" +vcpkg = "0.2.7" [dependencies] aho-corasick = "^0.7" diff --git a/build.rs b/build.rs index 08ee61f85..de815edb3 100644 --- a/build.rs +++ b/build.rs @@ -6,24 +6,57 @@ use cc; use pkg_config; +use vcpkg; +use std::env; use std::path::PathBuf; // No fontconfig on MacOS: #[cfg(target_os = "macos")] const LIBS: &'static str = "harfbuzz >= 1.4 harfbuzz-icu icu-uc freetype2 graphite2 libpng zlib"; +#[cfg(target_os = "macos")] +const VCPKG_LIBS: &[&'static str] = &["harfbuzz", "freetype", "graphite2"]; + #[cfg(not(target_os = "macos"))] const LIBS: &'static str = "fontconfig harfbuzz >= 1.4 harfbuzz-icu icu-uc freetype2 graphite2 libpng zlib"; +#[cfg(not(target_os = "macos"))] +const VCPKG_LIBS: &[&'static str] = &["fontconfig", "harfbuzz", "freetype", "graphite2"]; +// Need a way to check that the vcpkg harfbuzz port has graphite2 and icu options enabled. + +fn load_vcpkg_deps(include_paths: &mut Vec) { + for dep in VCPKG_LIBS { + let library = vcpkg::find_package(dep).expect("failed to load package from vcpkg"); + include_paths.extend(library.include_paths.iter().cloned()); + } +} + fn main() { - // We (have to) rerun the search again below to emit the metadata at the right time. + let target = env::var("TARGET").unwrap(); + let rustflags = env::var("RUSTFLAGS").unwrap_or(String::new()); + + let use_vcpkg = env::var("TECTONIC_VCPKG").is_ok(); + let mut deps = None; + let mut vcpkg_includes = vec![]; + if use_vcpkg { + load_vcpkg_deps(&mut vcpkg_includes); + eprintln!("{:?}", vcpkg_includes); - let deps = pkg_config::Config::new() - .cargo_metadata(false) - .probe(LIBS) - .unwrap(); + if target.contains("-linux-") { + // add icudata to the end of the list of libs as vcpkg-rs does not + // order individual libraries as a single pass linker requires + println!("cargo:rustc-link-lib=icudata"); + } + } else { + // We (have to) rerun the search again below to emit the metadata at the right time. + let deps_library = pkg_config::Config::new() + .cargo_metadata(false) + .probe(LIBS) + .unwrap(); + deps = Some(deps_library); + } // Actually I'm not 100% sure that I can't compile the C and C++ code // into one library, but who cares? @@ -212,9 +245,16 @@ fn main() { .file("tectonic/xetex-XeTeXOTMath.cpp") .include("."); - for p in deps.include_paths { - ccfg.include(&p); - cppcfg.include(&p); + if let Some(deps) = &deps { + for p in &deps.include_paths { + ccfg.include(p); + cppcfg.include(p); + } + } else { + for p in &vcpkg_includes { + ccfg.include(p); + cppcfg.include(p); + } } // Platform-specific adjustments: @@ -244,6 +284,15 @@ fn main() { cppcfg.define("WORDS_BIGENDIAN", "1"); } + if target.contains("-msvc") { + ccfg.flag("/EHsc"); + cppcfg.flag("/EHsc"); + if rustflags.contains("+crt-static") { + ccfg.define("GRAPHITE2_STATIC", None); + cppcfg.define("GRAPHITE2_STATIC", None); + } + } + // OK, back to generic build rules. ccfg.compile("libtectonic_c.a"); @@ -252,10 +301,12 @@ fn main() { // Now that we've emitted the info for our own libraries, we can emit the // info for their dependents. - pkg_config::Config::new() - .cargo_metadata(true) - .probe(LIBS) - .unwrap(); + if let Some(_deps) = &deps { + pkg_config::Config::new() + .cargo_metadata(true) + .probe(LIBS) + .unwrap(); + } // Tell cargo to rerun build.rs only if files in the tectonic/ directory have changed. for file in PathBuf::from("tectonic").read_dir().unwrap() { diff --git a/tectonic/xetex-XeTeXFontMgr.cpp b/tectonic/xetex-XeTeXFontMgr.cpp index 7fd3dbaf1..e1876f078 100644 --- a/tectonic/xetex-XeTeXFontMgr.cpp +++ b/tectonic/xetex-XeTeXFontMgr.cpp @@ -40,7 +40,7 @@ authorization from the copyright holders. #endif #include "xetex-XeTeXFontInst.h" -#include +#include // see cpascal.h #define printcstring(STR) \ diff --git a/tectonic/xetex-XeTeXLayoutInterface.cpp b/tectonic/xetex-XeTeXLayoutInterface.cpp index c81fa4ff6..d3d9952fd 100644 --- a/tectonic/xetex-XeTeXLayoutInterface.cpp +++ b/tectonic/xetex-XeTeXLayoutInterface.cpp @@ -39,9 +39,9 @@ authorization from the copyright holders. #include #include -#include -#include -#include +#include +#include +#include #include "xetex-web.h" diff --git a/tectonic/xetex-core.h b/tectonic/xetex-core.h index 80002a5dd..3be72a907 100644 --- a/tectonic/xetex-core.h +++ b/tectonic/xetex-core.h @@ -25,8 +25,8 @@ #include FT_TRUETYPE_TABLES_H /* harfbuzz */ -#include -#include +#include +#include /* Endianness foo */ From e08094ec0690c6044f17ced4157debd5cd2802c0 Mon Sep 17 00:00:00 2001 From: Jim McGrath Date: Wed, 17 Jul 2019 11:16:01 -0500 Subject: [PATCH 3/7] add x86_64-pc-windows-msvc build on appveyor --- .appveyor.yml | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 5fcb7b78c..bf1f4b03a 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -4,21 +4,17 @@ ## Operating System (VM environment) ## # Rust needs at least Visual Studio 2013 Appveyor OS for MSVC targets. -os: Visual Studio 2015 +os: Visual Studio 2017 ## Build Matrix ## environment: matrix: - ### MSVC Targets ### - # Stable 64-bit MSVC - # - channel: stable - # toolchain: stable-x86_64-pc-windows-msvc - # target: x86_64-pc-windows-msvc - # target_env: msvc - # mingw_subdir: mingw64 - # mingw_target: x86_64-w64-mingw32 - # mingw_package_prefix: mingw-w64-x86_64 + # Stable 64-bit MSVC + - target: x86_64-pc-windows-msvc + channel: stable + toolchain: stable-x86_64-pc-windows-msvc + target_env: msvc # Stable 32-bit MSVC # - channel: stable # toolchain: stable-i686-pc-windows-msvc @@ -29,10 +25,10 @@ environment: # mingw_package_prefix: mingw-w64-i686 ### GNU Targets ### - # Stable 64-bit GNU - - channel: stable + # Stable 64-bit GNU + - target: x86_64-pc-windows-gnu + channel: stable toolchain: stable-x86_64-pc-windows-msvc - target: x86_64-pc-windows-gnu target_env: gnu mingw_subdir: mingw64 mingw_target: x86_64-w64-mingw32 @@ -72,10 +68,16 @@ install: - appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe - rustup-init -yv --default-toolchain %channel%-msvc --default-host %target% - set PATH=%PATH%;%USERPROFILE%\.cargo\bin - - set PATH=C:\msys64\%mingw_subdir%\bin;C:\msys64\usr\bin;%PATH% + - if "%target_env%" == "gnu" set PATH=C:\msys64\%mingw_subdir%\bin;C:\msys64\usr\bin;%PATH% - rustup target add %target% - rustup component add rust-src - - pacman -S --noconfirm "%mingw_package_prefix%-fontconfig" "%mingw_package_prefix%-freetype" "%mingw_package_prefix%-icu" + - if "%target_env%" == "gnu" pacman -S --noconfirm "%mingw_package_prefix%-fontconfig" "%mingw_package_prefix%-freetype" "%mingw_package_prefix%-icu" + - if "%target_env%" == "msvc" git clone https://github.com/microsoft/vcpkg %USERPROFILE%\vcpkg + - if "%target_env%" == "msvc" call %USERPROFILE%\vcpkg\bootstrap-vcpkg.bat + - if "%target_env%" == "msvc" %USERPROFILE%\vcpkg\vcpkg install --triplet x64-windows-static fontconfig freetype harfbuzz[icu,graphite2] + - if "%target_env%" == "msvc" set VCPKG_ROOT=%USERPROFILE%\vcpkg + - if "%target_env%" == "msvc" set TECTONIC_VCPKG=1 + - if "%target_env%" == "msvc" set RUSTFLAGS=-Ctarget-feature=+crt-static - rustc -vV - cargo -vV From fafece15163c028cb1188c97134f40b0c9e92327 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Wed, 7 Aug 2019 21:17:41 -0400 Subject: [PATCH 4/7] .appveyor.yml: (try to) avoid the Windows/MSVC test suite failure --- .appveyor.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.appveyor.yml b/.appveyor.yml index bf1f4b03a..30a6037d0 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -94,6 +94,8 @@ before_test: # Workaround rust#53454 - if "%target_env%" == "gnu" copy /y "C:\msys64\%mingw_subdir%\%mingw_target%\lib\crt2.o" %USERPROFILE%\.rustup\toolchains\%toolchain%\lib\rustlib\%target%\lib\crt2.o" - if "%target_env%" == "gnu" copy /y "C:\msys64\%mingw_subdir%\%mingw_target%\lib\dllcrt2.o" %USERPROFILE%\.rustup\toolchains\%toolchain%\lib\rustlib\%target%\lib\dllcrt2.o" + # Dodge format file locking issue in the test suite + - set RUST_TEST_THREADS=1 # Uses 'cargo test' to run tests and build. Alternatively, the project may call compiled programs # directly or perform other testing commands. Rust will automatically be placed in the PATH From 17065f68fa5c204aba1ef12dcea79528722f1038 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Fri, 16 Aug 2019 22:26:17 -0400 Subject: [PATCH 5/7] build.rs: abstract over dep-finding backend more explicitly --- .appveyor.yml | 2 +- build.rs | 187 ++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 135 insertions(+), 54 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 30a6037d0..d1475e2a8 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -76,7 +76,7 @@ install: - if "%target_env%" == "msvc" call %USERPROFILE%\vcpkg\bootstrap-vcpkg.bat - if "%target_env%" == "msvc" %USERPROFILE%\vcpkg\vcpkg install --triplet x64-windows-static fontconfig freetype harfbuzz[icu,graphite2] - if "%target_env%" == "msvc" set VCPKG_ROOT=%USERPROFILE%\vcpkg - - if "%target_env%" == "msvc" set TECTONIC_VCPKG=1 + - if "%target_env%" == "msvc" set TECTONIC_DEP_BACKEND=vcpkg - if "%target_env%" == "msvc" set RUSTFLAGS=-Ctarget-feature=+crt-static - rustc -vV - cargo -vV diff --git a/build.rs b/build.rs index de815edb3..2c1b1e574 100644 --- a/build.rs +++ b/build.rs @@ -1,35 +1,137 @@ // build.rs -- build helper script for Tectonic. -// Copyright 2016-2018 the Tectonic Project +// Copyright 2016-2019 the Tectonic Project // Licensed under the MIT License. -// -// TODO: this surely needs to become much smarter and more flexible. +/// The Tectonic build script. Not only do we have internal C/C++ code, we +/// also depend on several external C/C++ libraries, so there's a lot to do +/// here. It would be great to streamline things. +/// +/// TODO: this surely needs to become much smarter and more flexible. use cc; use pkg_config; use vcpkg; use std::env; -use std::path::PathBuf; +use std::path::{Path, PathBuf}; + +#[cfg(not(target_os = "macos"))] +const PKGCONFIG_LIBS: &'static str = + "fontconfig harfbuzz >= 1.4 harfbuzz-icu icu-uc freetype2 graphite2 libpng zlib"; // No fontconfig on MacOS: #[cfg(target_os = "macos")] -const LIBS: &'static str = "harfbuzz >= 1.4 harfbuzz-icu icu-uc freetype2 graphite2 libpng zlib"; +const PKGCONFIG_LIBS: &'static str = + "harfbuzz >= 1.4 harfbuzz-icu icu-uc freetype2 graphite2 libpng zlib"; + +/// Build-script state when using pkg-config as the backend. +#[derive(Debug)] +struct PkgConfigState { + libs: pkg_config::Library, +} + +// Need a way to check that the vcpkg harfbuzz port has graphite2 and icu options enabled. +#[cfg(not(target_os = "macos"))] +const VCPKG_LIBS: &[&'static str] = &["fontconfig", "harfbuzz", "freetype", "graphite2"]; #[cfg(target_os = "macos")] const VCPKG_LIBS: &[&'static str] = &["harfbuzz", "freetype", "graphite2"]; -#[cfg(not(target_os = "macos"))] -const LIBS: &'static str = - "fontconfig harfbuzz >= 1.4 harfbuzz-icu icu-uc freetype2 graphite2 libpng zlib"; +/// Build-script state when using vcpkg as the backend. +#[derive(Clone, Debug)] +struct VcPkgState { + include_paths: Vec, +} -#[cfg(not(target_os = "macos"))] -const VCPKG_LIBS: &[&'static str] = &["fontconfig", "harfbuzz", "freetype", "graphite2"]; -// Need a way to check that the vcpkg harfbuzz port has graphite2 and icu options enabled. +/// State for discovering and managing our dependencies, which may vary +/// depending on the framework that we're using to discover them. +/// +/// The basic gameplan is that we probe our dependencies to check that they're +/// available and pull out the C/C++ include directories; then we emit info +/// for building our C/C++ libraries; then we emit info for our dependencies. +/// Building stuff pretty much always requires some level of hackery, though, +/// so we don't try to be purist about the details. +#[derive(Debug)] +enum DepState { + /// pkg-config + PkgConfig(PkgConfigState), + + /// vcpkg + VcPkg(VcPkgState), +} + +impl DepState { + /// Probe for our dependent libraries using pkg-config. + fn new_pkg_config() -> Self { + let libs = pkg_config::Config::new() + .cargo_metadata(false) + .probe(PKGCONFIG_LIBS) + .unwrap(); + DepState::PkgConfig(PkgConfigState { libs }) + } + + /// Probe for our dependent libraries using vcpkg. + fn new_vcpkg() -> Self { + let mut include_paths = vec![]; + + for dep in VCPKG_LIBS { + let library = vcpkg::find_package(dep) + .expect(&format!("failed to load package {} from vcpkg", dep)); + include_paths.extend(library.include_paths.iter().cloned()); + } -fn load_vcpkg_deps(include_paths: &mut Vec) { - for dep in VCPKG_LIBS { - let library = vcpkg::find_package(dep).expect("failed to load package from vcpkg"); - include_paths.extend(library.include_paths.iter().cloned()); + DepState::VcPkg(VcPkgState { include_paths }) + } + + /// Invoke a callback for each C/C++ include directory injected by our + /// dependencies. + fn foreach_include_path(&self, mut f: F) + where + F: FnMut(&Path), + { + match self { + &DepState::PkgConfig(ref s) => { + for p in &s.libs.include_paths { + f(p); + } + } + + &DepState::VcPkg(ref s) => { + for p in &s.include_paths { + f(p); + } + } + } + } + + /// This function is called after we've emitted the cargo compilation info + /// for our own libraries. Now we can emit any special information + /// relating to our dependencies, which may depend on the dep-finding + /// backend or the target. + fn emit_late_extras(&self, target: &str) { + match self { + &DepState::PkgConfig(_) => { + pkg_config::Config::new() + .cargo_metadata(true) + .probe(PKGCONFIG_LIBS) + .unwrap(); + } + + &DepState::VcPkg(_) => { + if target.contains("-linux-") { + // add icudata to the end of the list of libs as vcpkg-rs + // does not order individual libraries as a single pass + // linker requires. + println!("cargo:rustc-link-lib=icudata"); + } + } + } + } +} + +/// The default dependency-finding backend is pkg-config. +impl Default for DepState { + fn default() -> Self { + DepState::new_pkg_config() } } @@ -37,26 +139,20 @@ fn main() { let target = env::var("TARGET").unwrap(); let rustflags = env::var("RUSTFLAGS").unwrap_or(String::new()); - let use_vcpkg = env::var("TECTONIC_VCPKG").is_ok(); - let mut deps = None; - let mut vcpkg_includes = vec![]; - if use_vcpkg { - load_vcpkg_deps(&mut vcpkg_includes); - eprintln!("{:?}", vcpkg_includes); - - if target.contains("-linux-") { - // add icudata to the end of the list of libs as vcpkg-rs does not - // order individual libraries as a single pass linker requires - println!("cargo:rustc-link-lib=icudata"); + // OK, how are we finding our dependencies? + + println!("cargo:rerun-if-env-changed=TECTONIC_DEP_BACKEND"); + + let dep_state = if let Ok(dep_backend_str) = env::var("TECTONIC_DEP_BACKEND") { + match dep_backend_str.as_ref() { + "pkg-config" => DepState::new_pkg_config(), + "vcpkg" => DepState::new_vcpkg(), + "default" => DepState::default(), + other => panic!("unrecognized TECTONIC_DEP_BACKEND setting {:?}", other), } } else { - // We (have to) rerun the search again below to emit the metadata at the right time. - let deps_library = pkg_config::Config::new() - .cargo_metadata(false) - .probe(LIBS) - .unwrap(); - deps = Some(deps_library); - } + DepState::default() + }; // Actually I'm not 100% sure that I can't compile the C and C++ code // into one library, but who cares? @@ -245,17 +341,10 @@ fn main() { .file("tectonic/xetex-XeTeXOTMath.cpp") .include("."); - if let Some(deps) = &deps { - for p in &deps.include_paths { - ccfg.include(p); - cppcfg.include(p); - } - } else { - for p in &vcpkg_includes { - ccfg.include(p); - cppcfg.include(p); - } - } + dep_state.foreach_include_path(|p| { + ccfg.include(p); + cppcfg.include(p); + }); // Platform-specific adjustments: @@ -298,15 +387,7 @@ fn main() { ccfg.compile("libtectonic_c.a"); cppcfg.compile("libtectonic_cpp.a"); - // Now that we've emitted the info for our own libraries, we can emit the - // info for their dependents. - - if let Some(_deps) = &deps { - pkg_config::Config::new() - .cargo_metadata(true) - .probe(LIBS) - .unwrap(); - } + dep_state.emit_late_extras(&target); // Tell cargo to rerun build.rs only if files in the tectonic/ directory have changed. for file in PathBuf::from("tectonic").read_dir().unwrap() { From 7167bc63d002a73f03faa87fca4a98688506cfa3 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sun, 18 Aug 2019 10:54:35 -0400 Subject: [PATCH 6/7] Fix some `cargo fmt` complaints --- src/app_dirs.rs | 5 ++++- src/config.rs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app_dirs.rs b/src/app_dirs.rs index 290a6830d..14f068d56 100644 --- a/src/app_dirs.rs +++ b/src/app_dirs.rs @@ -1,5 +1,8 @@ -use std::path::PathBuf; +// Copyright 2019 the Tectonic Project +// Licensed under the MIT License. + use app_dirs::{AppDataType, AppDirsError}; +use std::path::PathBuf; pub use app_dirs::sanitized; diff --git a/src/config.rs b/src/config.rs index a5f3281e2..f98f7f619 100644 --- a/src/config.rs +++ b/src/config.rs @@ -19,10 +19,10 @@ use std::sync::atomic::{AtomicBool, Ordering}; use crate::app_dirs; use crate::errors::{ErrorKind, Result}; -use crate::io::Bundle; use crate::io::itarbundle::{HttpITarIoFactory, ITarBundle}; use crate::io::local_cache::LocalCache; use crate::io::zipbundle::ZipBundle; +use crate::io::Bundle; use crate::status::StatusBackend; /// Awesome hack time!!! From 396d5dde55d5a319c1a62941aa0f251c82b44095 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Sun, 18 Aug 2019 11:43:41 -0400 Subject: [PATCH 7/7] dist/docker/x86_64-alpine-linux-musl/Dockerfile: add libbz2 to the link line It seems that we now need to include libbz2 in the set of forced static links. --- dist/docker/x86_64-alpine-linux-musl/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dist/docker/x86_64-alpine-linux-musl/Dockerfile b/dist/docker/x86_64-alpine-linux-musl/Dockerfile index eec236685..d2a1387f8 100644 --- a/dist/docker/x86_64-alpine-linux-musl/Dockerfile +++ b/dist/docker/x86_64-alpine-linux-musl/Dockerfile @@ -22,7 +22,7 @@ RUN sh /setup_unpriv.sh # happen: ADD cargo-config.toml /alpine/home/rust/.cargo/config -ENV RUSTFLAGS="-L /alpine/usr/lib -l static=expat -l static=uuid -l static=stdc++ -C target-feature=+crt-static" +ENV RUSTFLAGS="-L /alpine/usr/lib -l static=expat -l static=bz2 -l static=uuid -l static=stdc++ -C target-feature=+crt-static" ENV TARGET_CC="x86_64-unknown-linux-musl-cc" ENV TARGET_CXX="x86_64-unknown-linux-musl-g++" ENV PKG_CONFIG_ALLOW_CROSS=1