From 2b270fdd0ee0075cdf406a504e9b628cdb6a4853 Mon Sep 17 00:00:00 2001 From: Christian Klarhorst Date: Sun, 17 Sep 2023 00:08:40 +0200 Subject: [PATCH] litex_setup.py: Disable auto-update of litex_setup for CI This adds a new config option to litex_setup (--disable-auto-update) to disable the auto-update mechanism. It further changes the CI flow to use that flag. Why? The auto-update is a problem for the CI workflow because it will override any (especially branch-specific) changes to the litex_setup script. Then CI is testing the wrong litex_setup script. --- .github/workflows/ci.yml | 2 +- litex_setup.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cbfa106f64..ad59997b2c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,7 +38,7 @@ jobs: # Install (n)Migen / LiteX / Cores - name: Install LiteX run: | - python3 litex_setup.py --config=full --init --install --user + python3 litex_setup.py --config=full --init --install --user --disable-auto-update # Install GCC Toolchains - name: Install GCC Toolchains diff --git a/litex_setup.py b/litex_setup.py index 577675dfd8..0670ee0240 100755 --- a/litex_setup.py +++ b/litex_setup.py @@ -429,6 +429,7 @@ def main(): parser.add_argument("--dev", action="store_true", help="Development-Mode (no Auto-Update of litex_setup.py / Switch to git@github.com URLs).") parser.add_argument("--freeze", action="store_true", help="Freeze and display current config.") parser.add_argument("--release", default=None, help="Make release.") + parser.add_argument("--disable-auto-update", action="store_true", help="Disables Auto-Update of litex_setup.py") # Retro-compatibility. parser.add_argument("compat_args", nargs="*", help="Retro-Compatibility arguments (init, update, install or gcc).") @@ -444,7 +445,7 @@ def main(): # Location/Auto-Update. litex_setup_location_check() - if not args.dev: + if not args.dev and not args.disable_auto_update: litex_setup_auto_update() # Init.