[Bug]: On Mac OS `CLEAN_LEVEL="sources"` fails for docker build
- Dominant language
- Shell
- Stars
- 5.4k
- Forks
- 3.1k
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 204
Description
### What happened?
On a Darwin (Mac OS) host, building is done through docker and fine, unless specifying CLEAN_LEVEL="sources"
```
[🐳|🌱] Cleaning [ sources ]
rm: cannot remove '/armbian/cache/sources/linux-kernel-worktree': Device or resource busy
rm: cannot remove '/armbian/cache/sources/u-boot-worktree': Device or resource busy
[🐳|💥] Error 1 occurred in main shell [ at /armbian/lib/functions/general/cleaning.sh:43
general_cleaning() --> lib/functions/general/cleaning.sh:43
do_with_logging() --> lib/functions/logging/section-logging.sh:81
main_default_build_packages() --> lib/functions/main/build-packages.sh:66
full_build_packages_rootfs_and_image() --> lib/functions/main/default-build.sh:31
do_with_default_build() --> lib/functions/main/default-build.sh:42
cli_standard_build_run() --> lib/functions/cli/cli-build.sh:25
armbian_cli_run_command() --> lib/functions/cli/utils-cli.sh:136
cli_entrypoint() --> lib/functions/cli/entrypoint.sh:208
main() --> compile.sh:50
```
### How to reproduce?
```
./compile.sh build \
BOARD=bananapim2zero \
BRANCH=current \
RELEASE=trixie \
BUILD_MINIMAL=yes \
BUILD_DESKTOP=no \
KERNEL_CONFIGURE=no \
EXPERT=yes \
CLEAN_LEVEL="sources"
```
### Branch
main (main development branch)
### On which host OS are you running the build script and observing this problem?
Other
### Are you building on Windows WSL2?
- [ ] Yes, my Ubuntu/Debian/OtherOS is running on WSL2
### Relevant log URL
https://paste.armbian.de/donujafaxi
### Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Contributor guide
Research direction
Start at lib/functions/general/cleaning.sh:43 and reproduce with the provided compile.sh command on a Darwin host using Docker. Trace how the sources worktrees are handled during CLEAN_LEVEL="sources"; done means the cleanup completes without the Device or resource busy errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, macos, shell
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100