From e9eb4c0a478e60599deb0adb7456e8132bc92618 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Tue, 22 Sep 2020 22:48:22 +0530 Subject: cache: Use the build platform to decide when to relocate Relocation is needed when we don't build pkg-config with --enable-define-prefix. Relocation was already broken on macOS and Windows because self.build_dir is hard-coded to /builds/... which is wrong on macOS ($HOME/builds/...) and Windows (C:/builds/...). Part-of: --- cerbero/commands/cache.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cerbero/commands/cache.py b/cerbero/commands/cache.py index f2a64c88..0a1aa633 100644 --- a/cerbero/commands/cache.py +++ b/cerbero/commands/cache.py @@ -147,12 +147,12 @@ class FetchCache(BaseCache): m.warning("Corrupted dependency file, ignoring.") os.remove(dep_path) - # Don't need to relocate on Windows since binaries in the prefix - # are meant to be used in a relocatable manner. In case this needs - # to be re-enabled at some point, note that the current - # self.build_dir value is an absolute path, and should instead be - # derived from CI env vars. - if config.target_platform != Platform.WINDOWS: + # Don't need to relocate on Windows and macOS since we build + # pkg-config with --enable-define-prefix. + # In case this needs to be re-enabled at some point, note that the + # current self.build_dir value is hard-coded and is wrong on macOS + # and Windows. It should instead be derived from CI env vars. + if config.platform == Platform.LINUX: origin = self.build_dir % namespace m.message("Relocating from %s to %s" % (origin, config.home_dir)) # FIXME: Just a quick hack for now -- cgit v1.2.3