Package Details: git-review 2.4.0-3

Git Clone URL: https://aur.archlinux.org/git-review.git (read-only, click to copy)
Package Base: git-review
Description: Tool to submit code to Gerrit
Upstream URL: https://opendev.org/opendev/git-review
Licenses: Apache
Submitter: arojas
Maintainer: mistersmee
Last Packager: mistersmee
Votes: 6
Popularity: 0.39
First Submitted: 2022-04-01 17:30 (UTC)
Last Updated: 2024-04-27 19:28 (UTC)

Latest Comments

« First ‹ Previous 1 2

mistersmee commented on 2022-07-17 10:37 (UTC)

@aleskva I was able to build without python-wheel, so I don't think it's required, but I could add it, I guess.

aleskva commented on 2022-07-02 22:08 (UTC)

@mistersmee I've found out that it needs python-wheel. After I installed it and run makepkg again, it worked. Maybe you should add it to the makedepends?

mistersmee commented on 2022-06-17 14:04 (UTC)

@aleskva Unable to reproduce. The package builds, installs and runs fine for me, albeit with a WARNING: Tests failed after the check() section, which I'm assuming is expected and normal, since it was present even when I wasn't the maintainer, and the package is working even with some tests failing.

aleskva commented on 2022-06-16 21:30 (UTC)

Still failing to build. After the check() section, which takes hours and fails, build also fails complaining something about wheels.

peter.kehl commented on 2022-04-16 19:27 (UTC)

The most recent update keeps failing: https://pastebin.com/F3175Xjm

d34dh0r53 commented on 2022-04-14 17:17 (UTC)

I should also note, that while I haven't tested this I think downgrading to Java < 17 will also fix the issue. From what I've read Java 17 added some stricter bounds checking that the Gerrit version we're using isn't compliant with.

d34dh0r53 commented on 2022-04-14 17:14 (UTC)

So here is a patch file that will allow the AUR to install correctly, if I get some time later I'll try to do a PR:

--- git-review/git_review/tests/__init__.py     2019-03-18 09:37:27.000000000 -0500
+++ src/git-review-1.28.0/git_review/tests/__init__.py  2022-04-14 11:43:53.035058572 -0500
@@ -159,15 +159,21 @@
         print("Creating a new golden site of version " + GOLDEN_SITE_VER)

         # initialize Gerrit
