mcgoo / vcpkg-rs

Build library for finding native libraries in vcpkg for Rust - Windows (msvc), Linux and macOS
https://docs.rs/vcpkg
Apache License 2.0
108 stars 22 forks source link

Test failed because of missing test-data #35

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hi. i am trying too package vcpkg-rs in fedora and the test failed because the test-data are not include in the crate source. https://download.copr.fedorainfracloud.org/results/remilauzier/rust-simp/fedora-rawhide-x86_64/02251202-rust-vcpkg/builder-live.log.gz At the end of the log you can see the issue. Thanks for your time.

waych commented 3 years ago

It looks to me like this isn't an issue of test-data missing, but rather a few missing build steps.

vcpkg-rs is a build crate that allows rust users source libraries to link from a prebuilt microsoft/vcpkg tree.

To build the prebuilt vcpkg tree, one normally would use cargo-vcpkg, by invoking the following steps before cargo build:

cargo install cargo-vcpkg     # once per dev environment
cargo vcpkg build             # download and build dependencies from vcpkg in ./target/vcpkg

These steps are required to build the crate.

Re: Fedora integration, I'm not really sure what the goal here is, or how distributions are expecting to package Rust crates in general, and how this would apply to build-helper crates like this one in particular. Do you have pointers of what your goals are so I can better understand?

ghost commented 3 years ago

For now i need to package vcpkg-rs to be able to package libwebp-sys2 and so on. You can see fedora guideline for rust there: https://docs.fedoraproject.org/en-US/packaging-guidelines/Rust/ I need the test-data since fedora build package without internet access, so it need to be in the crate source for the test to pass. Here an exemple of a rust package in fedora: https://src.fedoraproject.org/rpms/rust-ripgrep/blob/rawhide/f/rust-ripgrep.spec

waych commented 3 years ago

Hmm, I was mistaken in my understanding of the test-data breaks you are seeing. I assumed it was due to needing a full tree, but looking more closely at the tests, they are not reliant on pulling and building a working tree, instead are dependent upon a proper test-data files.

If I'm understanding correctly now (thanks for the links!), Fedora is pulling the crate sources as published from crates.io, and the issue is that test-data/ isn't included in that published image?

ghost commented 3 years ago

Exactly! Thanks for your work!

waych commented 3 years ago

This should now be addressed in 0.2.14.