Skip to content

Commit 42e6d49

Browse files
committed
Make public/bundles/nelmioapidoc a real target, during build
This makes sure it is copied (locally, in the source tree) as the current user, preventing permission issues cleaning it up again. During install it is copied with everything else to the target tree. By making it a real, non-PHONY target, it does not get recreated again during `make install-docs`, which could then also likely be with root ownership.
1 parent 9bc49fb commit 42e6d49

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

webapp/Makefile

+6-8
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,10 +43,11 @@ 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:
47+
# This must be copied first to later install with the rest, do this
48+
# during build time, so that the files have the right permissions.
4749
# We can not use bin/console here, as when using a fakeroot,
48-
# the include paths are broken. We just copy in the data we need
49-
-rm -rf public/bundles/nelmioapidoc
50+
# the include paths are broken. We just copy in the data we need.
5051
mkdir -p public/bundles/nelmioapidoc
5152
cp -R vendor/nelmio/api-doc-bundle/public/* public/bundles/nelmioapidoc/
5253

@@ -55,8 +56,6 @@ clean-l:
5556
-rm -f vendor/autoload_runtime.php
5657

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) ; \
@@ -86,5 +85,4 @@ maintainer-clean-l:
8685
done ; \
8786
done
8887

89-
.PHONY: composer-dump-autoload composer-dump-autoload-dev \
90-
copy-bundle-assets
88+
.PHONY: composer-dump-autoload composer-dump-autoload-dev

0 commit comments

Comments
 (0)