add docker-helper.sh to lift examples using pac-nix docker image#514
Merged
katrinafyi merged 5 commits intomainfrom Aug 4, 2025
Merged
add docker-helper.sh to lift examples using pac-nix docker image#514katrinafyi merged 5 commits intomainfrom
katrinafyi merged 5 commits intomainfrom
Conversation
this introduces the src/test/make/docker-helper.sh script which is a (hopefully) developer-friendly method for lifting examples in a Docker container provided by [pac-nix][]. to ensure reproducibility, this uses an x86_64-linux docker container with cross-compiler provided by nix. for more details, also see #288. the usage is comprehensively documented in [nix-docker-build readme]. the general flow is: 1. activate the docker-helper.sh environment: `eval $(docker-helper.sh env)`. (you will need to re-run this if you close your terminal) 2. pull the docker image: `docker-helper.sh pull` 3. start the docker container: `docker-helper.sh start` 4. (optional) clean the directory you want to lift: `make SUBDIRS=extraspec_incorrect/malloc_memcpy_strlen_memset_free clean` 5. compile and lift the directory: `make SUBDIRS=extraspec_incorrect/malloc_memcpy_strlen_memset_free` 6. commit the results (eventually, we want to move the binaries into another repo. but until then, committing is fine.) [pac-nix]: https://github.com/katrinafyi/pac-nix/ [nix-docker-build readme]: https://github.com/UQ-PAC/BASIL/blob/nix-docker-build/src/test/readme.md
ailrst
approved these changes
Jul 18, 2025
src/test/readme.md
Outdated
| @@ -0,0 +1,413 @@ | |||
| # Writing and Running Tests | |||
|
|
|||
| See [docs/development/readme.md](../../docs/development/readme.md) for context. | |||
Contributor
There was a problem hiding this comment.
I wonder whether this would be better placed in /docs/ for visibility.
i don't want to set $CC in `docker-helper.sh env` because i think $CC is a default variable read by cmake and such, so setting it to a cross-compiler might break things unexpectedly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this introduces the src/test/make/docker-helper.sh script which is
a (hopefully) developer-friendly method for lifting examples in a Docker
container provided by pac-nix.
to ensure reproducibility, this uses an x86_64-linux docker container
with cross-compiler provided by nix. for more details, see #288 which the
docker-helper.sh is stolen from.
the usage is comprehensively documented in readme.
the general flow is:
eval $(docker-helper.sh env).(you will need to re-run this if you close your terminal)
docker-helper.sh pulldocker-helper.sh startmake SUBDIRS=extraspec_incorrect/malloc_memcpy_strlen_memset_free cleanmake SUBDIRS=extraspec_incorrect/malloc_memcpy_strlen_memset_freean out-of-repo location. but until then, committing is probably fine.)
this PR does not make any changes to the existing examples. it only serves to make the Docker container available and accessible for people who want to use it as a uniform lifting environment.
I do think that all examples should eventually be re-lifted using a consistent method, but this will come later.