Skip to content

Commit

Permalink
Merge branch '5-0-x' into miniak/liftoff-correctly-unuse-labels-5-0-x
Browse files Browse the repository at this point in the history
  • Loading branch information
miniak committed Jun 4, 2019
2 parents e968fcc + be458b5 commit d5607e9
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .env.example
@@ -1,7 +1,7 @@
# These env vars are only necessary for creating Electron releases.
# See docs/development/releasing.md

APPVEYOR_TOKEN=
APPVEYOR_CLOUD_TOKEN=
CIRCLE_TOKEN=
ELECTRON_GITHUB_TOKEN=
VSTS_TOKEN=
5 changes: 4 additions & 1 deletion Dockerfile
Expand Up @@ -16,7 +16,7 @@ RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
locales \
lsb-release \
nano \
python-dbusmock \
python-dbus \
python-pip \
python-setuptools \
sudo \
Expand All @@ -33,6 +33,9 @@ RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
# crcmod is required by gsutil, which is used for filling the gclient git cache
RUN pip install -U crcmod

# dbusmock is needed for Electron tests
RUN pip install python-dbusmock

RUN mkdir /tmp/workspace
RUN chown builduser:builduser /tmp/workspace

Expand Down
4 changes: 2 additions & 2 deletions build/zip.py
Expand Up @@ -10,8 +10,8 @@

PATHS_TO_SKIP = [
'angledata', #Skipping because it is an output of //ui/gl that we don't need
'./libVkLayer_', #Skipping because these are outputs that we don't need
'./VkLayerLayer_', #Skipping because these are outputs that we don't need
'./libVkICD_mock_', #Skipping because these are outputs that we don't need
'./VkICD_mock_', #Skipping because these are outputs that we don't need

# //chrome/browser:resources depends on this via
# //chrome/browser/resources/ssl/ssl_error_assistant, but we don't need to
Expand Down
8 changes: 7 additions & 1 deletion docs/development/build-instructions-macos.md
Expand Up @@ -29,7 +29,13 @@ $ brew install python@2 && brew link python@2 --force
If you are using Python as provided by Homebrew, you also need to install
the following Python modules:

* [pyobjc](https://pythonhosted.org/pyobjc/install.html)
* [pyobjc](https://pypi.org/project/pyobjc/#description)

You can use `pip` to install it:

```sh
$ pip install pyobjc
```

## macOS SDK

Expand Down
1 change: 1 addition & 0 deletions patches/common/v8/.patches
Expand Up @@ -8,4 +8,5 @@ do_not_run_arm_arm64_mksnapshot_binaries.patch
deps_provide_more_v8_backwards_compatibility.patch
dcheck.patch
expose_protected_v8_platform_systemclocktimemillis.patch
do_not_export_private_v8_symbols_on_windows.patch
liftoff_correctly_unuse_labels.patch
@@ -0,0 +1,63 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tomas Rycl <torycl@microsoft.com>
Date: Mon, 13 May 2019 15:48:48 +0200
Subject: Do not export private V8 symbols on Windows

This change stops private V8 symbols and internal crt methods being exported.
It fixes an issue where native node modules can import
incorrect CRT methods and crash on Windows.
It also reduces size of node.lib by 75%.

This patch can be safely removed if, when it is removed, `node.lib` does not
contain any standard C++ library exports (e.g. `std::ostringstream`).

diff --git a/BUILD.gn b/BUILD.gn
index 465247a682cc1012d77c28c731fe1553565f128f..d208b9a2fbb6409bd436169b29786349a4df3b19 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -229,6 +229,7 @@ v8_toolset_for_shell = "host"
# Configurations
#
config("internal_config") {
+ defines = []
visibility = [ ":*" ] # Only targets in this file can depend on this.

include_dirs = [
@@ -238,8 +239,12 @@ config("internal_config") {

configs = [ "//build/config/compiler:wexit_time_destructors" ]

+ if (!is_component_build && is_electron_build) {
+ defines += [ "HIDE_PRIVATE_SYMBOLS" ]
+ }
+
if (is_component_build || is_electron_build) {
- defines = [ "BUILDING_V8_SHARED" ]
+ defines += [ "BUILDING_V8_SHARED" ]
}
}

diff --git a/src/base/macros.h b/src/base/macros.h
index 8a088ffc40eacb15b2833d6a85612e2075315fb9..76791d31b4a695ba9f8bb80121a791f512d99879 100644
--- a/src/base/macros.h
+++ b/src/base/macros.h
@@ -415,13 +415,17 @@ bool is_inbounds(float_t v) {
#ifdef V8_OS_WIN

// Setup for Windows shared library export.
+#if defined(HIDE_PRIVATE_SYMBOLS)
+#define V8_EXPORT_PRIVATE
+#else //if !defined(HIDE_PRIVATE_SYMBOLS)
#ifdef BUILDING_V8_SHARED
#define V8_EXPORT_PRIVATE __declspec(dllexport)
#elif USING_V8_SHARED
#define V8_EXPORT_PRIVATE __declspec(dllimport)
-#else
+#else //!(BUILDING_V8_SHARED || USING_V8_SHARED)
#define V8_EXPORT_PRIVATE
-#endif // BUILDING_V8_SHARED
+#endif
+#endif

#else // V8_OS_WIN

12 changes: 6 additions & 6 deletions script/ci-release-build.js
Expand Up @@ -2,12 +2,12 @@ if (!process.env.CI) require('dotenv-safe').load()

const assert = require('assert')
const request = require('request')
const buildAppVeyorURL = 'https://windows-ci.electronjs.org/api/builds'
const buildAppVeyorURL = 'https://ci.appveyor.com/api/builds'
const vstsURL = 'https://github.visualstudio.com/electron/_apis/build'

const appVeyorJobs = {
'electron-x64': 'electron',
'electron-ia32': 'electron-39ng6'
'electron-x64': 'electron-x64-release',
'electron-ia32': 'electron-ia32-release'
}

const circleCIJobs = [
Expand Down Expand Up @@ -100,13 +100,13 @@ async function callAppVeyor (targetBranch, job, options) {
const requestOpts = {
url: buildAppVeyorURL,
auth: {
bearer: process.env.APPVEYOR_TOKEN
bearer: process.env.APPVEYOR_CLOUD_TOKEN
},
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
accountName: 'AppVeyor',
accountName: 'electron-bot',
projectSlug: appVeyorJobs[job],
branch: targetBranch,
environmentVariables
Expand All @@ -116,7 +116,7 @@ async function callAppVeyor (targetBranch, job, options) {
const appVeyorResponse = await makeRequest(requestOpts, true).catch(err => {
console.log('Error calling AppVeyor:', err)
})
const buildUrl = `https://windows-ci.electronjs.org/project/AppVeyor/${appVeyorJobs[job]}/build/${appVeyorResponse.version}`
const buildUrl = `https://ci.appveyor.com/project/electron-bot/${appVeyorJobs[job]}/build/${appVeyorResponse.version}`
console.log(`AppVeyor release build request for ${job} successful. Check build status at ${buildUrl}`)
}

Expand Down
4 changes: 3 additions & 1 deletion script/strip-binaries.py
Expand Up @@ -9,7 +9,9 @@
'electron',
'libffmpeg.so',
'libGLESv2.so',
'libEGL.so'
'libEGL.so',
'swiftshader/libGLESv2.so',
'swiftshader/libEGL.so'
]

def strip_binaries(directory, target_cpu):
Expand Down

0 comments on commit d5607e9

Please sign in to comment.