forked from AmazingAmpharos/OoT-Randomizer
-
Notifications
You must be signed in to change notification settings - Fork 234
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
Add dockerfile for toolchain, minor internal changes #2314
Open
mracsys
wants to merge
2
commits into
OoTRandomizer:Dev
Choose a base branch
from
mracsys:asm_dev_container
base: Dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+242
−21
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the | ||
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-docker-compose | ||
{ | ||
"name": "Existing Docker Compose (Extend)", | ||
|
||
// Update the 'dockerComposeFile' list if you have more compose files or use different names. | ||
// The .devcontainer/docker-compose.yml file contains any overrides you need/want to make. | ||
"dockerComposeFile": [ | ||
"../ASM/docker-compose.yml" | ||
], | ||
|
||
// The 'service' property is the name of the service for the container that VS Code should | ||
// use. Update this value and .devcontainer/docker-compose.yml to the real service name. | ||
"service": "toolchain", | ||
|
||
// The optional 'workspaceFolder' property is the path VS Code should open by default when | ||
// connected. This is typically a file mount in .devcontainer/docker-compose.yml | ||
"workspaceFolder": "/app/OoT-Randomizer", | ||
|
||
// Features to add to the dev container. More info: https://containers.dev/features. | ||
// "features": {}, | ||
|
||
// Use 'forwardPorts' to make a list of ports inside the container available locally. | ||
// "forwardPorts": [], | ||
|
||
// Uncomment the next line if you want start specific services in your Docker Compose config. | ||
// "runServices": [], | ||
|
||
// Uncomment the next line if you want to keep your containers running after VS Code shuts down. | ||
// "shutdownAction": "none", | ||
|
||
// Uncomment the next line to run commands after the container is created. | ||
// "postCreateCommand": "cat /etc/os-release", | ||
|
||
// Configure tool-specific properties. | ||
// "customizations": {}, | ||
|
||
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root. | ||
// On Linux these users will have their IDs modified to the host user's ID to attempt to prevent | ||
// file permissions conflicts on bind mounts. | ||
"remoteUser": "ootr", | ||
"containerUser": "ootr", | ||
|
||
"overrideCommand": true | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ | |
/c/*.o | ||
armips* | ||
!.gitkeep | ||
!dmaTable.dat |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
FROM debian:bookworm | ||
|
||
ARG USERNAME=ootr | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
|
||
# Create the user | ||
RUN groupadd --gid $USER_GID $USERNAME \ | ||
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME -s /bin/bash | ||
|
||
# Install build tools | ||
RUN apt-get update \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --assume-yes curl gnupg ca-certificates \ | ||
&& curl https://practicerom.com/public/packages/debian/pgp.pub | apt-key add - \ | ||
&& echo deb http://practicerom.com/public/packages/debian staging main >/etc/apt/sources.list.d/practicerom.list \ | ||
&& apt-get update \ | ||
&& DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --assume-yes \ | ||
build-essential \ | ||
nodejs \ | ||
npm \ | ||
git \ | ||
cmake \ | ||
gdb-multiarch | ||
|
||
# Install toolchain. Compile from source if not on Intel/AMD. | ||
RUN if [ "$(dpkg --print-architecture)" = "amd64" ]; then \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --assume-yes n64-ultra; \ | ||
else \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --assume-yes \ | ||
wget \ | ||
tar \ | ||
make \ | ||
diffutils \ | ||
texinfo \ | ||
gcc \ | ||
g++ \ | ||
lua5.3 \ | ||
libjansson4 \ | ||
libusb-1.0-0 \ | ||
libgmp10 \ | ||
liblua5.3-dev \ | ||
libjansson-dev \ | ||
libusb-1.0-0-dev \ | ||
libgmp-dev \ | ||
libmpfr-dev \ | ||
zlib1g-dev; \ | ||
fi | ||
RUN if [ "$(dpkg --print-architecture)" != "amd64" ]; then \ | ||
mkdir -p build \ | ||
&& cd build \ | ||
&& git clone --recursive https://github.com/glankk/n64.git \ | ||
&& cd n64 \ | ||
&& ./configure --enable-vc --prefix=/opt/n64 \ | ||
&& make install-toolchain \ | ||
&& make && make install \ | ||
&& make install-sys \ | ||
&& echo 'export PATH="/opt/n64/bin:$PATH"' >> /etc/profile; \ | ||
fi | ||
|
||
# Build armips | ||
WORKDIR /build | ||
RUN git clone --recursive https://github.com/Kingcom/armips.git | ||
WORKDIR /build/armips | ||
RUN mkdir build | ||
WORKDIR /build/armips/build | ||
RUN cmake -DCMAKE_BUILD_TYPE=Release .. \ | ||
&& cmake --build . \ | ||
&& mv ./armips /usr/local/bin/ \ | ||
&& chmod a+rx /usr/local/bin/armips | ||
|
||
# Run as non-root user | ||
USER $USERNAME |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@echo off | ||
docker compose up |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#/bin/bash | ||
if [[ "$OSTYPE" == "linux-gnu"* ]]; then | ||
export DOCKER_UID="$(id -u)" | ||
export DOCKER_GID="$(id -g)" | ||
export DOCKER_UID_GID="$(id -u):$(id -g)" | ||
fi | ||
cd "$(dirname "$0")" | ||
docker compose up |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: ootr-dev | ||
|
||
services: | ||
toolchain: | ||
build: | ||
context: . | ||
args: | ||
USERNAME: ootr | ||
USER_UID: ${DOCKER_UID:-1000} | ||
USER_GID: ${DOCKER_GID:-1000} | ||
user: ${DOCKER_UID_GID:-} | ||
volumes: | ||
- ..:/app/OoT-Randomizer:cached | ||
- ./build:/app/OoT-Randomizer/ASM/build:consistent | ||
- ./roms:/app/OoT-Randomizer/ASM/roms:consistent | ||
- ../Output:/app/OoT-Randomizer/Output:consistent | ||
- ../data/generated:/app/OoT-Randomizer/data/generated:consistent | ||
- ../Logs:/app/OoT-Randomizer/Logs:consistent | ||
network_mode: host | ||
extra_hosts: | ||
- host.docker.internal:host-gateway | ||
|
||
# Uncomment the next four lines if you will use a ptrace-based debugger like C++, Go, and Rust. | ||
cap_add: | ||
- SYS_PTRACE | ||
security_opt: | ||
- seccomp:unconfined | ||
|
||
# Overrides default command so things don't shut down after the process ends. | ||
command: python3 /app/OoT-Randomizer/ASM/build.py --compile-c |
File renamed without changes.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
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.
--compile-c
is the default as of #2187.