Improve Docker-based build & test pipeline for pkgmgr

- Add .dockerignore rules to prevent Arch package artifacts from entering the build context
- Rework Dockerfile to remove stale package artifacts before makepkg and use a dev entry script
- Introduce docker-entry-dev.sh to always rebuild pkgmgr from the mounted /src tree
- Update Makefile 'test' target to rebuild pkgmgr inside the container before running tests
- Fix predictable makepkg failures caused by residual *.pkg.tar.* files

Conversation reference: https://chatgpt.com/share/6935e6e8-f3fc-800f-a4e9-7537114f13d1
This commit is contained in:
Kevin Veen-Birkenbach
2025-12-07 21:43:38 +01:00
parent 225d6a84b7
commit 9679478353
5 changed files with 49 additions and 9 deletions

View File

@@ -34,7 +34,20 @@ test: build
--workdir /src \
--entrypoint bash \
package-manager-test \
-c 'git config --global --add safe.directory /src && nix develop .#default --no-write-lock-file -c python3 -m unittest discover -s tests -p "test_*.py"'
-c '\
set -e; \
echo "Remove existing Arch package-manager (if any)..."; \
pacman -Rns --noconfirm package-manager || true; \
echo "Rebuild Arch package from /src..."; \
rm -f /src/package-manager-*.pkg.tar.* || true; \
chown -R builder:builder /src; \
su builder -c "cd /src && makepkg -sf --noconfirm --clean"; \
pacman -U --noconfirm /src/package-manager-*.pkg.tar.*; \
echo "Run tests inside Nix devShell..."; \
git config --global --add safe.directory /src && \
nix develop .#default --no-write-lock-file -c \
python3 -m unittest discover -s tests -p \"test_*.py\" \
'
install:
@if [ -n "$$IN_NIX_SHELL" ]; then \