Skip to content

Commit 089a641

Browse files
committed
work on fixing github workflows
1 parent 7eaf866 commit 089a641

File tree

10 files changed

+28
-32
lines changed

10 files changed

+28
-32
lines changed

.github/actions/install/action.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ runs:
5959
- name: install v8
6060
shell: bash
6161
run: |
62-
mkdir -p vendor/zig-js-runtime/vendor/v8/${{inputs.arch}}-${{inputs.os}}/debug
63-
ln -s ${{ inputs.cache-dir }}/v8/libc_v8.a vendor/zig-js-runtime/vendor/v8/${{inputs.arch}}-${{inputs.os}}/debug/libc_v8.a
62+
mkdir -p v8/build/${{inputs.arch}}-${{inputs.os}}/debug/ninja/obj/zig/
63+
ln -s ${{ inputs.cache-dir }}/v8/libc_v8.a v8/build/${{inputs.arch}}-${{inputs.os}}/debug/ninja/obj/zig/libc_v8.a
6464
65-
mkdir -p vendor/zig-js-runtime/vendor/v8/${{inputs.arch}}-${{inputs.os}}/release
66-
ln -s ${{ inputs.cache-dir }}/v8/libc_v8.a vendor/zig-js-runtime/vendor/v8/${{inputs.arch}}-${{inputs.os}}/release/libc_v8.a
65+
mkdir -p v8/build/${{inputs.arch}}-${{inputs.os}}/release/ninja/obj/zig/
66+
ln -s ${{ inputs.cache-dir }}/v8/libc_v8.a v8/build/${{inputs.arch}}-${{inputs.os}}/release/ninja/obj/zig/libc_v8.a
6767
6868
- name: libiconv
6969
shell: bash

.github/workflows/build.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
arch: ${{env.ARCH}}
3232

3333
- name: zig build
34-
run: zig build --release=safe -Doptimize=ReleaseSafe -Dengine=v8 -Dcpu=x86_64 -Dgit_commit=$(git rev-parse --short ${{ github.sha }})
34+
run: zig build --release=safe -Doptimize=ReleaseSafe -Dcpu=x86_64 -Dgit_commit=$(git rev-parse --short ${{ github.sha }})
3535

3636
- name: Rename binary
3737
run: mv zig-out/bin/lightpanda lightpanda-${{ env.ARCH }}-${{ env.OS }}
@@ -63,7 +63,7 @@ jobs:
6363
arch: ${{env.ARCH}}
6464

6565
- name: zig build
66-
run: zig build --release=safe -Doptimize=ReleaseSafe -Dengine=v8 -Dgit_commit=$(git rev-parse --short ${{ github.sha }})
66+
run: zig build --release=safe -Doptimize=ReleaseSafe -Dgit_commit=$(git rev-parse --short ${{ github.sha }})
6767

6868
- name: Rename binary
6969
run: mv zig-out/bin/lightpanda lightpanda-${{ env.ARCH }}-${{ env.OS }}
@@ -95,7 +95,7 @@ jobs:
9595
arch: ${{env.ARCH}}
9696

9797
- name: zig build
98-
run: zig build --release=safe -Doptimize=ReleaseSafe -Dengine=v8 -Dgit_commit=$(git rev-parse --short ${{ github.sha }})
98+
run: zig build --release=safe -Doptimize=ReleaseSafe -Dgit_commit=$(git rev-parse --short ${{ github.sha }})
9999

100100
- name: Rename binary
101101
run: mv zig-out/bin/lightpanda lightpanda-${{ env.ARCH }}-${{ env.OS }}
@@ -127,7 +127,7 @@ jobs:
127127
arch: ${{env.ARCH}}
128128

129129
- name: zig build
130-
run: zig build --release=safe -Doptimize=ReleaseSafe -Dengine=v8 -Dgit_commit=$(git rev-parse --short ${{ github.sha }})
130+
run: zig build --release=safe -Doptimize=ReleaseSafe -Dgit_commit=$(git rev-parse --short ${{ github.sha }})
131131

132132
- name: Rename binary
133133
run: mv zig-out/bin/lightpanda lightpanda-${{ env.ARCH }}-${{ env.OS }}

.github/workflows/e2e-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
- uses: ./.github/actions/install
4848

4949
- name: zig build release
50-
run: zig build -Doptimize=ReleaseSafe -Dengine=v8
50+
run: zig build -Doptimize=ReleaseSafe
5151

5252
- name: upload artifact
5353
uses: actions/upload-artifact@v4
@@ -86,7 +86,7 @@ jobs:
8686
- name: run puppeteer
8787
run: |
8888
python3 -m http.server 1234 -d ./public & echo $! > PYTHON.pid
89-
./lightpanda serve & echo $! > LPD.pid
89+
./lightpanda serve --gc_hints & echo $! > LPD.pid
9090
RUNS=100 npm run bench-puppeteer-cdp > puppeteer.out || exit 1
9191
cat /proc/`cat LPD.pid`/status |grep VmHWM|grep -oP '\d+' > LPD.VmHWM
9292
kill `cat LPD.pid` `cat PYTHON.pid`

.github/workflows/wpt.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555

5656
- uses: ./.github/actions/install
5757

58-
- run: zig build wpt -Dengine=v8 -- --safe --summary
58+
- run: zig build wpt -- --safe --summary
5959

6060
# For now WPT tests doesn't pass at all.
6161
# We accept then to continue the job on failure.
@@ -80,7 +80,7 @@ jobs:
8080
- uses: ./.github/actions/install
8181

8282
- name: json output
83-
run: zig build wpt -Dengine=v8 -- --safe --json > wpt.json
83+
run: zig build wpt -- --safe --json > wpt.json
8484

8585
- name: write commit
8686
run: |

.github/workflows/zig-test.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ jobs:
5656
- uses: ./.github/actions/install
5757

5858
- name: zig build debug
59-
run: zig build -Dengine=v8
59+
run: zig build
6060

6161
- name: upload artifact
6262
uses: actions/upload-artifact@v4
@@ -102,11 +102,8 @@ jobs:
102102

103103
- uses: ./.github/actions/install
104104

105-
- name: zig build unittest
106-
run: zig build unittest -freference-trace --summary all
107-
108105
- name: zig build test
109-
run: zig build test -Dengine=v8 -- --json > bench.json
106+
run: zig build test -- --json > bench.json
110107

111108
- name: write commit
112109
run: |

Makefile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
ZIG := zig
55
BC := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
6-
# option test filter make unittest F="server"
6+
# option test filter make test F="server"
77
F=
88

99
# OS and ARCH
@@ -47,7 +47,7 @@ help:
4747

4848
# $(ZIG) commands
4949
# ------------
50-
.PHONY: build build-dev run run-release shell test bench download-zig wpt unittest data
50+
.PHONY: build build-dev run run-release shell test bench download-zig wpt data
5151

5252
zig_version = $(shell grep 'recommended_zig_version = "' "vendor/zig-js-runtime/build.zig" | cut -d'"' -f2)
5353

@@ -62,13 +62,13 @@ download-zig:
6262
## Build in release-safe mode
6363
build:
6464
@printf "\e[36mBuilding (release safe)...\e[0m\n"
65-
$(ZIG) build -Doptimize=ReleaseSafe -Dengine=v8 -Dgit_commit=$$(git rev-parse --short HEAD) || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;)
65+
$(ZIG) build -Doptimize=ReleaseSafe -Dgit_commit=$$(git rev-parse --short HEAD) || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;)
6666
@printf "\e[33mBuild OK\e[0m\n"
6767

6868
## Build in debug mode
6969
build-dev:
7070
@printf "\e[36mBuilding (debug)...\e[0m\n"
71-
@$(ZIG) build -Dengine=v8 -Dgit_commit=$$(git rev-parse --short HEAD) || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;)
71+
@$(ZIG) build -Dgit_commit=$$(git rev-parse --short HEAD) || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;)
7272
@printf "\e[33mBuild OK\e[0m\n"
7373

7474
## Run the server in debug mode
@@ -79,16 +79,16 @@ run: build
7979
## Run a JS shell in debug mode
8080
shell:
8181
@printf "\e[36mBuilding shell...\e[0m\n"
82-
@$(ZIG) build shell -Dengine=v8 || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;)
82+
@$(ZIG) build shell || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;)
8383

8484
## Run WPT tests
8585
wpt:
8686
@printf "\e[36mBuilding wpt...\e[0m\n"
87-
@$(ZIG) build wpt -Dengine=v8 -- --safe $(filter-out $@,$(MAKECMDGOALS)) || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;)
87+
@$(ZIG) build wpt -- --safe $(filter-out $@,$(MAKECMDGOALS)) || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;)
8888

8989
wpt-summary:
9090
@printf "\e[36mBuilding wpt...\e[0m\n"
91-
@$(ZIG) build wpt -Dengine=v8 -- --safe --summary $(filter-out $@,$(MAKECMDGOALS)) || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;)
91+
@$(ZIG) build wpt -- --safe --summary $(filter-out $@,$(MAKECMDGOALS)) || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;)
9292

9393
## Test
9494
test:

build.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub fn build(b: *std.Build) !void {
7676
{
7777
// get v8
7878
// -------
79-
const v8 = b.dependency("v8", .{.target = target, .optimize = optimize});
79+
const v8 = b.dependency("v8", .{ .target = target, .optimize = optimize });
8080
const get_v8 = b.addRunArtifact(v8.artifact("get-v8"));
8181
const get_step = b.step("get-v8", "Get v8");
8282
get_step.dependOn(&get_v8.step);
@@ -85,7 +85,7 @@ pub fn build(b: *std.Build) !void {
8585
{
8686
// build v8
8787
// -------
88-
const v8 = b.dependency("v8", .{.target = target, .optimize = optimize});
88+
const v8 = b.dependency("v8", .{ .target = target, .optimize = optimize });
8989
const build_v8 = b.addRunArtifact(v8.artifact("build-v8"));
9090
const build_step = b.step("build-v8", "Build v8");
9191
build_step.dependOn(&build_v8.step);

src/browser/html/window.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ const storage = @import("../storage/storage.zig");
3333
// https://html.spec.whatwg.org/multipage/nav-history-apis.html#window
3434
pub const Window = struct {
3535
pub const prototype = *EventTarget;
36-
pub const global_type = true;
3736

3837
// Extend libdom event target for pure zig struct.
3938
base: parser.EventTargetTBase = parser.EventTargetTBase{},
@@ -58,6 +57,7 @@ pub const Window = struct {
5857
};
5958
}
6059

60+
6161
pub fn replaceLocation(self: *Window, loc: Location) !void {
6262
self.location = loc;
6363
if (self.document) |doc| {

src/runtime/js.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ pub fn Env(comptime S: type, comptime types: anytype) type {
227227
// Hey, look! This is our first real usage of the TYPE_LOOKUP.
228228
// Just like we said above, given a type, we can get its
229229
// template index.
230+
230231
const proto_index = @field(TYPE_LOOKUP, proto_name);
231232
templates[i].inherit(templates[proto_index]);
232233
}
@@ -366,7 +367,6 @@ pub fn Env(comptime S: type, comptime types: anytype) type {
366367
// FunctionTemplate of the isolate (in startExecutor)
367368
fn attachClass(self: *Self, comptime Struct: type, template: v8.FunctionTemplate) void {
368369
const template_proto = template.getPrototypeTemplate();
369-
370370
inline for (@typeInfo(Struct).@"struct".decls) |declaration| {
371371
const name = declaration.name;
372372
if (comptime name[0] == '_') {

src/testing.zig

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,15 @@
1717
// along with this program. If not, see <https://www.gnu.org/licenses/>.
1818

1919
const std = @import("std");
20-
const parser = @import("browser/netsurf.zig");
20+
const Allocator = std.mem.Allocator;
21+
2122
pub const allocator = std.testing.allocator;
2223
pub const expectError = std.testing.expectError;
2324
pub const expectString = std.testing.expectEqualStrings;
2425
pub const expectEqualSlices = std.testing.expectEqualSlices;
2526

2627
const App = @import("app.zig").App;
27-
const Allocator = std.mem.Allocator;
28+
const parser = @import("browser/netsurf.zig");
2829

2930
// Merged std.testing.expectEqual and std.testing.expectString
3031
// can be useful when testing fields of an anytype an you don't know
@@ -388,10 +389,8 @@ pub const JsRunner = struct {
388389
errdefer runner.env.deinit();
389390

390391
runner.url = try URL.parse("https://lightpanda.io/opensource-browser/", null);
391-
errdefer runner.env.deinit();
392392

393393
runner.renderer = Renderer.init(arena);
394-
395394
runner.cookie_jar = storage.CookieJar.init(arena);
396395
runner.loop = try Loop.init(arena);
397396
errdefer runner.loop.deinit();

0 commit comments

Comments
 (0)