Skip to content

Webapp is incompatible with FHS compliant build #2353

@GugolPlex

Description

@GugolPlex

Description of the problem

The new webapp/public/index.php in 8.3.0dev is not compatible with configure --enable-fhs. It seems impossible to build a working FHS-compliant domserver.

Your environment

  • DOMjudge 8.3.0dev (snapshot domjudge-snapshot-20240303.tar.gz)
  • Debian 12.5

Steps to reproduce

After install all prerequisites and untar the source code from the last 8.3.0dev snapshot:

./configure --enable-fhs  --disable-doc-build --disable-judgehost-build
[...]

Summary:
 * project.............: DOMjudge 8.3.0DEV
 * prefix..............: /usr/local
[...]
 * domserver...........: 
    - bin..............: /usr/local/bin
    - etc..............: /usr/local/etc/domjudge
    - lib..............: /usr/local/lib/domjudge
    - libvendor........: /usr/local/lib/domjudge/vendor
    - log..............: /usr/local/var/log/domjudge
    - run..............: /usr/local/var/run/domjudge
    - sql..............: /usr/local/share/domjudge/sql
    - tmp..............: /tmp
    - webapp...........: /usr/local/share/domjudge/webapp
    - example_problems.: /usr/local/share/domjudge/example_problems
    - database_dumps...: /usr/local/var/lib/domjudge/db-dumps

 * systemd unit files..: /lib/systemd/system

Note that the main webapp will be located at /usr/local/share/domjudge/webapp and PHP vendor libs at /usr/local/lib/domjudge/vendor.

Unfortunately, ./webapp/public/index.php was changed and now is content is:

<?php declare(strict_types=1);

use App\Kernel;

require_once dirname(__DIR__, 2) . '/lib/vendor/autoload_runtime.php';
[ ... ]

When installed, that require_once looks for the file /usr/local/share/domjudge/lib/vendor/autoload_runtime.php but that file is missing because it is stored in the libvendordirectory, far from the webapp directory when FHS is enabled. The correct path should be /usr/local/lib/domjudge/vendor/autoload_runtime.php. In fact, that file exists after make install.

configure provides two parameters to change the lib and libvendor directories so this could be a workaround:

./configure --enable-fhs  --disable-doc-build --disable-judgehost-build \
            --with-domserver_libdir=/usr/local/share/domjudge/lib/ \
            --with-domserver_libvendordir=/usr/local/share/domjudge/lib/vendor
[...]

Summary:
 * project.............: DOMjudge 8.3.0DEV
 * prefix..............: /usr/local
[...]
 * domserver...........: 
    - bin..............: /usr/local/bin
    - etc..............: /usr/local/etc/domjudge
    - lib..............: /usr/local/share/domjudge/lib/
    - libvendor........: /usr/local/share/domjudge/lib/vendor
    - log..............: /usr/local/var/log/domjudge
    - run..............: /usr/local/var/run/domjudge
    - sql..............: /usr/local/share/domjudge/sql
    - tmp..............: /tmp
    - webapp...........: /usr/local/share/domjudge/webapp
    - example_problems.: /usr/local/share/domjudge/example_problems
    - database_dumps...: /usr/local/var/lib/domjudge/db-dumps

 * systemd unit files..: /lib/systemd/system

Now libvendor it is located in a path compatible with the new index.php. But these options seems to be ignored by make install-domserver because nothing changes in the installation paths. autoload_runtime.php ends in the same /usr/local/lib/domjudge/vendor folder and the webapp doesn't work.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions