Skip to content

Commit 9d122bd

Browse files
committed
Merge branch 'main' into css_style_declaration
2 parents 0972710 + 0df531a commit 9d122bd

File tree

18 files changed

+83
-90
lines changed

18 files changed

+83
-90
lines changed

.github/actions/install/action.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ inputs:
1717
zig-v8:
1818
description: 'zig v8 version to install'
1919
required: false
20-
default: 'v0.1.23'
20+
default: 'v0.1.24'
2121
v8:
2222
description: 'v8 version to install'
2323
required: false
@@ -59,11 +59,11 @@ runs:
5959
- name: install v8
6060
shell: bash
6161
run: |
62-
mkdir -p v8/out/debug/obj/zig/
63-
ln -s ${{ inputs.cache-dir }}/v8/libc_v8.a v8/out/debug/obj/zig/libc_v8.a
62+
mkdir -p v8/out/${{ inputs.os }}/debug/obj/zig/
63+
ln -s ${{ inputs.cache-dir }}/v8/libc_v8.a v8/out/${{ inputs.os }}/debug/obj/zig/libc_v8.a
6464
65-
mkdir -p v8/out/release/obj/zig/
66-
ln -s ${{ inputs.cache-dir }}/v8/libc_v8.a v8/out/release/obj/zig/libc_v8.a
65+
mkdir -p v8/out/${{ inputs.os }}/release/obj/zig/
66+
ln -s ${{ inputs.cache-dir }}/v8/libc_v8.a v8/out/${{ inputs.os }}/release/obj/zig/libc_v8.a
6767
6868
- name: libiconv
6969
shell: bash

.github/workflows/e2e-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
- name: run puppeteer
8989
run: |
9090
python3 -m http.server 1234 -d ./public & echo $! > PYTHON.pid
91-
./lightpanda serve --gc_hints & echo $! > LPD.pid
91+
./lightpanda serve & echo $! > LPD.pid
9292
RUNS=100 npm run bench-puppeteer-cdp > puppeteer.out || exit 1
9393
cat /proc/`cat LPD.pid`/status |grep VmHWM|grep -oP '\d+' > LPD.VmHWM
9494
kill `cat LPD.pid` `cat PYTHON.pid`

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ARG ZIG=0.14.0
55
ARG ZIG_MINISIG=RWSGOq2NVecA2UPNdBUZykf1CCb147pkmdtYxgb3Ti+JO/wCYvhbAb/U
66
ARG ARCH=x86_64
77
ARG V8=11.1.134
8-
ARG ZIG_V8=v0.1.23
8+
ARG ZIG_V8=v0.1.24
99

1010
RUN apt-get update -yq && \
1111
apt-get install -yq xz-utils \
@@ -57,8 +57,8 @@ RUN make install-libiconv && \
5757

5858
# download and install v8
5959
RUN curl --fail -L -o libc_v8.a https://github.com/lightpanda-io/zig-v8-fork/releases/download/${ZIG_V8}/libc_v8_${V8}_linux_${ARCH}.a && \
60-
mkdir -p v8/build/${ARCH}-linux/release/ninja/obj/zig/ && \
61-
mv libc_v8.a v8/build/${ARCH}-linux/release/ninja/obj/zig/libc_v8.a
60+
mkdir -p v8/out/linux/release/obj/zig/ && \
61+
mv libc_v8.a v8/out/linux/release/obj/zig/libc_v8.a
6262

6363
# build release
6464
RUN make build

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,19 @@ build:
6969
## Build in debug mode
7070
build-dev:
7171
@printf "\e[36mBuilding (debug)...\e[0m\n"
72-
@$(ZIG) build -Dgit_commit=$$(git rev-parse --short HEAD) || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;)
72+
@$(ZIG) build -Dgit_commit=$$(git rev-parse --short HEAD) -Dlog_level=debug || (printf "\e[33mBuild ERROR\e[0m\n"; exit 1;)
7373
@printf "\e[33mBuild OK\e[0m\n"
7474

75-
## Run the server in debug mode
75+
## Run the server in release mode
7676
run: build
7777
@printf "\e[36mRunning...\e[0m\n"
7878
@./zig-out/bin/lightpanda || (printf "\e[33mRun ERROR\e[0m\n"; exit 1;)
7979

80+
## Run the server in debug mode
81+
run-debug: build-dev
82+
@printf "\e[36mRunning...\e[0m\n"
83+
@./zig-out/bin/lightpanda || (printf "\e[33mRun ERROR\e[0m\n"; exit 1;)
84+
8085
## Run a JS shell in debug mode
8186
shell:
8287
@printf "\e[36mBuilding shell...\e[0m\n"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Fast web automation for AI agents, LLM training, scraping and testing:
3636
_Puppeteer requesting 100 pages from a local website on a AWS EC2 m5.large instance.
3737
See [benchmark details](https://github.com/lightpanda-io/demo)._
3838

39-
[^1]: **Playwright support disclaimer:**
39+
[^1]: **Playwright support disclaimer:**
4040
Due to the nature of Playwright, a script that works with the current version of the browser may not function correctly with a future version. Playwright uses an intermediate JavaScript layer that selects an execution strategy based on the browser's available features. If Lightpanda adds a new [Web API](https://developer.mozilla.org/en-US/docs/Web/API), Playwright may choose to execute different code for the same script. This new code path could attempt to use features that are not yet implemented. Lightpanda makes an effort to add compatibility tests, but we can't cover all scenarios. If you encounter an issue, please create a [GitHub issue](https://github.com/lightpanda-io/browser/issues) and include the last known working version of the script.
4141

4242
## Quick start
@@ -164,7 +164,7 @@ For Debian/Ubuntu based Linux:
164164
sudo apt install xz-utils \
165165
python3 ca-certificates git \
166166
pkg-config libglib2.0-dev \
167-
gperf libexpat1-dev unzip \
167+
gperf libexpat1-dev unzip rsync \
168168
cmake clang
169169
```
170170

build.zig

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -170,13 +170,30 @@ fn common(b: *std.Build, opts: *std.Build.Step.Options, step: *std.Build.Step.Co
170170
mod.addImport("v8", v8_mod);
171171
}
172172

173-
const lib_path = try std.fmt.allocPrint(
174-
mod.owner.allocator,
175-
"v8/out/{s}/obj/zig/libc_v8.a",
176-
.{if (mod.optimize.? == .Debug) "debug" else "release"},
177-
);
178173
mod.link_libcpp = true;
179-
mod.addObjectFile(mod.owner.path(lib_path));
174+
175+
{
176+
const release_dir = if (mod.optimize.? == .Debug) "debug" else "release";
177+
const os = switch (target.result.os.tag) {
178+
.linux => "linux",
179+
.macos => "macos",
180+
else => return error.UnsupportedPlatform,
181+
};
182+
var lib_path = try std.fmt.allocPrint(
183+
mod.owner.allocator,
184+
"v8/out/{s}/{s}/obj/zig/libc_v8.a",
185+
.{ os, release_dir },
186+
);
187+
std.fs.cwd().access(lib_path, .{}) catch {
188+
// legacy path
189+
lib_path = try std.fmt.allocPrint(
190+
mod.owner.allocator,
191+
"v8/out/{s}/obj/zig/libc_v8.a",
192+
.{release_dir},
193+
);
194+
};
195+
mod.addObjectFile(mod.owner.path(lib_path));
196+
}
180197

181198
switch (target.result.os.tag) {
182199
.macos => {
@@ -188,7 +205,6 @@ fn common(b: *std.Build, opts: *std.Build.Step.Options, step: *std.Build.Step.Co
188205
}
189206

190207
mod.addImport("build_config", opts.createModule());
191-
mod.addObjectFile(mod.owner.path(lib_path));
192208
}
193209

194210
fn moduleNetSurf(b: *std.Build, step: *std.Build.Step.Compile, target: std.Build.ResolvedTarget) !void {

build.zig.zon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
.hash = "tigerbeetle_io-0.0.0-ViLgxpyRBAB5BMfIcj3KMXfbJzwARs9uSl8aRy2OXULd",
1414
},
1515
.v8 = .{
16-
.url = "https://github.com/lightpanda-io/zig-v8-fork/archive/240140e5b3e5a8e5e51cbdd36bc120bf28ae5c31.tar.gz",
17-
.hash = "v8-0.0.0-xddH64eyAwBcX7e2x5tv9MhT0MgQbshP2rb19blo06Db",
16+
.url = "https://github.com/lightpanda-io/zig-v8-fork/archive/e38cb27ddb044c6afbf8a938b293721b9804405e.tar.gz",
17+
.hash = "v8-0.0.0-xddH6_GzAwCaz83JWuw3sepOGq0I7C_CmfOwA1Gb9q3y",
1818
},
1919
//.v8 = .{ .path = "../zig-v8-fork" },
2020
//.tigerbeetle_io = .{ .path = "../tigerbeetle-io" },

src/app.zig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ pub const App = struct {
2828

2929
pub const Config = struct {
3030
run_mode: RunMode,
31-
gc_hints: bool = false,
3231
tls_verify_host: bool = true,
3332
http_proxy: ?std.Uri = null,
3433
};

src/browser/browser.zig

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,7 @@ pub const Browser = struct {
8686
session.deinit();
8787
self.session = null;
8888
_ = self.session_arena.reset(.{ .retain_with_limit = 1 * 1024 * 1024 });
89-
if (self.app.config.gc_hints) {
90-
self.env.lowMemoryNotification();
91-
}
89+
self.env.lowMemoryNotification();
9290
}
9391
}
9492

src/browser/session.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ pub const Session = struct {
4949
// page and start another.
5050
transfer_arena: Allocator,
5151

52-
executor: Env.Executor,
52+
executor: Env.ExecutionWorld,
5353
storage_shed: storage.Shed,
5454
cookie_jar: storage.CookieJar,
5555

5656
page: ?Page = null,
5757

5858
pub fn init(self: *Session, browser: *Browser) !void {
59-
var executor = try browser.env.newExecutor();
59+
var executor = try browser.env.newExecutionWorld();
6060
errdefer executor.deinit();
6161

6262
const allocator = browser.app.allocator;

0 commit comments

Comments
 (0)