Skip to content

Commit

Permalink
Merge pull request #677 from encounter/progress-categories
Browse files Browse the repository at this point in the history
Progress categories support
  • Loading branch information
LagoLunatic authored Sep 4, 2024
2 parents f6247bb + 8e1861d commit da7a1c4
Show file tree
Hide file tree
Showing 3 changed files with 483 additions and 241 deletions.
22 changes: 8 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,19 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Git config
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Prepare
run: cp -R /orig/${{matrix.version}} orig
- name: Download objdiff CLI
if: github.ref == 'refs/heads/main'
run: |
python tools/download_tool.py --tag v2.0.0-beta.4 objdiff-cli objdiff-cli
- name: Build
run: |
python configure.py --version ${{matrix.version}} --compilers /compilers --warn error
ninja
python configure.py --version ${{matrix.version}} --compilers /compilers --warn off
ninja all_source
ninja all_source build/${{ matrix.version }}/progress.json build/${{ matrix.version }}/report.json
- name: Upload progress
if: github.ref == 'refs/heads/main'
continue-on-error: true
Expand All @@ -43,16 +42,11 @@ jobs:
run: |
python tools/upload_progress.py -b https://progress.decomp.club/ -p tww -v ${{matrix.version}} \
build/${{matrix.version}}/progress.json
- name: Generate objdiff progress report
if: github.ref == 'refs/heads/main'
run: |
./objdiff-cli report generate -o report.json
- name: Save objdiff progress report artifact
if: github.ref == 'refs/heads/main'
- name: Upload report
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.version }}-report-${{ github.sha }}
path: report.json
name: ${{ matrix.version }}_report
path: build/${{ matrix.version }}/report.json

website:
runs-on: ubuntu-latest
Expand All @@ -66,7 +60,7 @@ jobs:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: GZLE01-report-${{ github.sha }}
name: GZLE01_report
path: ./artifacts
- name: Rename artifact
run: |
Expand Down
76 changes: 59 additions & 17 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,7 @@
import sys
from pathlib import Path
from typing import Any, Dict, List

from tools.project import (
Object,
ProjectConfig,
calculate_progress,
generate_build,
is_windows,
)
from tools.project import *

# Game versions
DEFAULT_VERSION = 1
Expand Down Expand Up @@ -144,6 +137,7 @@
config.binutils_tag = "2.42-1"
config.compilers_tag = "20240706"
config.dtk_tag = "v0.9.2"
config.objdiff_tag = "v2.0.0-beta.5"
config.sjiswrap_tag = "v1.1.1"
config.wibo_tag = "0.6.11"

Expand Down Expand Up @@ -256,6 +250,7 @@ def DolphinLib(lib_name: str, objects: List[Object]) -> Dict[str, Any]:
"lib": lib_name,
"mw_version": "GC/1.2.5n",
"cflags": cflags_base,
"progress_category": "dolphin",
"host": False,
"objects": objects,
}
Expand All @@ -267,6 +262,7 @@ def Rel(lib_name: str, objects: List[Object]) -> Dict[str, Any]:
"lib": lib_name,
"mw_version": "GC/1.3.2",
"cflags": cflags_rel,
"progress_category": "game",
"host": True,
"objects": objects,
}
Expand All @@ -283,6 +279,7 @@ def JSystemLib(lib_name, objects):
"lib": lib_name,
"mw_version": "GC/1.3.2",
"cflags": cflags_framework,
"progress_category": "core",
"host": True,
"objects": objects,
}
Expand All @@ -295,12 +292,12 @@ def JSystemLib(lib_name, objects):
config.warn_missing_source = False
config.libs = [
{
"lib": "framework",
"lib": "machine",
"mw_version": "GC/1.3.2",
"cflags": cflags_framework,
"progress_category": "core",
"host": True,
"objects": [
# machine
Object(Matching, "m_Do/m_Do_main.cpp"),
Object(Matching, "m_Do/m_Do_printf.cpp"),
Object(Matching, "m_Do/m_Do_audio.cpp"),
Expand All @@ -318,11 +315,26 @@ def JSystemLib(lib_name, objects):
Object(NonMatching, "m_Do/m_Do_MemCardRWmng.cpp"),
Object(Matching, "m_Do/m_Do_gba_com.cpp"),
Object(Matching, "m_Do/m_Do_machine_exception.cpp"),

# c
],
},
{
"lib": "c",
"mw_version": "GC/1.3.2",
"cflags": cflags_framework,
"progress_category": "game",
"host": True,
"objects": [
Object(NonMatching, "c/c_damagereaction.cpp"),
Object(Matching, "c/c_dylink.cpp"),

],
},
{
"lib": "framework",
"mw_version": "GC/1.3.2",
"cflags": cflags_framework,
"progress_category": "core",
"host": True,
"objects": [
# f_ap
Object(Matching, "f_ap/f_ap_game.cpp"),

Expand Down Expand Up @@ -381,8 +393,15 @@ def JSystemLib(lib_name, objects):
Object(Matching, "f_pc/f_pc_draw.cpp"),
Object(Matching, "f_pc/f_pc_fstcreate_req.cpp"),
Object(Matching, "f_pc/f_pc_stdcreate_req.cpp"),

# dolzel
],
},
{
"lib": "dolzel",
"mw_version": "GC/1.3.2",
"cflags": cflags_framework,
"progress_category": "game",
"host": True,
"objects": [
Object(NonMatching, "d/d_stage.cpp"),
Object(NonMatching, "d/d_map.cpp"),
Object(Matching, "d/d_com_inf_game.cpp", extra_cflags=['-sym off']),
Expand Down Expand Up @@ -543,14 +562,23 @@ def JSystemLib(lib_name, objects):
Object(Matching, "d/d_wind_arrow.cpp"),
Object(NonMatching, "d/d_wpillar.cpp"),
Object(Matching, "d/d_wpot_water.cpp"),

],
},
{
"lib": "DynamicLink",
"mw_version": "GC/1.3.2",
"cflags": cflags_framework,
"progress_category": "core",
"host": True,
"objects": [
Object(Matching, "DynamicLink.cpp"),
],
},
{
"lib": "SSystem",
"mw_version": "GC/1.3.2",
"cflags": cflags_framework,
"progress_category": "core",
"host": True,
"objects": [
Object(Matching, "SSystem/SComponent/c_malloc.cpp"),
Expand Down Expand Up @@ -1114,6 +1142,7 @@ def JSystemLib(lib_name, objects):
"lib": "Runtime.PPCEABI.H",
"mw_version": "GC/1.3",
"cflags": cflags_runtime,
"progress_category": "dolphin",
"host": False,
"objects": [
Object(Matching, "PowerPC_EABI_Support/Runtime/Src/__mem.c"),
Expand All @@ -1132,6 +1161,7 @@ def JSystemLib(lib_name, objects):
"lib": "MSL_C",
"mw_version": "GC/1.3",
"cflags": cflags_runtime,
"progress_category": "dolphin",
"host": False,
"objects": [
Object(Matching, "PowerPC_EABI_Support/MSL/MSL_C/MSL_Common/Src/abort_exit.c"),
Expand Down Expand Up @@ -1185,6 +1215,7 @@ def JSystemLib(lib_name, objects):
"lib": "TRK_MINNOW_DOLPHIN",
"mw_version": "GC/1.3.2",
"cflags": cflags_runtime,
"progress_category": "dolphin",
"host": False,
"objects": [
Object(NonMatching, "TRK_MINNOW_DOLPHIN/Portable/mainloop.c"),
Expand Down Expand Up @@ -1217,6 +1248,7 @@ def JSystemLib(lib_name, objects):
"lib": "amcstubs",
"mw_version": "GC/1.3.2",
"cflags": cflags_runtime,
"progress_category": "dolphin",
"host": False,
"objects": [
Object(NonMatching, "amcstubs/AmcExi2Stubs.c"),
Expand All @@ -1226,6 +1258,7 @@ def JSystemLib(lib_name, objects):
"lib": "OdemuExi2",
"mw_version": "GC/1.3.2",
"cflags": cflags_runtime,
"progress_category": "dolphin",
"host": False,
"objects": [
Object(NonMatching, "OdemuExi2/DebuggerDriver.c"),
Expand All @@ -1235,6 +1268,7 @@ def JSystemLib(lib_name, objects):
"lib": "odenotstub",
"mw_version": "GC/1.3.2",
"cflags": cflags_runtime,
"progress_category": "dolphin",
"host": False,
"objects": [
Object(NonMatching, "odenotstub/odenotstub.c"),
Expand All @@ -1246,6 +1280,7 @@ def JSystemLib(lib_name, objects):
"lib": "REL",
"mw_version": "GC/1.3.2",
"cflags": cflags_rel,
"progress_category": "core",
"host": False,
"objects": [
Object(Matching, "REL/executor.c"),
Expand Down Expand Up @@ -1673,12 +1708,19 @@ def JSystemLib(lib_name, objects):
ActorRel(NonMatching, "d_a_movie_player", extra_cflags=["-O3,p"]),
]

# Optional extra categories for progress tracking
config.progress_categories = [
ProgressCategory("core", "Core Game Engine"),
ProgressCategory("game", "TWW Game Code"),
ProgressCategory("dolphin", "GameCube Specific Code"),
]
config.progress_each_module = args.verbose

if args.mode == "configure":
# Write build.ninja and objdiff.json
generate_build(config)
elif args.mode == "progress":
# Print progress and write progress.json
config.progress_each_module = args.verbose
calculate_progress(config)
else:
sys.exit("Unknown mode: " + args.mode)
Loading

0 comments on commit da7a1c4

Please sign in to comment.