Skip to content

Commit

Permalink
Merge branch 'main' into wine-b-gone
Browse files Browse the repository at this point in the history
  • Loading branch information
ethteck committed Aug 27, 2024
2 parents d61f3b2 + 1c90e90 commit 5270445
Show file tree
Hide file tree
Showing 65 changed files with 1,672 additions and 855 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
frontend/ @bates64
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ assignees: ''

---

I would like to create/update (delete as applicable) a compiler preset on decomp.me.
I would like to create/update a compiler preset on decomp.me.

- **Preset Name:** e.g. `Superfrog 64`
- **Preset ID (when updating):** e.g. `13` (see [Compiler Presets API](https://decomp.me/api/preset))
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ jobs:
--build-arg ENABLE_GC_WII_SUPPORT=YES \
--build-arg ENABLE_PS2_SUPPORT=YES \
--build-arg ENABLE_SATURN_SUPPORT=YES \
--build-arg ENABLE_DREAMCAST_SUPPORT=YES \
--build-arg ENABLE_WIN32_SUPPORT=YES
- name: Run tests
run: |-
Expand All @@ -181,7 +182,6 @@ jobs:
-v $(pwd)/local_files:/local_files \
-v $(pwd)/compilers:/compilers \
-v $(pwd)/libraries:/libraries \
--tmpfs /dev/shm:exec,uid=1000,gid=1000,size=64M,mode=0700 \
--security-opt apparmor=unconfined \
--security-opt seccomp=unconfined \
--entrypoint /bin/bash \
Expand All @@ -197,6 +197,7 @@ jobs:
poetry install --no-root && \
poetry run compilers/download.py --compilers-dir ${COMPILER_BASE_PATH} && \
poetry run libraries/download.py --libraries-dir ${LIBRARY_BASE_PATH} && \
for r in wine/*.reg; do regedit $r; done && \
poetry run python manage.py test'
frontend_lint:
Expand Down
11 changes: 8 additions & 3 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ RUN apt-get -y update && apt-get install -y \
&& rm -rf /var/lib/apt/lists/*

RUN curl -sSL https://install.python-poetry.org/ | \
POETRY_VERSION=1.6.1 POETRY_HOME=/etc/poetry python3.10 -
POETRY_VERSION=1.8.3 POETRY_HOME=/etc/poetry python3.10 -

COPY --from=nsjail /nsjail/nsjail /bin/nsjail

Expand All @@ -77,16 +77,20 @@ RUN add-apt-repository -y ppa:dosemu2/ppa && \
ARG ENABLE_MSDOS_SUPPORT
ARG ENABLE_PS2_SUPPORT
ARG ENABLE_WIN32_SUPPORT
ARG ENABLE_DREAMCAST_SUPPORT
RUN if [ "${ENABLE_MSDOS_SUPPORT}" = "YES" ] || \
[ "${ENABLE_PS2_SUPPORT}" = "YES" ] || \
[ "${ENABLE_DREAMCAST_SUPPORT}" = "YES" ] || \
[ "${ENABLE_WIN32_SUPPORT}" = "YES" ]; then \
dpkg --add-architecture i386 && apt-get update && \
apt-get install -y -o APT::Immediate-Configure=false \
wine; \
fi

ARG ENABLE_PSP_SUPPORT

# Patched mips binutils
RUN if [ "${ENABLE_PS2_SUPPORT}" = "YES" ]; then \
RUN if [ "${ENABLE_PS2_SUPPORT}" = "YES" ] || [ "${ENABLE_PSP_SUPPORT}" = "YES" ]; then \
wget "https://github.com/decompals/binutils-mips-ps2-decompals/releases/download/v0.4/binutils-mips-ps2-decompals-linux-x86-64.tar.gz" && \
tar xvzf binutils-mips-ps2-decompals-linux-x86-64.tar.gz -C /usr/bin mips-ps2-decompals-as mips-ps2-decompals-nm mips-ps2-decompals-objdump && \
rm binutils-mips-ps2-decompals-linux-x86-64.tar.gz && \
Expand Down Expand Up @@ -128,6 +132,7 @@ USER user
RUN if [ "${ENABLE_MSDOS_SUPPORT}" = "YES" ] || \
[ "${ENABLE_NDS_ARM9_SUPPORT}" = "YES" ] || \
[ "${ENABLE_PS2_SUPPORT}" = "YES" ] || \
[ "${ENABLE_DREAMCAST_SUPPORT}" = "YES" ] || \
[ "${ENABLE_WIN32_SUPPORT}" = "YES" ]; then \
wineboot --init; \
fi
Expand All @@ -141,7 +146,6 @@ ARG ENABLE_N3DS_SUPPORT
ARG ENABLE_N64_SUPPORT
ARG ENABLE_NDS_ARM9_SUPPORT
ARG ENABLE_PS1_SUPPORT
ARG ENABLE_PSP_SUPPORT
ARG ENABLE_SATURN_SUPPORT
ARG ENABLE_SWITCH_SUPPORT

Expand All @@ -150,6 +154,7 @@ ENV ENABLE_GC_WII_SUPPORT=${ENABLE_GC_WII_SUPPORT}
ENV ENABLE_MACOSX_SUPPORT=${ENABLE_MACOSX_SUPPORT}
ENV ENABLE_MSDOS_SUPPORT=${ENABLE_MSDOS_SUPPORT}
ENV ENABLE_N3DS_SUPPORT=${ENABLE_N3DS_SUPPORT}
ENV ENABLE_DREAMCAST_SUPPORT=${ENABLE_DREAMCAST_SUPPORT}
ENV ENABLE_N64_SUPPORT=${ENABLE_N64_SUPPORT}
ENV ENABLE_NDS_ARM9_SUPPORT=${ENABLE_NDS_ARM9_SUPPORT}
ENV ENABLE_PS1_SUPPORT=${ENABLE_PS1_SUPPORT}
Expand Down
11 changes: 10 additions & 1 deletion backend/compilers/compilers.linux.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ gc_wii:
- mwcc_233_163
- mwcc_233_163e
- mwcc_233_163n
- mwcc_242_53
- mwcc_242_81
- mwcc_242_81r
- mwcc_247_92
- mwcc_247_92p1
- mwcc_247_105
- mwcc_247_107
- mwcc_247_108
Expand All @@ -24,9 +26,10 @@ gc_wii:
- mwcc_42_140
- mwcc_42_142
- mwcc_43_145
- mwcc_43_188
- mwcc_43_151
- mwcc_43_172
- mwcc_43_188
- mwcc_43_202
- mwcc_43_213
- prodg_35
- prodg_37
Expand Down Expand Up @@ -99,6 +102,7 @@ ps1:
- psyq4.4
- psyq4.5
- psyq4.6
- psyq_263_221
- gcc2.5.7-psx
- gcc2.6.3-psx
- gcc2.6.0-mipsel
Expand All @@ -111,6 +115,7 @@ ps1:
- gcc2.7.2.3-mipsel
- gcc2.8.0-mipsel
- gcc2.8.1-mipsel
- gcc2.8.1-psx
- gcc2.91.66-mipsel
- gcc2.95.2-mipsel

Expand Down Expand Up @@ -168,6 +173,9 @@ psp:
saturn:
- cygnus-2.7-96Q3

dreamcast:
- shc-v5.1r11

macosx:
- gcc-5026
- gcc-5363
Expand All @@ -191,3 +199,4 @@ win32:
- msvc6.6
- msvc7.0
- msvc7.1
- msvc8.0
6 changes: 2 additions & 4 deletions backend/coreapp/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@

from .models.course import Course, CourseChapter, CourseScenario
from .models.github import GitHubUser
from .models.preset import Preset
from .models.preset import Preset, PresetAdmin
from .models.profile import Profile
from .models.project import Project, ProjectMember
from .models.scratch import (
Asm,
Assembly,
AssemblyAdmin,
CompilerConfig,
Scratch,
ScratchAdmin,
)
Expand All @@ -19,8 +18,7 @@
admin.site.register(Asm)
admin.site.register(Assembly, AssemblyAdmin)
admin.site.register(Scratch, ScratchAdmin)
admin.site.register(CompilerConfig)
admin.site.register(Preset)
admin.site.register(Preset, PresetAdmin)
admin.site.register(Project)
admin.site.register(ProjectMember)
admin.site.register(Course)
Expand Down
64 changes: 55 additions & 9 deletions backend/coreapp/asm_preludes/ps2.s
Original file line number Diff line number Diff line change
@@ -1,21 +1,67 @@
.macro glabel label
.global \label
.type \label, @function
\label:
.macro glabel name, visibility=global
.\visibility "\name"
.type "\name", @function
"\name":
.endm

.macro dlabel label
.global \label
\label:
.macro dlabel name, visibility=global
.\visibility "\name"
.type "\name", @object
"\name":
.endm

.macro jlabel label
\label:
.macro jlabel name, visibility=local
.\visibility "\name"
"\name":
.endm

.macro .late_rodata
.section .rodata
.endm

# Defines a sized symbol with function type.
# Usage:
# .fn my_function, local
# /* asm here */
# .endfn my_function
.macro .fn name, visibility=global
.\visibility "\name"
.type "\name", @function
"\name":
.endm

.macro .endfn name
.size "\name", . - "\name"
.endm

# Defines a sized symbol with object type.
# Usage:
# .obj my_object, local
# /* data here */
# .endobj my_object
.macro .obj name, visibility=global
.\visibility "\name"
.type "\name", @object
"\name":
.endm

.macro .endobj name
.size "\name", . - "\name"
.endm

# Defines a sized symbol without a type.
# Usage:
# .sym my_sym, local
# /* anything here */
# .endsym my_sym
.macro .sym name, visibility=global
.\visibility "\name"
"\name":
.endm

.macro .endsym name
.size "\name", . - "\name"
.endm

.set noat
.set noreorder
5 changes: 2 additions & 3 deletions backend/coreapp/compiler_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def lru_cache(maxsize: int = 128, typed: bool = False) -> Callable[[F], F]:

@dataclass
class DiffResult:
result: Dict[str, Any]
errors: str
result: Optional[Dict[str, Any]] = None
errors: Optional[str] = None


@dataclass
Expand Down Expand Up @@ -255,7 +255,6 @@ def assemble_asm(platform: Platform, asm: Asm) -> Assembly:
hash=hash,
arch=platform.arch,
source_asm=asm,
elf_object=f"assembled({asm.data})".encode("UTF-8"),
)
assembly.save()
return assembly
Expand Down
Loading

0 comments on commit 5270445

Please sign in to comment.