4389 Build - NoUsableRevError

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

4389 Build - NoUsableRevError

Postby leeroy » Fri Feb 26, 2021 5:19 pm

When trying to perform a build of 4389 we receive an error about `NoUsableRevError`

Code: Select all
cd c:\code\
python3 automate\automate-git.py --download-dir=c:\code\chromium_git --depot-tools-dir=c:\code\depot_tools --branch=$env:CEF_BRANCH --force-clean --force-build --x64-build

Code: Select all
*** - 8. Build CEF.
Cloning into 'c:\code\chromium_git\cef'...



Note: switching to 'origin/4389'.



You are in 'detached HEAD' state. You can look around, make experimental

changes and commit them, and you can discard any commits you make in this

state without impacting any branches by switching back to a branch.



If you want to create a new branch to retain commits you create, you may

do so (now or later) by using -c with the switch command. Example:



  git switch -c <new-branch-name>



Or undo this operation with:



  git switch -



Turn off this advice by setting config variable advice.detachedHead to false



HEAD is now at c1f90d8c9 Linux: cefclient: Fix GTK expectations with OSR multi-threaded-message-loop (fixes issue #3087)



Previous HEAD position was 8a2e6a7a ninjalog_uploader_wrapper: do not use binary read/write for json

HEAD is now at 1f976d6f Roll out new goma client binary VERSION=214



From https://chromium.googlesource.com/chromium/src

   c7b4beed2c39..010d8b1618a2  lkgr                   -> origin/lkgr

   e77d9b00d485..5c32ef22b100  master                 -> origin/master

   d2cc8cc201c3..04286a9e3e74  refs/branch-heads/4430 -> branch-heads/4430



From https://chromium.googlesource.com/chromium/src

   3215a98c5d8e..7d1addbd25b1  lkgr-android-internal -> origin/lkgr-android-internal

 * [new tag]                   90.0.4430.4           -> 90.0.4430.4



[0:01:01] Still working on:

[0:01:01]   src



src/third_party/ots/src (ERROR)

----------------------------------------

[0:01:01] Started.

From https://chromium.googlesource.com/chromium/src

[0:01:17]    f7ceee3bc8db..5667d97ed753  lkgr-ios-internal -> origin/lkgr-ios-internal

[0:01:17]    5c32ef22b100..f141c3dead02  master            -> origin/master

----------------------------------------

Traceback (most recent call last):

  File "c:\code\depot_tools\gclient_scm.py", line 878, in revert

    deps_revision = self.GetUsableRev(deps_revision, options)

  File "c:\code\depot_tools\gclient_scm.py", line 938, in GetUsableRev

    raise NoUsableRevError(

gclient_scm.NoUsableRevError: 83> Hash ee537ac096667eed6559124164c3e8482646fd77 does not appear to be a valid hash in this repo.



During handling of the above exception, another exception occurred:



Traceback (most recent call last):

  File "c:\code\depot_tools\metrics.py", line 267, in print_notice_and_exit

    yield

  File "c:\code\depot_tools\gclient.py", line 3199, in <module>

    sys.exit(main(sys.argv[1:]))

  File "c:\code\depot_tools\gclient.py", line 3185, in main

    return dispatcher.execute(OptionParser(), argv)

  File "c:\code\depot_tools\subcommand.py", line 252, in execute

    return command(parser, args[1:])

  File "c:\code\depot_tools\gclient.py", line 2821, in CMDrevert

    return client.RunOnDeps('revert', args)

  File "c:\code\depot_tools\gclient.py", line 1779, in RunOnDeps

    work_queue.flush(revision_overrides, command, args, options=self._options,

  File "c:\code\depot_tools\gclient_utils.py", line 968, in flush

    reraise(e[0], e[1], e[2])

  File "c:\code\depot_tools\gclient_utils.py", line 67, in reraise

    raise value

  File "c:\code\depot_tools\gclient_utils.py", line 1045, in run

    self.item.run(*self.args, **self.kwargs)

  File "c:\code\depot_tools\gclient.py", line 925, in run

    self._got_revision = self._used_scm.RunCommand(command, options, args,

  File "c:\code\depot_tools\gclient_scm.py", line 132, in RunCommand

    return getattr(self, command)(options, args, file_list)

  File "c:\code\depot_tools\gclient_scm.py", line 884, in revert

    e.message)

AttributeError: 'NoUsableRevError' object has no attribute 'message'



--> Download Directory: c:\code\chromium_git

--> Depot Tools Directory: c:\code\depot_tools

--> Updating depot_tools

-------- Running "update_depot_tools.bat" in "c:\code\depot_tools"...

--> Removing directory c:\code\chromium_git\cef

--> CEF Branch: 4389

--> CEF URL: https://bitbucket.org/chromiumembedded/cef.git

--> CEF Source Directory: c:\code\chromium_git\cef

-------- Running "c:\code\depot_tools\git.bat clone https://bitbucket.org/chromiumembedded/cef.git c:\code\chromium_git\cef" in "c:\code\chromium_git"...

-------- Running "c:\code\depot_tools\git.bat rev-parse HEAD" in "c:\code\chromium_git\cef"...

-------- Running "c:\code\depot_tools\git.bat rev-parse origin/4389" in "c:\code\chromium_git\cef"...

--> CEF Current Checkout: 8f5fdc1f9adb0aa81f9db4c3f0d74d08d554ccc5

--> CEF Desired Checkout: c1f90d8c933dce163b74971707dbd79f00f18219 (origin/4389)

-------- Running "c:\code\depot_tools\git.bat checkout --force origin/4389" in "c:\code\chromium_git\cef"...

--> Reading c:\code\chromium_git\cef\CHROMIUM_BUILD_COMPATIBILITY.txt

-------- Running "c:\code\depot_tools\git.bat checkout --force 1f976d6f30" in "c:\code\depot_tools"...

--> CEF Output Directory: c:\code\chromium_git\out_4389

-------- Running "c:\code\depot_tools\git.bat config --get remote.origin.url" in "c:\code\chromium_git\chromium\src"...

--> Chromium URL: https://chromium.googlesource.com/chromium/src.git

-------- Running "c:\code\depot_tools\git.bat fetch" in "c:\code\chromium_git\chromium\src"...

-------- Running "c:\code\depot_tools\git.bat fetch --tags" in "c:\code\chromium_git\chromium\src"...

-------- Running "c:\code\depot_tools\git.bat rev-parse HEAD" in "c:\code\chromium_git\chromium\src"...

-------- Running "c:\code\depot_tools\git.bat rev-parse refs/tags/89.0.4389.40" in "c:\code\chromium_git\chromium\src"...

--> Chromium Current Checkout: 2c3400a2b467aa3cf67b4942740db29e60feecb8

--> Chromium Desired Checkout: 2c3400a2b467aa3cf67b4942740db29e60feecb8 (refs/tags/89.0.4389.40)

--> Removing directory c:\code\chromium_git\chromium\src\cef

--> Removing directory c:\code\chromium_git\chromium\src\out

-------- Running "gclient revert --nohooks" in "c:\code\chromium_git\chromium"...

Traceback (most recent call last):

  File "automate\automate-git.py", line 1367, in <module>

    run("gclient revert --nohooks", chromium_dir, depot_tools_dir)

  File "automate\automate-git.py", line 69, in run

    return subprocess.check_call(

  File "c:\code\depot_tools\bootstrap-3_8_0_chromium_8_bin\python3\bin\lib\subprocess.py", line 364, in check_call

    raise CalledProcessError(retcode, cmd)

subprocess.CalledProcessError: Command '['gclient', 'revert', '--nohooks']' returned non-zero exit status 1.


I believe this relates to the following issues, but I'm not following the fix?
viewtopic.php?f=6&t=18217&p=48226&hilit=gclient_scm.NoUsableRevError#p48226
viewtopic.php?f=6&t=18217&p=48218&hilit=gclient_scm.NoUsableRevError#p48218

Any help is much appreciated!
Thanks,
Lee
leeroy
Expert
 
Posts: 103
Joined: Mon Jan 06, 2020 6:27 pm

Re: 4389 Build - NoUsableRevError

Postby leeroy » Mon Mar 01, 2021 6:38 pm

I did also try copying "chromium_git\cef" to "chromium_git\chromium\src\cef" and still no dice.
leeroy
Expert
 
Posts: 103
Joined: Mon Jan 06, 2020 6:27 pm

Re: 4389 Build - NoUsableRevError

Postby leeroy » Tue Mar 02, 2021 12:04 am

At the time of writing the depot tools rev number 1f976d6f30 seems to have an issue with CEF branch 4389 and removing the warning from gclient_scm.py revert seems to address the issue.:

Code: Select all
def revert(self, options, _args, file_list):
    """Reverts local modifications.

    All reverted files will be appended to file_list.
    """
    if not os.path.isdir(self.checkout_path):
      # revert won't work if the directory doesn't exist. It needs to
      # checkout instead.
      self.Print('_____ %s is missing, syncing instead' % self.relpath)
      # Don't reuse the args.
      return self.update(options, [], file_list)

    default_rev = "refs/heads/master"
    if options.upstream:
      if self._GetCurrentBranch():
        upstream_branch = scm.GIT.GetUpstreamBranch(self.checkout_path)
        default_rev = upstream_branch or default_rev
    _, deps_revision = gclient_utils.SplitUrlRevision(self.url)
    if not deps_revision:
      deps_revision = default_rev
    if deps_revision.startswith('refs/heads/'):
      deps_revision = deps_revision.replace('refs/heads/', self.remote + '/')
    try:
      deps_revision = self.GetUsableRev(deps_revision, options)
    except NoUsableRevError as e:
      # If the DEPS entry's url and hash changed, try to update the origin.
      # See also http://crbug.com/520067.
      logging.warning(
          "Couldn't find usable revision, will retrying to update instead: %s",
          e.message)
      return self.update(options, [], file_list)

    if file_list is not None:
      files = self._GetDiffFilenames(deps_revision)

    self._Scrub(deps_revision, options)
    self._Run(['clean', '-f', '-d'], options)

    if file_list is not None:
      file_list.extend([os.path.join(self.checkout_path, f) for f in files])


$before = @"
.*?logging.warning\(
.*?"Couldn't find usable revision, will retrying to update instead: %s",
.*?e.message\)
"@

$after = @"
# logging.warning(
# "Couldn't find usable revision, will retrying to update instead: %s",
# e.message)
"@

(Get-Content -Path C:\code\depot_tools\gclient_scm.py -Raw) -replace $before, $after | Set-Content -Path "C:\code\depot_tools\gclient_scm.py"

I imagine this may eventually clear itself up, as I don't know that we want to do this long term, but seems to address the issue for us. I also don't have access to the CR listed around this line to see the details for this decision...
leeroy
Expert
 
Posts: 103
Joined: Mon Jan 06, 2020 6:27 pm

Re: 4389 Build - NoUsableRevError

Postby leeroy » Tue Mar 02, 2021 2:55 am

Also add the flag "--no-depot-tools-update" to any usage of automate-git.py else your changes get nuked.
leeroy
Expert
 
Posts: 103
Joined: Mon Jan 06, 2020 6:27 pm


Return to Support Forum

Who is online

Users browsing this forum: No registered users and 19 guests