[Buildroot] [Help] Struggling to build external python package on out of tree build

Arnout Vandecappelle arnout at mind.be
Thu Feb 23 19:39:18 UTC 2023



On 23/02/2023 10:13, Alberto Fahrenkrog wrote:
> Hi all, I'm slowly getting ahead with this, and I still have a few more questions...
> 
> I'm trying to get a tar.gz file from a git repo, which needs authentication. The 
> command that works manually is:
> /wget https://outwebsite.com/koala/archive/release1.2.3.tar.gz --header 
> 'Authorization: token MY_TOKEN'/
> /
> /
> And the .mk file is configured as:
> PYTHON_KOALA_SITE_METHOD = wget
> PYTHON_KOALA_DL_OPTS = --header 'Authorization: token MY_TOKEN'

  Since commit 3f2bdd0701de4f2bca7e6d96f96972e7bcabdd93 (by Yann, in Cc), it is 
necessary to twice-quote the arguments to wget (and wget only). So

PYTHON_KOALA_DL_OPTS = --header "'Authorization: token MY_TOKEN'"

  Yann, I honestly don't understand why this eval is needed, instead of simply 
passing BR2_HG unquoted... But I didn't look too deeply into it.

  Regards,
  Arnout


> PYTHON_KOALA_SITE = https://outwebsite.com/koala/archive/ 
> <https://outwebsite.com/koala/archive/>
> 
> The .mk file is being read correctly, but I can't figure out how to use DL_OPTS. 
> The manual says DL_OPTS is a space separated list, but i see wget tries to use 
> "token" or "MY_TOKEN" as the address. I tried a few different combinations of 
> inverted commas, but none worked.
> 
> Thanks again,
> 
> Alberto
> /
> /
> /
> /
> Alberto​ Fahrenkrog	
> 
> 	Senior Embedded Engineer
> 
> Orica ‑ Perth Technology Centre
> 
> p: +61 (0) 8 6365 4056
> 
> e: *Alberto.Fahrenkrog at rigtechnologies.com.au* 
> <mailto:Alberto.Fahrenkrog at rigtechnologies.com.au>
> 
> --------------------------------------------------------------------------------
> *From:* Alberto Fahrenkrog <Alberto.Fahrenkrog at rigtechnologies.com.au>
> *Sent:* Thursday, February 23, 2023 3:13 PM
> *To:* buildroot at buildroot.org <buildroot at buildroot.org>
> *Subject:* Re: [Buildroot] [Help] Struggling to build external python package on 
> out of tree build
> Ok, I see now that external.mk is explained in chapter 9. I jumped straight to 
> chapter 18 and missed external.mk completely. And for some reason I never found 
> external.mk on my google searches.
> 
> Thanks all for your help!
> 
> Cheers,
> 
> Alberto
> --------------------------------------------------------------------------------
> *From:* buildroot <buildroot-bounces at buildroot.org> on behalf of Alberto 
> Fahrenkrog <Alberto.Fahrenkrog at rigtechnologies.com.au>
> *Sent:* Thursday, February 23, 2023 3:09 PM
> *To:* buildroot at buildroot.org <buildroot at buildroot.org>
> *Subject:* Re: [Buildroot] [Help] Struggling to build external python package on 
> out of tree build
> 	
> You don't often get email from alberto.fahrenkrog at rigtechnologies.com.au. Learn 
> why this is important <https://aka.ms/LearnAboutSenderIdentification>
> 	
> 
> Hi Andreas,
> 
> Thank you so much! That did it! Where in the manual is external.mk explained? I 
> missed it for sure...
> 
> Cheers,
> 
> Alberto
> Alberto​ Fahrenkrog 	
> 
> 	Senior Embedded Engineer
> 
> Orica ‑ Perth Technology Centre
> 
> p: +61 (0) 8 6365 4056
> 
> e: *Alberto.Fahrenkrog at rigtechnologies.com.au* 
> <mailto:Alberto.Fahrenkrog at rigtechnologies.com.au>
> 
> --------------------------------------------------------------------------------
> *From:* buildroot <buildroot-bounces at buildroot.org> on behalf of Andreas Ziegler 
> <br015 at umbiko.net>
> *Sent:* Thursday, February 23, 2023 2:49 PM
> *To:* Alberto Fahrenkrog <Alberto.Fahrenkrog at rigtechnologies.com.au>
> *Cc:* buildroot at buildroot.org <buildroot at buildroot.org>
> *Subject:* Re: [Buildroot] [Help] Struggling to build external python package on 
> out of tree build
> [You don't often get email from br015 at umbiko.net. Learn why this is important at 
> https://aka.ms/LearnAboutSenderIdentification 
> <https://aka.ms/LearnAboutSenderIdentification> ]
> 
> Hi Alberto,
> 
> On 2023-02-23 04:47, Alberto Fahrenkrog wrote:
>> Update,
>>
>> if I change  $(eval $(python-koala)) to $(eval $(python-package)) I
>> still get the same error. I assume that might have been one mistake.
>>
>> Cheers,
>>
>> Alberto
>>
>> Alberto Fahrenkrog Senior Embedded Engineer
>> Orica - Perth Technology Centre
>> p: +61 (0) 8 6365 4056
>> e: Alberto.Fahrenkrog at rigtechnologies.com.au
>> ________________________________
>> From: buildroot <buildroot-bounces at buildroot.org> on behalf of Alberto
>> Fahrenkrog <Alberto.Fahrenkrog at rigtechnologies.com.au>
>> Sent: Thursday, February 23, 2023 12:42 PM
>> To: buildroot at buildroot.org <buildroot at buildroot.org>
>> Subject: [Buildroot] [Help] Struggling to build external python package
>> on out of tree build
>>
>> You don't often get email from
>> alberto.fahrenkrog at rigtechnologies.com.au. Learn why this is
>> important<https://aka.ms/LearnAboutSenderIdentification 
> <https://aka.ms/LearnAboutSenderIdentification>>
>> Hello all,
>>
>> I'm trying to build a very simple custom python package following the
>> instructions on the manual, yet I must be doing something very wrong as
>> I get this result:
>>
>> $ make python-koala
>> make[1]: *** No rule to make target 'python-koala'.  Stop.
>> make: *** [Makefile:23: _all] Error 2
>>
>> I create my out of tree build with:
>> make -C ~/opt/buildroot-2021.02/ BR2_EXTERNAL=~/Projects/br_build
>> O=~/Projects/br_build BR2_DL_DIR=~/Projects/br_build/downloads
>> br_build_defconfig
>>
>> On my "br_build" folder I have a Config.in file:
>> menu "Python-Libs"
>>     source "~/Projects/br_build/package/python-koala/Config.in"
>> endmenu
> 
> Similar to the include file for configs, you also need an external.mk
> file for the project make files, with this content:
> 
>     include $(sort $(wildcard ~/Projects/br_build/package/*/*.mk))
> 
> Otherwise your .mk files will not be picked up.
> 
>> In "br_build/packages/python-koala/Config.in"
> 
> The package directory is usually named 'package', not sure if this is
> relevant (but Config.in /external.mk have to match it).
> 
>> config BR2_PACKAGE_PYTHON_KOALA
>> ??????bool "python-koala"
>>   depends on BR2_PACKAGE_PYTHON3
>> ??????help
>> ??????  Python implementation of Koala Library
>>
>> In "br_build/packages/python-koala/python-koala.mk"
>> ################################################################################
>> #
>> # python-koala
>> #
>> ################################################################################
>>
>> PYTHON_KOALA_VERSION = 1.3.3
>> PYTHON_KOALA_SOURCE = $(PYTHON_KOALA_VERSION).tar.gz
>> PYTHON_KOALA_SITE =
>> https://mywebsite.com.au/ExternalCode/koala/archive/ 
> <https://mywebsite.com.au/ExternalCode/koala/archive/>
>> PYTHON_KOALA_SETUP_TYPE = setuptools
>>
>> $(eval $(python-koala))
>>
>> If I run "make menuconfig" I can select or deselect the package, and
>> it's selected per default on the br_build_defconfig (and in .config):
>> BR2_PACKAGE_PYTHON_KOALA=y
>>
>> But if I try to run "make python-koala" I get the "no target" error.
>> I'll still have a read and see what I might be doing wrong, but I'm
>> very confused. Any ideas are very welcome.
>>
>> Cheers,
>>
>> Alberto
> 
> <cut>
> 
> Kind regards,
> Andreas
> _______________________________________________
> buildroot mailing list
> buildroot at buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot 
> <https://lists.buildroot.org/mailman/listinfo/buildroot>
> 
> _______________________________________________
> buildroot mailing list
> buildroot at buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot



More information about the buildroot mailing list