View previous topic :: View next topic |
Author |
Message |
Sinbiosis n00b
Joined: 03 Oct 2022 Posts: 30
|
Posted: Sun Jul 23, 2023 12:34 pm Post subject: [Solved] omegaconf can't generate parser for python3 |
|
|
I'm creating an ebuild for the omegaconf python module. The ebuild file currently looks like so:
Code: | # Copyright 2022-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
DISTUTILS_USE_PEP517=setuptools
PYTHON_COMPAT=( python3_{10..11} )
inherit distutils-r1
DESCRIPTION="Flexible Python configuration system. The last one you will ever need."
HOMEPAGE="
https://pypi.org/project/omegaconf
https://github.com/omry/omegaconf
"
SRC_URI="
https://github.com/omry/${PN}/archive/v${PV}.tar.gz
-> ${P}.gh.tar.gz
"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""
RDEPEND="
dev-python/mypy[${PYTHON_USEDEP}]
dev-python/pyyaml[${PYTHON_USEDEP}]
dev-python/antlr4-python3-runtime[${PYTHON_USEDEP}]
"
BDEPEND="
test? (
${RDEPEND}
)
"
distutils_enable_tests pytest |
When emerging the package, I get the following error:
Code: | user@host % sudo emerge -av --oneshot dev-python/omegaconf
....
2023-07-23 08:26:41,277 root INFO running antlr
2023-07-23 08:26:41,277 root INFO Generating parser for Python3: ['java', '-jar', '/var/tmp/portage/dev-python/omegaconf-2.3.0/work/omegaconf-2.3.0/build_helpers/bin/antlr-4.9.3-complete.jar', '-Dlanguage=Python3', '-o', '/var/tmp/portage/dev-python/omegaconf-2.3.0/work/omegaconf-2.3.0/omegaconf/grammar/gen', '-Xexact-output-dir', '-visitor', '/var/tmp/portage/dev-python/omegaconf-2.3.0/work/omegaconf-2.3.0/omegaconf/grammar/OmegaConfGrammarLexer.g4']
2023-07-23 08:26:41,280 root CRITICAL ===========================================================================
| Unable to generate parsers: [Errno 2] No such file or directory: 'java' |
===========================================================================
* ERROR: dev-python/omegaconf-2.3.0::localrepo failed (compile phase):
* Wheel build failed
*
* Call stack:
* ebuild.sh, line 136: Called src_compile
* environment, line 3827: Called distutils-r1_src_compile
* environment, line 1845: Called _distutils-r1_run_foreach_impl 'distutils-r1_python_compile'
* environment, line 745: Called python_foreach_impl 'distutils-r1_run_phase' 'distutils-r1_python_compile'
* environment, line 3447: Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
* environment, line 3002: Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_compile'
* environment, line 3000: Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'distutils-r1_python_compile'
* environment, line 1125: Called distutils-r1_run_phase 'distutils-r1_python_compile'
* environment, line 1827: Called distutils-r1_python_compile
* environment, line 1646: Called distutils_pep517_install '/var/tmp/portage/dev-python/omegaconf-2.3.0/work/omegaconf-2.3.0-python3_11/install'
* environment, line 2185: Called die
* The specific snippet of code:
* [[ -n ${wheel} ]] || die "No wheel name returned";
*
* If you need support, post the output of `emerge --info '=dev-python/omegaconf-2.3.0::localrepo'`,
* the complete build log and the output of `emerge -pqv '=dev-python/omegaconf-2.3.0::localrepo'`.
* The complete build log is located at '/var/tmp/portage/dev-python/omegaconf-2.3.0/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/dev-python/omegaconf-2.3.0/temp/environment'.
* Working directory: '/var/tmp/portage/dev-python/omegaconf-2.3.0/work/omegaconf-2.3.0'
* S: '/var/tmp/portage/dev-python/omegaconf-2.3.0/work/omegaconf-2.3.0'
>>> Failed to emerge dev-python/omegaconf-2.3.0, Log file:
.... |
The issue to me seems to be this line:
Code: | 2023-07-23 08:26:41,277 root INFO Generating parser for Python3: ['java', '-jar', '/var/tmp/portage/dev-python/omegaconf-2.3.0/work/omegaconf-2.3.0/build_helpers/bin/antlr-4.9.3-complete.jar', '-Dlanguage=Python3', '-o', '/var/tmp/portage/dev-python/omegaconf-2.3.0/work/omegaconf-2.3.0/omegaconf/grammar/gen', '-Xexact-output-dir', '-visitor', '/var/tmp/portage/dev-python/omegaconf-2.3.0/work/omegaconf-2.3.0/omegaconf/grammar/OmegaConfGrammarLexer.g4']
2023-07-23 08:26:41,280 root CRITICAL ===========================================================================
| Unable to generate parsers: [Errno 2] No such file or directory: 'java' | |
But what I can't tell is if this means I'm missing a dependency or if there is a deeper issue going on. Any help would be appreciated!
Last edited by Sinbiosis on Sun Jul 23, 2023 2:37 pm; edited 1 time in total |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 21743
|
Posted: Sun Jul 23, 2023 2:15 pm Post subject: |
|
|
The upstream build expects to run java as part of generating Python code. This seems weird. As a Python project, it would make more sense to use a Python script to generate their file.
You need to instruct Portage to install a JRE before building this. The upstream documentation is completely unhelpful on this point, as they just assume pip will magically handle everything. As a first try, I suggest adding virtual/jre to BDEPEND. This may not be sufficient, depending on what Java libraries they assume they can import. |
|
Back to top |
|
|
Sinbiosis n00b
Joined: 03 Oct 2022 Posts: 30
|
Posted: Sun Jul 23, 2023 2:36 pm Post subject: |
|
|
Hu wrote: | The upstream build expects to run java as part of generating Python code. This seems weird. As a Python project, it would make more sense to use a Python script to generate their file.
You need to instruct Portage to install a JRE before building this. The upstream documentation is completely unhelpful on this point, as they just assume pip will magically handle everything. As a first try, I suggest adding virtual/jre to BDEPEND. This may not be sufficient, depending on what Java libraries they assume they can import. |
Well it seems that was the solution. Thanks! |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|