Skip to content

Commit

Permalink
base: Make the virtual bin directory path deterministic
Browse files Browse the repository at this point in the history
  • Loading branch information
48cf committed Jan 23, 2024
1 parent 4022048 commit 71d1e6c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions xbstrap/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1600,11 +1600,14 @@ def substitute(varname):

# /bin directory for virtual tools.
explicit_pkgconfig = False
vb = tempfile.TemporaryDirectory()
virtual_bin = "/tmp/xbstrap/virtual/bin"

try_rmtree(virtual_bin)
os.makedirs(virtual_bin)

for yml in manifest["virtual_tools"]:
if yml["virtual"] == "pkgconfig-for-host":
vscript = os.path.join(vb.name, yml["program_name"])
vscript = os.path.join(virtual_bin, yml["program_name"])
paths = []
for tool_yml in manifest["tools"]:
paths.append(os.path.join(build_root, tool_yml["prefix_subdir"], "lib/pkgconfig"))
Expand Down Expand Up @@ -1635,7 +1638,7 @@ def substitute(varname):
explicit_pkgconfig = True
elif yml["virtual"] == "pkgconfig-for-target":
vscript = os.path.join(
vb.name, "{}-pkg-config".format(replace_at_vars(yml["triple"], substitute))
virtual_bin, "{}-pkg-config".format(replace_at_vars(yml["triple"], substitute))
)
with open(vscript, "wt") as f:
f.write(
Expand All @@ -1661,7 +1664,7 @@ def substitute(varname):
# Build the environment
environ = os.environ.copy()

path_dirs = [vb.name]
path_dirs = [virtual_bin]
ldso_dirs = []
aclocal_dirs = []
for yml in manifest["tools"]:
Expand Down

0 comments on commit 71d1e6c

Please sign in to comment.