glondu / belenios

Verifiable online voting system. This is a mirror of https://gitlab.inria.fr/belenios/belenios
https://www.belenios.org
GNU Affero General Public License v3.0
133 stars 21 forks source link

make: *** [Makefile:25: check] Error 2 - Step: Make check #23

Closed valentin-dirken closed 3 years ago

valentin-dirken commented 3 years ago

Hello, I've cloned this repository : https://gitlab.inria.fr/belenios/belenios

The gitlab-ci.yml is :

stages:

build_and_test_with_preinstalled_image: stage: test

Image glondu/beleniosbase:YYYYMMDD-N is built by Dockerfile_base_environment

image: glondu/beleniosbase:20200824-1 script:

Initialize environment

- source ~/env.sh
- opam install --yes gettext-camomile
# Run command-line tool tests
- make check
# Compile belenios
- make build-release-server
# Start belenios web server
- ./demo/run-server.sh &
# Access the localhost web page, print page output for debug purposes, and check validity of page output
- first_access_index_page_output=$(wget --retry-connrefused --no-check-certificate -T 30 http://localhost:8001 -O-)
- echo $first_access_index_page_output
- if [ "$(echo \"$first_access_index_page_output\" | grep '>Belenios</a>' | wc -l)" != "1" ]; then echo "[First page access] First page access does not show a single '>Belenios</a>' text, but it should" && exit 1; else echo "[First page access] First page access shows a single '>Belenios</a>' text, as expected"; fi

You have this : https://gitlab.inria.fr/belenios/belenios/-/jobs/851414

$ make check make build-debug-tool make[1]: Entering directory '/builds/belenios/belenios' BELENIOS_DEBUG=1 dune build --build-dir=_build-debug -p belenios-platform,belenios-platform-native,belenios,belenios-tool rm -rf _run/tool-debug dune install --build-dir=_build-debug --destdir=_run/tool-debug --prefix=/ belenios-platform belenios-platform-native belenios belenios-tool 2>/dev/null make[1]: Leaving directory '/builds/belenios/belenios' make -C tests/tool check make[1]: Entering directory '/builds/belenios/belenios/tests/tool' mkdir -p data ./demo.sh

I have this error :

`Running with gitlab-runner 13.5.0 (ece86343) on sam-dev-docker oCyD3VJJ Preparing the "docker" executor 02:04 Using Docker executor with image glondu/beleniosbase:20200824-1 ... Pulling docker image glondu/beleniosbase:20200824-1 ... Using docker image sha256:998d10453e7b7391f601d8a5b4505b944aba1c3a91652ede66f3649329681d12 for glondu/beleniosbase:20200824-1 with digest glondu/beleniosbase@sha256:fecfc0082f3a13c448a367f529e8457331303a44f3d353219c75f5e439d6bda4 ... Preparing environment 00:02 Running on runner-ocyd3vjj-project-199-concurrent-0 via ...secret..... Getting source from Git repository 00:01 Fetching changes with git depth set to 50... Reinitialized existing Git repository in /builds/vdirken/belenios-ci/.git/ Checking out 6d004da5 as master... Removing _build-debug/ Removing belenios-platform.install Removing belenios.install Removing src/lib/.merlin Removing src/platform/.merlin Removing src/platform/native/.merlin Removing src/tool/.merlin Skipping Git submodules setup Executing "step_script" stage of the job script 01:39 $ source ~/env.sh $ opam install --yes gettext-camomile [NOTE] It seems you have not updated your repositories for a while. Consider updating them with: opam update The following actions will be performed:

Do you know why I have this ? The code is exactly like your code (no changes).

Kind regards,

Valentin

glondu commented 3 years ago

Maybe you cloned the git repository with --no-tags?

valentin-dirken commented 3 years ago

only with git clone https://gitlab.inria.fr/belenios/belenios.git

glondu commented 3 years ago

What is the output of git config --list | grep -i tag?

valentin-dirken commented 3 years ago

Hello,

I've followed this methodology : https://docs.gitlab.com/ee/user/project/import/repo_by_url.html So git clone --bare https://gitlab.inria.fr/belenios/belenios.git

But, I think there is an issue in the : src/platform/version/gen.sh

-ROOT=../../../../.. +ROOT=../../.. VERSION="$(head -n1 $ROOT/VERSION)"

So,

#!/bin/sh

set -e

ROOT=../../..
VERSION="$(head -n1 $ROOT/VERSION)"

if [ -d $ROOT/.git ] && command -v git >/dev/null; then
    BUILD=${BUILD:-$(git describe)}
else
    DATE=${SOURCE_DATE_EPOCH:-$(date +%s)}
    DATE=$(date -u -d @$DATE +%Y%m%d)
    BUILD=${BUILD:-$DATE}
fi

if [ -n "$BELENIOS_DEBUG" ]; then
    DEBUG=true
else
    DEBUG=false
fi

echo "let version = \"$VERSION\""
echo "let build = \"$BUILD\""
echo "let debug = $DEBUG"

Indeed, with the "first" ROOT, I have :

$ make check
make build-debug-tool
make[1]: Entering directory '/builds/vdirken/belenios-test'
BELENIOS_DEBUG=1 dune build --build-dir=_build-debug -p belenios-platform,belenios-platform-native,belenios,belenios-tool
         gen src/platform/version/belenios_version.ml (exit 128)
(cd _build-debug/default/src/platform/version && ./gen.sh) > _build-debug/default/src/platform/version/belenios_version.ml
fatal: No names found, cannot describe anything.
make[1]: *** [Makefile:20: build-debug-tool] Error 1
make[1]: Leaving directory '/builds/vdirken/belenios-test'
make: *** [Makefile:25: check] Error 2

With the "new" ROOT

$ make check
make build-debug-tool
make[1]: Entering directory '/builds/vdirken/belenios-test'
BELENIOS_DEBUG=1 dune build --build-dir=_build-debug -p belenios-platform,belenios-platform-native,belenios,belenios-tool
rm -rf _run/tool-debug
dune install --build-dir=_build-debug --destdir=_run/tool-debug --prefix=/ belenios-platform belenios-platform-native belenios belenios-tool 2>/dev/null
make[1]: Leaving directory '/builds/vdirken/belenios-test'
make -C tests/tool check
make[1]: Entering directory '/builds/vdirken/belenios-test/tests/tool'
mkdir -p data
./demo.sh
=-=-= Setup election =-=-=

Do you think this is an issue ? I don't know what is the link with the "git describe" error : (fatal: No names found, cannot describe anything.)

It is true that I wonder why this change of route solves the problem, because a git describe works even if you are in a sub-folder

Kind regards,

Valentin

glondu commented 3 years ago

I do not understand. If you clone with --bare, then there is no working copy.

valentin-dirken commented 3 years ago

When you use gitlab GUI, the git clone is with --bare argument. Do you consider that there is an error with the variable ROOT in the gen.sh?

glondu commented 3 years ago

What do you mean by "use gitlab GUI"?

valentin-dirken commented 3 years ago

Hello, https://docs.gitlab.com/ee/user/project/import/repo_by_url.html

You can import your existing repositories by providing the Git URL:

  1. From your GitLab dashboard click New project
  2. Switch to the Import project tab
  3. Click on the Repo by URL button
  4. Fill in the “Git repository URL” and the remaining project fields
  5. Click Create project to begin the import process
  6. Once complete, you will be redirected to your newly created project

Have you got some information about the ROOT variable ?

Kind regards,

Valentin

glondu commented 3 years ago

I don't understand what you are trying to do.

If you are importing belenios in some new gitlab instance, then fine. There is no building, no script being run, the ROOT variable being (in)correct should not have any importance.

If you are trying to build belenios from a git checkout, then it means you have a regular clone of belenios (not a --bare one, they do not make sense in this context). What is the output of git tag -l? What is the output of git config --list | grep -i tag?

From what you wrote here, the error seems to be missing tags in your clone. Your suggested change to ROOT does not seem to be correct.

ghost commented 3 years ago

Forking this instance might help also - https://gitlab.com/hpaterek/belenios