Closed kyllingstad closed 3 years ago
@markaren, two notes for PR #633:
conanfile.py
.COSIM_
to LIBCOSIM_
since that's the convention we've used elsewhere.Wupsie, seems tests are not enabled for windows (ENV not set)
Good catch! And enabling it revealed another problem: When environment variables are set to True
in a workflow YAML file, it gets interpreted as a boolean rather than a string and converted to lowercase true
during the parsing process. Conan only understands the literal values True
and 1
for its environment variables, and true
gets interpreted as false. :-|
This is probably an issue with the CMake CI setup too, so I'll investigate and open a separate PR for that if necessary.
This change was motivated by some test failures in PR #633 which are almost surely unrelated to the PR itself. The probable diagnosis is simply that the build environment provided by GitHub's workflow runners is so messy that some unwanted library inadvertently gets picked up from outside the Conan package ecosystem. (We add to the mess by installing an additional GCC version, which happens to be the version for which the tests fail...)
Long story short, here I've set up a cleaner build environment using Docker. The building still takes place on GitHub's runners, but is now isolated from the messy host environment inside a Docker container. The base environments for the different compilers are the ones used for Conan Center.
The process, described in the Linux part of
.github/workflows/ci-conan.yml
, now goes like this:/tmp/osp-builder-docker/Dockerfile
, which defines the build environment as a Docker image./tmp/osp-builder-docker/entrypoint.sh
, which gets copied into the Docker image as/entrypoint.sh
and contains the actual libcosim build steps.osp-builder
based on the above files.osp-builder
, i.e., run/entrypoint.sh
inside the build environment. The source folder which is checked out on the host runner gets mounted read-only at/mnt/source
inside the container.I've included a change which was originally in #633, namely the addition of the environment variable
LIBCOSIM_RUN_TESTS_ON_CONAN_BUILD
, added so we can run tests in Conan-based CI builds too.