Skip to content
This repository was archived by the owner on Mar 29, 2024. It is now read-only.

Commit 21fbabc

Browse files
committed
Upgrade to libv8 6.5.116
1 parent 34e054f commit 21fbabc

File tree

12 files changed

+63
-49
lines changed

12 files changed

+63
-49
lines changed

.travis.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ services:
66

77
env:
88
global:
9-
- V8=6.4
9+
- V8=6.5
1010
matrix:
11-
- TAG=xenial-v8-64-php-71
12-
- TAG=xenial-v8-64-php-71 TEST_PHP_ARGS=-m
13-
- TAG=xenial-v8-64-php-72
14-
- TAG=xenial-v8-64-php-72 TEST_PHP_ARGS=-m
11+
- TAG=xenial-v8-65-php-71
12+
- TAG=xenial-v8-65-php-71 TEST_PHP_ARGS=-m
13+
- TAG=xenial-v8-65-php-72
14+
- TAG=xenial-v8-65-php-72 TEST_PHP_ARGS=-m
1515

1616
before_install:
1717
# docker on travis doesn't allow anything before FROM, let's fix that

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ project(php-v8)
33

44
# NOTE: This CMake file is just for syntax highlighting in CLion
55

6-
include_directories(/usr/local/opt/v8@6.4/include)
7-
include_directories(/usr/local/opt/v8@6.4/include/libplatform)
6+
include_directories(/usr/local/opt/v8@6.5/include)
7+
include_directories(/usr/local/opt/v8@6.5/include/libplatform)
88

99
include_directories(/usr/local/include/php)
1010
include_directories(/usr/local/include/php/TSRM)

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG TAG=xenial-v8-64-php-72
1+
ARG TAG=xenial-v8-65-php-72
22

33
FROM pinepain/php-v8-docker:${TAG}
44

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ on top of php-v8 extension and makes embedding JavaScript in PHP easier.
100100
### Requirements
101101

102102
#### V8
103-
You will need a recent v8 Google JavaScript engine version installed. At this time v8 >= 6.4.6 required.
103+
You will need a recent v8 Google JavaScript engine version installed. At this time v8 >= 6.5.116 required.
104104

105105
#### PHP
106106
This extension is PHP7-only. It works and tested with both PHP 7.0 and PHP 7.1.
@@ -123,7 +123,7 @@ $ php --ri v8
123123

