Skip to content

Commit 8830fc5

Browse files
committed
Fix timezone issues
1 parent 4c45781 commit 8830fc5

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

.github/workflows/build-test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ jobs:
230230
- name: Install dependencies
231231
run: |
232232
brew install v8
233+
# Symlink icudtl.dat to the default location
234+
ln -sf /opt/homebrew/Cellar/v8/$(brew list --versions v8 | awk '{print $2}')/libexec/icudtl.dat /opt/homebrew/lib/icudtl.dat
233235
234236
- name: Build extension
235237
run: |

README.Linux.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,18 @@ cd v8
9696
git checkout 12.0.267.36
9797
gclient sync -D
9898
99+
ARCH=$(uname -m)
100+
99101
# Setup GN
100-
tools/dev/v8gen.py -vv x64.release -- is_component_build=true use_custom_libcxx=false
102+
tools/dev/v8gen.py -vv ${ARCH}.release -- is_component_build=true use_custom_libcxx=false
101103
102104
# Build
103-
ninja -C out.gn/x64.release/
105+
ninja -C out.gn/${ARCH}.release/
104106
105107
# Install to /opt/v8/
106108
sudo mkdir -p /opt/v8/{lib,include}
107-
sudo cp out.gn/x64.release/lib*.so out.gn/x64.release/*_blob.bin \
108-
out.gn/x64.release/icudtl.dat /opt/v8/lib/
109+
sudo cp out.gn/${ARCH}.release/lib*.so out.gn/${ARCH}.release/*_blob.bin \
110+
out.gn/${ARCH}.release/icudtl.dat /opt/v8/lib/
109111
sudo cp -R include/* /opt/v8/include/
110112
```
111113

README.MacOS.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,19 @@ make -j4
2121
make test
2222
make install
2323
```
24+
25+
V8Js' build system assumes that the `icudtl.dat` file is located next to the `libv8.so`
26+
library file and compiles the path into the library itself. If for whatever reason the
27+
`icudtl.dat` file is stored at a different place during runtime, you need to set the
28+
php.ini variable `v8js.icudtl_dat_path` to point to the file. Otherwise locale-aware
29+
features of V8 will not work as expected.
30+
31+
To avoid having to configure `v8js.icudtl_dat_path` manually, you can symlink or copy the ICU data file into the default library location. For Homebrew users, run:
32+
33+
In case of a brew installed v8, run:
34+
35+
```
36+
ln -sf /opt/homebrew/Cellar/v8/$(brew list --versions v8 | awk '{print $2}')/libexec/icudtl.dat /opt/homebrew/lib/icudtl.dat
37+
```
38+
39+
This ensures V8Js will find `icudtl.dat` automatically and timezone/i18n support will work out of the box.

0 commit comments

Comments
 (0)