Skip to content
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

Debug ci #1085

Merged
merged 11 commits into from
Apr 1, 2021
Merged

Debug ci #1085

merged 11 commits into from
Apr 1, 2021

Conversation

waych
Copy link
Contributor

@waych waych commented Mar 30, 2021

Creating this PR to iterate on windows-latest vcpkg CI debug.

@waych
Copy link
Contributor Author

waych commented Mar 30, 2021

Accidentally based this PR off the wrong branch at first, then forced a repush with just the debug.

In the first run however, the linux (bundled) run failed with:

Caused by:
  process didn't exit successfully: `/home/runner/work/rust-sdl2/rust-sdl2/target/debug/build/sdl2-sys-e84c5b63e6bda213/build-script-build` (exit code: 101)
  --- stderr
  thread 'main' panicked at 'Command 'curl' failed:   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
  
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  curl: (7) Failed to connect to libsdl.org port 443: Connection refused
  ', sdl2-sys/build.rs:61:17

A failure to fetch the upstream sources. I wonder if this is the same sort of flake that just happens to be hitting the Windows vcpkg build too (maybe more often if it is a static IP?).

@waych
Copy link
Contributor Author

waych commented Mar 30, 2021

Looks like the vcpkg build of sdl-gfx is choking due to invalid character set translation happening in the somewhere in microsoft's toolchain.

 D:\a\rust-sdl2\rust-sdl2\target\vcpkg\buildtrees\sdl2-gfx\src\1.0.4-86ce4cf464\SDL2_gfxPrimitives_font.h(1559): warning C4828: The file contains a character starting at offset 0x7375 that is illegal in the current source character set (codepage 65001).
D:\a\rust-sdl2\rust-sdl2\target\vcpkg\buildtrees\sdl2-gfx\src\1.0.4-86ce4cf464\SDL2_gfxPrimitives_font.h(1559): warning C4828: The file contains a character starting at offset 0x744f that is illegal in the current source character set (codepage 65001).

codepage 65001 is utf-8 so this seems like a valid thing to warn about?

@waych
Copy link
Contributor Author

waych commented Mar 30, 2021

an error:

 D:\a\rust-sdl2\rust-sdl2\target\vcpkg\buildtrees\sdl2-gfx\src\1.0.4-86ce4cf464\SDL2_gfxPrimitives.c(1766): error C2169: 'lrint': intrinsic function, cannot be defined

@waych
Copy link
Contributor Author

waych commented Mar 30, 2021

This was fixed in upstream vcpkg already: microsoft/vcpkg#14348

Will try spinning with an updated vcpkg ref pointer.

@waych
Copy link
Contributor Author

waych commented Mar 30, 2021

windows-latest passes at vcpkg HEAD, but ubuntu-latest is broken (missing symbols in link for brotli).

@waych
Copy link
Contributor Author

waych commented Mar 31, 2021

Spent a good while today trying to understand why the ubuntu-latest build breaks when vcpkg is updated to HEAD.

The root of the issue appears to be final link for the examples, where a the final link is:

"cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-Wl,--eh-frame-hdr" "-L" "/home/mike/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.10idwqarplkgc4a6.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.11h2ee86adxik22t.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.11trwys7c9paqhqf.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.15kyrr6pqr1ttucm.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.16h54pz658ysu0jc.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.17i69agx7uit0dtz.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.182tznmjyoat650b.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.1b75gphnfapu8dyz.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.1e869im5c3t54ggu.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.1enuqan2hrvmtsai.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.1fr4xtszp451pdna.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.1h4yi2w2wk5ra7aa.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.1jite5tufevzcvy8.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.1kckid9yu05ad241.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.1o912rvd9kv9v15w.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.1t1lf6nkt3viwrhf.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.1t8tqreb8uef3j7x.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.1tet76652g4u7axl.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.1uiggf4ffvphwk41.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.1y8ccfmt7au3kyoa.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.1ywyjvoxb272neok.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.22hnz0p4p5hauu7s.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.22xc5jkaa2adxesk.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.23fqb302pcs4b2jd.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.25xtes9ix0fxif3y.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.273iumqb6up3g4d8.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.28vm8scakjo0hjk6.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.2aygwmazusuyydcr.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.2ex8civq2lh5o5hz.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.2izjvehlj743e8ol.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.2l2qnpy5zjar5fhj.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.2opizyggjtfux7u4.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.2pc9tdvcvncrbph2.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.2sq8czaki95iumst.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.2tx0sk09a01hcyac.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.391ge9kop3f7jto8.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.3adkqkuvvu2c18op.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.3au1mgxtbjrzqih0.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.3byxn59u2v3tgywl.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.3dv1pf7c4efobk12.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.3fwswkqa3ys74ldj.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.3pvv265o9k7woqbd.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.3t81hn3xdhxmbzwr.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.3uudgns5qf0bevsm.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.3v270y2nr5c4ujee.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.3y3q5da7at0569v3.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.40jle900b3g7qmjt.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.40oz8vl6jdpidyrn.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.42p48moable96b55.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.45vnj9y36vn26690.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.478hhyi5o9p151rl.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.47mxxzaiyan6pza3.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.49ethqdmgjx8zue.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.4bg12q02lxyaj5h7.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.4edt9v7b4ly31365.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.4h9d8srbg09k1cbq.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.4ibcetljxwlovrw8.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.4khsr03c1kovx4r5.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.4nash5eegssobu09.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.4nbe56dlgcsorifw.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.4nrflwagckfc6z9g.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.4ntswaf6dq1xan95.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.4oubos2x08om6fjv.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.4rtnb4dgmtvlze71.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.4t3pr9pcykzlt2g5.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.4tdy82rncgm3eas8.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.4udngupicgrz40a8.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.4xljwvdx3mrlrqxq.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.4zxpwrj7wtguukwy.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.518fa1q90fv68osv.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.51ixi3d4834rb67u.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.54wlxvxjg91c0sbt.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.55uvxghax6vc6tyf.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.578z0lgfi4kgnycs.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.5d8xqjb7wh6ynzjz.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.5vissx26lizxzv.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.6pp04zl411ue6io.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.84te99y036lke5i.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.9ut7r3slbaovefc.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.bqb2otte46v5ood.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.jxgllx6rj9gi1up.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.lkbfz6dhh7urdki.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.mh6ecy6i1qkwjc8.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.p0m9yggd392k28r.rcgu.o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.v4pexvv57k2so7t.rcgu.o" "-o" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6" "/home/mike/linux-code/rust-sdl2/target/debug/examples/resource_manager-0d824b03450856f6.kxfk35g2wg2q114.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro" "-Wl,-znow" "-nodefaultlibs" "-L" "/home/mike/linux-code/rust-sdl2/target/debug/deps" "-L" "/home/mike/linux-code/rust-sdl2/target/vcpkg/installed/x64-linux/lib" "-L" "/home/mike/linux-code/rust-sdl2/target/vcpkg/installed/x64-linux/lib" "-L" "/home/mike/linux-code/rust-sdl2/target/vcpkg/installed/x64-linux/lib" "-L" "/home/mike/linux-code/rust-sdl2/target/vcpkg/installed/x64-linux/lib" "-L" "/home/mike/linux-code/rust-sdl2/target/vcpkg/installed/x64-linux/lib" "-L" "/usr/lib/x86_64-linux-gnu" "-L" "/home/mike/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/mike/linux-code/rust-sdl2/target/debug/deps/libsdl2-75389b90956b3f41.rlib" "/home/mike/linux-code/rust-sdl2/target/debug/deps/libc_vec-e11f43463ff8624b.rlib" "/home/mike/linux-code/rust-sdl2/target/debug/deps/libsdl2_sys-796eaa3f02f97e74.rlib" "/home/mike/linux-code/rust-sdl2/target/debug/deps/libbitflags-fec8e9ae1a67719f.rlib" "/home/mike/linux-code/rust-sdl2/target/debug/deps/liblazy_static-ff2d4c059a61c830.rlib" "/home/mike/linux-code/rust-sdl2/target/debug/deps/liblibc-2fae61444c6a5793.rlib" "-Wl,--start-group" "/home/mike/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-61556e43b375c2c0.rlib" "/home/mike/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-787faa8b02fbd963.rlib" "/home/mike/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-dda4c0b69607e93b.rlib" "/home/mike/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-4b7dae8949ac132c.rlib" "/home/mike/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-978e97832b309706.rlib" "/home/mike/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-073b1b693304b876.rlib" "/home/mike/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-c07f996a53ee6558.rlib" "/home/mike/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-0ae8ed6a282247d0.rlib" "/home/mike/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-978dd04958b6ebcc.rlib" "/home/mike/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-14b94bdd9a47d665.rlib" "/home/mike/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-bff7534e4dfcef6c.rlib" "/home/mike/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-022f1a0e7cd794ec.rlib" "/home/mike/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-ff456575f1773ef0.rlib" "/home/mike/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-3aeb407930ebd519.rlib" "/home/mike/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-6ab1ee6dbc17ad08.rlib" "/home/mike/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-166dae07beec0398.rlib" "-Wl,--end-group" "/home/mike/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-761b290f47712921.rlib" "-Wl,-Bdynamic" "-lSDL2_image" "-ltiff" "-ltiffxx" "-llzma" "-ljpeg" "-lturbojpeg" "-lwebp" "-lwebpdecoder" "-lwebpdemux" "-lwebpmux" "-lSDL2_ttf" "-lfreetype" "-lz" "-lpng" "-lpng16" "-lbz2" "-lbrotlicommon-static" "-lbrotlidec-static" "-lbrotlienc-static" "-lSDL2_mixer" "-lSDL2_gfx" "-lSDL2" "-lSDL2main" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc"

The breakage happens because "-Wl,--as-needed" and the ordering of the following: "-lbrotlicommon-static" "-lbrotlidec-static" "-lbrotlienc-static". Swapping these around so "-lbrotlicommon-static" is last works, as its unused symbols don't get pruned before the links for the codec halves.

I spent a good amount of time trying to work out where that ordering comes from exactly, without any success. I've iterated through several variations in the CMake and automake as well as in the vcpkg port, but I still haven't lucked my way to re-ordering what is processed.

I'm wondering if the ordering isn't just alphabetic sorted flat as the three libs are defined flat among each other in pkg-config, but I'm not very sure how these are getting sourced.

@Cobrand
Copy link
Member

Cobrand commented Mar 31, 2021

Thanks, it's really appreciated! If ubuntu-latest fails now but didn't fail before, then it looks like the error is coming from vspkg itself, isn't it? In that case, perhaps we could try to somehow git bisect vcpkg itself to see where the error is coming from, report it upstream and in the meanwhile only use the latest commit that works for all platforms?

@waych
Copy link
Contributor Author

waych commented Mar 31, 2021

Yes the error is from vcpkg. Unfortunately, I tried both vcpkg HEAD above, as well as at the commit where the vs2019 fix is added, and both have the same link errors for brotli, implying that there doesn't exist a commit yet upstream where all three builds would work at the same commit.

I spent more time digging into how the ordering comes about and indeed within cargo-vcpkg (specifically the vcpkg crate that is used by build.rs) the libs are discovered by path matching the installed package's manifest, which is listed alphabetically (so in the wrong --as-needed sort order). I think the solution is to fold the brotlicommon-static archive into both the brotlidec-static and brotlienc-static archives. Will file an issue against upstream and cook up a pull request with my suggested fix.

waych added a commit to waych/vcpkg that referenced this pull request Mar 31, 2021
This change allows downstream consumers of the archives to not worry
about ordering the link correctly when using this package, which can be
problematic when --as-needed is passed to the linker and the order isn't
otherwise known.

Keeping the brotlicommon-static archive as is allows for probing of the
brotli libraries to remain symmetric between dynamic and static links.

Fixes static linking issue discussed in
microsoft#16991 which is blocking
rust-sdl2 CI dependent upon vcpkg discussed here
Rust-SDL2/rust-sdl2#1085 .
@waych
Copy link
Contributor Author

waych commented Mar 31, 2021

vcpkg pr sent for brotli, rust-sdl2 CI is now passing with the vcpkg pointing at the fix at my github. :D

@Cobrand
Copy link
Member

Cobrand commented Apr 1, 2021

Honestly, I can't thank you enough, huge props to you for finding this out, it's really appreciated! Merging this!

@Cobrand Cobrand merged commit 68ae17c into Rust-SDL2:master Apr 1, 2021
waych added a commit to waych/vcpkg-rs that referenced this pull request Apr 1, 2021
vcpkg-rs discovers libraries to link using the manifest files from
vcpkg.

While ports are handled corrrectly already in dependency order, multiple
libraries defined by a single Port are otherwise not sorted. This can
cause problems when there is an explicit ordering that should be obeyed.

This is observed when building rust-sdl2 using the 'use-vcpkg' flag, as
this transitively includes the broli port, which defines 3 libraries:
libbrotlicommon, libbrotlidec and libbrotlienc. These libraries expect
to be linked with libbrotlicommon last, as otherwise rustc's invocation
of link will fail (as --as-needed is passed to the linker).

See also: microsoft/vcpkg#16991
See also: Rust-SDL2/rust-sdl2#1085

This commit works around the issue by teaching vcpkg-rs the bare minimum
required to parse (optional) .pc files if they are available in the
vcpkg package, and uses them to infer the correct ordering that should
be used.

Closes mcgoo#26
@waych waych deleted the debug_ci branch April 2, 2021 15:26
waych added a commit to mcgoo/vcpkg-rs that referenced this pull request Apr 16, 2021
vcpkg-rs discovers libraries to link using the manifest files from
vcpkg. The manifest files do not indicate any ordering of library files.

While ports are handled correctly already in dependency order, multiple
libraries defined by a single Port are otherwise not sorted. This can
cause problems when there is an explicit ordering that should be obeyed.

This is observed when building rust-sdl2 using the 'use-vcpkg' flag, as
this transitively includes the brotli port, which defines 3 libraries:
libbrotlicommon, libbrotlidec and libbrotlienc. These libraries expect
to be linked with libbrotlicommon last, as otherwise rustc's invocation
of link will fail (as --as-needed is passed to the linker).

See also: microsoft/vcpkg#16991
See also: Rust-SDL2/rust-sdl2#1085

This commit works around the issue by teaching vcpkg-rs the bare minimum
required to parse (optional) .pc files if they are available in the
vcpkg package, and uses them to infer the correct ordering that should
be used.

Closes #26
sypwex pushed a commit to sypwex/rust-sdl2 that referenced this pull request Jun 2, 2024
* Add verbose flag (-v) to `cargo vcpkg build` in CI
* Fix CI so that it works for all platforms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants