Skip to content

Commit

Permalink
Merge pull request #122 from paulocoutinhox/chromium/6658
Browse files Browse the repository at this point in the history
updated to chromium/6658
  • Loading branch information
paulocoutinhox authored Aug 15, 2024
2 parents 460c344 + a88c183 commit 37d8eb9
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 100 deletions.
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

0 comments on commit 37d8eb9

Please sign in to comment.