microsoft / pxt-maker

MakeCode target for "Maker" boards (beta)
https://maker.makecode.com/
Other
116 stars 81 forks source link

Building with pxt build --local --force failing #294

Closed wallarug closed 4 years ago

wallarug commented 4 years ago

Describe the bug Building with pxt build --local --force failing

Go to project folder (after following all other instructions from README.md).

pxt clean
export PXT_NODOCKER=1
pxt build --local --force

There's a few issues here on Windows 10.

  1. Does not correctly identify or find the CMake compiler. I don't think this is a major issue. I have set CC and CXX to look for the Visual Studio 2019 Community CMake.exe file.
[run] cd built/codal; python build.py
Creating libraries folder
Cloning into: https://github.com/lancaster-university/codal-itsybitsy-m4
Cloning into 'codal-itsybitsy-m4'...
Checking out branch: v0.2.4
HEAD is now at 270a9fe... Snapshot v0.2.4
Set target: codal-itsybitsy-m4
Using target-locked.json
Targeting codal-itsybitsy-m4
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- The ASM compiler identification is unknown
-- Found assembler: C:/Program Files (x86)/ProgrammingIDEs/VisualStudio/2019/Community/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmake.exe
-- Warning: Did not find file Compiler/-ASM
-- Adding library path: (C:/Users/cianb/Documents/repos/makecode-peter/pxt-maker/projects/Serial-M4/built/codal/libraries)
  1. It is unable to build correctly. This fails for all the packages it tries to compile for with the same error at the end. Parse Error in command line argument -DITSYBITSY_M4_EXPORTS. I don't know what this means or where it comes from - I can only guess it comes from the main pxt.json file.
Using library: codal-samd
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/cianb/Documents/repos/makecode-peter/pxt-maker/projects/Serial-M4/built/codal/build
[1/184] Building CXX object CMakeFiles\ITSYBITSY_M4.dir\pxtapp\accelerometer\accelhw.cpp.obj
FAILED: CMakeFiles/ITSYBITSY_M4.dir/pxtapp/accelerometer/accelhw.cpp.obj
C:\PROGRA~2\PROGRA~2\VISUAL~1\2019\COMMUN~1\Common7\IDE\COMMON~1\MICROS~1\CMake\CMake\bin\cmake.exe  -DITSYBITSY_M4_EXPORTS -I..\libraries -I..\pxtapp\accelerometer -I..\pxtapp -I..\pxtapp\mixer---samd -I..\pxtapp\serial -I..\pxtapp\settings -I..\pxtapp\thermometer -I..\libraries\codal-itsybitsy-m4\model -I..\libraries\codal-itsybitsy-m4\inc -I..\libraries\codal-core\.\inc\JACDAC -I..\libraries\codal-core\.\inc\JACDAC\control -I..\libraries\codal-core\.\inc\JACDAC\services -I..\libraries\codal-core\.\inc\core -I..\libraries\codal-core\.\inc\driver-models -I..\libraries\codal-core\.\inc\drivers -I..\libraries\codal-core\.\inc\streams -I..\libraries\codal-core\.\inc\types -I..\libraries\codal-samd\inc\CMSIS -I..\libraries\codal-samd\inc -I..\libraries\codal-samd\asf4\samd51 -I..\libraries\codal-samd\asf4\samd51\include -I..\libraries\codal-samd\asf4\samd51\config -I..\libraries\codal-samd\asf4\samd51\hri -I..\libraries\codal-samd\asf4\samd51\hpl\port -I..\libraries\codal-samd\asf4\samd51\hal\include -I..\libraries\codal-samd\asf4\samd51\hal\utils\include -I..\libraries\codal-samd\samd-peripherals\samd -I..\libraries\codal-samd\samd-peripherals -mcpu=cortex-m4 -mthumb -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -fno-exceptions -fno-unwind-tables -ffunction-sections -fdata-sections -Wall -Wextra -Wno-unused-parameter -std=c++11 -fwrapv -fno-rtti -fno-threadsafe-statics -fno-exceptions -fno-unwind-tables -Wl,--gc-sections -Wl,--sort-common -Wl,--sort-section=alignment -Wno-array-bounds -include C:/Users/cianb/Documents/repos/makecode-peter/pxt-maker/projects/Serial-M4/built/codal/build/codal_extra_definitions.h -IC:/Users/cianb/Documents/repos/makecode-peter/pxt-maker/projects/Serial-M4/built/codal/utils/cmake/toolchains/ARM_GCC    -DSAMDX1 -D__SAMD51J19A__ -MMD -MT CMakeFiles\ITSYBITSY_M4.dir\pxtapp\accelerometer\accelhw.cpp.obj -MF CMakeFiles\ITSYBITSY_M4.dir\pxtapp\accelerometer\accelhw.cpp.obj.d -o CMakeFiles\ITSYBITSY_M4.dir\pxtapp\accelerometer\accelhw.cpp.obj -c ..\pxtapp\accelerometer\accelhw.cpp
Parse error in command line argument: -DITSYBITSY_M4_EXPORTS
Should be: VAR:type=value
CMake Error: No cmake script provided.
CMake Error: Problem processing arguments. Aborting.
  1. Build fails (full stop)
ninja: build stopped: subcommand failed.
INTERNAL ERROR: Error: Exit code: 1 from cd built/codal; python build.py
    at ChildProcess.<anonymous> (C:\Users\cianb\Documents\repos\makecode-peter\pxt-maker\node_modules\pxt-core\built\nodeutil.js:85:24)
    at ChildProcess.emit (events.js:223:5)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)

Desktop (please complete the following information):

Additional context As an aside to the above issue. The instructions should probably be improved to include that for Windows 10 you need to install all the below before you can get to this stage:

wallarug commented 4 years ago

Update I through I would change it to the GNU CMake and that seems to have fixed the issue.

Without being told to use this version of CMake, one could assume that you just use VS tools. I work with MinGW32 for all development on Windows which may also not help.

Set target: codal-itsybitsy-m4
Using target-locked.json
Targeting codal-itsybitsy-m4
-- The C compiler identification is GNU 6.2.1
-- The CXX compiler identification is GNU 6.2.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/arm-none-eabi-gcc