Bug 242176 - [GLib] Tools/glib/apply-build-revision-to-files.py fails on Git worktrees
Summary: [GLib] Tools/glib/apply-build-revision-to-files.py fails on Git worktrees
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Local Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Adrian Perez
URL:
Keywords: InRadar
Depends on:
Blocks: 242191
  Show dependency treegraph
 
Reported: 2022-06-30 04:43 PDT by Adrian Perez
Modified: 2022-06-30 07:48 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adrian Perez 2022-06-30 04:43:15 PDT
When used from a Git worktree, after a fresh clone from the GitHub repository,
it tries to fall back to using Subversion for guessing the revision; but we
do not use Subversion anymore:

Traceback (most recent call last):
  File "/app/webkit/Tools/glib/apply-build-revision-to-files.py", line 106, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/app/webkit/Tools/glib/apply-build-revision-to-files.py", line 78, in main
    build_revision = get_build_revision()
  File "/app/webkit/Tools/glib/apply-build-revision-to-files.py", line 73, in get_build_revision
    revision = "r%s" % subprocess.check_output(("svnversion"), stderr=devnull).decode('utf-8').strip()
  File "/usr/lib/python3.9/subprocess.py", line 424, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.9/subprocess.py", line 505, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'svnversion'
Comment 1 Adrian Perez 2022-06-30 04:44:55 PDT
This happens because in a worktree the “.git” path is NOT a directory,
but instead a regular text file which contains the path of the actual
repository location:

  % cat .git
  gitdir: /home/aperez/devel/WebKit/.git/worktrees/WebKit-2.36

(This is how worktrees manage to share blobs, refs, branches and all
with their “parent” repository and be more disk-space efficient.)
Comment 2 Adrian Perez 2022-06-30 04:52:47 PDT
Pull request: https://github.com/WebKit/WebKit/pull/1942
Comment 3 EWS 2022-06-30 05:37:32 PDT
Committed 251991@main (56353fd580f3): <https://commits.webkit.org/251991@main>

Reviewed commits have been landed. Closing PR #1942 and removing active labels.
Comment 4 Radar WebKit Bug Importer 2022-06-30 05:38:13 PDT
<rdar://problem/96212219>