Skip to content

Commit

Permalink
Don't hardcode /tmp paths
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
  • Loading branch information
s0undt3ch committed Nov 7, 2023
1 parent dc4c764 commit ac98472
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions relenv/build/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""
The linux build process.
"""
import tempfile
from .common import *
from ..common import arches, LINUX

Expand Down Expand Up @@ -340,9 +341,14 @@ def build_python(env, dirs, logfp):
]
)

with open("/tmp/patch", "w") as fp:
fp.write(PATCH)
runcmd(["patch", "-p0", "-i", "/tmp/patch"], env=env, stderr=logfp, stdout=logfp)
with tempfile.NamedTemporaryFile(
node="w", suffix="_patch", delete_on_close=False
) as patch_file:
patch_file.write(PATCH)
patch_file.close()
runcmd(
["patch", "-p0", "-i", patch_file.name], env=env, stderr=logfp, stdout=logfp
)

env["PKG_CONFIG_PATH"] = f"{dirs.prefix}/lib/pkgconfig"
env["OPENSSL_CFLAGS"] = f"-I{dirs.prefix}/include -Wno-coverage-mismatch"
Expand Down

0 comments on commit ac98472

Please sign in to comment.