Skip to content

Commit f35e83d

Browse files
committed
Revert "Build All Versions Together (#2873)"
This reverts commit ba3ba47.
1 parent 9dfec21 commit f35e83d

File tree

14 files changed

+32
-155
lines changed

14 files changed

+32
-155
lines changed

.github/workflows/validate-and-report.yml

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -97,46 +97,6 @@ jobs:
9797
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
9898
run: .venv/bin/python3 tools/progress.py --version ${{ matrix.version }}
9999

100-
# unlike the matrix build above, this task builds all versions of the
101-
# game from the same build graph
102-
build-all:
103-
# Building and testing cannot work if the repository owner is not Xeeynamo
104-
# due to the missing secrets to clone the CI dependencies
105-
if: github.repository == 'Xeeynamo/sotn-decomp'
106-
runs-on: ubuntu-latest
107-
env:
108-
DISCORD_PROGRESS_WEBHOOK: ${{ secrets.DISCORD_PROGRESS_WEBHOOK }}
109-
steps:
110-
- name: Install requirements
111-
run: sudo apt-get install gcc-mipsel-linux-gnu
112-
- name: Clone main repo (PR)
113-
if: github.event_name == 'pull_request_target'
114-
uses: actions/checkout@v4
115-
with:
116-
ref: ${{ github.event.pull_request.head.sha }}
117-
submodules: false
118-
- name: Clone main repo
119-
if: github.event_name != 'pull_request_target'
120-
uses: actions/checkout@v4
121-
with:
122-
ref: ${{ github.ref }}
123-
submodules: false
124-
- name: Install tools requirements
125-
run: make update-dependencies
126-
- name: Get PSX dependencies
127-
uses: actions/cache@v4
128-
id: get-dependencies
129-
with:
130-
path: 'disks/dependencies'
131-
key: sotn-pspeu-deps
132-
- name: Setting up dependencies
133-
working-directory: disks
134-
run: cat dependencies/* | tar -zxf -
135-
- name: Extract dependencies
136-
run: make extract_disk
137-
- name: Build binaries and check if they match
138-
run: make
139-
140100
generate-duplicates-report:
141101
strategy:
142102
matrix:

Makefile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ endif
126126

127127
.PHONY: all
128128
all: ##@ (Default) build and check
129-
all: build_all check
129+
all: build check
130130

131131
.PHONY: extract_assets
132132
extract_assets:
@@ -157,18 +157,19 @@ build_pspeu: $(SOTNSTR_APP) $(SOTNASSETS) $(ALLEGREX) $(MWCCPSP) $(MWCCGAP_APP)
157157
ninja
158158
.PHONY: build_all
159159
build_all:
160-
$(PYTHON) tools/builds/gen.py
161-
ninja
160+
$(MAKE) VERSION=us
161+
$(MAKE) VERSION=pspeu
162+
$(MAKE) VERSION=hd
162163

163164
.PHONY: clean clean_asm
164165
clean_asm:
165166
git clean -fdx $(ASM_DIR)
166167
clean: ##@ clean extracted files, assets, and build artifacts
167168
clean: clean_asm
168169
git clean -fdx assets/
169-
git clean -fdx build/
170+
git clean -fdx build/$(VERSION)/
170171
git clean -fdx src/**/gen/
171-
git clean -fdx config/
172+
git clean -fdx config/*$(VERSION)*
172173
git clean -fdx function_calls/
173174
git clean -fdx sotn_calltree.txt
174175

config/assets.pspeu.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ files:
333333
- [0x2B328, layers, layers]
334334
- [0x2B608, palette, pal_stained_glass, 16] # 0x204
335335
- [0x2B628, paldef, palette_def]
336-
- [0x2B6F8, gfx_banks, psp/graphics_banks]
336+
- [0x2B6F8, gfx_banks, graphics_banks]
337337
- [0x2B8E0, skip]
338338
- [0x2BC20, rooms, rooms]
339339
- [0x2BCF8, cutscene, cutscene_script_it]
@@ -350,7 +350,7 @@ files:
350350
# These gfx palette assignments are unconfirmed.
351351
# They match psx, but the .png does not render correctly for psp.
352352
- [0x2C588, cmpgfx, gfx_stage_name_jp_sm, 128, 128, 4]
353-
- [0x2C880, cmpgfx, psp/gfx_stage_name_jp_lg, 128, 128, 4]
353+
- [0x2C880, cmpgfx, gfx_stage_name_jp_lg, 128, 128, 4]
354354
- [0x2CD10, cmpgfx, gfx_confessional, 128, 128, 4]
355355
- [0x2DF38, cmpgfx, gfx_chair, 128, 128, 4, 0x3ADF0]
356356
- [0x2EB18, cmpgfx, gfx_corner_guard, 128, 128, 4, 0x3AE50]

config/assets.us.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,14 +257,14 @@ files:
257257
- [0x8C, palette, pal_stained_glass, 16] # 0x204
258258
- [0xAC, paldef, palette_def]
259259
- [0x178, layers, layers]
260-
- [0x468, gfx_banks, us/graphics_banks]
260+
- [0x468, gfx_banks, graphics_banks]
261261
- [0x670, layout, entity_layouts]
262262
- [0x818, skip]
263263
- [0x2358, rooms, rooms]
264264
- [0x2F44, skip]
265265
- [0x3A94, cutscene, cutscene_script_psx]
266266
- [0x3C18, binary, cutscene_data_psx] # May be gfx data, unsure
267-
- [0x3F20, cmpgfx, us/gfx_stage_name_jp_lg, 128, 128, 4]
267+
- [0x3F20, cmpgfx, gfx_stage_name_jp_lg, 128, 128, 4]
268268
- [0x8498, cmpgfx, gfx_confessional, 128, 128, 4]
269269
- [0x96BC, cmpgfx, gfx_chair, 128, 128, 4, 0x1692C]
270270
- [0xA298, cmpgfx, gfx_corner_guard, 128, 128, 4, 0x16BAC]

src/st/dai/gfx_data.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ u8 gfx_stage_name_jp_sm[] = {
88
#endif
99

1010
u8 gfx_stage_name_jp_lg[] = {
11-
#include GEN_VERSION(gfx_stage_name_jp_lg.h)
11+
#include "gen/gfx_stage_name_jp_lg.h"
1212
};
1313

1414
u8 gfx_confessional[] = {

src/st/dai/graphics_banks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// SPDX-License-Identifier: AGPL-3.0-or-later
22
#include "dai.h"
33

4-
#include GEN_VERSION(graphics_banks.h)
4+
#include "gen/graphics_banks.h"

tools/builds/gen.py

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,11 @@ def add_c_psx(
108108
"cc_flags": get_cc_flags_for_exceptional_files(version, file_name),
109109
},
110110
)
111-
112-
# this file may be generated by a different
113-
# version of the game, but the content will
114-
# be identical.
115-
if file_name in entries:
116-
return output
117-
entries[file_name] = {"reason": "generated"}
118111
nw.build(
119112
rule="phony",
120113
outputs=file_name,
121114
implicit=[f"src/.assets_build_done_{ver}"],
122115
)
123-
124116
return output
125117

126118

@@ -158,9 +150,6 @@ def add_copy_psx(
158150
outputs=[output],
159151
inputs=[in_file_name],
160152
)
161-
if in_file_name in entries:
162-
return output
163-
entries[in_file_name] = {"reason": "copied"}
164153
nw.build(
165154
rule="phony",
166155
outputs=[in_file_name],
@@ -241,13 +230,6 @@ def add_c_psp(
241230
"src_dir": os.path.dirname(file_name),
242231
},
243232
)
244-
245-
# this file may be generated by a different
246-
# version of the game, but the content will
247-
# be identical.
248-
if file_name in entries:
249-
return output
250-
entries[file_name] = {"reason": "generated"}
251233
nw.build(
252234
rule="phony",
253235
outputs=file_name,
@@ -286,21 +268,18 @@ def add_assets_config(nw: ninja_syntax.Writer, version: str):
286268
def add_gfx_stage(
287269
nw: ninja_syntax.Writer, target_path: str, asset_path: str, output_name: str
288270
):
289-
input_name = f"{asset_path}_0.png"
290-
if input_name not in entries:
291-
entries[input_name] = {"reason": "gfxtage decoding"}
292-
nw.build(
293-
rule="gfxstage-decode",
294-
outputs=input_name,
295-
inputs=target_path,
296-
variables={
297-
"path": asset_path,
298-
},
299-
)
271+
nw.build(
272+
rule="gfxstage-decode",
273+
outputs=f"{asset_path}_0.png",
274+
inputs=target_path,
275+
variables={
276+
"path": asset_path,
277+
},
278+
)
300279
nw.build(
301280
rule="gfxstage-encode",
302281
outputs=[output_name],
303-
inputs=[input_name],
282+
inputs=[f"{asset_path}_0.png"],
304283
variables={
305284
"path": asset_path,
306285
},
@@ -648,7 +627,7 @@ def add_checksum(nw: ninja_syntax.Writer, version: str, file_name: str):
648627
)
649628
nw.build(
650629
rule="check",
651-
outputs=[f"{version} 🆗"],
630+
outputs=["🆗"],
652631
inputs=file_name,
653632
implicit=binaries,
654633
)
@@ -804,8 +783,8 @@ def add_checksum(nw: ninja_syntax.Writer, version: str, file_name: str):
804783

805784
actual_version = os.getenv("VERSION")
806785
if not actual_version:
807-
actual_version = "us,hd,pspeu"
808-
for version in actual_version.split(","):
786+
actual_version = "us"
787+
for version in [actual_version]:
809788
for entry in os.scandir("config/"):
810789
if not entry.name.startswith(f"splat.{version}."):
811790
continue

tools/sotn-assets/assets/cmpgfx/handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func (h *handler) Extract(e assets.ExtractArgs) error {
6565
if err := util.WriteFile(assetPathAsRAW(e.AssetDir, e.Name), cmp); err != nil {
6666
return fmt.Errorf("error writing file: %v", err)
6767
}
68-
fout, err := util.CreateAtomicWriter(assetPathAsPNG(e.AssetDir, e.Name))
68+
fout, err := os.Create(assetPathAsPNG(e.AssetDir, e.Name))
6969
if err != nil {
7070
return fmt.Errorf("error creating file: %v", err)
7171
}

tools/sotn-assets/assets/headergfx/handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func (h *handler) Extract(e assets.ExtractArgs) error {
4949
if err := os.MkdirAll(e.AssetDir, 0755); err != nil {
5050
return fmt.Errorf("error creating directory: %v", err)
5151
}
52-
fout, err := util.CreateAtomicWriter(assetPath(e.AssetDir, e.Name))
52+
fout, err := os.Create(assetPath(e.AssetDir, e.Name))
5353
if err != nil {
5454
return fmt.Errorf("error creating file: %v", err)
5555
}

tools/sotn-assets/assets/palette/palette.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ func (h *handler) Extract(e assets.ExtractArgs) error {
8181
for i, paletteFileName := range paletteNames {
8282
i, paletteFileName := i, paletteFileName
8383
eg.Go(func() error {
84-
f, err := util.CreateAtomicWriter(filepath.Join(e.AssetDir, paletteFileName))
84+
f, err := os.Create(filepath.Join(e.AssetDir, paletteFileName))
8585
if err != nil {
8686
return err
8787
}

0 commit comments

Comments
 (0)