124124
While [pinepain/php](https://launchpad.net/~pinepain/+archive/ubuntu/php) PPA targets to contain all necessary
125125
extensions with dependencies, you may find
126-
[pinepain/libv8-6.4](https://launchpad.net/~pinepain/+archive/ubuntu/libv8-6.4),
126+
[pinepain/libv8-6.5](https://launchpad.net/~pinepain/+archive/ubuntu/libv8-6.5),
127127
[pinepain/libv8-experimental](https://launchpad.net/~pinepain/+archive/ubuntu/libv8-experimental) and
128128
[pinepain/php-v8](https://launchpad.net/~pinepain/+archive/ubuntu/php-v8) standalone PPAs useful.
129129

config.m4

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ if test "$PHP_V8" != "no"; then
1919
SEARCH_PATH="/usr/local /usr"
2020
SEARCH_FOR="include/v8.h"
2121

22-
V8_MIN_API_VERSION_STR=6.4.6
22+
V8_MIN_API_VERSION_STR=6.5.116
2323

2424
DESIRED_V8_VERSION=`echo "${V8_MIN_API_VERSION_STR}" | $AWK 'BEGIN { FS = "."; } { printf "%s.%s", [$]1, [$]2;}'`
2525

docs/development/release-libv8.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ To track v8 changes you can use these links:
2929
been rebuild on push as we don't need them anymore and replace them with a new one (we still need to keep old tags
3030
for CI purpose and just in case things won't go smooth and we have to rollback).
3131
5. Rebuild/publish docker images to include new `libv8` version.
32-
6. Make sure you have proper `php-v8` version set in `packaging/Dockerfile` under `V8` constant.
32+
6. You may want to set proper default image `TAG` in `php-v8` `Dockerfile` by updating it first line `ARG TAG=xenial-v8-64-php-72`.
33+
7. Make sure you have proper `php-v8` version set in `packaging/Dockerfile` under `V8` constant.
3334

3435
## After docker images rebuilt/published
3536

scripts/provision/provision.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ echo Provisioning...
55
# Add Ondřej Surý's PPA with co-installable PHP versions:
66
sudo add-apt-repository -y ppa:ondrej/php
77
# Add libv8 PPA:
8-
sudo add-apt-repository ppa:pinepain/libv8-6.4
8+
sudo add-apt-repository ppa:pinepain/libv8-6.5
99

1010
# Let's update packages list:
1111
sudo apt-get update
@@ -19,10 +19,10 @@ sudo apt-get install -y git htop curl pkgconf
1919

2020

2121
# Build and development requirements
22-
sudo apt-get install -y libv8-6.4 libv8-6.4-dev libv8-6.4-dbg
22+
sudo apt-get install -y libv8-6.5 libv8-6.5-dev libv8-6.5-dbg
2323
sudo apt-get install -y dh-make valgrind
2424
sudo apt-get install -y libssl-dev openssl
25-
sudo apt-get install -y php7.1 php7.1-cli php7.1-dev php7.1-fpm
25+
sudo apt-get install -y php7.2 php7.2-cli php7.2-dev php7.2-fpm
2626
sudo apt-get install -y php-pear autoconf automake curl libcurl3-openssl-dev build-essential libxslt1-dev re2c libxml2 libxml2-dev bison libbz2-dev libreadline-dev
2727
sudo apt-get install -y libfreetype6 libfreetype6-dev libpng12-0 libpng12-dev libjpeg-dev libjpeg8-dev libjpeg8 libgd-dev libgd3 libxpm4 libltdl7 libltdl-dev
2828
sudo apt-get install -y libssl-dev openssl gettext libgettextpo-dev libgettextpo0 libicu-dev libmhash-dev libmhash2 libmcrypt-dev libmcrypt4

scripts/test_v8/hello_world.cpp

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,6 @@
66

77
using namespace v8;
88

9-
class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
10-
public:
11-
virtual void* Allocate(size_t length) {
12-
void* data = AllocateUninitialized(length);
13-
return data == NULL ? data : memset(data, 0, length);
14-
}
15-
virtual void* AllocateUninitialized(size_t length) { return malloc(length); }
16-
virtual void Free(void* data, size_t) { free(data); }
17-
};
18-
19-
209
void weak_callback(const v8::WeakCallbackInfo<v8::Persistent<v8::String>>& data) {
2110
printf("Weak callback called\n");
2211
data.GetParameter()->Reset();
@@ -29,20 +18,16 @@ int main(int argc, char* argv[]) {
2918
v8::Platform *platform = v8::platform::CreateDefaultPlatform();
3019
v8::V8::InitializePlatform(platform);
3120

32-
V8::Initialize();
33-
21+
// std::unique_ptr<v8::Platform> platform = v8::platform::NewDefaultPlatform();
22+
// v8::V8::InitializePlatform(platform.get());
3423

35-
ArrayBufferAllocator *array_buffer_allocator;
36-
v8::Isolate::CreateParams *create_params;
37-
38-
array_buffer_allocator = new ArrayBufferAllocator();
39-
create_params = new v8::Isolate::CreateParams();
40-
41-
create_params->array_buffer_allocator = array_buffer_allocator;
24+
V8::Initialize();
4225

26+
v8::Isolate::CreateParams create_params;
27+
create_params.array_buffer_allocator = v8::ArrayBuffer::Allocator::NewDefaultAllocator();
4328

4429
// Create a new Isolate and make it the current one.
45-
Isolate* isolate = v8::Isolate::New(*create_params);
30+
Isolate* isolate = v8::Isolate::New(create_params);
4631

4732
v8::Persistent<v8::String> test;
4833

@@ -90,9 +75,5 @@ int main(int argc, char* argv[]) {
9075
V8::Dispose();
9176
V8::ShutdownPlatform();
9277

93-
delete array_buffer_allocator;
94-
delete create_params;
95-
delete platform;
96-
9778
return 0;
9879
}

scripts/test_v8/hello_world_build_deb.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
#!/bin/bash
22

3-
ROOT=/opt/libv8-6.2
3+
ROOT=/opt/libv8-6.5
44
LIB_DIR=$ROOT/lib/
55

66
SRC_DIR=$ROOT
77
INCLUDE_DIR=$ROOT/include
88

9-
g++ hello_world.cpp -o hello_world \
9+
set -x
10+
11+
g++ -std=c++14 hello_world.cpp -o hello_world \
1012
-g \
1113
-O2 \
1214
-std=c++11 \
13-
-I$SRC_DIR \
1415
-I$INCLUDE_DIR \
1516
-L$LIB_DIR \
17+
-Wl,-rpath,$LIB_DIR \
1618
-lv8_libbase \
1719
-lv8_libplatform \
1820
-lv8 \

scripts/test_v8/hello_world_build_osx.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
ROOT=/usr/local/opt/v8@6.2
3+
ROOT=/usr/local/opt/v8@6.5
44
LIB_DIR=$ROOT/lib/
55

66
SRC_DIR=$ROOT

0 commit comments

Comments
 (0)