balena-os / balena-supervisor

Balena Supervisor: balena's agent on devices.
https://balena.io
Other
148 stars 63 forks source link

'npm run release' fails on multiple runs. #1768

Open peakyDicers opened 3 years ago

peakyDicers commented 3 years ago

When you run npm run release more than once, you will get these errors and fail.

mv: cannot move 'build/src/compose' to 'build/compose': Directory not empty
mv: cannot move 'build/src/config' to 'build/config': Directory not empty
mv: cannot move 'build/src/device-api' to 'build/device-api': Directory not empty
...

I noticed this while trying to run dindctl refresh. I was able to fix this by adding rm -rf build to the beginning of the release command.

Does this seem okay? If so, I can go ahead and submit a PR.

cywang117 commented 3 years ago

Hi @peakyDicers, thanks for opening this issue. Currently npm run release is only run during image build, so it's only ever run once and thus we haven't encountered this situation. Of course, dindctl refresh does appear to use the script, but we're not using docker-in-docker for the majority of our development so we haven't encountered this situation there either. I do remember @Page- listing a good use case for dind -- Page, what do you think about maintaining dind in the Supervisor repo? Should we continue to do so?

Ian, we do have an npm script which functions as rm -rf build: it's npm run clean, and it supports Windows workflows as well :)