Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
freertos-variscite: Fix compile failure when do_compile is rerun
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]>
- Loading branch information