3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-11-24 06:31:27 +00:00

Fix NuGet package missing Microsoft.Z3.dll due to inverted replace() logic (#8029)

* Initial plan

* Fix NuGet packaging and add GitHub Actions workflow

- Fixed critical bug in mk_nuget_task.py replace() function
- Created comprehensive GitHub Actions workflow for building NuGet packages

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

* Add documentation and improve code comments

- Added comprehensive README for NuGet build workflow
- Added detailed comments explaining the replace() function fix
- Verified all Python syntax is correct

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
Copilot 2025-11-16 11:46:16 -08:00 committed by GitHub
parent 59eec25102
commit 62cd39729f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 354 additions and 1 deletions

View file

@ -44,10 +44,20 @@ def classify_package(f, arch):
return None
def replace(src, dst):
"""
Replace destination file with source file.
Removes the destination file if it exists, then moves the source file to the destination.
This ensures that the file is always moved, whether or not the destination exists.
Previous buggy implementation only moved when removal failed, causing files to be
deleted but not replaced when the destination already existed.
"""
try:
os.remove(dst)
except:
shutil.move(src, dst)
pass
shutil.move(src, dst)
def unpack(packages, symbols, arch):
# unzip files in packages