Skip to content

Commit

Permalink
Feature: Add development environment setup (copy#970)
Browse files Browse the repository at this point in the history
  • Loading branch information
cognitivegears authored Jan 13, 2024
1 parent 609d794 commit dc8667f
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM library/node:lts-bookworm

ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && \
apt-get install -y nodejs nasm gdb unzip p7zip-full openjdk-17-jre wget python3 qemu-system-x86 git-core build-essential libc6-dev-i386-cross libc6-dev-i386 clang curl time
RUN npm install -g jshint
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
RUN /root/.cargo/bin/rustup toolchain install stable && \
/root/.cargo/bin/rustup target add wasm32-unknown-unknown && \
/root/.cargo/bin/rustup component add rustfmt-preview && \
/root/.cargo/bin/rustup update && /root/.cargo/bin/rustup update nightly
28 changes: 28 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"name": "v86 dev container",
"build": {
"dockerfile": "Dockerfile",
"args": {
"VARIANT": "ubuntu"
}
},
"features": {
"ghcr.io/devcontainers-contrib/features/curl-apt-get:1": {},
"ghcr.io/jungaretti/features/ripgrep:1": {}
},
"customizations": {
"vscode": {
"extensions": [
"ms-azuretools.vscode-docker",
"yzhang.markdown-all-in-one",
"DavidAnson.vscode-markdownlint",
"christian-kohler.npm-intellisense",
"dbaeumer.vscode-eslint",
"dustypomerleau.rust-syntax",
"serayuzgur.crates",
"ms-vscode.makefile-tools",
"rust-lang.rust-analyzer"
]
}
}
}
12 changes: 12 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Fetch images",
"type": "shell",
"command": "wget -P images/ https://k.copy.sh/{linux3.iso,linux.iso,linux4.iso,buildroot-bzimage.bin,openbsd-floppy.img,kolibri.img,windows101.img,os8.img,freedos722.img}"
}
]
}
10 changes: 9 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,20 @@ for a full setup on Debian or
- Then you can simply run `docker run -it -p 8000:8000 v86:alpine-3.14` to start the server.
- Check `localhost:8000` for hosted server.

### Running via Devcontainer

- If you are using an IDE that supports Devcontainers, such as Github Codespaces, VSCode Remote Container extension, or possibly others such as Jetbrains IDEA, you can setup the development environment in a Dev container.
- Follow the instructions from your development environment to setup the container.
- Run the Task "Fetch images" in order to download images for testing.

## Testing

The disk images for testing are not included in this repository. You can
download them directly from the website using:

`wget -P images/ https://k.copy.sh/{linux.iso,linux4.iso,buildroot-bzimage.bin,openbsd-floppy.img,kolibri.img,windows101.img,os8.img,freedos722.img}`
`wget -P images/ https://k.copy.sh/{linux3.iso,linux.iso,linux4.iso,buildroot-bzimage.bin,openbsd-floppy.img,kolibri.img,windows101.img,os8.img,freedos722.img}`

Run integration tests: `make tests`

Run all tests: `make jshint rustfmt kvm-unit-test nasmtests nasmtests-force-jit expect-tests jitpagingtests qemutests rust-test tests`

Expand Down

0 comments on commit dc8667f

Please sign in to comment.