Closed lesamouraipourpre closed 2 years ago
It has been reported. This is a duplicate of #48. I was able to solve the error you're posting, but I abandoned trying to build mpy-cross with NMake.
Since then I've learned how to use CMake, so maybe its worth adjusting mpy-cross to build using
cmake -G "NMake Makefiles" <path-to-mpycross-src-with-CMakeLists.txt>
In the meantime, anyone can use WSL on windows... See also https://github.com/adafruit/circuitpython-build-tools/issues/48#issuecomment-692011657
I took another whack at this since mpy-cross builds are now downloaded from AWS (which wasn't an option last I tried solving this). However, I don't know the proper URL to use when downloading a pre-built executable of mpy-cross for Windows.
I have been able to solve the copyfile()
problem on Windows. which also led to an AttributeError
since os.uname()
does not exist in python on Windows. AFAIK, we can use platform.uname()
instead without losing any required info (best practice would be to mandate uniform string casing as well).
I can submit a PR that simply fixes this issue, but full compatibility on Windows requires a pre-built executable of mpy-cross from AWS because building from source still uses make
and other Unix specific cmds.
The listing for a path on our s3 is always viewable -- try https://adafruit-circuit-python.s3.amazonaws.com/index.html?prefix=bin/mpy-cross/
looks like a typical filename for mpy-cross for windows would be https://adafruit-circuit-python.s3.amazonaws.com/bin/mpy-cross/mpy-cross.static-x64-windows-7.1.1.exe
@jepler Thank you! I'm kinda embarrassed to think that I didn't check with AWS search query (I don't often work with AWS because 💰).
With the correct URL, this pkg now runs on Windows (x64 only). I'll open a PR after checking contrib guidelines...
No worries, the "index.html?prefix=" trick is not something you would be expected to know. I only know it due to being in my browser history.
Following comments from @jepler on #72, I've looked further into why I can't get
circuitpython-build-tools
to run on Windows.The problem is usage of
tempfile.NamedTemporaryFile()
, for example at https://github.com/adafruit/circuitpython-build-tools/blob/716a38c713eddb9d2d713bcfbe95e5f0572791d6/circuitpython_build_tools/build.py#L221The problem is documented at https://docs.python.org/3/library/tempfile.html#tempfile.NamedTemporaryFile, specifically
The error is triggered later in the method at a call to
shutil.copyfile(temp_file.name, output_file)
becausecopyfile
tries to re-open the file.Error on Windows:
I don't use Windows for development so this bug is not of concern to me. That it has not been reported before suggests that almost nobody has come across this or at least have not reported it.