DOMjudge / domjudge-packaging

DOMjudge packaging for (Linux) distributions and live image
33 stars 40 forks source link

Installing Haskell as an extra compiler #186

Closed jeroenvanderzwam closed 5 months ago

jeroenvanderzwam commented 6 months ago

Dear developers,

I have been trying to install Haskell as an extra compiler within the chroot. Underneath is the code I have added to the chroot-and-tar.sh

apt-get update -y
apt-get install -y --no-install-recommends \
        curl \
        libnuma-dev \
        zlib1g-dev \
        libgmp-dev \
        libgmp10 \
        git \
        wget \
        lsb-release \
        software-properties-common \
        gnupg2 \
        apt-transport-https \
        gcc \
        autoconf \
        automake \
        build-essential

# gpg --batch --keyserver keyserver.ubuntu.com --recv-keys 7D1E8AFD1D4A16D71FADA2F2CCC85C0E40C06A8C

curl https://downloads.haskell.org/~ghcup/x86_64-linux-ghcup > /usr/bin/ghcup
chmod +x /usr/bin/ghcup
# ghcup config set gpg-setting GPGStrict

GHC=latest
CABAL=latest
CHROOTDIR="/chroot/domjudge"

ghcup -v install ghc --isolate "$CHROOTDIR/usr/local/lib" --force ${GHC}
# ghcup -v install ghc --force ${GHC}
ghcup -v install cabal --isolate "$CHROOTDIR/usr/local/lib" --force ${CABAL}
# ghcup -v install cabal --force ${CABAL}

# chroot /chroot/domjudge ln -s -f /usr/local/lib/bin/ghc-9.8.1 /usr/local/bin/ghc

But it seems that when I try to compile with the domserver the ghc command is not recognized.

Later I just tried to install ghc and cabal manually within the docker container. But this still does not help.

If somebody could help me I would be very grateful.

eldering commented 6 months ago

You should install ghc inside the chroot. I'm not really familiar with our docker packaging, but I assume that just adding it to that script doesn't do so. Have a look at the dj_make_chroot script. Also note that only a few directories from the chroot are mounted by default in the sandbox, so if ghc needs files from other directories, then you may need to adjust that. See the judge/chroot-start-stop.sh script in the main repo.

FYI, for questions please use our slack chat or mailinglist, as this is meant for bug reports and feature requests.

vmcj commented 5 months ago

I'll close this one as its not a bug.