summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2024-03-24 03:15:05 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2024-03-24 04:14:26 +0530
commitbb9d98ed078ca1dd67d095828906f76b0b3dab2a (patch)
tree7d463b9c900c63599369dddc5bfe4fd3e49df15c
parentcbb87d89e796be3db5c2575c39f6199a1466b212 (diff)
cerbero: Need to rebuild pyvenv tools on Windows
Part-of: <https://gitlab.freedesktop.org/gstreamer/cerbero/-/merge_requests/1423>
-rw-r--r--cerbero/commands/cache.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/cerbero/commands/cache.py b/cerbero/commands/cache.py
index b76d3552..1a764064 100644
--- a/cerbero/commands/cache.py
+++ b/cerbero/commands/cache.py
@@ -20,6 +20,7 @@ import os
import sys
import json
import tempfile
+import pickle
import shutil
from hashlib import sha256
@@ -223,6 +224,21 @@ class FetchCache(BaseCache):
continue
self._change_lib_paths(object_file, old_path, new_path)
+ def mark_windows_build_tools_dirty(self, config):
+ """
+ On Windows, Python virtualenv writes out an executable for all
+ pip-installed Python programs, which need to be rebuilt for the current
+ prefix. Currently, this is just Meson in build-tools.
+ """
+ cache_file = os.path.join(config.home_dir, config.build_tools_cache)
+ with open(cache_file, 'rb+') as f:
+ p = pickle.load(f)
+ # Reset the recipe status
+ del p['meson']
+ f.seek(0)
+ f.truncate(0)
+ pickle.dump(p, f)
+
def relocate_prefix(self, config, namespace):
"""
We need to relocate pc files that weren't generated by meson and
@@ -240,6 +256,8 @@ class FetchCache(BaseCache):
# Need to relocate RPATHs and names in binaries
if config.platform == Platform.DARWIN:
self.relocate_macos_build_tools(config, origin, dest)
+ elif config.platform == Platform.WINDOWS:
+ self.mark_windows_build_tools_dirty(config)
async def fetch_dep(self, config, dep, namespace):
is_ci = 'CI' in os.environ