Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b404383

Browse files
committed
Don't run composer as root if unneeded
We now track the autoload_runtime file and create it as the normal user and because it exists we don't recreate it in the install-domserver step as root (assuming it runs with `sudo`). It will still create it if it doesn't exist, because domserver is a dependency for install-domserver (and in that case `composer` would run as root again, so prompting the user to accept this risk). This also works for the inplace targets as those depend on `build` which runs the `domserver` part.
1 parent b09a88a commit b404383

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

‎Makefile

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ endif
4747
domserver: domserver-configure paths.mk config
4848
judgehost: judgehost-configure paths.mk config
4949
docs: paths.mk config
50-
install-domserver: domserver composer-dump-autoload domserver-create-dirs
50+
install-domserver: domserver domserver-create-dirs
5151
install-judgehost: judgehost judgehost-create-dirs
5252
install-docs: docs-create-dirs
5353
dist: configure composer-dependencies
@@ -76,12 +76,6 @@ endif
7676
composer-dependencies-dev:
7777
composer $(subst 1,-q,$(QUIET)) install --prefer-dist --no-scripts --no-plugins
7878

79-
# Dump autoload dependencies (including plugins)
80-
# This is needed since symfony/runtime is a Composer plugin that runs while dumping
81-
# the autoload file
82-
composer-dump-autoload:
83-
composer $(subst 1,-q,$(QUIET)) dump-autoload -o -a
84-
8579
composer-dump-autoload-dev:
8680
composer $(subst 1,-q,$(QUIET)) dump-autoload
8781

@@ -101,7 +95,7 @@ build-scripts:
10195

10296
# List of SUBDIRS for recursive targets:
10397
build: SUBDIRS= lib misc-tools
104-
domserver: SUBDIRS=etc sql misc-tools webapp
98+
domserver: SUBDIRS=etc lib sql misc-tools webapp
10599
install-domserver: SUBDIRS=etc lib sql misc-tools webapp example_problems
106100
judgehost: SUBDIRS=etc judge misc-tools
107101
install-judgehost: SUBDIRS=etc lib judge misc-tools
@@ -222,7 +216,7 @@ webapp/.env.local:
222216
# symlinks where necessary to let it work from the source tree.
223217
# This stuff is a hack!
224218
maintainer-install: inplace-install composer-dump-autoload-dev
225-
inplace-install: build composer-dump-autoload domserver-create-dirs judgehost-create-dirs
219+
inplace-install: build domserver-create-dirs judgehost-create-dirs
226220
inplace-install-l:
227221
# Replace libjudgedir with symlink to prevent lots of symlinks:
228222
-rmdir $(judgehost_libjudgedir)
@@ -341,5 +335,5 @@ clean-autoconf:
341335
$(addprefix inplace-,conf conf-common install uninstall) \
342336
$(addprefix maintainer-,conf install) clean-autoconf config distdocs \
343337
composer-dependencies composer-dependencies-dev \
344-
composer-dump-autoload composer-dump-autoload-dev \
338+
composer-dump-autoload-dev \
345339
coverity-conf coverity-build

‎lib/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
ifndef TOPDIR
22
TOPDIR=..
33
endif
4+
5+
REC_TARGETS = domserver
6+
47
include $(TOPDIR)/Makefile.global
58

69
OBJECTS = $(addsuffix $(OBJEXT),lib.error lib.misc)
@@ -31,3 +34,5 @@ install-domserver:
3134
install-judgehost:
3235
$(INSTALL_DATA) -t $(DESTDIR)$(judgehost_libdir) *.php *.sh
3336
$(INSTALL_PROG) -t $(DESTDIR)$(judgehost_libdir) alert
37+
38+
domserver: SUBDIRS=vendor

‎lib/vendor/Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
ifndef TOPDIR
2+
TOPDIR=../..
3+
endif
4+
include $(TOPDIR)/Makefile.global
5+
6+
clean-l:
7+
rm -f autoload_runtime.php
8+
9+
autoload_runtime.php:
10+
composer $(subst 1,-q,$(QUIET)) dump-autoload -o -a -d $(TOPDIR)
11+
12+
domserver: autoload_runtime.php

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /