Compile CanvasKit - fatal: CreateProcess: %1 is not a valid Win32 application.

586 views
Skip to first unread message

Pedro Henrique

unread,
Oct 18, 2022, 7:07:47 AM10/18/22
to skia-discuss

I'm trying to compile with ./compile.sh inside modules/canvaskit and I get the error:
...
Done. Made 102 targets from 55 files in 99ms
+ out/canvaskit_wasm/depot_tools/./ninja.exe -v -C out/canvaskit_wasm canvaskit.js
ninja: Entering directory `out/canvaskit_wasm'
ninja: fatal: CreateProcess: %1 is not a valid Win32 application.


What could be happening?

I'm using Windows 10 with MINGW64.









Pedro Henrique

unread,
Oct 18, 2022, 7:08:45 AM10/18/22
to skia-discuss
$  ./compile.sh
+++ dirname ./compile.sh
++ cd .
++ pwd
+ BASE_DIR=/e/Documentos/skia/modules/canvaskit
+ pushd /e/Documentos/skia/modules/canvaskit/../..
/e/Documentos/skia /e/Documentos/skia/modules/canvaskit
+ ./bin/fetch-gn
+ IS_OFFICIAL_BUILD=true
+ IS_DEBUG=false
+ FORCE_TRACING=false
+ PROFILE_BUILD=false
+ [[ '' != *force_tracing* ]]
+ FORCE_TRACING=true
+ [[ '' == *debug_build* ]]
+ [[ '' == *profiling* ]]
+ BUILD_DIR=out/canvaskit_wasm
+ mkdir -p out/canvaskit_wasm
+ rm -f 'out/canvaskit_wasm/*.a'
+ ENABLE_GPU=true
+ ENABLE_WEBGL=false
+ ENABLE_WEBGPU=false
+ [[ '' == *cpu* ]]
+ [[ '' == *webgpu* ]]
+ ENABLE_WEBGL=true
+ SERIALIZE_SKP=true
+ [[ '' == *no_skp_serialization* ]]
+ DESERIALIZE_EFFECTS=true
+ [[ '' == *no_effects_deserialization* ]]
+ ENABLE_SKOTTIE=true
+ [[ '' == *no_skottie* ]]
+ INCLUDE_VIEWER=false
+ USE_EXPAT=false
+ [[ '' == *viewer* ]]
+ ENABLE_PARTICLES=true
+ [[ '' == *no_particles* ]]
+ ENABLE_PATHOPS=true
+ [[ '' == *no_pathops* ]]
+ ENABLE_RT_SHADER=true
+ [[ '' == *no_rt_shader* ]]
+ ENABLE_SKSL_TRACE=true
+ [[ '' == *no_sksl_trace* ]]
+ ENABLE_MATRIX=true
+ [[ '' == *no_matrix* ]]
+ ENABLE_CANVAS=true
+ [[ '' == *no_canvas* ]]
+ [[ '' == *no_matrix* ]]
+ GN_FONT='skia_enable_fontmgr_custom_directory=false '
+ WOFF2_FONT=skia_use_freetype_woff2=true
+ ENABLE_FONT=true
+ ENABLE_EMBEDDED_FONT=true
+ [[ '' == *no_font* ]]
+ [[ '' == *no_embedded_font* ]]
+ GN_FONT+='skia_enable_fontmgr_custom_embedded=true skia_enable_fontmgr_custom_empty=false '
+ GN_FONT+='skia_fontmgr_factory=":fontmgr_custom_embedded_factory"'
+ [[ '' == *no_woff2* ]]
+ ENABLE_ALIAS_FONT=true
+ [[ '' == *no_alias_font* ]]
+ LEGACY_DRAW_VERTICES=false
+ [[ '' == *legacy_draw_vertices* ]]
+ DEBUGGER_ENABLED=false
+ [[ '' == *enable_debugger* ]]
+ GN_SHAPER='skia_use_icu=true skia_use_system_icu=false skia_use_harfbuzz=true skia_use_system_harfbuzz=false'
+ [[ '' == *primitive_shaper* ]]
+ [[ '' == *no_font* ]]
+ ENABLE_PARAGRAPH=true
+ [[ '' == *no_paragraph* ]]
+ [[ '' == *primitive_shaper* ]]
+ [[ '' == *no_font* ]]
+ DO_DECODE=true
+ [[ '' == *no_codecs* ]]
+ ENCODE_PNG=true
+ [[ '' == *no_encode_png* ]]
+ ENCODE_JPEG=true
+ [[ '' == *no_encode_jpeg* ]]
+ ENCODE_WEBP=true
+ [[ '' == *no_encode_webp* ]]
+ set +e
++ which ninja
which: no ninja in (/c/Users/Pedro/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/Pedro/bin:/c/Program Files/Python310/Scripts:/c/Program Files/Python310:/c/Program Files (x86)/Common Files/Oracle/Java/javapath:/c/Windows/system32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0:/c/Windows/System32/OpenSSH:/c/Program Files (x86)/NVIDIA Corporation/PhysX/Common:/cmd:/c/Users/Pedro/Documents/flutter/bin:/c/ProgramData/chocolatey/bin:/c/Users/Pedro/AppData/Local/Pub/Cache/bin:/c/Users/Pedro/.fastcli/bin:/c/Program Files/dotnet:/c/Program Files/Microsoft SQL Server/130/Tools/Binn:/c/Program Files/Git LFS:/c/Program Files/PuTTY:/c/Program Files/Microsoft SQL Server/150/Tools/Binn:/c/Program Files/Microsoft SQL Server/Client SDK/ODBC/170/Tools/Binn:/c/Program Files/nodejs:/c/Program Files/MySQL/MySQL Shell 8.0/bin:/c/Users/Pedro/AppData/Local/Microsoft/WindowsApps:/c/Users/Pedro/AppData/Local/Programs/Microsoft VS Code/bin:/c/Program Files/JetBrains/PyCharm Community Edition 2020.1/bin:/c/tools/dart-sdk/bin:/c/Users/Pedro/AppData/Roaming/Pub/Cache/bin:/c/Users/Pedro/.dotnet/tools:/c/Users/Pedro/AppData/Local/GitHubDesktop/bin:/c/Users/Pedro/fvm/default/bin:/c/Users/Pedro/AppData/Roaming/npm:/usr/bin/vendor_perl:/usr/bin/core_perl)
+ NINJA=
+ [[ -z '' ]]
+ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git --depth 1 out/canvaskit_wasm/depot_tools
Cloning into 'out/canvaskit_wasm/depot_tools'...
remote: Counting objects: 709, done
remote: Finding sources: 100% (709/709)
remote: Total 709 (delta 110), reused 443 (delta 110)
Receiving objects: 100% (709/709), 1.50 MiB | 1.32 MiB/s, done.
Resolving deltas: 100% (110/110), done.
+ NINJA=out/canvaskit_wasm/depot_tools/./ninja.exe
+ set -e
+ echo Compiling
Compiling
+ ./bin/gn gen out/canvaskit_wasm '--args=is_debug=false   is_official_build=true   is_component_build=false   werror=true   target_cpu="wasm"     skia_use_angle=false   skia_use_dng_sdk=false   skia_use_dawn=false   skia_use_webgl=true   skia_use_webgpu=false   skia_use_expat=false   skia_use_fontconfig=false   skia_use_freetype=true   skia_use_libheif=false   skia_use_libjpeg_turbo_decode=true   skia_use_libjpeg_turbo_encode=true   skia_use_libpng_decode=true   skia_use_libpng_encode=true   skia_use_libwebp_decode=true   skia_use_libwebp_encode=true   skia_use_lua=false   skia_use_piex=false   skia_use_system_freetype2=false   skia_use_system_libjpeg_turbo=false   skia_use_system_libpng=false   skia_use_system_libwebp=false   skia_use_system_zlib=false  skia_use_vulkan=false   skia_use_wuffs=true   skia_use_zlib=true   skia_enable_gpu=true   skia_build_for_debugger=false   skia_enable_sksl_tracing=true     skia_use_icu=true skia_use_system_icu=false skia_use_harfbuzz=true skia_use_system_harfbuzz=false   skia_enable_fontmgr_custom_directory=false skia_enable_fontmgr_custom_embedded=true skia_enable_fontmgr_custom_empty=false skia_fontmgr_factory=":fontmgr_custom_embedded_factory"   skia_use_freetype_woff2=true     skia_enable_skshaper=true   skia_enable_skparagraph=true   skia_enable_pdf=false   skia_canvaskit_force_tracing=true   skia_canvaskit_profile_build=false   skia_canvaskit_enable_skp_serialization=true   skia_canvaskit_enable_effects_deserialization=true   skia_canvaskit_enable_skottie=true   skia_canvaskit_include_viewer=false   skia_canvaskit_enable_particles=true   skia_canvaskit_enable_pathops=true   skia_canvaskit_enable_rt_shader=true   skia_canvaskit_enable_matrix_helper=true   skia_canvaskit_enable_canvas_bindings=true   skia_canvaskit_enable_font=true   skia_canvaskit_enable_embedded_font=true   skia_canvaskit_enable_alias_font=true   skia_canvaskit_legacy_draw_vertices_blend_mode=false   skia_canvaskit_enable_debugger=false   skia_canvaskit_enable_paragraph=true   skia_canvaskit_enable_webgl=true   skia_canvaskit_enable_webgpu=false'
Done. Made 102 targets from 55 files in 125ms

+ out/canvaskit_wasm/depot_tools/./ninja.exe -v -C out/canvaskit_wasm canvaskit.js
ninja: Entering directory `out/canvaskit_wasm'
ninja: fatal: CreateProcess: %1 is not a valid Win32 application.

Message has been deleted

Pedro Henrique

unread,
Oct 18, 2022, 7:15:22 AM10/18/22
to skia-discuss
To run ninja I had to change line 204 of compile.sh to NINJA=$BUILD_DIR/depot_tools/./ninja.exe.  Maybe the problem is related to this change?

Without this change I get:


+ out/canvaskit_wasm/depot_tools/ninja -C out/canvaskit_wasm canvaskit.js
'out' is not recognized as an internal or external command,
operable program or batch file.

render dender

unread,
Feb 17, 2023, 8:45:21 AM2/17/23
to skia-discuss
Probably it's already irrelevant, but I had the same issue with Skia building on Win10 with MSYS2 MinGW64.
And it was because I didn't have python2 installed and the script was trying to get executed with python3 aliased as python and in the end gave a weird error message.
So, I installed python2 package and in one of the python scripts (track in your ninja script which one it is) I replaced directly the first line #!/usr/bin/env python with #!python2  just to be sure and not break everything else.

вторник, 18 октября 2022 г. в 14:15:22 UTC+3, pedro.b...@gmail.com:

John Stiles

unread,
Feb 17, 2023, 11:56:59 AM2/17/23
to skia-d...@googlegroups.com
Not sure if this is related or not, but nowadays Skia will not build until you run `bin/fetch-ninja` once in order to get ninja installed.
There was a window of time for a few months where this was required, but not in the build docs—it's documented now though.
Could this be related?

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skia-discuss/254b12fe-fe71-4bb9-8315-a1a28f61a9c9n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages