Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[python-hydra-core] Fix antlr4 runtime version #223

Merged
merged 1 commit into from
Feb 22, 2023
Merged

[python-hydra-core] Fix antlr4 runtime version #223

merged 1 commit into from
Feb 22, 2023

Conversation

daskol
Copy link
Contributor

@daskol daskol commented Jan 28, 2023

Maybe, some auxiliary constrains on java runtime are needed in advance.

https://aur.archlinux.org/packages/python-hydra-core

@daskol
Copy link
Contributor Author

daskol commented Jan 31, 2023

@acxz Any feedback?

@YodaEmbedding
Copy link

YodaEmbedding commented Feb 6, 2023

Related issue: #212.

@YodaEmbedding
Copy link

YodaEmbedding commented Feb 6, 2023

Patched version doesn't build for me.

Output log
==> Starting prepare()...
/mnt/data/code/downloaded/arch/PKGBUILDs/python-hydra-core/src
patching file build_helpers/build_helpers.py
==> Starting build()...
* Getting build dependencies for wheel...
running egg_info
creating hydra_core.egg-info
writing hydra_core.egg-info/PKG-INFO
writing dependency_links to hydra_core.egg-info/dependency_links.txt
writing entry points to hydra_core.egg-info/entry_points.txt
writing requirements to hydra_core.egg-info/requires.txt
writing top-level names to hydra_core.egg-info/top_level.txt
writing manifest file 'hydra_core.egg-info/SOURCES.txt'
reading manifest file 'hydra_core.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
adding license file 'LICENSE'
writing manifest file 'hydra_core.egg-info/SOURCES.txt'
* Building wheel...
running bdist_wheel
running build
running build_py
running clean
Generating parsers with antlr4
running antlr
Generating parser for Python3: ['java', '-jar', '/usr/share/java/antlr-complete.jar', '-Dlanguage=Python3', '-o', '/mnt/data/code/downloaded/arch/PKGBUILDs/python-hydra-core/src/hydra-1.3.1/hydra/grammar/gen/', '-Xexact-output-dir', '-visitor', '/mnt/data/code/downloaded/arch/PKGBUILDs/python-hydra-core/src/hydra-1.3.1/hydra/grammar/OverrideLexer.g4']
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/antlr/v4/Tool has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
        at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
        at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:601)
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
    main()
  File "/usr/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 335, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
  File "/usr/lib/python3.10/site-packages/pyproject_hooks/_in_process/_in_process.py", line 251, in build_wheel
    return _build_backend().build_wheel(wheel_directory, config_settings,
  File "/usr/lib/python3.10/site-packages/setuptools/build_meta.py", line 413, in build_wheel
    return self._build_with_temp_dir(['bdist_wheel'], '.whl',
  File "/usr/lib/python3.10/site-packages/setuptools/build_meta.py", line 398, in _build_with_temp_dir
    self.run_setup()
  File "/usr/lib/python3.10/site-packages/setuptools/build_meta.py", line 484, in run_setup
    super(_BuildMetaLegacyBackend,
  File "/usr/lib/python3.10/site-packages/setuptools/build_meta.py", line 335, in run_setup
    exec(code, locals())
  File "<string>", line 26, in <module>
  File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 108, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.10/site-packages/setuptools/dist.py", line 1213, in run_command
    super().run_command(command)
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 325, in run
    self.run_command("build")
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.10/site-packages/setuptools/dist.py", line 1213, in run_command
    super().run_command(command)
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/command/build.py", line 132, in run
    self.run_command(cmd_name)
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.10/site-packages/setuptools/dist.py", line 1213, in run_command
    super().run_command(command)
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/mnt/data/code/downloaded/arch/PKGBUILDs/python-hydra-core/src/hydra-1.3.1/build_helpers/build_helpers.py", line 152, in run
    run_antlr(self)
  File "/mnt/data/code/downloaded/arch/PKGBUILDs/python-hydra-core/src/hydra-1.3.1/build_helpers/build_helpers.py", line 137, in run_antlr
    cmd.run_command("antlr")
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/usr/lib/python3.10/site-packages/setuptools/dist.py", line 1213, in run_command
    super().run_command(command)
  File "/usr/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/mnt/data/code/downloaded/arch/PKGBUILDs/python-hydra-core/src/hydra-1.3.1/build_helpers/build_helpers.py", line 199, in run
    subprocess.check_call(command)
  File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['java', '-jar', '/usr/share/java/antlr-complete.jar', '-Dlanguage=Python3', '-o', '/mnt/data/code/downloaded/arch/PKGBUILDs/python-hydra-core/src/hydra-1.3.1/hydra/grammar/gen/', '-Xexact-output-dir', '-visitor', '/mnt/data/code/downloaded/arch/PKGBUILDs/python-hydra-core/src/hydra-1.3.1/hydra/grammar/OverrideLexer.g4']' returned non-zero exit status 1.

Also, prepare() should probably have cd "${srcdir}".

@daskol
Copy link
Contributor Author

daskol commented Feb 6, 2023

Exception in thread "main" java.lang.UnsupportedClassVersionError: org/antlr/v4/Tool has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0

@YodaEmbedding Update java or set default one with archlinux-java as this message says.

Also, prepare() should probably have cd "${srcdir}".

Absolutely no. Patch is applied in src directory.

BTW It seems that we need to make an orphan request.

@acxz acxz changed the title Fix antlr4 runtime version [python-hydra-core] Fix antlr4 runtime version Feb 22, 2023
@acxz
Copy link
Owner

acxz commented Feb 22, 2023

For now, since it seems like many people want this, I'll merge this in. I'd like a proper upstream issue and PR before I close the associated issue.

@acxz acxz merged commit 9040b99 into acxz:master Feb 22, 2023
@daskol daskol deleted the fix/python-hydra-core branch February 22, 2023 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants