Build: Outright remove the unwanted binaries, just to be sure.

This is needed on Windows at the moment, which doesn't actually parse that file, but does execute the method.

part of CURA-12229
This commit is contained in:
Remco Burema 2024-10-30 08:45:58 +01:00
parent e0f0e9407b
commit cf836c29cb

View file

@ -285,11 +285,13 @@ class CuraConan(ConanFile):
blacklist = pyinstaller_metadata["blacklist"] blacklist = pyinstaller_metadata["blacklist"]
filtered_binaries = [b for b in binaries if not any([all([(part in b[0].lower()) for part in parts]) for parts in blacklist])] filtered_binaries = [b for b in binaries if not any([all([(part in b[0].lower()) for part in parts]) for parts in blacklist])]
# TEMP: print to make sure -- remove this before merge # In case the installer isn't actually pyinstaller (Windows at the moment), outright remove the offending files:
print("specifically don't include:") specifically_delete = set(binaries) - set(filtered_binaries)
print(set(binaries) - set(filtered_binaries)) for (unwanted_path, _) in specifically_delete:
print("=== === ===") print(f"delete: {unwanted_path}")
os.remove(unwanted_path)
# Write the actual file:
with open(os.path.join(location, "UltiMaker-Cura.spec"), "w") as f: with open(os.path.join(location, "UltiMaker-Cura.spec"), "w") as f:
f.write(pyinstaller.render( f.write(pyinstaller.render(
name = str(self.options.display_name).replace(" ", "-"), name = str(self.options.display_name).replace(" ", "-"),