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

Do not run system-dependent examples #213

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jeandudey
Copy link

Hello!

I'm packaging just on GNU Guix and found some friction when packaging this crate1 (Guix needs all dependencies to be compiled an tested) because it requires access to some executables that are system dependent, so I've marked some of the doc-tests to not run (but will be compiled) so testing can be done on GNU Guix (each build is a container with minimal utilities needed to compile the source code with the additional dependencies).

Also I've relaxed the version requirements on Cargo.toml, this to make maintenance easier on GNU Guix side as some of the dependencies might not be on the latest released version. (crates are updated but it's a slow process and maybe some crates have semver breaking changes). To overcome the MSRV issue on the CI, I pinned the bitflags crate on the GitHub workflow.

Copy link
Owner

@soenkehahn soenkehahn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jeandudey, thanks for the PR!

cradle relies on the doctests being run for test-coverage. So I don't think it's a good idea to disable them. Also, you say that guix needs all tests to be run. That also sounds like you shouldn't just disable them. :) Could you explain, which executables the test-suite relies on, that aren't available on the guix test environment when building cradle? I'm not a guix expert, but I would assume that there's some way to declare dependencies that are only needed to run the tests. Is that not the case?

Regarding the bitflags change: Could you explain what problem you ran into exactly? Which compiler version or versions did you use? And which bitflags versions are available?

Also, I think it could be helpful to split these two changes up into separate PRs. So that we can discuss them separately and not have one depend on the other.

@jeandudey
Copy link
Author

Could you explain, which executables the test-suite relies on, that aren't available on the guix test environment when building cradle? I'm not a guix expert, but I would assume that there's some way to declare dependencies that are only needed to run the tests. Is that not the case?

Yeah, that's what I did with with it on Guix, declaring all the dependencies, see here for the dependencies, xxd, coreutils and which. One of the doc tests also tries to access $HOME which is not available on the build container. If these tests test the functionality of the crate directly it would be better to switch them to normal tests (#[test]) so if they fail on Guix (or other distributions that package rust crates like Ubuntu or Debian) because of differences with a normal Linux distribution they can be skipped/ignored at the test phase.

Regarding the bitflags change: Could you explain what problem you ran into exactly? Which compiler version or versions did you use? And which bitflags versions are available?

The code currently expects the exact version of bitflags, Guix only packages a single major version of the package (unless the package breaks semver and a specific minor one needs to be included) to make things easier, and, currently a higher version is packaged, so, build breaks.

The bitflags 1.2.1 crate can still be pinned on CI to avoid the MSRV compilation error.

That's also the reason for relaxing the other versions as Guix packages older o newer crates. For example, see this.

Also, I think it could be helpful to split these two changes up into separate PRs. So that we can discuss them separately and not have one depend on the other.

Yeah for sure!

@jeandudey jeandudey changed the title Fix compilation for GNU Guix Do not run system-dependent examples Aug 1, 2022
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