Skip to content

Commit

Permalink
- Fix incorrect GN version being used when using the clone script
Browse files Browse the repository at this point in the history
  • Loading branch information
teeminus committed Aug 2, 2024
1 parent de4ed8c commit c92d5c4
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,24 @@ def main():
# Clone sources
subprocess.run([sys.executable, str(Path('ungoogled-chromium', 'utils', 'clone.py')), '-o', 'build\src', '-p', 'win32' if args.x86 else 'win64'], check=True)

# Setup GN
get_logger().info('Setting up GN...')
gnpath = source_tree / 'uc_staging' / 'gn_win'
gnpath.mkdir(parents=True, exist_ok=True)
subprocess.run(['git', 'clone', "https://gn.googlesource.com/gn", str(gnpath)], check=True)
subprocess.run(['git', 'reset', '--hard', 'b2afae122eeb6ce09c52d63f67dc53fc517dbdc8'], cwd=gnpath, check=True)
subprocess.run(['git', 'clean', '-ffdx'], cwd=gnpath, check=True)
subprocess.run([sys.executable, str(gnpath / 'build' / 'gen.py')], check=True)
for item in gnpath.iterdir():
if not item.is_dir():
shutil.copy(item, source_tree / 'tools' / 'gn')
elif item.name != '.git' and item.name != 'out':
shutil.copytree(item, source_tree / 'tools' / 'gn' / item.name, dirs_exist_ok=True)
last_commit_position = source_tree / 'tools' / 'gn' / 'bootstrap' / 'last_commit_position.h'
if last_commit_position.exists():
last_commit_position.unlink()
shutil.move(str(gnpath / 'out' / 'last_commit_position.h'), str(last_commit_position))

# Retrieve windows downloads
get_logger().info('Downloading required files...')
download_info_win = downloads.DownloadInfo([_ROOT_DIR / 'downloads.ini'])
Expand Down

0 comments on commit c92d5c4

Please sign in to comment.