From 3b4ef4b3466bd900595002a4a76001246191ee47 Mon Sep 17 00:00:00 2001 From: geisserml Date: Sat, 20 Jan 2024 16:19:01 +0100 Subject: [PATCH] Try to fix sourcebuild 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. --- setupsrc/pypdfium2_setup/build_pdfium.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/setupsrc/pypdfium2_setup/build_pdfium.py b/setupsrc/pypdfium2_setup/build_pdfium.py index 042f5e226..2bce8b153 100755 --- a/setupsrc/pypdfium2_setup/build_pdfium.py +++ b/setupsrc/pypdfium2_setup/build_pdfium.py @@ -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 @@ -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: