Skip to content

fix: misc build improvements, removal of opam env from build#196

Open
difcsi wants to merge 3 commits into
stephenrkell:masterfrom
difcsi:fix-build-things
Open

fix: misc build improvements, removal of opam env from build#196
difcsi wants to merge 3 commits into
stephenrkell:masterfrom
difcsi:fix-build-things

Conversation

@difcsi

@difcsi difcsi commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

As discussed, we don't need to maintain our opam environment, we trust the builder to be competent enough to do that.

We also don't install any artifact we produce. We still need opam to install build dependencies for us. Theoretically, that could also be left to the user, but the dependencies are listed by cil, which might change, so we attempt to install them / ensure they exist.

Overhead should be very little for subsequent builds.

This PR also removes old Dockerfiles that weren't maintained, opting to provide a single Dockerfile to anyone interested.

A devcontainer config is also bundled, enabling IDEs to automatically pick up on our suggested development environment. It is a tiny wrapper around the dockerfile.

At present, we only have build-dependencies.txt and test-dependencies.txt.

As this is distribution specific, these should technically be scoped (ubuntu26.04-build-dependencies.txt and friends), but as other distros were unmaintained anyways, I think the names are okay for now. In the future, we hope to be more flexible with support

@difcsi difcsi force-pushed the fix-build-things branch from d539dc7 to c77aa13 Compare June 8, 2026 23:04
@difcsi

difcsi commented Jun 9, 2026

Copy link
Copy Markdown
Contributor Author

This CI failure exposes a latent instance of #149.

Presently, the test runner relies on the build configure-time hardcoded paths to find tools for testing, instead of liballocs correctly making itself available through the system. I'd argue that the test runner should represent a 'post-install' state, where liballocs tools are reachable from the env path. 'cilly' should resolve, though I'll push a fix that uses the full path as with other tools for now.

In an ideal scenario, the test runner would only have runtime dependencies available. This is blocked by make install not working correctly, and also because #178: lib-test relies on rebuilding liballocs, thus it needs some build-time dependencies: presently, this is solved by over-equipping the test runner. This defeats the point of having the two separate CI stages: why waste time persisting a workspace when we could run tests within the build job?

(I have a fix for #149 somewhere on my fork, part of the Debian package build system. I'll bring that up-to-date one day: now we can actually run with commonly-bundled compiler versions: fairly modern gcc and clang with dwarf4. )

I suppose the right path here is to patch the makefile so Cilly's absolute path is used within the tests; that much is clear. But I don't see the point of maintaining two jobs (build -> test) if both need the same environment (persisted build artefacts and build-time dependencies). We could just merge them into one build&test, save some CI time and the complexity of having two dependency lists.

@stephenrkell, what do you think?

@difcsi difcsi force-pushed the fix-build-things branch 2 times, most recently from 8549bcb to 7f22c0d Compare June 14, 2026 13:11
@difcsi difcsi changed the title fix: misc build improvements, removal of opam prefix fix: misc build improvements, removal of opam from build Jun 14, 2026
@difcsi

difcsi commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

@stephenrkell we should either set the CIL branch to goblint-develop+srk within the .gitmodules here, or you can set that as the default branch on your fork for @dependabot to pick up the CIL updates

@difcsi difcsi force-pushed the fix-build-things branch 5 times, most recently from 21e564d to 69facf5 Compare June 14, 2026 15:08
@stephenrkell

Copy link
Copy Markdown
Owner

I am fine with moving the lib-test step into the build job.

For the other tests, we should always test with the cilly that we were configured with.

I am confused about the current state of this PR regarding opam. The patch currently removes opam things in some places but adds them in others.

@difcsi difcsi changed the title fix: misc build improvements, removal of opam from build fix: misc build improvements, removal of opam env from build Jun 15, 2026
@difcsi

difcsi commented Jun 15, 2026

Copy link
Copy Markdown
Contributor Author

Sorry, I edited the name of the PR, my bad.

Opam can maintain OCaml versions and packages separately, much like a Python virtual environment. We don't do that anymore.

But we still need opam, as goblint-cil has OCaml packages as build dependencies that we need to install somehow. With disabled sandboxing (as is here), this amounts to a system-wide install.

Alternatively, we could use apt, by installing packages such as libzarith-ocaml-dev. Ubuntu repositories seem to have the necessary packages. But leaving it to opam makes our build resilient to upstream dependency changes.

Happy to switch to a fully apt-based building.

Also, the Dockerfile still has a sandboxed opam, which is genuinely something I missed

@stephenrkell

Copy link
Copy Markdown
Owner

Thanks for explaining!

I definitely favour maximising the use of apt and minimising use of opam (ideally to zero, or else to the smallest degree feasible). The fewer distinct sources of "stuff from the Internet" that we have in the build, the better for reliability, transparency, supply chain integrity, etc... and also a general preference for fewer distinct tools involved in the build.

@difcsi

difcsi commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

I definitely favour maximising the use of apt and minimising use of opam (ideally to zero, or else to the smallest degree feasible). The fewer distinct sources of "stuff from the Internet" that we have in the build, the better for reliability, transparency, supply chain integrity, etc... and also a general preference for fewer distinct tools involved in the build.

Unfortunately, it seems not everything is available from apt on ubuntu. I'll push a patch that moves all we can to apt

@difcsi difcsi force-pushed the fix-build-things branch from 38de6b5 to af8ae67 Compare June 26, 2026 17:26
@difcsi

difcsi commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

@stephenrkell stripped out opam as requested, this one is ready to merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants