aboutsummaryrefslogtreecommitdiff
path: root/docs/upgrading-webkit.md
blob: e726fb1d8ea23fb3fe643ef40eb32624447f09a7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
Bun uses [a fork](https://github.com/oven-sh/WebKit) of WebKit with a small number of changes.

It's important to periodically update WebKit for many reasons:

- Security
- Performance
- Compatibility
- …and many more.

To upgrade, first find the commit in **Bun's WebKit fork** (not Bun!) between when we last upgraded and now.

```bash
$ cd src/bun.js/WebKit # In the WebKit directory! not bun
$ git checkout $COMMIT
```

This is the main command to run:

```bash
$ git pull https://github.com/WebKit/WebKit.git main --no-rebase --allow-unrelated-histories -X theirs
```

Then, you will likely see some silly merge conflicts. Fix them and then run:

```bash
# You might have to run this multiple times.
$ rm -rf WebKitBuild

# Go to Bun's directory! Not WebKit.
cd ../../../../
make jsc-build-mac-compile
```

Make sure that JSC's CLI is able to load successfully. This verifies that the build is working.

You know this worked when it printed help options. If it complains about symbols, crashes, or anything else that looks wrong, something is wrong.

```bash
src/bun.js/WebKit/WebKitBuild/Release/bin/jsc --help
```

Then, clear out our bindings and regenerate the C++<>Zig headers:

```bash
make clean-bindings headers builtins
```

Now update Bun's bindings wherever there are compiler errors:

```bash
# It will take awhile if you don't pass -j here
make bindings -j10
```

This is the hard part. It might involve digging through WebKit's commit history to figure out what changed and why. Fortunately, WebKit contributors write great commit messages.
191/bun/commit/src/bun.js/javascript_core_c_api.zig?h=jarred/dump&id=272e71fec2117bc759b2a41e0eaf985f9b064e51&follow=1'>Fix string encoding issue in JSC C API usagesGravatar Jarred Sumner 3-139/+74 2022-11-14Prevent double-frees in log msgsGravatar Jarred Sumner 1-4/+15 2022-11-14Fix build errorGravatar Jarred SUmner 2-6/+1 2022-11-14Bugfixes and perf improvements to child_processGravatar Jarred SUmner 15-192/+416 2022-11-13use `write$NOCANCEL`, more loggingGravatar Jarred Sumner 3-12/+42 2022-11-13Add an e2e testGravatar Jarred Sumner 3-0/+52 2022-11-13Add missing `rmdir` exportGravatar Jarred Sumner 1-1/+2 2022-11-13Make node streams faster (#1502)Gravatar Jarred Sumner 23-406/+836 2022-11-13Fix incorrect exit status messageGravatar Jarred Sumner 1-3/+6 2022-11-12Fix syntax errorGravatar Jarred Sumner 1-2/+2 2022-11-12Set linker script to Bun 0.2Gravatar Jarred SUmner 1-1/+1 2022-11-12Fix infinite write loop on LinuxGravatar Jarred SUmner 3-44/+185 2022-11-12Add missing typeGravatar Jarred SUmner 1-1/+1 2022-11-12Add linker script to remove unwanted exports (#1499)Gravatar Tom Birch 2-1/+9 2022-11-12Fix memory leak in gzip pool + add test for gzip'd dataGravatar Jarred SUmner 7-62/+1530 2022-11-12Redo how we poll pipes (#1496)Gravatar Jarred Sumner 22-707/+1251 2022-11-11Add test that fails on linuxGravatar Jarred Sumner 7-21/+42 2022-11-112 framesGravatar Jarred Sumner 1-1/+1 2022-11-11Revert "Omit frame pointer"Gravatar Jarred Sumner 1-0/+1 2022-11-11Don't rm cachedGravatar Jarred Sumner 4-4/+0 2022-11-11try thisGravatar Jarred Sumner 4-0/+4 2022-11-11Update bun-linux-build.ymlGravatar Jarred Sumner 1-1/+0 2022-11-11try using git actionGravatar Jarred Sumner 4-7/+8 2022-11-11Remove with `git rm`Gravatar Jarred Sumner 2-8/+0