-        utils.run_cmd('java', '-jar', self.gerrit_war,
+        utils.run_cmd('java', '--add-opens', 'java.base/java.lang=ALL-UNNAMED',
+                      '--add-opens', 'java.base/java.net=ALL-UNNAMED',
+                      '-jar', self.gerrit_war,
                       'init', '-d', self.gsite_dir,
                       '--batch', '--no-auto-start', '--install-plugin',
                       'download-commands')
-        utils.run_cmd('java', '-jar', self.gerrit_war, 'reindex',
+
+        utils.run_cmd('java', '--add-opens', 'java.base/java.lang=ALL-UNNAMED',
+                      '--add-opens', 'java.base/java.net=ALL-UNNAMED',
+                      '-jar', self.gerrit_war, 'reindex',
                       '-d', self.gsite_dir)

         with open(golden_ver_file, 'w') as f:
             f.write(GOLDEN_SITE_VER)
+        utils.run_cmd("sed", "-i", "s/su - $GERRIT_USER -s//", self._dir("gsite", "bin", "gerrit.sh"))

         # create SSH public key
         key_file = self._dir('gsite', 'test_ssh_key')
@@ -185,7 +191,9 @@
         INSERT INTO ACCOUNT_SSH_KEYS (SSH_PUBLIC_KEY, VALID) \
             VALUES ('%s', 'Y')""" % pub_key.decode()

-        utils.run_cmd('java', '-jar',
+        utils.run_cmd('java', '--add-opens', 'java.base/java.lang=ALL-UNNAMED',
+                      '--add-opens', 'java.base/java.net=ALL-UNNAMED',
+                      '-jar',
                       self._dir('gsite', 'bin', 'gerrit.war'),
                       'gsql', '-d', self.gsite_dir, '-c', sql_query)

I added this file as java_args.patch in the PKGBUILD directory and modified it as follows:

diff --git a/PKGBUILD b/PKGBUILD
index ae7fb72..aa44535 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -14,16 +14,20 @@ depends=('git' 'python-requests')
 makedepends=('python-pbr')
 checkdepends=('java-runtime=11' 'libcups' 'openssh' 'procps-ng' 'python-stestr' 'python-mock')
 source=("$pkgname-$pkgver.tar.gz::https://opendev.org/opendev/git-review/archive/$pkgver.tar.gz"
-        https://tarballs.openstack.org/ci/gerrit/gerrit-v2.11.4.13.cb9800e.war)
+        https://tarballs.openstack.org/ci/gerrit/gerrit-v2.11.4.13.cb9800e.war
+        java_args.patch)
 sha512sums=('6ff078377fdfaf7c6663222fa05d354bcab3fe64e34f9f0662f41c809ca077e83f1ea8a8f14d893424c5d1430ab3facb246acdf91a2e7c46a286e6fb0c77166f'
-            '764388dc0ee381e2f05f5aaef9fc4156b4659a329eaf815ad7beb0b2a924a8d171444b8824ea9aad6b8aa7a3cc0b60bf8daa9d483298e6226cb692ea1caafa7f')
+            '764388dc0ee381e2f05f5aaef9fc4156b4659a329eaf815ad7beb0b2a924a8d171444b8824ea9aad6b8aa7a3cc0b60bf8daa9d483298e6226cb692ea1caafa7f'
+            '0b349c28a8e47341359043e600a3b2ca20f1d43f2c080b58c5f494a72ee99010c3e46acb924911f61308de8a3959bb9897073ee37dff53cfc19f210fd5fe6b12')

 prepare() {
   export PBR_VERSION=$pkgver
+  mv $pkgname $pkgname-$pkgver
   mkdir -p $pkgname-$pkgver/.gerrit
   cp gerrit-v2.11.4.13.cb9800e.war $pkgname-$pkgver/.gerrit/

   cd $pkgname-$pkgver
+  patch --forward --strip=1 --input="${srcdir}/java_args.patch"

   # Remove the su - part
   sed -i '/f.write(GOLDEN_SITE_VER)/a \        utils.run_cmd("sed", "-i", "s/su - $GERRIT_USER -s//", self._dir("gsite", "bin", "gerrit.sh"))' git_review/tests/__init__.py

I also filed a bug with the git-review project on Storyboard 0 and I'll patch this upstream which is the ultimate fix.

Hope this helps /Dave

d34dh0r53 commented on 2022-04-14 15:45 (UTC)

This is a patch for the first error:

diff --git a/PKGBUILD b/PKGBUILD
index ae7fb72..439d572 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -20,6 +20,7 @@ sha512sums=('6ff078377fdfaf7c6663222fa05d354bcab3fe64e34f9f0662f41c809ca077e83f1

 prepare() {
   export PBR_VERSION=$pkgver
+  mv $pkgname $pkgname-$pkgver
   mkdir -p $pkgname-$pkgver/.gerrit
   cp gerrit-v2.11.4.13.cb9800e.war $pkgname-$pkgver/.gerrit/

I'm looking into the Java error but I'm by no means well versed.

milianw commented on 2022-04-13 12:01 (UTC) (edited on 2022-04-13 12:01 (UTC) by milianw)

The issue seems to be that the PKGBUILD tries to use a versioned folder name (git-review-1.28.0) but the actual code is in the unversioned folder called git-review.

but even fixing that in the PKGBUILD doesn't seem to help, as I then get this:

Installing git-review script to /home/milian/.cache/pikaur/build/git-review/src/git-review-1.28.0/tmp_install/usr/bin
Creating a new golden site of version 4
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/milian/.cache/pikaur/build/git-review/src/git-review-1.28.0/git_review/tests/prepare.py", line 26, in <module>
    main()
  File "/home/milian/.cache/pikaur/build/git-review/src/git-review-1.28.0/git_review/tests/prepare.py", line 23, in main
    helpers.init_gerrit()
  File "/home/milian/.cache/pikaur/build/git-review/src/git-review-1.28.0/git_review/tests/__init__.py", line 162, in init_gerrit
    utils.run_cmd('java', '-jar', self.gerrit_war,
  File "/home/milian/.cache/pikaur/build/git-review/src/git-review-1.28.0/git_review/tests/utils.py", line 48, in run_cmd
    raise Exception(
Exception: Error occurred while processing the command:
java -jar /home/milian/.cache/pikaur/build/git-review/src/git-review-1.28.0/.gerrit/gerrit-v2.11.4.13.cb9800e.war init -d /home/milian/.cache/pikaur/build/git-review/src/git-review-1.28.0/.gerrit/golden_site --batch --no-auto-start --install-plugin download-commands.
Stdout: Exception in thread "main" com.google.common.util.concurrent.ExecutionError: java.lang.ExceptionInInitializerError
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2201)
        at com.google.common.cache.LocalCache.get(LocalCache.java:3937)
        at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:3941)
        at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:4824)
        at com.google.common.cache.LocalCache$LocalLoadingCache.getUnchecked(LocalCache.java:4830)
        at com.google.inject.internal.FailableCache.get(FailableCache.java:48)
        at com.google.inject.internal.ConstructorInjectorStore.get(ConstructorInjectorStore.java:50)
        at com.google.inject.internal.ConstructorBindingImpl.initialize(ConstructorBindingImpl.java:136)
        at com.google.inject.internal.InjectorImpl.initializeBinding(InjectorImpl.java:533)
        at com.google.inject.internal.AbstractBindingProcessor$Processor$1.run(AbstractBindingProcessor.java:160)
        at com.google.inject.internal.ProcessedBindingData.initializeBindings(ProcessedBindingData.java:44)
        at com.google.inject.internal.InternalInjectorCreator.initializeStatically(InternalInjectorCreator.java:123)
        at com.google.inject.internal.InternalInjectorCreator.build(InternalInjectorCreator.java:107)
        at com.google.inject.Guice.createInjector(Guice.java:96)
        at com.google.inject.Guice.createInjector(Guice.java:73)
        at com.google.inject.Guice.createInjector(Guice.java:62)
        at com.google.gerrit.server.config.GerritServerConfigModule.getSecureStoreFromGerritConfig(GerritServerConfigModule.java:54)
        at com.google.gerrit.server.config.GerritServerConfigModule.getSecureStoreClassName(GerritServerConfigModule.java:39)
        at com.google.gerrit.pgm.util.SiteProgram.getConfiguredSecureStoreClass(SiteProgram.java:186)
        at com.google.gerrit.pgm.init.BaseInit.createSiteInit(BaseInit.java:214)
        at com.google.gerrit.pgm.init.BaseInit.run(BaseInit.java:106)
        at com.google.gerrit.pgm.util.AbstractProgram.main(AbstractProgram.java:64)
        at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
        at java.base/java.lang.reflect.Method.invoke(Method.java:577)
        at com.google.gerrit.launcher.GerritLauncher.invokeProgram(GerritLauncher.java:166)
        at com.google.gerrit.launcher.GerritLauncher.mainImpl(GerritLauncher.java:93)
        at com.google.gerrit.launcher.GerritLauncher.main(GerritLauncher.java:50)
        at Main.main(Main.java:25)
Caused by: java.lang.ExceptionInInitializerError
        at com.google.inject.internal.cglib.reflect.$FastClassEmitter.<init>(FastClassEmitter.java:67)
        at com.google.inject.internal.cglib.reflect.$FastClass$Generator.generateClass(FastClass.java:72)
        at com.google.inject.internal.cglib.core.$DefaultGeneratorStrategy.generate(DefaultGeneratorStrategy.java:25)
        at com.google.inject.internal.cglib.core.$AbstractClassGenerator.create(AbstractClassGenerator.java:216)
        at com.google.inject.internal.cglib.reflect.$FastClass$Generator.create(FastClass.java:64)
        at com.google.inject.internal.BytecodeGen.newFastClass(BytecodeGen.java:204)
        at com.google.inject.internal.DefaultConstructionProxyFactory.create(DefaultConstructionProxyFactory.java:54)
        at com.google.inject.internal.ProxyFactory.create(ProxyFactory.java:159)
        at com.google.inject.internal.ConstructorInjectorStore.createConstructor(ConstructorInjectorStore.java:90)
        at com.google.inject.internal.ConstructorInjectorStore.access$000(ConstructorInjectorStore.java:29)
        at com.google.inject.internal.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:37)
        at com.google.inject.internal.ConstructorInjectorStore$1.create(ConstructorInjectorStore.java:33)
        at com.google.inject.internal.FailableCache$1.load(FailableCache.java:37)
        at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3527)
        at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2319)
        at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2282)
        at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2197)
        ... 27 more
Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make protected final java.lang.Class java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain) throws java.lang.ClassFormatError accessible: module java.base does not "opens java.lang" to unnamed module @7ce3cb8e
        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)
        at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
        at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:200)
        at java.base/java.lang.reflect.Method.setAccessible(Method.java:194)
        at com.google.inject.internal.cglib.core.$ReflectUtils$2.run(ReflectUtils.java:56)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:318)
        at com.google.inject.internal.cglib.core.$ReflectUtils.<clinit>(ReflectUtils.java:46)
        ... 44 more
Stderr: None

grandchild commented on 2022-04-12 12:01 (UTC)

Latest version fails to build:

==> Starting prepare()...
sed: can't read git_review/tests/__init__.py: No such file or directory
==> ERROR: A failure occurred in prepare().