[Buildroot] Missing dependencies

James Hilliard james.hilliard1 at gmail.com
Mon Jul 17 23:42:09 UTC 2023


On Mon, Jul 17, 2023 at 9:48 AM Andreas <andreasembbuild at gmail.com> wrote:
>
> Hi Arnout,
>
> Thanks for the quick response. I am indeed still on python 3.10.6 here. I think upgrading might be a major exercise. It requires more than just changing the version in packages/python3.mk doesn't it? Do I need to have the same python version also on the host system? I am currently running buildroot on a Ubuntu 22.04 VM.

You should just update buildroot itself, newer versions use python
3.11 so updating
buildroot will pull that in along with any required changes. What
version of buildroot
are you actually using right now? The installed version of python on
your build host
system shouldn't matter as buildroot will build a separate
host-python3 for cross
compilation.

>
>
> Am Mo., 17. Juli 2023 um 17:19 Uhr schrieb Arnout Vandecappelle <arnout at mind.be>:
>>
>>
>>
>> On 17/07/2023 16:10, Andreas wrote:
>> > Hi,
>> >
>> > I am new to buildroot and I am trying to build the package
>> > python-hatchling-1.18.0. However it fails with the following message:
>> >
>> > * Getting dependencies for wheel...
>> >
>> > ERROR Missing dependencies:
>> > tomli>=1.2.2; python_version < '3.11'
>>
>>   That's really weird... This line means that it depends on tomli, but only for
>> Python-3.10 or lower. Since we're using Python 3.11.4, this dependency shouldn't
>> trigger at all... You're not using an old Buildroot version that still uses
>> 3.10, are you?
>>
>>
>> > make: *** [package/pkg-generic.mk:293 <http://pkg-generic.mk:293>:
>> > /buildroot/output/build/python-hatchling-1.18.0/.stamp_built] Error 1
>> >
>> > The python-hatchling.mk <http://python-hatchling.mk> file looks as follows:
>> > ################################################################################
>> > #
>> > # python-hatchling
>> > #
>> > ################################################################################
>> >
>> > PYTHON_HATCHLING_VERSION = 1.18.0
>>
>>   Erm, python-hatchling was added to Buildroot in commit
>> 626c5bedaa7e1461dd3747562b9c04dd40713c83, in 2022.11. Have you tried just
>> updating the existing package (and sending the patch upstream to us, of course)?
>>
>>   We only have a host package for it, because it's a pep517 so normally not
>> useful on the target. Why do you need the target package?
>
>
> Let me double check but you might be correct that I do not need it on the target.

Yeah, it doesn't really make sense to have a target python-hatchling package in
buildroot from my understanding.

Why are you trying to add this package? Is it a dependency for a
different package
you are trying to add or something?

>>
>>
>> > PYTHON_HATCHLING_SOURCE = hatchling-$(PYTHON_HATCHLING_VERSION).tar.gz
>> > PYTHON_HATCHLING_SITE =
>> > https://files.pythonhosted.org/packages/e3/57/87da2c5adc173950ebe9f1acce4d5f2cd0a960783992fd4879a899a0b637
>> > PYTHON_HATCHLING_SETUP_TYPE = pep517
>> > PYTHON_HATCHLING_LICENSE = MIT
>> > PYTHON_HATCHLING_LICENSE_FILES = LICENSE.txt
>> >
>> > PYTHON_HATCHLING_DEPENDENCIES = \
>> > python-tomli \
>>
>>   I think the problem is that pep517 checks for the presence of tomli in the
>> _host_ directory. So you'd need to add a dependency on host-python-tomli here.
>> James is more aware of these things so I put him in Cc.
>
>
> I will first try to add the host dependency as you suggested below and see what happens.

I thought our pep517 infrastructure prior to updating to python 3.11 would pull
in host-python-tomli automatically(due to it being a host-python-flit dependency
prior to python 3.11). I'm not sure how you could be getting a missing
tomli error
like this in the first place as we didn't remove host-python-tomli
from our pep517
infrastructure dependency tree prior to python being updated to version 3.11.

>
>>
>>
>> > python-editables \
>> > python-packaging \
>> > python-pathspec \
>> > python-pluggy \
>> > python-trove-classifiers
>> > HOST_PYTHON_HATCHLING_DEPENDENCIES = \
>> > host-python-tomli \
>> > host-python-editables \
>> > host-python-packaging \
>> > host-python-pathspec \
>> > host-python-pluggy \
>> > host-python-trove-classifiers
>> >
>> > $(eval $(python-package))
>> > $(eval $(host-python-package))
>> >
>> > I do have a python-tomli.mk <http://python-tomli.mk> file therefore I am
>> > confused why I am seeing this error. If I remove the tomli dependency from the
>> > pyproject.toml file in hatchling (in output/build/python-hatchling-1.18.0)
>> > manually it continoues the build.
>> >
>> > dependencies = [
>> >    "editables>=0.3",
>> >    "packaging>=21.3",
>> >    "pathspec>=0.10.1",
>> >    "pluggy>=1.0.0",
>> >    "tomli>=1.2.2; python_version < '3.11'",
>> >    "trove-classifiers",
>> > ]
>> >
>> > My impression is that my current buildroot setup has a problem to properly
>> > interpret the line ` "tomli>=1.2.2; python_version < '3.11'"` maybe because of
>> > an outdated package that I am not aware of.
>>
>>   I think this way of expressing version-dependent dependencies is already
>> pretty old, and certainly predates the pep517 infrastructure in Buildroot, so
>> I'd be surprised if this were the case.
>
>
> Well that is how the dependency is defined in hatchling defined it (see here https://github.com/pypa/hatch/blob/master/backend/pyproject.toml)

Yeah, it should work fine, we didn't have to add a host-python-tomli dependency
when I added host-python-hatchling.

https://github.com/buildroot/buildroot/commit/626c5bedaa7e1461dd3747562b9c04dd40713c83

>
>>
>>   Regards,
>>   Arnout
>>
>> > Any idea how to address this issue
>> > and how to debug such an error in buildroot in future? I already checked the
>> > manual, especially the section for python packages.
>> >
>> > Regards,
>> > Andreas
>> >
>> >
>> > _______________________________________________
>> > buildroot mailing list
>> > buildroot at buildroot.org
>> > https://lists.buildroot.org/mailman/listinfo/buildroot



More information about the buildroot mailing list