From 091219d742adb529f0a34f985c3ce1b0e916726d Mon Sep 17 00:00:00 2001 From: Zach Banks Date: Tue, 18 May 2021 19:53:11 -0400 Subject: [PATCH] Small env fixes: git submodules & python3 (#127) * Small env fixes: for git submodules & python3 Using `/usr/bin/env python3` is preferred over `/usr/bin/python3` because it is compatible with virtualenvs, etc. It picks the version of `python3` currently on the `PATH`, rather than the system-wide default. For the git submodules, I had two issues: The ZAPD repo is currently pointing at a commit not on the master branch, which has to be specifically fetched. Adding `--remote` to the update command fixes this. The decomp-permuter has primary branch `main` not `master` like this repo, so this has to be specified in `.gitmodules` when using `--remote`. * Rework `git submodule update...` part of Makefile --- .gitmodules | 1 + Makefile | 5 ++++- tools/gen_mips_to_c_context.py | 2 +- tools/m2ctx.py | 2 +- tools/overlayhelpers/ichaindis.py | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index ea797ad4b1..746dc80584 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,6 +7,7 @@ [submodule "tools/decomp-permuter"] path = tools/decomp-permuter url = https://github.com/simonlindholm/decomp-permuter + branch = main [submodule "ZAPD"] path = tools/ZAPD url = https://github.com/zeldaret/ZAPD.git diff --git a/Makefile b/Makefile index 01dcc77d08..cdb2997f92 100644 --- a/Makefile +++ b/Makefile @@ -212,7 +212,10 @@ distclean: assetclean clean ## Extraction step setup: - git submodule update --init --recursive + # Initialize submodules, fetching commit in case it is not on the default branch + -git submodule update --init --recursive + git submodule foreach --recursive 'git fetch origin $$sha1' + git submodule update --recursive python3 -m pip install -r requirements.txt $(MAKE) -C tools ./tools/extract_rom.py $(MM_BASEROM) diff --git a/tools/gen_mips_to_c_context.py b/tools/gen_mips_to_c_context.py index 5d89bc6c5d..2767457f4f 100755 --- a/tools/gen_mips_to_c_context.py +++ b/tools/gen_mips_to_c_context.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 import os import sys diff --git a/tools/m2ctx.py b/tools/m2ctx.py index a3dad5974f..c3f06cc7c2 100755 --- a/tools/m2ctx.py +++ b/tools/m2ctx.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 import os import sys diff --git a/tools/overlayhelpers/ichaindis.py b/tools/overlayhelpers/ichaindis.py index d899bde77c..1bacff1972 100755 --- a/tools/overlayhelpers/ichaindis.py +++ b/tools/overlayhelpers/ichaindis.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 +#!/usr/bin/env python3 import os import sys