Skip to content

include_dir integration test fails when built under the Debian packaging infrastructure. #88

Description

@igor-petruk

Hi,

I was working on packaging this crate to include it to Debian. It will be a dependency of something else there. The crate builds and works just fine, but the test fails and it is nice thing to have working tests under Debian Rust packaging infrastructure.

The root cause is very interesting: https://github.com/Michael-F-Bryan/include_dir/blob/master/include_dir/tests/integration_test.rs#L5

This line includes the source code of the tool itself into the test. Under normal circumstances include_dir is a subcrate of a workspace. This means the target directory resided outside of it's directory, level up.

Under debian the package is fetched from the crates.io, so it ends up being a top directory of itself. For this reason the test attempts to include target directory, which somehow overwhelms the include_dir (maybe it is size, maybe it is a race condition), but the file under test src/main.rs does not get included. Same about the extraction test.

I just wanted to let you know about this and ask if you'd be willing to fix this. Or alternatively accept a PR with the fix, I can work on that. In the case of latter, should I try to find the solution on my own, or do you have some advice on would would be a preferrable fix? If I were to work on the PR I'd probably include a dedicated tests/testdata subdirectory with a few files and subdirectories.

Thanks,
Igor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions