yue / yue

A library for creating native cross-platform GUI apps
https://libyue.com
GNU Lesser General Public License v2.1
3.44k stars 152 forks source link

Failed to compile yode #180

Open xland opened 6 months ago

xland commented 6 months ago

Yode Version: node-20 Operating System: windows 10

command:

node ./build.js x64

error info:

ninja: build stopped: subcommand failed.
node:child_process:965
    throw err;
    ^

Error: Command failed: ninja -j 8 -C out/Release yode
    at checkExecSyncError (node:child_process:890:11)
    at Object.execSync (node:child_process:962:15)
    at execSync (D:\sdk\yode\build.js:151:13)
    at Object.<anonymous> (D:\sdk\yode\build.js:101:1)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 45440,
  stdout: null,
  stderr: null
}

Node.js v20.11.1
xland commented 6 months ago

I found that yode compiled file size is only 19M, and my own Node.js compiled file size is more than 90M, may I ask what yode streamlined content? How do you cut these things down? Thanks very much.

zcbenz commented 6 months ago

Can you try running ./deps/ninja/ninja.exe -C out/Release yode and see if there is any output?

I found that yode compiled file size is only 19M, and my own Node.js compiled file size is more than 90M,

Yode is built with the small-icu instead of the full one, which should be responsible for most of it. Also on Windows incremental linking is disabled, which can result in smaller binary size sometimes.

xland commented 6 months ago

cmd:./deps/ninja/ninja.exe -C out/Release yode

......
注意: 包含文件:   D:\sdk\yode\node\deps\icu-small\source\common\bytesinkutil.h
注意: 包含文件:    D:\sdk\yode\node\deps\icu-small\source\common\unicode/edits.h
注意: 包含文件:  D:\sdk\yode\node\deps\icu-small\source\i18n\unicode/simplenumberformatter.h
注意: 包含文件:   D:\sdk\yode\node\deps\icu-small\source\i18n\unicode/usimplenumberformatter.h
[65/3754] LINK_EMBED torque.exe
FAILED: torque.exe torque.exe.pdb
C:\Users\liuxiaolun\AppData\Local\Programs\Python\Python311\python.exe gyp-win-tool link-with-manifests environment.x64 True torque.exe "C:\Users\liuxiaolun\AppData\Local\Programs\Python\Python311\python.exe gyp-win-tool link-wrapper environment.x64 False link.exe /nologo /OUT:torque.exe @torque.exe.rsp" 1 mt.exe rc.exe "obj\node\tools\v8_gypfiles\torque.torque.exe.intermediate.manifest" obj\node\tools\v8_gypfiles\torque.torque.exe.generated.manifest
Traceback (most recent call last):
  File "D:\sdk\yode\out\Release\gyp-win-tool", line 375, in <module>
    sys.exit(main(sys.argv[1:]))
             ^^^^^^^^^^^^^^^^^^
  File "D:\sdk\yode\out\Release\gyp-win-tool", line 31, in main
    exit_code = executor.Dispatch(args)
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\sdk\yode\out\Release\gyp-win-tool", line 74, in Dispatch
    return getattr(self, method)(*args[1:])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\sdk\yode\out\Release\gyp-win-tool", line 143, in ExecLinkWrapper
    out = link.communicate()[0].decode("utf-8")
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 2: invalid continuation byte
Traceback (most recent call last):
  File "D:\sdk\yode\out\Release\gyp-win-tool", line 375, in <module>
    sys.exit(main(sys.argv[1:]))
             ^^^^^^^^^^^^^^^^^^
  File "D:\sdk\yode\out\Release\gyp-win-tool", line 31, in main
    exit_code = executor.Dispatch(args)
                ^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\sdk\yode\out\Release\gyp-win-tool", line 74, in Dispatch
    return getattr(self, method)(*args[1:])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "D:\sdk\yode\out\Release\gyp-win-tool", line 204, in ExecLinkWithManifests
    subprocess.check_call(ldcmd + add_to_ld)
  File "C:\Users\liuxiaolun\AppData\Local\Programs\Python\Python311\Lib\subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'C:\Users\liuxiaolun\AppData\Local\Programs\Python\Python311\python.exe gyp-win-tool link-wrapper environment.x64 False link.exe /nologo /OUT:torque.exe @torque.exe.rsp torque.exe.manifest.res' returned non-zero exit status 1.
[66/3754] CXX obj\node\deps\icu-small\source\i18n\icui18n.collationroot.obj
注意: 包含文件:  D:\sdk\yode\node\deps\icu-small\source\common\unicode/utypes.h
注意: 包含文件:   D:\sdk\yode\node\deps\icu-small\source\common\unicode/umachine.h
注意: 包含文件:    D:\sdk\yode\node\deps\icu-small\source\common\unicode/ptypes.h
注意: 包含文件:     c:\program files (x86)\windows kits\10\include\10.0.22621.0\ucrt\stddef.h
注意: 包含文件:      c:\program files (x86)\windows kits\10\include\10.0.22621.0\ucrt\corecrt.h
注意: 包含文件:       c:\program files\microsoft visual studio\2022\community\vc\tools\msvc\14.39.33519\include\vcruntime.h
......
zcbenz commented 6 months ago

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xd5 in position 2: invalid continuation byte Traceback (most recent call last):

This is a python error, could be python being too new or too old. I'll update the node version and see if it can solve this.

xland commented 5 months ago

I think Yode is much more important than people realize. It is the bridge between Node.js and the desktop application. Most developers can't navigate Node.js the way Electron's author can. ;D People can develop more interesting products base on Yode. Thank you for creating this project. I think it should have its own list of issues. ;D

zcbenz commented 5 months ago

Thanks for your kind words! I have enabled issues page in Yode.

By the way, are you aware of any other application of Yode apart from using libyue?

xland commented 5 months ago

Developers build apps based on Flutter using Dart, based on MAUI using C# and XAML, based on Compose Multiplatform using Kotlin.

All the big companies are creating native application frameworks for their own languages. I haven't found a native application framework created for JavaScript other than node-gui and NodeGui. node-gui is nice, but Microsoft's GDI+ rendering engine is weak. NodeGui is based on Qt, Qt's commercial licensing is not friendly.

It's worth mentioning that NodeGui uses Yode,too. This is what the author of NodeGui wrote in the document.

So in order to make both NodeJs and Qt work together we need to find a way to merge these two event loops into one. This is achieved by a custom NodeJs binary we call as Qode. Qode is a lightly modified fork of Node.js that merges Node's event loop with Qt's event loop. The idea of merging event loops is inspired by Electron and other Gui libraries developed by zcbenz (Cheng Zhao). It has been detailed in a post here: Electron internals. Hence, we reused the logic from electron to achieve smooth integration between Qt and NodeJs. The source code of Qode can be found here. *PS: Qode is a fork of Yode

I don't think developing a framework like Flutter or MAUI is an easy task. And I don't think switching Yue's rendering engine to Skia will satisfy everyone's needs,too. But I believe Yode will lead more people to work in this direction.


These are the two projects I created: ScreenCapture is a desktop screenshot project. If this project has Yode support, users can write their own scripts to control the screenshot function. I tried to build this project based on yue...

QuickUI is a project which integrate QuickJS and WebUI. Replacing QuickJS with Yode will bring more features to the user.

In addition, AutoHotKey says its own script is "The ultimate automation scripting language for Windows". Maybe JavaScript(Yode) can do the same thing.

Window.js should be able to do much more if it has support from Yode.

We can use JavaScript to control the Lottie animationedit video or bring webgpu to native.