Skip to content

Commit 1a37396

Browse files
authored
Merge pull request #367 from teeminus/update
2 parents 9f55f24 + 6184123 commit 1a37396

21 files changed

+3806
-395
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ ln -s /usr/bin/vim /usr/bin/vi
124124
1. Sanity checking for consistency in series file
125125
* `./devutils/check_patch_files.sh`
126126
1. Check for esbuild dependency changes in file `build/src/DEPS` and adapt `downloads.ini` accordingly
127+
1. Check for commit hash changes of `src` submodule in `third_party/microsoft_dxheaders` (e.g. using GitHub https://github.com/chromium/chromium/tree/127.0.6533.72/third_party/microsoft_dxheaders) and adapt `downloads.ini` accordingly
128+
1. Check for version changes of windows rust crate (`third_party/rust/windows_x86_64_msvc/`) and adapt `downloads.ini` and `patches/ungoogled-chromium/windows\windows-fix-building-with-rust.patch` accordingly
127129
1. Use git to add changes and commit
128130

129131
### Update rust

build.py

+38-26
Original file line numberDiff line numberDiff line change
@@ -152,40 +152,41 @@ def main():
152152
downloads_cache.mkdir(parents=True, exist_ok=True)
153153
_make_tmp_paths()
154154

155-
# Get download metadata (DownloadInfo)
155+
# Extractors
156+
extractors = {
157+
ExtractorEnum.SEVENZIP: args.sevenz_path,
158+
ExtractorEnum.WINRAR: args.winrar_path,
159+
}
160+
161+
# Prepare source folder
156162
if args.tarball:
157-
download_info = downloads.DownloadInfo([
158-
_ROOT_DIR / 'downloads.ini',
159-
_ROOT_DIR / 'ungoogled-chromium' / 'downloads.ini',
160-
])
163+
# Download chromium tarball
164+
get_logger().info('Downloading chromium tarball...')
165+
download_info = downloads.DownloadInfo([_ROOT_DIR / 'ungoogled-chromium' / 'downloads.ini'])
166+
downloads.retrieve_downloads(download_info, downloads_cache, True, args.disable_ssl_verification)
167+
try:
168+
downloads.check_downloads(download_info, downloads_cache)
169+
except downloads.HashMismatchError as exc:
170+
get_logger().error('File checksum does not match: %s', exc)
171+
exit(1)
172+
173+
# Unpack chromium tarball
174+
get_logger().info('Unpacking chromium tarball...')
175+
downloads.unpack_downloads(download_info, downloads_cache, source_tree, extractors)
161176
else:
162-
download_info = downloads.DownloadInfo([
163-
_ROOT_DIR / 'downloads.ini',
164-
])
177+
# Clone sources
178+
subprocess.run([sys.executable, str(Path('ungoogled-chromium', 'utils', 'clone.py')), '-o', 'build\src', '-p', 'win32' if args.x86 else 'win64'], check=True)
165179

166-
# Retrieve downloads
180+
# Retrieve windows downloads
167181
get_logger().info('Downloading required files...')
168-
downloads.retrieve_downloads(download_info, downloads_cache, True,
169-
args.disable_ssl_verification)
182+
download_info_win = downloads.DownloadInfo([_ROOT_DIR / 'downloads.ini'])
183+
downloads.retrieve_downloads(download_info_win, downloads_cache, True, args.disable_ssl_verification)
170184
try:
171-
downloads.check_downloads(download_info, downloads_cache)
185+
downloads.check_downloads(download_info_win, downloads_cache)
172186
except downloads.HashMismatchError as exc:
173187
get_logger().error('File checksum does not match: %s', exc)
174188
exit(1)
175189

176-
# Prepare source folder
177-
if not args.tarball:
178-
# Clone sources
179-
subprocess.run([sys.executable, str(Path('ungoogled-chromium', 'utils', 'clone.py')), '-o', 'build\src', '-p', 'win32' if args.x86 else 'win64'], check=True)
180-
181-
# Unpack downloads
182-
extractors = {
183-
ExtractorEnum.SEVENZIP: args.sevenz_path,
184-
ExtractorEnum.WINRAR: args.winrar_path,
185-
}
186-
get_logger().info('Unpacking downloads...')
187-
downloads.unpack_downloads(download_info, downloads_cache, source_tree, extractors)
188-
189190
# Prune binaries
190191
pruning_list = (_ROOT_DIR / 'ungoogled-chromium' / 'pruning.list') if args.tarball else (_ROOT_DIR / 'pruning.list')
191192
unremovable_files = prune_binaries.prune_files(
@@ -196,6 +197,10 @@ def main():
196197
get_logger().error('Files could not be pruned: %s', unremovable_files)
197198
parser.exit(1)
198199

200+
# Unpack downloads
201+
get_logger().info('Unpacking downloads...')
202+
downloads.unpack_downloads(download_info_win, downloads_cache, source_tree, extractors)
203+
199204
# Apply patches
200205
# First, ungoogled-chromium-patches
201206
patches.apply_patches(
@@ -252,7 +257,7 @@ def main():
252257

253258
# Generate version file
254259
with open(RUST_FLAG_FILE, 'w') as f:
255-
f.write('rustc 1.79.0-nightly (ef8b9dcf2 2024-04-24)')
260+
f.write('rustc 1.80.0-nightly (faefc618c 2024-05-07)')
256261
f.write('\n')
257262

258263
if not args.ci or not (source_tree / 'out/Default').exists():
@@ -277,6 +282,13 @@ def main():
277282

278283
# Run gn gen
279284
_run_build_process('out\\Default\\gn.exe', 'gen', 'out\\Default', '--fail-on-unused-args')
285+
286+
if not args.ci or not os.path.exists('third_party\\rust-toolchain\\bin\\bindgen.exe'):
287+
# Build bindgen
288+
_run_build_process(
289+
sys.executable,
290+
'tools\\rust\\build_bindgen.py')
291+
280292
# Run ninja
281293
if args.ci:
282294
_run_build_process_timeout('third_party\\ninja\\ninja.exe', '-C', 'out\\Default', 'chrome',

0 commit comments

Comments
 (0)