Install meson from git when MESON_COMMIT variable is set
authorXavier Claessens <xavier.claessens@collabora.com>
Fri, 16 Sep 2022 12:28:49 +0000 (08:28 -0400)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Thu, 24 Nov 2022 16:17:08 +0000 (16:17 +0000)
When starting manually a CI pipeline with MESON_COMMIT variable defined,
install the specified version of Meson. This can be used to help the
Meson project smoke testing RC releases or investigate eventual
regressions.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3036>

ci/scripts/handle-subprojects-cache.py

index 7e126e5..a718c9d 100755 (executable)
@@ -73,10 +73,19 @@ def copy_cache(options):
     subprocess.check_call(['meson', 'subprojects', 'update', '--reset'])
 
 
+def upgrade_meson():
+    # MESON_COMMIT variable can be set when creating a pipeline to test meson pre releases
+    meson_commit = os.environ.get('MESON_COMMIT')
+    if meson_commit:
+        url = f'git+https://github.com/mesonbuild/meson.git@{meson_commit}'
+        subprocess.check_call(['pip3', 'install', '--upgrade', url])
+
+
 if __name__ == "__main__":
     options = PARSER.parse_args()
 
     if options.build:
         create_cache_in_image(options)
     else:
+        upgrade_meson()
         copy_cache(options)