Skip to content

Commit bea683f

Browse files
committed
Fix build
1 parent 3ee9e01 commit bea683f

File tree

3 files changed

+40
-31
lines changed

3 files changed

+40
-31
lines changed

.github/workflows/build.yml

Lines changed: 24 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,23 @@ env:
1818

1919
jobs:
2020
macos:
21-
runs-on: macos-10.15
21+
runs-on: macos-11
2222
strategy:
2323
matrix:
2424
machine: ["x64", "arm64"]
2525
build_type: [Release, Debug]
2626
fail-fast: false
2727
steps:
28-
- uses: actions/checkout@v2
28+
- uses: actions/checkout@v3
2929
- run: python3 script/check_release.py --version ${{ env.version }} --build-type ${{ matrix.build_type }} --machine ${{ matrix.machine }}
3030
if: ${{ github.event.inputs.skip_release != 'true' }}
3131
env:
3232
API_TOKEN: ${{ secrets.API_TOKEN }}
33+
- uses: abdes/gha-setup-ninja@660f330a40aefa8d11632b3f901e92a4adb33d65
3334
- run: python3 script/checkout.py --version ${{ env.version }}
3435
- run: python3 script/build.py --build-type ${{ matrix.build_type }} --machine ${{ matrix.machine }}
3536
- run: python3 script/archive.py --version ${{ env.version }} --build-type ${{ matrix.build_type }} --machine ${{ matrix.machine }}
36-
- uses: actions/upload-artifact@v2
37+
- uses: actions/upload-artifact@v3
3738
with:
3839
name: Skia-${{ env.version }}-macos-${{ matrix.build_type }}-${{ matrix.machine }}.zip
3940
path: '*.zip'
@@ -50,20 +51,21 @@ jobs:
5051
build_type: [Release, Debug]
5152
fail-fast: false
5253
steps:
53-
- uses: actions/checkout@v2
54+
- uses: actions/checkout@v3
55+
- run: python3 script/check_release.py --version ${{ env.version }} --build-type ${{ matrix.build_type }} --machine ${{ matrix.target_machine }}
56+
if: ${{ github.event.inputs.skip_release != 'true' }}
57+
env:
58+
API_TOKEN: ${{ secrets.API_TOKEN }}
59+
- uses: abdes/gha-setup-ninja@660f330a40aefa8d11632b3f901e92a4adb33d65
5460
- run: sudo ./script/prepare_linux.sh
5561
- run: |
5662
sudo apt-get update
5763
sudo apt-get --yes install g\+\+-9-aarch64-linux-gnu
5864
if: ${{ matrix.target_machine == 'arm64' }}
59-
- run: python3 script/check_release.py --version ${{ env.version }} --build-type ${{ matrix.build_type }} --machine ${{ matrix.target_machine }}
60-
if: ${{ github.event.inputs.skip_release != 'true' }}
61-
env:
62-
API_TOKEN: ${{ secrets.API_TOKEN }}
6365
- run: PATH=/usr/lib/binutils-2.26/bin:$PATH python3 script/checkout.py --version ${{ env.version }}
6466
- run: PATH=/usr/lib/binutils-2.26/bin:$PATH python3 script/build.py --build-type ${{ matrix.build_type }} --machine ${{ matrix.target_machine }}
6567
- run: PATH=/usr/lib/binutils-2.26/bin:$PATH python3 script/archive.py --version ${{ env.version }} --build-type ${{ matrix.build_type }} --machine ${{ matrix.target_machine }}
66-
- uses: actions/upload-artifact@v2
68+
- uses: actions/upload-artifact@v3
6769
with:
6870
name: Skia-${{ env.version }}-linux-${{ matrix.build_type }}-${{ matrix.target_machine }}.zip
6971
path: '*.zip'
@@ -73,24 +75,25 @@ jobs:
7375
API_TOKEN: ${{ secrets.API_TOKEN }}
7476

7577
android:
78+
if: false
7679
runs-on: ubuntu-20.04
7780
strategy:
7881
matrix:
7982
machine: [arm, arm64, x64, x86]
8083
steps:
81-
- uses: actions/checkout@v2
82-
- uses: actions/setup-java@v1
83-
with:
84-
java-version: 1.8
85-
- run: sudo ./script/prepare_linux.sh
84+
- uses: actions/checkout@v3
8685
- run: python3 script/check_release.py --version ${{ env.version }} --system android --machine ${{ matrix.machine }}
8786
if: ${{ github.event.inputs.skip_release != 'true' }}
8887
env:
8988
API_TOKEN: ${{ secrets.API_TOKEN }}
89+
- uses: actions/setup-java@v1
90+
with:
91+
java-version: 1.8
92+
- run: sudo ./script/prepare_linux.sh
9093
- run: PATH=/usr/lib/binutils-2.26/bin:$PATH python3 script/checkout.py --version ${{ env.version }} --system android --machine ${{ matrix.machine }}
9194
- run: PATH=/usr/lib/binutils-2.26/bin:$PATH python3 script/build.py --system android --machine ${{ matrix.machine }} --ndk "/usr/local/lib/android/sdk/ndk-bundle"
9295
- run: PATH=/usr/lib/binutils-2.26/bin:$PATH python3 script/archive.py --system android --machine ${{ matrix.machine }}
93-
- uses: actions/upload-artifact@v2
96+
- uses: actions/upload-artifact@v3
9497
with:
9598
name: Skia-${{ env.version }}-android-Release-${{ matrix.machine }}.zip
9699
path: '*.zip'
@@ -100,27 +103,30 @@ jobs:
100103
API_TOKEN: ${{ secrets.API_TOKEN }}
101104

102105
windows:
103-
runs-on: windows-2019
106+
runs-on: windows-latest
104107
strategy:
105108
matrix:
106109
build_type: [Release, Debug]
107110
fail-fast: false
108111
steps:
109-
- uses: actions/checkout@v2
112+
- uses: actions/checkout@v3
110113
- shell: bash
111114
run: python3 script/check_release.py --version ${{ env.version }} --build-type ${{ matrix.build_type }}
112115
if: ${{ github.event.inputs.skip_release != 'true' }}
113116
env:
114117
API_TOKEN: ${{ secrets.API_TOKEN }}
118+
- uses: abdes/gha-setup-ninja@660f330a40aefa8d11632b3f901e92a4adb33d65
115119
- uses: microsoft/setup-msbuild@v1
116120
- uses: ilammy/msvc-dev-cmd@v1
121+
with:
122+
arch: amd64
117123
- shell: bash
118124
run: python3 script/checkout.py --version ${{ env.version }}
119125
- shell: bash
120126
run: python3 script/build.py --build-type ${{ matrix.build_type }}
121127
- shell: bash
122128
run: python3 script/archive.py --version ${{ env.version }} --build-type ${{ matrix.build_type }}
123-
- uses: actions/upload-artifact@v2
129+
- uses: actions/upload-artifact@v3
124130
with:
125131
name: Skia-${{ env.version }}-windows-${{ matrix.build_type }}-x64.zip
126132
path: '*.zip'

