Problem building `nw.js` from source (`Error processing node <?xml version="1.0" encoding="UTF-8"?>`

46 views
Skip to first unread message

Linus Hagemann

unread,
Oct 31, 2023, 8:04:58 AM10/31/23
to nw.js
Hi,

I am in the process of trying to build `nw.js` from source on a 64bit linux system. I used the buildbot (http://buildbot-master.nwjs.io:8010/builders/nw81_linux64/builds/5) to gather the necessary steps and came up with the following:

- create folderstructure like home/build/nw81_sdk_macarm/node-webkit/src/content
- in content directory, clone nwjs into a folder called `nw`
- go into the src directory inside of node-webkit directory
- set the following env vars:
```
CC_host=clang
CXX_host=clang++
GYP_CHROMIUM_NO_ACTION=0
GYP_DEFINES=target_arch=x64
building_nw=1
clang=1
host_arch=x64
buildtype=Official
GYP_GENERATORS=ninja
GYP_GENERATOR_FLAGS=output_dir=outst
```
- `python content/nw/tools/sync.py`
- `gn gen outst/nw '--args=is_debug=false is_component_ffmpeg=true target_cpu="x64" symbol_level=1 is_component_build=false nwjs_sdk=false proprietary_codecs=true ffmpeg_branding="Chromium"' --root=.`
- one directory up into `node-webkit` dir
- `python3 src/third_party/node-nw/tools/gyp/gyp_main.py -I src/third_party/node-nw/common.gypi -D build_type=Release src/third_party/node-nw/node.gyp`
- one directory down into `src`
- `ninja -C outst/nw nwjs`


Upon calling `ninja` some  20.000 targets get compiled successfully and then, I get the following error:
```
ninja: Entering directory `outst/nw'
[25/33129] ACTION //chrome/browser:resources_grit(//build/toolchain/linux:clang_x64)
FAILED: gen/chrome/browser/resources_grit.d.stamp gen/chrome/grit/browser_resources.h gen/chrome/browser_resources.pak gen/chrome/browser_resources.pak.info
python3 ../../tools/grit/grit.py -i ../../chrome/browser/nwjs_resources.grd build -o gen/chrome --depdir . --depfile gen/chrome/browser/resources_grit.d --write-only-new=1 --depend-on-stamp -D DEVTOOLS_GRD_PATH=gen/third_party/devtools-frontend/src/front_end/devtools_resources -D SHARED_INTERMEDIATE_DIR=gen -D _google_chrome=false -D _is_chrome_for_testing_branded=false -D chromeos_ash=false -D chromeos_lacros=false -D reven=false -D toolkit_views=true -D use_aura=true -D use_ozone=true -D use_titlecase=false -D nwjs_sdk=false -D scale_factors=2x -E root_gen_dir=gen -E root_src_dir=../../ -E CHROMIUM_BUILD=chromium -D nwjs_sdk=false -D chrome_root_store_supported=true -D enable_arcore=false -D enable_printing=true -D enable_extensions=true -D enable_hangout_services_extension=false -D enable_ink=false -D enable_nacl=false -D enable_dice_support=true -D enable_pdf=true -D enable_print_preview=true -D enable_screen_ai_service=true -D enable_supervised_users=true -D enable_vr=true -D enable_search_engine_choice=true -D enable_webui_certificate_viewer=true -D enable_webui_tab_strip=true -D is_official_build=false -D safe_browsing_mode=0 -D optimize_webui=true -D use_nss_certs=true -E additional_modules_list_file=gen/chrome/browser/internal/additional_modules_list.txt --brotli brotli -f gen/tools/gritsettings/default_resource_ids --assert-file-list obj/chrome/browser/resources_expected_outputs.txt
Error processing node <?xml version="1.0" encoding="UTF-8"?>
<include file="${root_gen_dir}\chrome\browser\resources\certificate_viewer\tsc\certificate_viewer.js" name="IDR_CERTIFICATE_VIEWER_JS" type="BINDATA" use_base_dir="false" />: [Errno 2] No such file or directory: '../../outst/nw/gen/chrome/browser/resources/certificate_viewer/tsc/certificate_viewer.js'
Traceback (most recent call last):
  File "/home/linus/build/nw81_sdk_linux64/node-webkit/src/outst/nw/../../tools/grit/grit.py", line 28, in <module>
    sys.exit(grit.grit_runner.Main(sys.argv[1:]))
  File "/home/linus/build/nw81_sdk_linux64/node-webkit/src/tools/grit/grit/grit_runner.py", line 313, in Main
    return toolobject.Run(options, args[1:])
  File "/home/linus/build/nw81_sdk_linux64/node-webkit/src/tools/grit/grit/tool/build.py", line 272, in Run
    self.Process()
  File "/home/linus/build/nw81_sdk_linux64/node-webkit/src/tools/grit/grit/tool/build.py", line 407, in Process
    self.ProcessNode(self.res, output, tmpfile)
  File "/home/linus/build/nw81_sdk_linux64/node-webkit/src/tools/grit/grit/tool/build.py", line 331, in ProcessNode
    formatted = formatter(node, output_node.GetLanguage(), output_dir=base_dir)
  File "/home/linus/build/nw81_sdk_linux64/node-webkit/src/tools/grit/grit/format/data_pack.py", line 87, in Format
    value = node.GetDataPackValue(lang, util.BINARY)
  File "/home/linus/build/nw81_sdk_linux64/node-webkit/src/tools/grit/grit/node/include.py", line 109, in GetDataPackValue
    data = util.ReadFile(filename, util.BINARY)
  File "/home/linus/build/nw81_sdk_linux64/node-webkit/src/tools/grit/grit/util.py", line 210, in ReadFile
    with open(filename, mode, encoding=encoding) as f:
FileNotFoundError: [Errno 2] No such file or directory: '../../outst/nw/gen/chrome/browser/resources/certificate_viewer/tsc/certificate_viewer.js'
[34/33129] CXX obj/gin/gin/v8_isolate_memory_dump_provider.o
ninja: build stopped: subcommand failed.
```

Any ideas on how to fix this? I am not very proficient with compiling stuff from source, so there might be an obvious step that I missed.

Would really appreciate any help! Many thanks in advance!

All the best!

Roger Wang

unread,
Oct 31, 2023, 12:14:04 PM10/31/23
to Linus Hagemann, nw.js
Would you try to build the sdk version? define nwjs_sdk to 'true'.

It looks like a bug in the build when the files left over from previous versions are being used...

--
You received this message because you are subscribed to the Google Groups "nw.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nwjs-general...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nwjs-general/a37f024c-f300-4f30-9a38-42024148d675n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages