Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improves scripts and add docker image #259

Merged
merged 2 commits into from
Nov 8, 2023

Conversation

henrybear327
Copy link
Collaborator

This commit adds a docker image that provides the pre-configured environment, which is capable of executing the rv32emu tests, to the users. It can also reduce hassles when working on the M1 machines for development.

Figuring out the dockerfile actually took longer than expected, and here are the 2 main issues (there are also copious of comments in the dockerfile):

  • The gcc-riscv64-unknown-elf compiler installed from apt will cause make arch-test to fail with error unsupported ISA subset 'z', thus, we build from scratch using the version [here].(ttps://github.com/sysprog21/rv32emu/blob/master/.ci/riscv-toolchain-install.sh).
  • The reference emulator in the repo is of x86 architecture, so for the aarch64 (M1 machine), we need to build from sail-riscv source. Interestingly, it's a known issue that the recent commits will fail to compile. But in any case, for this dockerfile, I am using the commit from sail-riscv which is around the time that the commit of the reference emulator happened on rv32emu, which has no problem building and completing tests.

Reference:

- Make the scripts fail as soon as an error is encountered
- For common.sh, it will now exit with an non-zero error code when the machine or OS is not supported

Reference
- https://blog.cloudflare.com/pipefail-how-a-missing-shell-option-slowed-cloudflare-down/
@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
Dockerfile Outdated Show resolved Hide resolved
.ci/gdbstub-test.sh Outdated Show resolved Hide resolved
The docker container built from the dockerfile will contain all the
necessary development tools pre-installed.

It will work for both x86 and aarch64 machines, as the toolchain is
built from scratch.

README is updated to reflect the build and execute instructions used.
@jserv jserv merged commit 19e9914 into sysprog21:master Nov 8, 2023
16 checks passed
@jserv
Copy link
Contributor

jserv commented Nov 8, 2023

Thank @henrybear327 for contributing!

@henrybear327 henrybear327 deleted the feat/docker-build branch November 8, 2023 16:39
vestata pushed a commit to vestata/rv32emu that referenced this pull request Jan 24, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants