diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 46635374c..2c04f8336 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -25,15 +25,30 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: + fetch-depth: 0 submodules: recursive # Set Git config - name: Git config run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + # Normalize file mod times + - name: Restore timestamps + run: uv run https://raw.githubusercontent.com/MestreLion/git-tools/refs/tags/v2022.12/git-restore-mtime --merge --commit-time + # Copy the original files to the workspace - name: Prepare - run: cp -R /orig . + run: cp -a /orig . + + # Restore cached files + - name: Cache build + uses: actions/cache@v4 + with: + path: | + build + .ninja_deps + .ninja_log + key: ${{ runner.os }}-${{ matrix.version }} # Build the project - name: Build diff --git a/configure.py b/configure.py index 94a3806ac..ac3e4592a 100755 --- a/configure.py +++ b/configure.py @@ -158,11 +158,11 @@ if args.no_asm: # Tool versions config.binutils_tag = "2.42-1" -config.compilers_tag = "20250520" +config.compilers_tag = "20250812" config.dtk_tag = "v1.6.2" -config.objdiff_tag = "v3.0.0-beta.10" +config.objdiff_tag = "v3.0.0-beta.14" config.sjiswrap_tag = "v1.2.1" -config.wibo_tag = "0.6.16" +config.wibo_tag = "0.7.0" # Project config.config_path = Path("config") / config.version / "config.yml" diff --git a/tools/download_tool.py b/tools/download_tool.py index 7adbf0d70..381b170a6 100755 --- a/tools/download_tool.py +++ b/tools/download_tool.py @@ -91,6 +91,7 @@ TOOLS: Dict[str, Callable[[str], str]] = { "wibo": wibo_url, } + def download(url, response, output) -> None: if url.endswith(".zip"): data = io.BytesIO(response.read()) @@ -107,6 +108,7 @@ def download(url, response, output) -> None: st = os.stat(output) os.chmod(output, st.st_mode | stat.S_IEXEC) + def main() -> None: parser = argparse.ArgumentParser() parser.add_argument("tool", help="Tool name") @@ -128,12 +130,17 @@ def main() -> None: try: import certifi import ssl - except: - print("\"certifi\" module not found. Please install it using \"python -m pip install certifi\".") + except ImportError: + print( + '"certifi" module not found. Please install it using "python -m pip install certifi".' + ) return - - with urllib.request.urlopen(req, context=ssl.create_default_context(cafile=certifi.where())) as response: + + with urllib.request.urlopen( + req, context=ssl.create_default_context(cafile=certifi.where()) + ) as response: download(url, response, output) + if __name__ == "__main__": main() diff --git a/tools/project.py b/tools/project.py index c6207c988..e3f7a393f 100644 --- a/tools/project.py +++ b/tools/project.py @@ -767,11 +767,11 @@ def generate_build_ninja( n.newline() def write_custom_step(step: str, prev_step: Optional[str] = None) -> None: - implicit: List[str | Path] = [] + implicit: List[Union[str, Path]] = [] if config.custom_build_steps and step in config.custom_build_steps: n.comment(f"Custom build steps ({step})") for custom_step in config.custom_build_steps[step]: - outputs = cast(List[str | Path], custom_step.get("outputs")) + outputs = cast(List[Union[str, Path]], custom_step.get("outputs")) if isinstance(outputs, list): implicit.extend(outputs) @@ -1589,7 +1589,7 @@ def generate_objdiff_config( "build_ctx": True, } ) - category_opt: List[str] | str = obj.options["progress_category"] + category_opt: Union[List[str], str] = obj.options["progress_category"] if isinstance(category_opt, list): progress_categories.extend(category_opt) elif category_opt is not None: