Skip to content

Commit 18de234

Browse files
committed
Replace wine with wibo
1 parent bda794e commit 18de234

File tree

4 files changed

+23
-43
lines changed

4 files changed

+23
-43
lines changed

backend/coreapp/compiler_wrapper.py

-8
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,6 @@ def lru_cache(maxsize: int = 128, typed: bool = False) -> Callable[[F], F]:
3939
else:
4040
PATH = os.environ["PATH"]
4141

42-
WINE: str
43-
if "microsoft" in uname().release.lower() and not settings.USE_SANDBOX_JAIL:
44-
logger.info("WSL detected & nsjail disabled: wine not required.")
45-
WINE = ""
46-
else:
47-
WINE = "wine"
48-
4942
WIBO: str
5043
if "microsoft" in uname().release.lower() and not settings.USE_SANDBOX_JAIL:
5144
logger.info("WSL detected & nsjail disabled: wibo not required.")
@@ -186,7 +179,6 @@ def compile_code(
186179
shell=True,
187180
env={
188181
"PATH": PATH,
189-
"WINE": WINE,
190182
"WIBO": WIBO,
191183
"INPUT": sandbox.rewrite_path(code_path),
192184
"OUTPUT": sandbox.rewrite_path(object_path),

backend/coreapp/compilers.py

+23-24
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ class Compiler:
5757
is_gcc: ClassVar[bool] = False
5858
is_ido: ClassVar[bool] = False
5959
is_mwcc: ClassVar[bool] = False
60-
needs_wine = False
6160
language: Language = Language.C
6261

6362
@property
@@ -211,7 +210,7 @@ def preset_from_name(name: str) -> Optional[Preset]:
211210
cc='cc -E -I "${COMPILER_DIR}"/include -iquote include -nostdinc -undef "$INPUT" | "${COMPILER_DIR}"/bin/agbcp -quiet $COMPILER_FLAGS -o - | arm-none-eabi-as -mcpu=arm7tdmi -o "$OUTPUT"',
212211
)
213212
# N3DS
214-
ARMCC_CC = '${WINE} "${COMPILER_DIR}"/bin/armcc.exe -c --cpu=MPCore --fpmode=fast --apcs=/interwork -I "${COMPILER_DIR}"/include $COMPILER_FLAGS -o "${OUTPUT}" "${INPUT}"'
213+
ARMCC_CC = '${WIBO} "${COMPILER_DIR}"/bin/armcc.exe -c --cpu=MPCore --fpmode=fast --apcs=/interwork -I "${COMPILER_DIR}"/include $COMPILER_FLAGS -o "${OUTPUT}" "${INPUT}"'
215214

216215
ARMCC_40_771 = ArmccCompiler(
217216
id="armcc_40_771",
@@ -305,7 +304,7 @@ def preset_from_name(name: str) -> Optional[Preset]:
305304
+ '(HOME="." dosemu -quiet -dumb -f ${COMPILER_DIR}/dosemurc -K . -E "ASPSX.EXE -quiet object.os -o object.oo") && '
306305
+ '${COMPILER_DIR}/psyq-obj-parser object.oo -o "$OUTPUT"'
307306
)
308-
PSYQ_CC = 'cpp -P "$INPUT" | unix2dos | ${WINE} ${COMPILER_DIR}/CC1PSX.EXE -quiet ${COMPILER_FLAGS} -o "$OUTPUT".s && ${WINE} ${COMPILER_DIR}/ASPSX.EXE -quiet "$OUTPUT".s -o "$OUTPUT".obj && ${COMPILER_DIR}/psyq-obj-parser "$OUTPUT".obj -o "$OUTPUT"'
307+
PSYQ_CC = 'cpp -P "$INPUT" | unix2dos | ${WIBO} ${COMPILER_DIR}/CC1PSX.EXE -quiet ${COMPILER_FLAGS} -o "$OUTPUT".s && ${WIBO} ${COMPILER_DIR}/ASPSX.EXE -quiet "$OUTPUT".s -o "$OUTPUT".obj && ${COMPILER_DIR}/psyq-obj-parser "$OUTPUT".obj -o "$OUTPUT"'
309308

310309
PSYQ35 = GCCPS1Compiler(
311310
id="psyq3.5",
@@ -465,31 +464,31 @@ def preset_from_name(name: str) -> Optional[Preset]:
465464
EE_GCC2952_273A = GCCCompiler(
466465
id="ee-gcc2.95.2-273a",
467466
platform=PS2,
468-
cc='${WINE} "${COMPILER_DIR}/bin/ee-gcc.exe" -c -B "${COMPILER_DIR}"/lib/gcc-lib/ee/2.95.2/ $COMPILER_FLAGS "$INPUT" -o "$OUTPUT"',
467+
cc='${WIBO} "${COMPILER_DIR}/bin/ee-gcc.exe" -c -B "${COMPILER_DIR}"/lib/gcc-lib/ee/2.95.2/ $COMPILER_FLAGS "$INPUT" -o "$OUTPUT"',
469468
)
470469

471470
EE_GCC2952_274 = GCCCompiler(
472471
id="ee-gcc2.95.2-274",
473472
platform=PS2,
474-
cc='${WINE} "${COMPILER_DIR}/bin/ee-gcc.exe" -c -B "${COMPILER_DIR}"/lib/gcc-lib/ee/2.95.2/ $COMPILER_FLAGS "$INPUT" -o "$OUTPUT"',
473+
cc='${WIBO} "${COMPILER_DIR}/bin/ee-gcc.exe" -c -B "${COMPILER_DIR}"/lib/gcc-lib/ee/2.95.2/ $COMPILER_FLAGS "$INPUT" -o "$OUTPUT"',
475474
)
476475

477476
EE_GCC2953_107 = GCCCompiler(
478477
id="ee-gcc2.95.3-107",
479478
platform=PS2,
480-
cc='${WINE} "${COMPILER_DIR}/bin/ee-gcc.exe" -c -B "${COMPILER_DIR}"/lib/gcc-lib/ee/2.95.3/ $COMPILER_FLAGS "$INPUT" -o "$OUTPUT"',
479+
cc='${WIBO} "${COMPILER_DIR}/bin/ee-gcc.exe" -c -B "${COMPILER_DIR}"/lib/gcc-lib/ee/2.95.3/ $COMPILER_FLAGS "$INPUT" -o "$OUTPUT"',
481480
)
482481

483482
EE_GCC2953_114 = GCCCompiler(
484483
id="ee-gcc2.95.3-114",
485484
platform=PS2,
486-
cc='${WINE} "${COMPILER_DIR}/bin/ee-gcc.exe" -c -B "${COMPILER_DIR}"/lib/gcc-lib/ee/2.95.3/ $COMPILER_FLAGS "$INPUT" -o "$OUTPUT"',
485+
cc='${WIBO} "${COMPILER_DIR}/bin/ee-gcc.exe" -c -B "${COMPILER_DIR}"/lib/gcc-lib/ee/2.95.3/ $COMPILER_FLAGS "$INPUT" -o "$OUTPUT"',
487486
)
488487

489488
EE_GCC2953_136 = GCCCompiler(
490489
id="ee-gcc2.95.3-136",
491490
platform=PS2,
492-
cc='${WINE} "${COMPILER_DIR}/bin/ee-gcc.exe" -c -B "${COMPILER_DIR}"/lib/gcc-lib/ee/2.95.3/ $COMPILER_FLAGS "$INPUT" -o "$OUTPUT"',
491+
cc='${WIBO} "${COMPILER_DIR}/bin/ee-gcc.exe" -c -B "${COMPILER_DIR}"/lib/gcc-lib/ee/2.95.3/ $COMPILER_FLAGS "$INPUT" -o "$OUTPUT"',
493492
)
494493

495494
EE_GCC296 = GCCCompiler(
@@ -507,31 +506,31 @@ def preset_from_name(name: str) -> Optional[Preset]:
507506
MWCPS2_23_991202 = MWCCCompiler(
508507
id="mwcps2-2.3-991202",
509508
platform=PS2,
510-
cc='${WINE} "${COMPILER_DIR}/mwccmips.exe" -c $COMPILER_FLAGS -nostdinc -stderr "$INPUT" -o "$OUTPUT"',
509+
cc='${WIBO} "${COMPILER_DIR}/mwccmips.exe" -c $COMPILER_FLAGS -nostdinc -stderr "$INPUT" -o "$OUTPUT"',
511510
)
512511

513512
MWCPS2_30B22_011126 = MWCCCompiler(
514513
id="mwcps2-3.0b22-011126",
515514
platform=PS2,
516-
cc='${WINE} "${COMPILER_DIR}/mwccps2.exe" -c $COMPILER_FLAGS -nostdinc -stderr "$INPUT" -o "$OUTPUT"',
515+
cc='${WIBO} "${COMPILER_DIR}/mwccps2.exe" -c $COMPILER_FLAGS -nostdinc -stderr "$INPUT" -o "$OUTPUT"',
517516
)
518517

519518
MWCPS2_30B22_020123 = MWCCCompiler(
520519
id="mwcps2-3.0b22-020123",
521520
platform=PS2,
522-
cc='${WINE} "${COMPILER_DIR}/mwccps2.exe" -c $COMPILER_FLAGS -nostdinc -stderr "$INPUT" -o "$OUTPUT"',
521+
cc='${WIBO} "${COMPILER_DIR}/mwccps2.exe" -c $COMPILER_FLAGS -nostdinc -stderr "$INPUT" -o "$OUTPUT"',
523522
)
524523

525524
MWCPS2_30B22_020716 = MWCCCompiler(
526525
id="mwcps2-3.0b22-020716",
527526
platform=PS2,
528-
cc='${WINE} "${COMPILER_DIR}/mwccps2.exe" -c $COMPILER_FLAGS -nostdinc -stderr "$INPUT" -o "$OUTPUT"',
527+
cc='${WIBO} "${COMPILER_DIR}/mwccps2.exe" -c $COMPILER_FLAGS -nostdinc -stderr "$INPUT" -o "$OUTPUT"',
529528
)
530529

531530
MWCPS2_30B22_020926 = MWCCCompiler(
532531
id="mwcps2-3.0b22-020926",
533532
platform=PS2,
534-
cc='${WINE} "${COMPILER_DIR}/mwccps2.exe" -c $COMPILER_FLAGS -nostdinc -stderr "$INPUT" -o "$OUTPUT"',
533+
cc='${WIBO} "${COMPILER_DIR}/mwccps2.exe" -c $COMPILER_FLAGS -nostdinc -stderr "$INPUT" -o "$OUTPUT"',
535534
)
536535

537536

@@ -582,7 +581,7 @@ def preset_from_name(name: str) -> Optional[Preset]:
582581
GCC272SN = GCCCompiler(
583582
id="gcc2.7.2sn",
584583
platform=N64,
585-
cc='cpp -P "$INPUT" | ${WINE} "${COMPILER_DIR}"/cc1n64.exe -quiet -G0 -mcpu=vr4300 -mips3 -mhard-float -meb ${COMPILER_FLAGS} -o "$OUTPUT".s && ${WINE} "${COMPILER_DIR}"/asn64.exe -q -G0 "$OUTPUT".s -o "$OUTPUT".obj && "${COMPILER_DIR}"/psyq-obj-parser "$OUTPUT".obj -o "$OUTPUT" -b -n',
584+
cc='cpp -P "$INPUT" | ${WIBO} "${COMPILER_DIR}"/cc1n64.exe -quiet -G0 -mcpu=vr4300 -mips3 -mhard-float -meb ${COMPILER_FLAGS} -o "$OUTPUT".s && ${WIBO} "${COMPILER_DIR}"/asn64.exe -q -G0 "$OUTPUT".s -o "$OUTPUT".obj && "${COMPILER_DIR}"/psyq-obj-parser "$OUTPUT".obj -o "$OUTPUT" -b -n',
586585
)
587586

588587
GCC272SNEW = GCCCompiler(
@@ -595,8 +594,8 @@ def preset_from_name(name: str) -> Optional[Preset]:
595594
id="gcc2.8.1sn",
596595
platform=N64,
597596
cc='cpp -E -lang-c -undef -D__GNUC__=2 -Dmips -D__mips__ -D__mips -Dn64 -D__n64__ -D__n64 -D_PSYQ -D__EXTENSIONS__ -D_MIPSEB -D__CHAR_UNSIGNED__ "$INPUT" '
598-
'| ${WINE} "${COMPILER_DIR}"/cc1n64.exe ${COMPILER_FLAGS} -o "$OUTPUT".s '
599-
'&& ${WINE} "${COMPILER_DIR}"/asn64.exe -q -G0 "$OUTPUT".s -o "$OUTPUT".obj '
597+
'| ${WIBO} "${COMPILER_DIR}"/cc1n64.exe ${COMPILER_FLAGS} -o "$OUTPUT".s '
598+
'&& ${WIBO} "${COMPILER_DIR}"/asn64.exe -q -G0 "$OUTPUT".s -o "$OUTPUT".obj '
600599
'&& "${COMPILER_DIR}"/psyq-obj-parser "$OUTPUT".obj -o "$OUTPUT" -b -n',
601600
)
602601

@@ -605,8 +604,8 @@ def preset_from_name(name: str) -> Optional[Preset]:
605604
base_compiler=GCC281SN,
606605
platform=N64,
607606
cc='cpp -E -lang-c++ -undef -D__GNUC__=2 -D__cplusplus -Dmips -D__mips__ -D__mips -Dn64 -D__n64__ -D__n64 -D_PSYQ -D__EXTENSIONS__ -D_MIPSEB -D__CHAR_UNSIGNED__ -D_LANGUAGE_C_PLUS_PLUS "$INPUT" '
608-
'| ${WINE} "${COMPILER_DIR}"/cc1pln64.exe ${COMPILER_FLAGS} -o "$OUTPUT".s '
609-
'&& ${WINE} "${COMPILER_DIR}"/asn64.exe -q -G0 "$OUTPUT".s -o "$OUTPUT".obj '
607+
'| ${WIBO} "${COMPILER_DIR}"/cc1pln64.exe ${COMPILER_FLAGS} -o "$OUTPUT".s '
608+
'&& ${WIBO} "${COMPILER_DIR}"/asn64.exe -q -G0 "$OUTPUT".s -o "$OUTPUT".obj '
610609
'&& "${COMPILER_DIR}"/psyq-obj-parser "$OUTPUT".obj -o "$OUTPUT" -b -n',
611610
)
612611

@@ -737,7 +736,7 @@ def preset_from_name(name: str) -> Optional[Preset]:
737736
# GC_WII
738737
# Thanks to Gordon Davisson for the xargs trick:
739738
# https://superuser.com/questions/1529226/get-bash-to-respect-quotes-when-word-splitting-subshell-output/1529316#1529316
740-
MWCCEPPC_CC = 'printf "%s" "${COMPILER_FLAGS}" | xargs -x -- ${WINE} "${COMPILER_DIR}/mwcceppc.exe" -pragma "msg_show_realref off" -c -proc gekko -nostdinc -stderr -o "${OUTPUT}" "${INPUT}"'
739+
MWCCEPPC_CC = 'printf "%s" "${COMPILER_FLAGS}" | xargs -x -- ${WIBO} "${COMPILER_DIR}/mwcceppc.exe" -pragma "msg_show_realref off" -c -proc gekko -nostdinc -stderr -o "${OUTPUT}" "${INPUT}"'
741740

742741
MWCC_233_144 = MWCCCompiler(
743742
id="mwcc_233_144",
@@ -759,7 +758,7 @@ def preset_from_name(name: str) -> Optional[Preset]:
759758
MWCC_233_163E = MWCCCompiler(
760759
id="mwcc_233_163e",
761760
platform=GC_WII,
762-
cc='${WINE} "${COMPILER_DIR}/mwcceppc.125.exe" -c -proc gekko -nostdinc -stderr ${COMPILER_FLAGS} -o "${OUTPUT}.1" "${INPUT}" && ${WINE} "${COMPILER_DIR}/mwcceppc.exe" -c -proc gekko -nostdinc -stderr ${COMPILER_FLAGS} -o "${OUTPUT}.2" "${INPUT}" && python3 "${COMPILER_DIR}/frank.py" "${OUTPUT}.1" "${OUTPUT}.2" "${OUTPUT}"',
761+
cc='${WIBO} "${COMPILER_DIR}/mwcceppc.125.exe" -c -proc gekko -nostdinc -stderr ${COMPILER_FLAGS} -o "${OUTPUT}.1" "${INPUT}" && ${WIBO} "${COMPILER_DIR}/mwcceppc.exe" -c -proc gekko -nostdinc -stderr ${COMPILER_FLAGS} -o "${OUTPUT}.2" "${INPUT}" && python3 "${COMPILER_DIR}/frank.py" "${OUTPUT}.1" "${OUTPUT}.2" "${OUTPUT}"',
763762
)
764763

765764
MWCC_233_163N = MWCCCompiler(
@@ -847,7 +846,7 @@ def preset_from_name(name: str) -> Optional[Preset]:
847846
)
848847

849848
# NDS_ARM9
850-
MWCCARM_CC = '${WINE} "${COMPILER_DIR}/mwccarm.exe" -pragma "msg_show_realref off" -c -proc arm946e -nostdinc -stderr ${COMPILER_FLAGS} -o "${OUTPUT}" "${INPUT}"'
849+
MWCCARM_CC = '${WIBO} "${COMPILER_DIR}/mwccarm.exe" -pragma "msg_show_realref off" -c -proc arm946e -nostdinc -stderr ${COMPILER_FLAGS} -o "${OUTPUT}" "${INPUT}"'
851850

852851
MWCC_20_72 = MWCCCompiler(
853852
id="mwcc_20_72",
@@ -987,7 +986,7 @@ def preset_from_name(name: str) -> Optional[Preset]:
987986
cc=MWCCARM_CC,
988987
)
989988

990-
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}"'
989+
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}"'
991990

992991
MSVC40 = MSVCCompiler(
993992
id="msvc4.0",
@@ -1051,12 +1050,12 @@ def preset_from_name(name: str) -> Optional[Preset]:
10511050
# Watcom doesn't like '/' in paths passed to it so we need to replace them.
10521051
WATCOM_ARGS = ' -zq -i="Z:${COMPILER_DIR}/h" -i="Z:${COMPILER_DIR}/h/nt" ${COMPILER_FLAGS} -fo"Z:${OUTPUT}" "Z:${INPUT}"'
10531052
WATCOM_CC = (
1054-
'${WINE} "${COMPILER_DIR}/binnt/wcc386.exe" $(echo "'
1053+
'${WIBO} "${COMPILER_DIR}/binnt/wcc386.exe" $(echo "'
10551054
+ WATCOM_ARGS
10561055
+ "\" | sed 's:/:\\\\:g')"
10571056
)
10581057
WATCOM_CXX = (
1059-
'${WINE} "${COMPILER_DIR}/binnt/wpp386.exe" $(echo "'
1058+
'${WIBO} "${COMPILER_DIR}/binnt/wpp386.exe" $(echo "'
10601059
+ WATCOM_ARGS
10611060
+ "\" | sed 's:/:\\\\:g')"
10621061
)

docs/CONTRIBUTING.md

-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@ yarn dev
7979

8080
### Optional steps
8181
- [Configure vscode for development](VSCODE.md)
82-
- [Configure wine for Windows compiler on Linux](WINE.md)
8382
- [Set up GitHub authentication](GITHUB.md)
8483
- [Install nsjail to run the compiler sandbox](SANDBOX.md)
8584
- [Configure an nginx reverse proxy](NGINX.md)

docs/WINE.md

-10
This file was deleted.

0 commit comments

Comments
 (0)