Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

window: use window as global object #184

Merged
merged 3 commits into from
Mar 8, 2024
Merged

window: use window as global object #184

merged 3 commits into from
Mar 8, 2024

Conversation

krichprollsch
Copy link
Member

@krichprollsch krichprollsch self-assigned this Feb 26, 2024
@krichprollsch
Copy link
Member Author

Tests are failing, but I don't understand why.

$ make test
Testing...
zig test Debug native: error: the following command failed with 1 compilation errors:
/usr/local/zig-0.12.0-dev.1773+8a8fd47d2/zig test /home/pierre/wrk/browsercore/src/run_tests.zig /home/pierre/wrk/browsercore/vendor/jsruntime-lib/vendor/v8/x86_64-linux/debug/libc_v8.a /home/pierre/wrk/browsercore/vendor/lexbor/liblexbor_static.a /home/pierre/wrk/browsercore/vendor/libiconv/lib/libiconv.a /home/pierre/wrk/browsercore/vendor/netsurf/lib/libdom.a /home/pierre/wrk/browsercore/vendor/netsurf/lib/libhubbub.a /home/pierre/wrk/browsercore/vendor/netsurf/lib/libparserutils.a /home/pierre/wrk/browsercore/vendor/netsurf/lib/libwapcaplet.a -lc++ --test-runner /home/pierre/wrk/browsercore/src/test_runner.zig --cache-dir /home/pierre/wrk/browsercore/zig-cache --global-cache-dir /home/pierre/.cache/zig --name test -fsingle-threaded --mod jsruntime:jsruntime_build_options,tigerbeetle-io,v8:/home/pierre/wrk/browsercore/vendor/jsruntime-lib/src/api.zig --mod v8::/home/pierre/wrk/browsercore/vendor/jsruntime-lib/vendor/zig-v8/src/v8.zig --mod tigerbeetle-io::/home/pierre/wrk/browsercore/vendor/jsruntime-lib/vendor/tigerbeetle-io/io.zig --mod jsruntime_build_options::/home/pierre/wrk/browsercore/zig-cache/c/8876f37143afa719ba1b36ca05715979/options.zig --deps jsruntime -I /home/pierre/wrk/browsercore/vendor/jsruntime-lib/vendor/zig-v8/src -I /home/pierre/wrk/browsercore/vendor/lexbor-src/source -I /home/pierre/wrk/browsercore/vendor/libiconv/include -I /home/pierre/wrk/browsercore/vendor/netsurf/libdom/src -I /home/pierre/wrk/browsercore/vendor/netsurf/libhubbub/src -I /home/pierre/wrk/browsercore/vendor/netsurf/libparserutils/src -I /home/pierre/wrk/browsercore/vendor/netsurf/libwapcaplet/src -I /home/pierre/wrk/browsercore/vendor/netsurf/include --listen=- 
Build Summary: 1/4 steps succeeded; 1 failed (disable with --summary none)
test transitive failure
└─ run test transitive failure
   └─ zig test Debug native 1 errors
vendor/jsruntime-lib/src/generate.zig:46:5: error: NativeTypeNotHandled: html.window.Window
    @compileError("NativeTypeNotHandled: " ++ @typeName(T));
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vendor/jsruntime-lib/src/engines/v8/v8.zig:241:44: note: called from here
        const T_refl = comptime gen.getType(@TypeOf(obj));
                                ~~~~~~~~~~~^~~~~~~~~~~~~~
referenced by:
    testExecFn__anon_177852: src/run_tests.zig:57:26
    testsAllExecFn: src/run_tests.zig:88:23
    remaining reference traces hidden; use '-freference-trace' to see all reference traces
Test ERROR

@krichprollsch
Copy link
Member Author

It looks like the Window type is resolved in two different ways in test 🤔

Build Summary: 1/4 steps succeeded; 1 failed (disable with --summary none)
test transitive failure
└─ run test transitive failure
   └─ zig test Debug native 1 errors
vendor/jsruntime-lib/src/engines/v8/v8.zig:261:29: error: expected type 'html.window.Window', found 'html.window.Window'
            nat_obj_ptr.* = obj;
                            ^~~
src/html/window.zig:9:20: note: struct declared here
pub const Window = struct {
                   ^~~~~~
/home/pierre/wrk/browsercore/src/html/window.zig:9:20: note: struct declared here
pub const Window = struct {
                   ^~~~~~
referenced by:
    testExecFn__anon_177852: src/run_tests.zig:57:26
    testsAllExecFn: src/run_tests.zig:88:23
    remaining reference traces hidden; use '-freference-trace' to see all reference traces
Test ERROR
make: *** [Makefile:90: test] Error 1

krichprollsch added a commit that referenced this pull request Mar 6, 2024
We have a zig compilation error in test only when using the Window
global type.
See #184 (comment)
krichprollsch added a commit that referenced this pull request Mar 6, 2024
We have a zig compilation error in test only when using the Window
global type.
See #184 (comment)
@krichprollsch krichprollsch force-pushed the window-global branch 2 times, most recently from 8b18428 to b3f4945 Compare March 7, 2024 08:45
@krichprollsch krichprollsch force-pushed the window-global branch 2 times, most recently from 031f64d to 8e3c58c Compare March 7, 2024 11:28
krichprollsch added a commit that referenced this pull request Mar 7, 2024
Instead of calling the bultin test functions
Indeed, it causes issue with type comparison.
See #184 (comment)
krichprollsch added a commit that referenced this pull request Mar 7, 2024
Instead of calling the bultin test functions
Indeed, it causes issue with type comparison.
See #184 (comment)
@krichprollsch
Copy link
Member Author

Ok, using direct function for JSRuntime test instead of using butilin.test_functions fix the issue. see 5bdc50b

The only remaining issue is I had to disable a test unit. Idk what is wrong now... If you have an idea @francisbouvier...
See 700bd95

krichprollsch added a commit that referenced this pull request Mar 8, 2024
Instead of calling the bultin test functions
Indeed, it causes issue with type comparison.
See #184 (comment)
@krichprollsch krichprollsch merged commit a81e10f into main Mar 8, 2024
4 checks passed
@krichprollsch krichprollsch deleted the window-global branch March 8, 2024 11:43
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