Skip to content

Commit

Permalink
Revert last commit
Browse files Browse the repository at this point in the history
Printing all the env variables feels like a security issue.
  • Loading branch information
WyattBlue committed Nov 27, 2024
1 parent 3710c77 commit a9cd38e
Showing 1 changed file with 14 additions and 42 deletions.
56 changes: 14 additions & 42 deletions scripts/cibuildpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,29 +105,6 @@ def run(cmd, env=None):
print(f"stderr: {e.stderr}")
raise e

def print_config_logs():
"""
Find and print ffbuild/config.log files.
Useful for debugging `ERROR: ... not found using pkg-config`
"""
print(f"Begin print_config_log")
print(f"{os.getcwd()=}")
target_dir = "ffbuild"
target_file = "config.log"
if platform.system() == "Windows":
os_root = ["C:\\", "D:\\"]
else:
os_root = ["/"]
for drive in os_root:
for root, dirs, files in os.walk(drive):
if target_dir in dirs:
potential_dir = os.path.join(root, target_dir)
if target_file in os.listdir(potential_dir):
full_path = os.path.join(potential_dir, target_file)
print(f"Found ffbuild/config.log: {full_path}")
with open(full_path, 'r') as log_file:
print(log_file.read())
print(f"End print_config_log")

@dataclass
class Package:
Expand Down Expand Up @@ -245,25 +222,20 @@ def _build_with_autoconf(self, package: Package, for_builder: bool) -> None:

# build package
os.makedirs(package_build_path, exist_ok=True)
try:
with chdir(package_build_path):
run(
[
"sh",
self._mangle_path(os.path.join(package_source_path, "configure")),
]
+ configure_args
+ package.build_arguments,
env=env,
)
run(
["make"] + make_args(parallel=package.build_parallel) + ["V=1"], env=env
)
run(["make", "install"], env=env)
except Exception as err:
print(err)
print(env)
print_config_logs()
with chdir(package_build_path):
run(
[
"sh",
self._mangle_path(os.path.join(package_source_path, "configure")),
]
+ configure_args
+ package.build_arguments,
env=env,
)
run(
["make"] + make_args(parallel=package.build_parallel) + ["V=1"], env=env
)
run(["make", "install"], env=env)

def _build_with_cmake(self, package: Package, for_builder: bool) -> None:
assert package.build_system == "cmake"
Expand Down

0 comments on commit a9cd38e

Please sign in to comment.