-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
411 simple integration test using old simple rust programs #413
Conversation
cb9111c
to
0356f7d
Compare
624b5c4
to
3a1ddb3
Compare
fb22ea5
to
ebac227
Compare
- name: 'HACK: patch rustc_arch.sh script (within docker)' | ||
run: | | ||
arch=$(rustc -vV | sed -n -e 's/host: \(.*\)$/\1/p') | ||
docker exec --user user mir-smir-ci-${GITHUB_SHA} \ | ||
bash -c "printf '#!/bin/sh\necho \"$arch\"\n' > deps/smir_pretty/rustc_arch.sh" | ||
docker exec --user user mir-smir-ci-${GITHUB_SHA} \ | ||
cat deps/smir_pretty/rustc_arch.sh | ||
docker exec --user user mir-smir-ci-${GITHUB_SHA} \ | ||
deps/smir_pretty/rustc_arch.sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jberthold This is the hack to get our version of rustc running for smir pretty on CI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. The problem is that we need to run inside the docker image (to have kompile
) but there is no rustup
in the image. That script uses rustup
to find rustc
, then calls rustc
just to find out the target architecture string (which is part of the path to the libraries to link to). ➰ ➿
The hack is to find that architecture string outside the docker image and then patch the script inside the docker image's file system (which is not shared with the host for some other reason... 🤷 ) to print that string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay my understanding is that this will not need to rebuild the stage 2 compiler from our semantics from consecutive runs of the tests, and even if the K source is changed as the semantics will kompile but the stage 2 compiler is already built.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I even think the entire set of compiler artefacts could be cached, and tried to set up a cache for it, but the compiler build setup is multi-stage and therefore more complex to avoid rebuilds. For now this was just supposed to be the first step - our setup with the compiler dependency is definitely "suboptimal" anyway (and should/will change soon).
I will let you choose when to merge @jberthold in case there was more commits to add |
This PR adds a set of simple rust programs (from prior art) for a simple parser test:
run-rs
in thetextual-mir
branchsmir_pretty
as a submodule for integration testsmake
targets to manage the submodule build (including a bootstrap ofrustc
, which should be set up as a recursive submodule in the future)make
target for a simple integration test: convert eachrun-rs
program to Stable-MIR and parse the result.Remarks:
smir_pretty
, information about the rust target architecture is needed. To circumvent this, the related script (withinsmir_pretty
repo) is patched (but only the copy in the docker file system). This is a workaround and could be addressed properly bysmir_pretty
to run withinnix
and using a nix shell.rust
build andsmir_pretty
within the docker image or container.