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

sourcebuild: allow for syncing existing repositories #23

Closed
mara004 opened this issue Dec 8, 2021 · 0 comments
Closed

sourcebuild: allow for syncing existing repositories #23

mara004 opened this issue Dec 8, 2021 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@mara004
Copy link
Member

mara004 commented Dec 8, 2021

If we are building from source and the repositories of DepotTools and PDFium are already present from previous runs, the current behaviour is to do nothing and re-use the existing repository as-is.
It would make sense if our build script could automate syncing/updating the repository. However, I think this should be opt-in to allow for building a custom version of PDFium, and to prevent inadvertent loss of unstaged changes.

The update strategy for the PDFium repository could either be done manually:

# clean up uncommitted changes (i. e. patches from the previous build)
run_cmd(f"git reset --hard HEAD", cwd=PDFiumDir)

# the `build/` directory contains an independent git repository, so reset that, too
run_cmd(f"git reset --hard HEAD", cwd=join(PDFiumDir,'build'))

# remove the `resources.rc` file that is not affected by `git reset`
os.remove(join(PDFiumDir,'resources.rc'))

# sync
run_cmd("gclient sync --no-history --shallow", cwd=WorkDir)

Or probably a lot easier with gclient:

run_cmd("gclient revert", cwd=WorkDir)
run_cmd("gclient sync", cwd=WorkDir)  # not sure whether revert already includes a sync
@mara004 mara004 added the enhancement New feature or request label Dec 8, 2021
@mara004 mara004 self-assigned this Dec 8, 2021
@mara004 mara004 closed this as completed in 6515466 Dec 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant