Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes building on Windows #2

Merged
merged 2 commits into from
Jan 3, 2023
Merged

Fixes building on Windows #2

merged 2 commits into from
Jan 3, 2023

Conversation

NicolasFlamel1
Copy link

os.rename fails on Windows if the destination already exists.

@NicolasFlamel1
Copy link
Author

NicolasFlamel1 commented Dec 30, 2022

So this fixes building on Windows with the following commands since cloning the repo includes an empty secp256k1-zkp folder.

git clone https://github.com/grinventions/secp256k1-zkp-mw.git
cd secp256k1-zkp-mw
pip install .

However I just looked at the contents of the Python package with pip download secp256k1-zkp-mw and it doesn't include an empty secp256k1-zkp folder, so this might not fix installing on Windows with pip install secp256k1-zkp-mw.

Don't merge this yet. I'll keep looking into it.

@NicolasFlamel1
Copy link
Author

NicolasFlamel1 commented Dec 31, 2022

I was able to get this all figured out. The Visual Studio C/C++ compiler doesn't work when files with long path names are used, and pip uses %TEMP%\pip-install\... as its default temp location when installing modules which can easily exceeds the compilers path length limitation. So to install this module on Windows you'll need to change the TEMP environmental variable to be something with a short path, like C:\temp, and also create that temp folder. This PR adds that information to the readme.

That's not all. The module also fails to install on Windows because of the absolute paths in the module's secp256k1-zkp-mw-0.1.0/secp256k1_zkp_mw.egg-info/SOURCES.txt file. So you'll need to change them from this:

/Users/marek/Development/open-source/grinventions/tmp3/secp256k1-zkp-mw/secp256k1-zkp/contrib/lax_der_parsing.c
/Users/marek/Development/open-source/grinventions/tmp3/secp256k1-zkp-mw/secp256k1-zkp/src/secp256k1.c

to this and republish the module with that change.

secp256k1-zkp/contrib/lax_der_parsing.c
secp256k1-zkp/src/secp256k1.c

This has been a great reminder of why I don't use Windows lol.

@marekyggdrasil
Copy link
Collaborator

Thank you @NicolasFlamel1 for investigating this. I am about to merge your changes, bump up the version and re-publish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants