Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updated to chromium/6658 #122

Merged
merged 2 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
sudo apt-get clean

- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: "3.10"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: "3.10"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: "3.10"

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
doxygen --version

- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v5
with:
python-version: "3.10"

Expand All @@ -46,7 +46,7 @@ jobs:
- name: Install EMSDK
uses: mymindstorm/setup-emsdk@v11
with:
version: "3.1.50"
version: "3.1.64"

- name: Install Node
uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion docker/android/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ RUN mkdir /build
WORKDIR /build
RUN gclient config --custom-var checkout_configuration=minimal --unmanaged https://pdfium.googlesource.com/pdfium.git
RUN echo "target_os = [ 'android' ]" >> .gclient
RUN gclient sync -r origin/chromium/6276 --no-history --shallow
RUN gclient sync -r origin/chromium/6658 --no-history --shallow

# pdfium reset and clean directories
RUN git -C /build/pdfium reset --hard
Expand Down
6 changes: 3 additions & 3 deletions docker/wasm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ RUN mkdir /build
WORKDIR /build
RUN gclient config --custom-var checkout_configuration=minimal --unmanaged https://pdfium.googlesource.com/pdfium.git
RUN echo "target_os = [ 'wasm' ]" >> .gclient
RUN gclient sync -r origin/chromium/6276 --no-history --shallow
RUN gclient sync -r origin/chromium/6658 --no-history --shallow

# pdfium reset and clean directories
RUN git -C /build/pdfium reset --hard
Expand Down Expand Up @@ -79,8 +79,8 @@ RUN pip3 install setuptools docopt pygemstones
RUN mkdir /emsdk
WORKDIR /emsdk
RUN git clone https://github.com/emscripten-core/emsdk.git .
RUN ./emsdk install 3.1.50
RUN ./emsdk activate 3.1.50
RUN ./emsdk install 3.1.64
RUN ./emsdk activate 3.1.64
ENV PATH="${PATH}:/emsdk:/emsdk/upstream/emscripten"

# cache system libraries
Expand Down
6 changes: 3 additions & 3 deletions modules/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
task = ""

# pdfium
pdfium_git_branch = "chromium/6276"
# ^ ref: https://pdfium.googlesource.com/pdfium/+/refs/heads/chromium/6276
pdfium_git_branch = "chromium/6658"
# ^ ref: https://pdfium.googlesource.com/pdfium/+/refs/heads/chromium/6658
# OBS 1: don't forget change in android docker file (docker/android/Dockerfile)
# OBS 2: don't forget change in wasm docker file (docker/wasm/Dockerfile)

# emsdk
emsdk_version = "3.1.50"
emsdk_version = "3.1.64"
# OBS 1: don't forget change in wasm docker file (docker/wasm/Dockerfile)

# macos
Expand Down
97 changes: 9 additions & 88 deletions modules/wasm.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,58 +72,6 @@ def run_task_patch():
else:
l.bullet("Skipped: build os", l.PURPLE)

# build overrides target
source_file = os.path.join(
source_dir,
"build",
"config",
"BUILDCONFIG.gn",
)

line_content = '_default_toolchain = "//build/toolchain/wasm:emscripten"'
line_number = f.get_file_line_number_with_content(
source_file, line_content, strip=True
)

if not line_number:
source = """} else {
assert(false, "Unsupported target_os: $target_os")
}"""

target = """} else if (target_os == "wasm") {
_default_toolchain = "//build/toolchain/wasm:emscripten"
} else {
assert(false, "Unsupported target_os: $target_os")
}"""

f.replace_in_file(source_file, source, target)
l.bullet("Applied: build overrides target", l.GREEN)
else:
l.bullet("Skipped: build overrides target", l.PURPLE)

# build overrides os
source_file = os.path.join(
source_dir,
"build",
"config",
"BUILDCONFIG.gn",
)

line_content = 'is_wasm = current_os == "wasm"'
line_number = f.get_file_line_number_with_content(
source_file, line_content, strip=True
)

if not line_number:
f.replace_in_file(
source_file,
'is_mac = current_os == "mac"',
'is_mac = current_os == "mac"\nis_wasm = current_os == "wasm"',
)
l.bullet("Applied: build overrides os", l.GREEN)
else:
l.bullet("Skipped: build overrides os", l.PURPLE)

# compiler
source_file = os.path.join(
source_dir,
Expand Down Expand Up @@ -163,16 +111,16 @@ def run_task_patch():
"BUILD.gn",
)

line_content = '} else if (current_os != "aix" && current_os != "wasm") {'
line_content = '} else if (current_os != "aix" && current_os != "zos" && current_os != "wasm") {'
line_number = f.get_file_line_number_with_content(
source_file, line_content, strip=True
)

if not line_number:
f.replace_in_file(
source_file,
'} else if (current_os != "aix") {',
'} else if (current_os != "aix" && current_os != "wasm") {',
'} else if (current_os != "aix" && current_os != "zos") {',
'} else if (current_os != "aix" && current_os != "zos" && current_os != "wasm") {',
)
l.bullet("Applied: stack protector", l.GREEN)
else:
Expand Down Expand Up @@ -207,33 +155,6 @@ def run_task_patch():
else:
l.bullet("Skipped: lib extension", l.PURPLE)

# # partition allocator
# source_file = os.path.join(
# source_dir,
# "base",
# "allocator",
# "partition_allocator",
# "partition_alloc_base",
# "threading",
# "platform_thread_posix.cc",
# )

# line_content = (
# "#elif BUILDFLAG(IS_POSIX) && (BUILDFLAG(IS_AIX) || defined(OS_ASMJS))"
# )
# line_number = f.get_file_line_number_with_content(
# source_file, line_content, strip=True
# )

# if not line_number:
# source = "#elif BUILDFLAG(IS_POSIX) && BUILDFLAG(IS_AIX)"
# target = "#elif BUILDFLAG(IS_POSIX) && (BUILDFLAG(IS_AIX) || defined(OS_ASMJS))"

# f.replace_in_file(source_file, source, target)
# l.bullet("Applied: partition allocator", l.GREEN)
# else:
# l.bullet("Skipped: partition allocator", l.PURPLE)

# fxcrt
source_file = os.path.join(
source_dir,
Expand All @@ -242,14 +163,14 @@ def run_task_patch():
"BUILD.gn",
)

line_content = "if (is_posix || is_fuchsia || is_wasm) {"
line_content = "if (is_posix || is_wasm) {"
line_number = f.get_file_line_number_with_content(
source_file, line_content, strip=True
)

if not line_number:
source = "if (is_posix || is_fuchsia) {"
target = "if (is_posix || is_fuchsia || is_wasm) {"
source = "if (is_posix) {"
target = "if (is_posix || is_wasm) {"

f.replace_in_file(source_file, source, target)
l.bullet("Applied: fxcrt", l.GREEN)
Expand All @@ -264,14 +185,14 @@ def run_task_patch():
"BUILD.gn",
)

line_content = "if (is_linux || is_chromeos || is_fuchsia || is_wasm) {"
line_content = "if (is_linux || is_chromeos || is_wasm) {"
line_number = f.get_file_line_number_with_content(
source_file, line_content, strip=True
)

if not line_number:
source = "if (is_linux || is_chromeos || is_fuchsia) {"
target = "if (is_linux || is_chromeos || is_fuchsia || is_wasm) {"
source = "if (is_linux || is_chromeos) {"
target = "if (is_linux || is_chromeos || is_wasm) {"

f.replace_in_file(source_file, source, target)
l.bullet("Applied: fxge", l.GREEN)
Expand Down
Loading