IRNAS/irnas-east-software

build directory is not deleted using east clean when it is not named build

Opened this issue · 3 comments

Describe the bug
When using the --build-dir flag, the build directory will not be deleted on a subsequent call to east clean unless it is called exactly build which defeats the purpose of the --build-dir flag.

Firmware/Software Version
0.6.2

To Reproduce
Steps to reproduce the behavior. Example using hello world sample:

cd zephyr/samples/hello_world
# board does not matterr
east build -b nrf52840dk_nrf52840 --build-dir build_52dk
# observe a folder named build_52dk was created
ls

east clean
# observe the folder named build_52dk is still there
ls

To implement this I would have to save some kind of data in the ~/.local/share/east folder to keep track of where build folders of previous builds are stored.

So I would need a mapping between:

  • folder path where build command was called and
  • path to the build folder that was created at build call.

This is a one to many relationship, as it is valid to do:

east build
east build --build-dir my_build_dir

(Should calling east clean on this same path clear both (all) build folders or just the last one?)

Also, if we were thinking that having a east clean --all (clear all build folders in the project repository) would be useful.

In that case there should be some relationship between project and above mentioned mappings.
Otherwise you would write east clean --all and it would wipe all build folders that you ever created with east.

@TjazVracko what do you think about above, there are probably some mistakes in the logic.

I think you should add the metadata to each project (like west does in .west).

east clean should remove all build folders in the current directory.
east clean --all should clean all build folders in this project - I think you can limit yourself to only the project folder. Keeping track of all samples in nrf/zephyr/... is overkill.