adafruit / circuitpython

CircuitPython - a Python implementation for teaching coding with microcontrollers
https://circuitpython.org
Other
4.03k stars 1.19k forks source link

Issue with 'mpy-cross/Makefile.static-mingw' #6304

Open gvanem opened 2 years ago

gvanem commented 2 years ago

CircuitPython version

From tip of `master` yesterday.

Code/REPL

None.

Behavior

Building the mpy-cross program using MinGW, fails in the last link-step:

LINK mpy-cross.static.exe
x86_64-w64-mingw32-gcc -o mpy-cross.static.exe
...

x86_64-w64-mingw32-gcc.exe: error: f:gvVC_2019VCToolsMSVC14.29.30133libx86: No such file or directory
/usr/bin/sh: f:gvVC_2019VCToolsMSVC14.29.30133AtlMfclibx86: command not found
/usr/bin/sh: f:ProgramFiler-x86WindowsKitsLib10.0.22000.0umx86: command not found

Since the $(LIB) env-variable is used for the link. But this is a MSVC thing and it contains \ slashes. Easy fix for me was to just unset it first:

--- a/mpy-cross/Makefile.static-mingw 2022-04-21 08:04:09
+++ b/mpy-cross/Makefile.static-mingw 2022-04-22 07:52:25
@@ -6,5 +6,6 @@
 CROSS_COMPILE = x86_64-w64-mingw32-
 BUILD=build-static-mingw
 STATIC_BUILD=1
+LIB=

 include mpy-cross.mk

Description

I've said enough.

Additional information

None.

dhalbert commented 2 years ago

From tip of master yesterday.

Did you mean main? master is defunct.

We do build on Windows as part of our CI checks with MSYS, see here: https://github.com/adafruit/circuitpython/blob/main/.github/workflows/ports_windows.yml Is there something different with what you are doing?

gvanem commented 2 years ago

We do build on Windows as part of our CI checks with MSYS,

MSYS does not normally use (or need) a LIB env-var, does it? Like I wrote LIB is a MSVC (+Borland, Watcom) thing.

gvanem commented 2 years ago

Try adding a MAKEFLAGS += --warn-undefined-variables to py/mkenv.mk. Then watch all the warnings. In a CI job a warning: undefined variable 'LIB' would probably show up. But not here; it's a legitimate env-var for other compilers.