patches/11081_SkLoadICU.cpp.patch

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
diff --git a/third_party/icu/SkLoadICU.cpp b/third_party/icu/SkLoadICU.cpp
2-
index 5b3b153336..8696aaf927 100644
2+
index b6107714f7..edceb98af7 100644
33
--- a/third_party/icu/SkLoadICU.cpp
44
+++ b/third_party/icu/SkLoadICU.cpp
5-
@@ -15,39 +15,37 @@
5+
@@ -13,41 +13,40 @@
6+
7+
#include <cstdio>
68
#include <cstring>
9+
+#include <iostream>
710
#include <mutex>
811
#include <string>
912
+#include <sstream>
@@ -14,43 +17,43 @@ index 5b3b153336..8696aaf927 100644
1417
- if (!dataFile) {
1518
- return nullptr;
1619
- }
17-
+static void* win_mmap(const std::wstring& dataFile, std::ostringstream& buffer) {
20+
+static void* win_mmap(const std::wstring& dataFile, std::wostringstream& buffer) {
1821
struct FCloseWrapper { void operator()(FILE* f) { fclose(f); } };
1922
- std::unique_ptr<FILE, FCloseWrapper> stream(_wfopen(dataFile, L"rb"));
20-
+ std::unique_ptr<FILE, FCloseWrapper> stream(_wfopen(dataFile, L"rb"));
23+
+ std::unique_ptr<FILE, FCloseWrapper> stream(_wfopen(dataFile.c_str(), L"rb"));
2124
if (!stream) {
2225
- fprintf(stderr, "SkIcuLoader: datafile missing: %ls.\n", dataFile);
23-
+ buffer << "SkLoadICU: datafile '" << dataFile << "' is missing" << std::endl;
26+
+ buffer << L"SkLoadICU: datafile '" << dataFile << L"' is missing" << std::endl;
2427
return nullptr;
2528
}
2629
int fileno = _fileno(stream.get());
2730
if (fileno < 0) {
2831
- fprintf(stderr, "SkIcuLoader: datafile fileno error.\n");
29-
+ buffer << "SkLoadICU: datafile '" << dataFile << "' fileno error " << fileno << std::endl;
32+
+ buffer << L"SkLoadICU: datafile '" << dataFile << L"' fileno error " << fileno << std::endl;
3033
return nullptr;
3134
}
3235
HANDLE file = (HANDLE)_get_osfhandle(fileno);
3336
if ((HANDLE)INVALID_HANDLE_VALUE == file) {
3437
- fprintf(stderr, "SkIcuLoader: datafile handle error.\n");
35-
+ buffer << "SkLoadICU: datafile '" << dataFile << "' handle error" << std::endl;
38+
+ buffer << L"SkLoadICU: datafile '" << dataFile << L"' handle error" << std::endl;
3639
return nullptr;
3740
}
3841
struct CloseHandleWrapper { void operator()(HANDLE h) { CloseHandle(h); } };
3942
std::unique_ptr<void, CloseHandleWrapper> mmapHandle(
4043
CreateFileMapping(file, nullptr, PAGE_READONLY, 0, 0, nullptr));
4144
if (!mmapHandle) {
4245
- fprintf(stderr, "SkIcuLoader: datafile mmap error.\n");
43-
+ buffer << "SkLoadICU: datafile '" << dataFile << "' mmap error" << std::endl;
46+
+ buffer << L"SkLoadICU: datafile '" << dataFile << L"' mmap error" << std::endl;
4447
return nullptr;
4548
}
4649
void* addr = MapViewOfFile(mmapHandle.get(), FILE_MAP_READ, 0, 0, 0);
4750
if (nullptr == addr) {
4851
- fprintf(stderr, "SkIcuLoader: datafile view error.\n");
49-
+ buffer << "SkLoadICU: datafile '" << dataFile << "' view error" << std::endl;
52+
+ buffer << L"SkLoadICU: datafile '" << dataFile << L"' view error" << std::endl;
5053
return nullptr;
5154
}
5255
return addr;
53-
@@ -86,23 +84,20 @@ static std::string executable_directory() {
56+
@@ -99,23 +98,20 @@ static std::wstring executable_directory() {
5457
return get_module_path(hModule);
5558
}
5659

@@ -70,12 +73,12 @@ index 5b3b153336..8696aaf927 100644
7073
static std::once_flag flag;
7174
std::call_once(flag, []() {
7275
- good = load_from(executable_directory()) || load_from(library_directory());
73-
+ std::ostringstream buffer;
76+
+ std::wostringstream buffer;
7477
+ void* addr = win_mmap(library_directory() + L"\\icudtl.dat", buffer);
7578
+ if (addr == nullptr)
7679
+ addr = win_mmap(executable_directory() + L"\\icudtl.dat", buffer);
7780
+ if (addr == nullptr)
78-
+ fputs(buffer.str().c_str(), stderr);
81+
+ std::wcerr << buffer.str() << std::endl;
7982
+ if (addr)
8083
+ loaded = init_icu(addr);
8184
});

script/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ def main():
8080
out = os.path.join('out', build_type + '-' + machine)
8181
gn = 'gn.exe' if 'windows' == system else 'gn'
8282
subprocess.check_call([os.path.join('bin', gn), 'gen', out, '--args=' + ' '.join(args)])
83-
ninja = 'ninja.exe' if 'windows' == system else 'ninja'
83+
ninja = 'ninja.bat' if 'windows' == system else 'ninja'
8484
subprocess.check_call([os.path.join('..', 'depot_tools', ninja), '-C', out, 'skia', 'modules'])
8585

8686
return 0

0 commit comments

Comments
 (0)