How to apply `patches` with `sourceRoot`?

How does one apply patches before switching to sourceRoot? I have a patch that applies to the root directory of a project, but I am attempting to build a package that is a subdirectory of the project root. Simply combining patches and sourceRoot does not work: patch application fails because it’s not able to find all of the files necessary in the locations expected. How does one do this?

I’d instead set patchFlags to strip more elements of the patch path.

1 Like

This would conceivably lead to conflicting patches being applied eg if my patch includes diffs on both foo/setup.py and bar/setup.py, what would happen if sourceRoot is foo and I use --strip=1?

There’s also the -d option if you have other files in the patch.

1 Like

Thanks, I think that will work!