Skip to content

Commit fd9473f

Browse files
committed
Keep the owner:group of the one downloading the tarball
In the scenario: ./configure --prefix=<something_which_needs_su/sudo> make domserver <as unpriviliged user which downloaded the tarball> sudo make-installdomserver <as root> We would copy the Nelmiodoc files as root, so the user can't run a make {dist}clean without errors as we can't remove the folder as its owned by root. See DOMjudge#2303 (comment) for the reasoning behind this. So we replace phony copy-bundle-assets target by a real one. This makes that we don't rerun the rule during `domserver-install` if it already ran during `domserver`, so that if you install as root, the local files are still owned by the user who first ran `make domserver`, not root. This does assume that if the directory `public/bundles/nelmioapidoc` exists, then it contains the assets, and these won't automatically get updated, for example, in the setting of a maintainer-install so there we always remove the directory and recreate it. We now also install nelmiodoc together with composer in the base image for CI: - together with the needed dependencies - make sure we get an autoload.php
1 parent e335f32 commit fd9473f

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

.github/jobs/configure-checks/setup_configure_image.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,21 @@ case $distro_id in
1010
dnf install pkg-config make bats autoconf automake util-linux -y ;;
1111
*)
1212
apt-get update; apt-get full-upgrade -y
13-
apt-get install pkg-config make bats autoconf -y ;;
13+
apt-get install pkg-config make bats autoconf -y
14+
apt-get install composer php php-cli php-curl php-fpm php-gd \
15+
php-intl php-json php-mbstring php-mysql php-xml php-zip -y ;;
1416
esac
1517

1618
# Build the configure file
1719
make configure
1820

21+
case $distro_id in
22+
"ID=fedora")
23+
true ;;
24+
*)
25+
composer install --no-scripts ;;
26+
esac
27+
1928
# Install extra assert statements for bots
2029
cp submit/assert.bash .github/jobs/configure-checks/
2130

webapp/Makefile

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ include $(TOPDIR)/Makefile.global
99
# Subdirectories to recurse into for REC_TARGETS
1010
SUBDIRS = config
1111

12-
domserver: composer-dump-autoload
12+
domserver: composer-dump-autoload public/bundles/nelmioapidoc
1313

1414
# Install PHP dependencies
1515
composer-dependencies:
@@ -43,20 +43,19 @@ composer-dump-autoload-dev:
4343
@echo "# the DOMjudge Symfony application in developer mode. Adjust as needed." >> $@
4444
@echo "APP_ENV=dev" >> $@
4545

46-
copy-bundle-assets:
46+
public/bundles/nelmioapidoc:
4747
# We can not use bin/console here, as when using a fakeroot,
4848
# the include paths are broken. We just copy in the data we need
49-
-rm -rf public/bundles/nelmioapidoc
50-
mkdir -p public/bundles/nelmioapidoc
51-
cp -R vendor/nelmio/api-doc-bundle/public/* public/bundles/nelmioapidoc/
49+
mkdir -p $@
50+
cp -a vendor/nelmio/api-doc-bundle/public/* $@
5251

5352
clean-l:
5453
-rm -rf public/bundles/nelmioapidoc
5554
-rm -f vendor/autoload_runtime.php
5655

56+
domserver-l: public/bundles/nelmioapidoc
57+
5758
install-domserver:
58-
# This must be done first to install with the rest.
59-
$(MAKE) copy-bundle-assets
6059
$(INSTALL_DIR) $(DESTDIR)$(domserver_webappdir);
6160
for d in bin config migrations public resources src templates tests vendor; do \
6261
$(call install_tree,$(DESTDIR)$(domserver_webappdir),$$d) ; \
@@ -71,12 +70,16 @@ maintainer-conf: .env.local
7170

7271
maintainer-install: composer-dump-autoload-dev
7372

73+
maintainer-install-l:
74+
# This must be done first to install with the rest.
75+
-rm -rf public/bundles/nelmioapidoc
76+
$(MAKE) public/bundles/nelmioapidoc
77+
7478
maintainer-clean-l:
7579
-for d in cache log ; do \
7680
for t in dev prod ; do \
7781
rm -rf var/$$d/$$t ; \
7882
done ; \
7983
done
8084

81-
.PHONY: composer-dump-autoload composer-dump-autoload-dev \
82-
copy-bundle-assets
85+
.PHONY: composer-dump-autoload composer-dump-autoload-dev

0 commit comments

Comments
 (0)