Skip to content

Commit

Permalink
Try to fix sourcebuild
Browse files Browse the repository at this point in the history
For some reason, `git fetch` neglects to do its duty properly -
it checks out the tags but not the commits.

It seemed to work when calling `git fetch` manually a second time, so
just try that as a shot in the dark.
  • Loading branch information
mara004 committed Jan 20, 2024
1 parent 2e84994 commit 3b4ef4b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions setupsrc/pypdfium2_setup/build_pdfium.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ def dl_pdfium(GClient, do_update, revision):
# TODO consider passing -D ?
run_cmd([GClient, "sync", "--revision", f"origin/{revision}", "--no-history", "--shallow"], cwd=SBDir)
# quick & dirty fix to make a versioned commit available (pdfium gets tagged frequently, so this should be more than enough in practice)
# FIXME avoid static number of commits, check out exactly up to latest versioned commit
# FIXME want to avoid static number of commits, and instead check out exactly up to latest versioned commit
run_cmd(["git", "fetch", "--depth=100"], cwd=PDFiumDir)
run_cmd(["git", "fetch", "--depth=100"], cwd=PDFiumDir)

return is_sync
Expand Down Expand Up @@ -136,7 +137,7 @@ def _walk_refs(log):

def identify_pdfium():
# we didn't manage to get git describe working reliably with chromium's branch heads and the awkward state the repo's in, so emulate git describe on our own
# FIXME avoid static number of commits - need a better way to determine latest version and commit count diff
# FIXME want to avoid static number of commits - need a better way to determine latest version and commit count diff
log = run_cmd(["git", "log", "-100", "--pretty=%D"], cwd=PDFiumDir, capture=True)
v_short, n_commits = _walk_refs(log)
if n_commits:
Expand Down

0 comments on commit 3b4ef4b

Please sign in to comment.