Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

freertos-variscite: Fix compile failure when do_compile is rerun #29

Open
wants to merge 1 commit into
base: kirkstone-var02
Choose a base branch
from

Conversation

kraj
Copy link

@kraj kraj commented Jul 25, 2023

do_compile could be rerun on a previous built tree, the do_compile of this recipe however is doing renaming and moving of files and then assuming the pristine condition is hard because it would have run these operations in prior run, in second run it does not find the ${S}/boards/${CM_BOARD}/demo_apps/disable_cache/ dir and find cmd fails to execute

| find: ‘/mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/freertos-variscite/2.9.x-r0/git/boards/som_mx8qm/demo_apps/disable_cache/hello_world’: No such file or directory | WARNING: /mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/freertos-variscite/2.9.x-r0/temp/run.do_compile.406532:151 exit 1 from 'find /mnt/b/yoe/master/build/tmp/work/imx8qm_var_ som-yoe-linux/freertos-variscite/2.9.x-r0/git/boards/som_mx8qm/demo_apps/disable_cache/ -name 'hello_world' -exec sh -c 'mv "$1" "$(echo "$1" | sed s/hello_world/disable_cache/)"' _ {} ;'

do_compile could be rerun on a previous built tree, the do_compile of
this recipe however is doing recursive copying of files, cp -r cmd as
specified first time will create disable_cache directory and then copy
the contents of hello_world/ directory not the top level hello_world/
itself. So after first run it looks like

% ls -l /mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/freertos-variscite/2.9.x-r0/git/boards/som_mx8qm/demo_apps/disable_cache
total 12K
drwxr-xr-x 3 kraj kraj 4.0K Jul 25 20:30 cm4_core0/
drwxr-xr-x 3 kraj kraj 4.0K Jul 25 20:30 cm4_core1/

However on rebuild do_compile is executed again and this time
disable_cache folder is already existing and this time cp -r will copy
complete hello_world/ folder under disable_cache/ so it looks like

% ls -l /mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/freertos-variscite/2.9.x-r0/git/boards/som_mx8qm/demo_apps/disable_cache
total 12K
drwxr-xr-x 3 kraj kraj 4.0K Jul 25 20:30 cm4_core0/
drwxr-xr-x 3 kraj kraj 4.0K Jul 25 20:30 cm4_core1/
drwxr-xr-x 4 kraj kraj 4.0K Jul 25 20:26 hello_world/

and then find cmd goes wrong

| find: ‘/mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/freertos-variscite/2.9.x-r0/git/boards/som_mx8qm/demo_apps/disable_cache/hello_world’: No such file or directory
| WARNING: /mnt/b/yoe/master/build/tmp/work/imx8qm_var_som-yoe-linux/freertos-variscite/2.9.x-r0/temp/run.do_compile.406532:151 exit 1 from 'find /mnt/b/yoe/master/build/tmp/work/imx8qm_var_
som-yoe-linux/freertos-variscite/2.9.x-r0/git/boards/som_mx8qm/demo_apps/disable_cache/ -name '*hello_world*' -exec sh -c 'mv "$1" "$(echo "$1" | sed s/hello_world/disable_cache/)"' _ {} \;'

To fix this we make cp -r consistent by explicitly creating
disable_cache/ folder and copying whats inside hello_world/
with -u option which will only replace them if source file is newer.

This fixes the second rebuild issue

Signed-off-by: Khem Raj <[email protected]>
@kraj kraj force-pushed the yoe/freertos-rebuild branch from 2feb474 to 96862a8 Compare July 26, 2023 03:39
@nsdrude nsdrude self-requested a review April 4, 2024 16:59
@nsdrude nsdrude self-assigned this Apr 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants