Bug 9982

Summary: Move patches directory to WORKDIR/patches from S/patches
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Chris Lord <chrislord.net>
Component: coreAssignee: Unassigned <unassigned>
Status: NEW --- QA Contact:
Severity: normal    
Priority: Medium CC: brendan.le.foll, meta.mr.watcher, meta.watcher, poky.bs.watcher, poky.watcher, randy.macleod, richard.purdie, ross.burton, sgw, thomas.epperson
Version: 2.1   
Target Milestone: 6.99   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Yes (doc changes required)

Description Chris Lord 2016-07-19 19:26:53 UTC
The do_install function defined by npm.bbclass does this:

npm_do_install() {
	mkdir -p ${NPM_INSTALLDIR}/
	cp -a ${S}/* ${NPM_INSTALLDIR}/ --no-preserve=ownership
}

This is roughly equivalent of what node does, I think, except that bitbake will put the patches directory in ${S}, so you end up packaging any patches for the recipe being built.

It might be nice to have an exclusion list for files/directories not to be included in npm_do_install, and certainly recipe files should not be packaged by default.
Comment 1 Ross Burton 2016-07-19 19:32:31 UTC
Aside from the function not having any pruning: I'd suggest that backup files and so on should also be filtered out, we *really* need to stop putting patches/ under ${S}.  Why can't we move that to ${WORKDIR}?
Comment 2 Ross Burton 2017-12-07 16:01:21 UTC
*** Bug 12397 has been marked as a duplicate of this bug. ***
Comment 3 Randy MacLeod 2023-10-24 14:24:44 UTC
Bulk move from 4.99 or 0.00 to 5.99
Comment 4 Richard Purdie 2025-12-11 16:26:26 UTC
We have changed the location of sources from unpackdir however patches are still created in S by quilt (along with .pc). Moving that would cause problems for those manually calling quilt from the directory and create a different usability issue for those using quilt to manage patches directly.

There probably is some improvement we can make here but it isn't trivial.

Ross does have branches that change the default patches directory for quilt but builds then don' work with a lot of breakage.