From 7b7eb991f2c3128861827060e6145dab7036a549 Mon Sep 17 00:00:00 2001 From: Mark Street Date: Sun, 17 Sep 2023 20:52:28 +0100 Subject: [PATCH 1/3] Replace wine with wibo --- backend/coreapp/compiler_wrapper.py | 2 -- backend/coreapp/compilers.py | 24 ++++++++++++------------ docs/CONTRIBUTING.md | 1 - docs/WINE.md | 10 ---------- 4 files changed, 12 insertions(+), 25 deletions(-) delete mode 100644 docs/WINE.md diff --git a/backend/coreapp/compiler_wrapper.py b/backend/coreapp/compiler_wrapper.py index 118c0a331..2da2dbf9f 100644 --- a/backend/coreapp/compiler_wrapper.py +++ b/backend/coreapp/compiler_wrapper.py @@ -48,7 +48,6 @@ def lru_cache(maxsize: int = 128, typed: bool = False) -> Callable[[F], F]: else: PATH = os.environ["PATH"] -WINE = "wine" WIBO = "wibo" @@ -195,7 +194,6 @@ def compile_code( shell=True, env={ "PATH": PATH, - "WINE": WINE, "WIBO": WIBO, "INPUT": sandbox.rewrite_path(code_path), "OUTPUT": sandbox.rewrite_path(object_path), diff --git a/backend/coreapp/compilers.py b/backend/coreapp/compilers.py index 900ba3b11..c50389357 100644 --- a/backend/coreapp/compilers.py +++ b/backend/coreapp/compilers.py @@ -385,7 +385,7 @@ def available_platforms() -> List[Platform]: 'echo "compiler_path=${COMPILER_DIR//\\//\\\\}" >> SN.INI && ' 'echo "assembler_path=${COMPILER_DIR//\\//\\\\}" >> SN.INI && ' 'echo "tmpdir=/tmp" >> SN.INI && ' - 'SN_PATH=. ${WINE} ${COMPILER_DIR}/CCPSX.EXE -v -c ${COMPILER_FLAGS} "${INPUT}" -o "${OUTPUT}bj" && ' + 'SN_PATH=. ${WIBO} ${COMPILER_DIR}/CCPSX.EXE -v -c ${COMPILER_FLAGS} "${INPUT}" -o "${OUTPUT}bj" && ' '${COMPILER_DIR}/psyq-obj-parser "${OUTPUT}"bj -o "${OUTPUT}"' ) @@ -530,31 +530,31 @@ def available_platforms() -> List[Platform]: EE_GCC2952_273A = GCCPS2Compiler( id="ee-gcc2.95.2-273a", platform=PS2, - cc='${WINE} "${COMPILER_DIR}/bin/ee-gcc.exe" -c -B "${COMPILER_DIR}"/lib/gcc-lib/ee/2.95.2/ $COMPILER_FLAGS "$INPUT" -o "$OUTPUT"', + cc='${WIBO} "${COMPILER_DIR}/bin/ee-gcc.exe" -c -B "${COMPILER_DIR}"/lib/gcc-lib/ee/2.95.2/ $COMPILER_FLAGS "$INPUT" -o "$OUTPUT"', ) EE_GCC2952_274 = GCCPS2Compiler( id="ee-gcc2.95.2-274", platform=PS2, - cc='${WINE} "${COMPILER_DIR}/bin/ee-gcc.exe" -c -B "${COMPILER_DIR}"/lib/gcc-lib/ee/2.95.2/ $COMPILER_FLAGS "$INPUT" -o "$OUTPUT"', + cc='${WIBO} "${COMPILER_DIR}/bin/ee-gcc.exe" -c -B "${COMPILER_DIR}"/lib/gcc-lib/ee/2.95.2/ $COMPILER_FLAGS "$INPUT" -o "$OUTPUT"', ) EE_GCC2953_107 = GCCPS2Compiler( id="ee-gcc2.95.3-107", platform=PS2, - cc='${WINE} "${COMPILER_DIR}/bin/ee-gcc.exe" -c -B "${COMPILER_DIR}"/lib/gcc-lib/ee/2.95.3/ $COMPILER_FLAGS "$INPUT" -o "$OUTPUT"', + cc='${WIBO} "${COMPILER_DIR}/bin/ee-gcc.exe" -c -B "${COMPILER_DIR}"/lib/gcc-lib/ee/2.95.3/ $COMPILER_FLAGS "$INPUT" -o "$OUTPUT"', ) EE_GCC2953_114 = GCCPS2Compiler( id="ee-gcc2.95.3-114", platform=PS2, - cc='${WINE} "${COMPILER_DIR}/bin/ee-gcc.exe" -c -B "${COMPILER_DIR}"/lib/gcc-lib/ee/2.95.3/ $COMPILER_FLAGS "$INPUT" -o "$OUTPUT"', + cc='${WIBO} "${COMPILER_DIR}/bin/ee-gcc.exe" -c -B "${COMPILER_DIR}"/lib/gcc-lib/ee/2.95.3/ $COMPILER_FLAGS "$INPUT" -o "$OUTPUT"', ) EE_GCC2953_136 = GCCPS2Compiler( id="ee-gcc2.95.3-136", platform=PS2, - cc='${WINE} "${COMPILER_DIR}/bin/ee-gcc.exe" -c -B "${COMPILER_DIR}"/lib/gcc-lib/ee/2.95.3/ $COMPILER_FLAGS "$INPUT" -o "$OUTPUT"', + cc='${WIBO} "${COMPILER_DIR}/bin/ee-gcc.exe" -c -B "${COMPILER_DIR}"/lib/gcc-lib/ee/2.95.3/ $COMPILER_FLAGS "$INPUT" -o "$OUTPUT"', ) EE_GCC296 = GCCPS2Compiler( @@ -572,7 +572,7 @@ def available_platforms() -> List[Platform]: MWCPS2_23_991202 = MWCCPS2Compiler( id="mwcps2-2.3-991202", platform=PS2, - cc='${WINE} "${COMPILER_DIR}/mwccmips.exe" -c $COMPILER_FLAGS -nostdinc -stderr "$INPUT" -o "$OUTPUT"', + cc='${WIBO} "${COMPILER_DIR}/mwccmips.exe" -c $COMPILER_FLAGS -nostdinc -stderr "$INPUT" -o "$OUTPUT"', ) MWCPS2_CC = '${WIBO} "${COMPILER_DIR}/mwccps2.exe" -c $COMPILER_FLAGS -nostdinc -stderr "$INPUT" -o "$OUTPUT"' @@ -719,7 +719,7 @@ def available_platforms() -> List[Platform]: PSPSNC_1_2_7503_0 = GCCCompiler( id="pspsnc_1.2.7503.0", platform=PSP, - cc='${WINE} ${COMPILER_DIR}/pspsnc.exe -c -td=. ${COMPILER_FLAGS} -o "${OUTPUT}" "${INPUT}"', + cc='${WIBO} ${COMPILER_DIR}/pspsnc.exe -c -td=. ${COMPILER_FLAGS} -o "${OUTPUT}" "${INPUT}"', ) MWCCPSP_CC = ( @@ -1137,7 +1137,7 @@ def available_platforms() -> List[Platform]: PRODG_CC = ( 'cpp -E "${INPUT}" -o "${INPUT}".i && ' - "${WINE} ${COMPILER_DIR}/cc1.exe -quiet ${COMPILER_FLAGS} -o ${OUTPUT}.s ${INPUT}.i && " + "${WIBO} ${COMPILER_DIR}/cc1.exe -quiet ${COMPILER_FLAGS} -o ${OUTPUT}.s ${INPUT}.i && " "${WIBO} ${COMPILER_DIR}/NgcAs.exe ${OUTPUT}.s -o ${OUTPUT}" ) @@ -1300,7 +1300,7 @@ def available_platforms() -> List[Platform]: cc=MWCCARM_CC, ) -CL_WIN = '${WINE} "${COMPILER_DIR}"/Bin/CL.EXE /c /nologo /IZ:"${COMPILER_DIR}"/Include/ ${COMPILER_FLAGS} /Fd"Z:/tmp/" /Bk"Z:/tmp/" /Fo"Z:${OUTPUT}" "Z:${INPUT}"' +CL_WIN = '${WIBO} "${COMPILER_DIR}"/Bin/CL.EXE /c /nologo /IZ:"${COMPILER_DIR}"/Include/ ${COMPILER_FLAGS} /Fd"Z:/tmp/" /Bk"Z:/tmp/" /Fo"Z:${OUTPUT}" "Z:${INPUT}"' MSVC40 = MSVCCompiler( id="msvc4.0", @@ -1364,12 +1364,12 @@ def available_platforms() -> List[Platform]: # Watcom doesn't like '/' in paths passed to it so we need to replace them. WATCOM_ARGS = ' -zq -i="Z:${COMPILER_DIR}/h" -i="Z:${COMPILER_DIR}/h/nt" ${COMPILER_FLAGS} -fo"Z:${OUTPUT}" "Z:${INPUT}"' WATCOM_CC = ( - '${WINE} "${COMPILER_DIR}/binnt/wcc386.exe" $(echo "' + '${WIBO} "${COMPILER_DIR}/binnt/wcc386.exe" $(echo "' + WATCOM_ARGS + "\" | sed 's:/:\\\\:g')" ) WATCOM_CXX = ( - '${WINE} "${COMPILER_DIR}/binnt/wpp386.exe" $(echo "' + '${WIBO} "${COMPILER_DIR}/binnt/wpp386.exe" $(echo "' + WATCOM_ARGS + "\" | sed 's:/:\\\\:g')" ) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index fc273e609..04a5db381 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -85,7 +85,6 @@ yarn dev ### Optional steps - [Configure vscode for development](VSCODE.md) -- [Configure wine for Windows compiler on Linux](WINE.md) - [Set up GitHub authentication](GITHUB.md) - [Install nsjail to run the compiler sandbox](SANDBOX.md) - [Configure an nginx reverse proxy](NGINX.md) diff --git a/docs/WINE.md b/docs/WINE.md deleted file mode 100644 index 4cfe86b83..000000000 --- a/docs/WINE.md +++ /dev/null @@ -1,10 +0,0 @@ -### Wine setup (for local development, running Windows compilers) -- Create a wineprefix dir -```shell -WINEPREFIX=$HOME/.wine WINEARCH=win32 wineboot --init -``` - -- Add the WINEPREFIX setting to your .local.env file in the root of the repo -```shell -echo "WINEPREFIX=$HOME/.wine" >> .local.env -``` From 8db9d43967221980d8abf067a2cf46a9e44bc19f Mon Sep 17 00:00:00 2001 From: Mark Street Date: Tue, 17 Oct 2023 21:35:38 +0100 Subject: [PATCH 2/3] wibo 0.6.8 --- backend/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 17c5bd983..3ce74f6a6 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -106,7 +106,7 @@ RUN if [ "${ENABLE_GC_WII_SUPPORT}" = "YES" ]; then \ curl -sSL https://github.com/encounter/gc-wii-binutils/releases/download/2.42-1/linux-`uname -m`.zip | \ bsdtar -xvf- -C /usr/bin && \ chmod +x /usr/bin/powerpc-eabi-*; \ - fi + fi RUN mkdir -p /etc/fonts From d61f3b25e09467627e381d24c0c7e64fcaea78b5 Mon Sep 17 00:00:00 2001 From: Ethan Date: Thu, 23 May 2024 02:45:31 +0900 Subject: [PATCH 3/3] Update to wibo 0.6.13 --- .github/workflows/ci.yml | 2 +- backend/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 248e21aac..ffc8d59ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -99,7 +99,7 @@ jobs: poetry run python3 libraries/download.py - name: Install wibo run: |- - wget https://github.com/decompals/wibo/releases/download/0.6.12/wibo && chmod +x wibo && sudo cp wibo /usr/bin/ + wget https://github.com/decompals/wibo/releases/download/0.6.13/wibo && chmod +x wibo && sudo cp wibo /usr/bin/ - name: Run backend tests run: |- diff --git a/backend/Dockerfile b/backend/Dockerfile index 3ce74f6a6..46f1646b7 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -65,7 +65,7 @@ RUN curl -sSL https://install.python-poetry.org/ | \ COPY --from=nsjail /nsjail/nsjail /bin/nsjail -COPY --from=ghcr.io/decompals/wibo:0.6.12 /usr/local/sbin/wibo /usr/bin/ +COPY --from=ghcr.io/decompals/wibo:0.6.13 /usr/local/sbin/wibo /usr/bin/ RUN add-apt-repository -y ppa:dosemu2/ppa && \ add-apt-repository -y ppa:stsp-0/dj64 && \