Skip to content

Commit

Permalink
Don't check .gitignore files in parent directories
Browse files Browse the repository at this point in the history
When building inside a .gitignore'd output directory as part of
another build system maturin may accidentially pick up the parent
.gitignore. Lets just disable searching for parent .gitignore
files since this functionality is broken anyways as the logic does
not match git's .gitignore logic anyways.

For example in buildroot we have an output directory that has its
contents gitignored in which maturin will build packages, changing
some minor implementation details in how we ignore this directory
triggered this bug.

buildroot/buildroot@a14c862

As the output dir files are supposed to be ignored both before and
after this change this indicates that ignore::WalkBuilder parent
matching is fundamentally broken and can not be used reliably
in the first place as it does not match git's ignore logic.

Signed-off-by: James Hilliard <[email protected]>
  • Loading branch information
jameshilliard committed Jul 23, 2024
1 parent 46cce03 commit e0740d1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/module_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1286,7 +1286,11 @@ pub fn write_python_part(
}

for package in python_packages {
for absolute in WalkBuilder::new(package).hidden(false).build() {
for absolute in WalkBuilder::new(package)
.hidden(false)
.parents(false)
.build()
{
let absolute = absolute?.into_path();
let relative = absolute.strip_prefix(python_dir).unwrap();
if absolute.is_dir() {
Expand Down

0 comments on commit e0740d1

Please sign in to comment.