Skip to content

Conversation

mochaaP
Copy link
Contributor

@mochaaP mochaaP commented Oct 11, 2025

See the referenced commits in messages.

A potential breaking change is the -Dparser one, but since builds will fail with:

subprojects/quickjs/meson.build:1:0: ERROR: Unknown option: "quickjs:disable_parser".

rather than building the normal variant silently, i think it's okay for this change.

fixup: 5a949ca ("CMake: Set _WIN32_WINNT=0x0601", quickjs-ng#900)
the original is -Ddisable_parser, invert that to make it less confusing
fixup: 8dda2a0 ("fixed hash_map_resize() - added Map/WeakMap in microbench")
fixup: 0a00011 ("Optimize {__proto__:null} object literal creation", quickjs-ng#1118)
fixup: 08db51a ("Add ref-counted string slices", quickjs-ng#1175)
skips building: qjs/qjsc cli, examples, tests, codegen
Store the original file path in module_loader_opaque, let normalize
function read from that and store a normalized filepath in context
opaque, and make module loader read from the filepath from that.

Make it possible to preserve the custom script name while resolving
from another path.
also removed -M during the test_fib.c codegen:

902cc2c ("Add native module support on Windows")
switched examples to dynamic import() instead of static import statement
and the lookup was deferred to runtime, thus we don't need to hint qjsc
this is a declared module and exclude it from bundling.
Fix unable to `import {fib} from './fib.so';` using qjs cli
@mochaaP mochaaP changed the title Update meson.build meson+qjsc+codegen: misc improvements Oct 11, 2025
@mochaaP
Copy link
Contributor Author

mochaaP commented Oct 11, 2025

I should probably split PRs; this quickly grew out of scope 😅
The commits themselves are independent, though.

Please merge this manually (qjsc changes first, then meson changes, and last codegen changes) to preserve commit history if you would like to squash them.

@mochaaP
Copy link
Contributor Author

mochaaP commented Oct 11, 2025

[PATCH] build/meson: add unicode_gen tests
diff --git a/meson.build b/meson.build
index 1121d8c..5864195 100644
--- a/meson.build
+++ b/meson.build
@@ -373,6 +373,16 @@ endif
 tests = get_option('tests').disable_auto_if(meson.is_subproject())
 examples = get_option('examples').disable_auto_if(meson.is_subproject())
 
+# Unicode generator
+unicode_gen = executable(
+  'unicode_gen',
+  'cutils.c',
+  'unicode_gen.c',
+
+  c_args: qjs_c_args + (tests.allowed() ? ['-DUSE_TEST'] : []),
+  build_by_default: false,
+)
+
 if tests.allowed()
   if host_system != 'emscripten'
     # Test262 runner
@@ -501,19 +511,17 @@ if tests.allowed()
       build_by_default: false,
     ),
   )
+
+  test(
+    'unicode_gen_test',
+    unicode_gen,
+    args: [
+      meson.current_source_dir() / 'unicode',
+    ],
+  )
+
 endif
 
-# Unicode generator
-unicode_gen = executable(
-  'unicode_gen',
-  'cutils.c',
-  'libunicode.c',
-  'unicode_gen.c',
-
-  c_args: qjs_c_args,
-  build_by_default: false,
-)
-
 run_target(
   'libunicode-table.h',
   command: [

omitted because unicode test currently fails.

@mochaaP
Copy link
Contributor Author

mochaaP commented Oct 11, 2025

https://github.com/mcha-forks/quickjs/tree/mochaa-meson-gen

support full source bootstrap on both native and cross (no prebuilt gen/* files).
this will further clutter meson.build, but is suitable for distributions that require strong source reproducibility; hence, it is not added in this PR.

this will fallback to the old path if not found.
@saghul
Copy link
Contributor

saghul commented Oct 12, 2025

Could you please split these into semantic PRs?

@mochaaP
Copy link
Contributor Author

mochaaP commented Oct 12, 2025

sure, later this day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants