| Summary: | Need to validate user isn't building in a PSEUDO_IGNORE_PATHS | ||
|---|---|---|---|
| Product: | [Build System, Metadata & Runtime] OE-Core | Reporter: | Richard Purdie <richard.purdie> |
| Component: | core | Assignee: | Dorinda <dorindabassey> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | Medium+ | CC: | dorindabassey, meta.mr.watcher, meta.watcher, randy.macleod, yf3yu |
| Version: | 3.3 | ||
| Target Milestone: | 3.3 M3 | ||
| Hardware: | x86 | ||
| OS: | Multiple | ||
| Whiteboard: | NEWCOMER | ||
| OS type for building Yocto: | --- | Type of Regression: | --- |
| Verified: | Documentation change: | Yes (doc changes required) | |
|
Description
Richard Purdie
2021-01-09 09:27:29 UTC
Hi, Would adding this check in the function in sanity.bbclass suffice?
def check_sanity_everybuild(status, d):
# Check that user isn't building in PSEUDO_IGNORE_PATHS
pseudoignorepaths = d.getVar('PSEUDO_IGNORE_PATHS').split(",")
workdir = d.getVar('WORKDIR')
for i in pseudoignorepaths:
if(i in workdir):
status.addresult("you are building in a path under PSEUDO_IGNORE_PATHS, please remove this" + str(i) + "directory in \nParsed WORKDIR: " + str(workdir) + "\n")
I think rather than "i in workdir", you might want to use: if workdir.startswith(i): but otherwise it looks good to me. Oh, also, do we need to run this test everybuild? I think we already test when tmpdir changes so we probably don't need to. looks like Dorinda did the work for me. I'll new to the project so I'll try to come up with my own solution. Dorinda, Feel free to send your patch in though, I can also run some tests Ok i get Thanks, so since workdir path already begins with tmpdir, then it might be better to add this under the conditional statement that checks when tmpdir changes:
# Also Check that user isn't building in PSEUDO_IGNORE_PATHS
pseudoignorepaths = d.getVar('PSEUDO_IGNORE_PATHS').split(",")
for i in pseudoignorepaths:
if tmpdir.startswith(i):
status.addresult("your tmpdir also contains a PSEUDO_IGNORE_PATHS, please remove this" + str(i) + "directory in \nParsed TMPDIR: " + str(tmpdir) + "\n")
oh Alright Yi Fan Yu, i will send a patch in due time thanks. Let's make this official since Dorinda is working on this bug. Thanks Dorinda. Since I won't be working on this anymore,
Here might be something to keep in mind with PSEUDO_IGNORE_PATH
-variables are included in the PSEUDO_IGNORE_PATH
`${BUILDHISTORY_DIR}` and `${CCACHE_DIR}`
More things...
-just doing `i in list` can cause issues such as if i am building in
`home/NAME/usr/b/` the sanity check might trigger since it found `/usr`
-I think it makes sense just inserting it in `check_sanity_version_change(..)`
so it runs basically once.
only issue I see is that a person might move everything to a suspicious directory after a build. -_-
Okay i see, thank you Yi Fan Yu, took note of your points hence am adding this in
check_sanity_version_change(status, d):
# Check that user isn't building in PSEUDO_IGNORE_PATHS
pseudoignorepaths = d.getVar('PSEUDO_IGNORE_PATHS', expand=True).split(",")
workdir = d.getVar('WORKDIR', expand=True)
for i in pseudoignorepaths:
if workdir.startswith(i):
status.addresult("you are building in a path under PSEUDO_IGNORE_PATHS, please remove this" + str(i) + "directory in \nParsed WORKDIR: " + str(workdir) + "\n")
i should submit a patch soon.
patch submitted to mailing list @ https://lists.openembedded.org/g/openembedded-core/message/147238?p=,,,20,0,0,0::Created,,verify+that+user,20,2,0,80117826 Thanks Dorinda. Next time please provide a link to the commit since not all submissions to the emails list are merged. This one is on master: http://cgit.openembedded.org/openembedded-core/commit/?id=7a681525e904914e938de25df5cc64209097d15d |