public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: "Tim Orling" <timothy.t.orling@linux.intel.com>
To: Richard Purdie <richard.purdie@linuxfoundation.org>,
	Andre McCurdy <armccurdy@gmail.com>
Cc: Tim Orling <ticotimo@gmail.com>,
	OE Core mailing list <openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [PATCH 1/4] scripts/install-buildtools: improvements
Date: Fri, 3 Apr 2020 16:22:20 -0700	[thread overview]
Message-ID: <CA7CE9BB-3AFE-40B8-B1A6-22BBB43A23F5@linux.intel.com> (raw)
In-Reply-To: <9bd493e6c0a4117b04e636bc0f3200e84ab30cbd.camel@linuxfoundation.org>

[-- Attachment #1: Type: text/plain, Size: 3130 bytes --]



> On Apr 1, 2020, at 3:16 PM, Richard Purdie <richard.purdie@linuxfoundation.org> wrote:
> 
> On Wed, 2020-04-01 at 15:09 -0700, Andre McCurdy wrote:
>> On Wed, Apr 1, 2020 at 3:02 PM Tim Orling <ticotimo@gmail.com> wrote:
>>> On Wed, Apr 1, 2020 at 2:32 PM Tim Orling via
>>> lists.openembedded.org <ticotimo=gmail.com@lists.openembedded.org>
>>> wrote:
>>>> On Wed, Apr 1, 2020 at 1:09 PM Andre McCurdy <armccurdy@gmail.com
>>>>> wrote:
>>>>> It looks like there are some assumptions about the minimum
>>>>> version of
>>>>> python3 on the host in order to even be able to run
>>>>> install-buildtools. Should that be checked explicitly?
>>>> 
>>>> To be honest, everything was written on CentOS-7, where ‘python3’
>>>> is now python36.
>>>> 
>>>> The remaining supported holdout for 3.4 is Debian-8 (Jessie).
>>>> Which also happens to have tar 1.27. At least it has git 2.1.4,
>>>> so it’s not a complete mess.
>>>> 
>>>> Python 3.4 is already EOL. We should not support it for the
>>>> complete build system, but I can see that the install-buildtools
>>>> script should ideally still run on python34. The whole point is
>>>> to make it easier to install the pre-built buildtools.
>>> 
>>> Python 3.5 is now required in bitbake/lib/bb/__init__.py
>>> Which is needed for bb.utils.md5sum_file and sha256_file to check
>>> the checksum of the download. I’d rather not have to rewrite those
>>> functions.
>> 
>> Looks like copy and pasting ~30 lines? Maybe not even much of a net
>> increase in code size if you can remove the existing code to check
>> that bitbake libs are available...
>> 
>> def _hasher(method, filename):
>>    import mmap
>> 
>>    with open(filename, "rb") as f:
>>        try:
>>            with mmap.mmap(f.fileno(), 0, access=mmap.ACCESS_READ) as
>> mm:
>>                for chunk in iter(lambda: mm.read(8192), b''):
>>                    method.update(chunk)
>>        except ValueError:
>>            # You can't mmap() an empty file so silence this
>> exception
>>            pass
>>    return method.hexdigest()
>> 
>> def md5_file(filename):
>>    """
>>    Return the hex string representation of the MD5 checksum of
>> filename.
>>    """
>>    import hashlib
>>    return _hasher(hashlib.md5(), filename)
>> 
>> def sha256_file(filename):
>>    """
>>    Return the hex string representation of the 256-bit SHA checksum
>> of
>>    filename.
>>    """
>>    import hashlib
>>    return _hasher(hashlib.sha256(), filename)
> 
> Can you send a patch against master-next please? The buildtools
> installer is one place we probably do want to support older pythons and
> it shouldn't be too onnerous.
> 

Submitted. The check for whether the install worked or not was the hardest part.
After many iterations, I just could not get subprocess.Popen to work as expected on python 3.4.
https://patchwork.openembedded.org/patch/171593/ <https://patchwork.openembedded.org/patch/171593/>

Thank you Andre for the testing and input. It takes a village to make a good release.

> Cheers,
> 
> Richard
> 
> 


[-- Attachment #2: Type: text/html, Size: 5397 bytes --]

      reply	other threads:[~2020-04-03 23:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-30 19:42 [PATCH 1/4] scripts/install-buildtools: improvements Tim Orling
2020-03-30 19:43 ` [PATCH 2/4] oe-buildenv-internal: python 3.5 as min version Tim Orling
2020-03-30 19:43 ` [PATCH 3/4] sanity.bbclass: recommend using install-buildtools Tim Orling
2020-03-30 19:52   ` [OE-core] " Andre McCurdy
2020-03-30 19:43 ` [PATCH 4/4] sanity.bbclass: add test for gcc < 5.0 Tim Orling
2020-03-30 19:52   ` [OE-core] " Richard Purdie
2020-04-01 20:09 ` [OE-core] [PATCH 1/4] scripts/install-buildtools: improvements Andre McCurdy
2020-04-01 21:31   ` Tim Orling
     [not found]   ` <1601CF873C42565A.6346@lists.openembedded.org>
2020-04-01 22:02     ` Tim Orling
2020-04-01 22:09       ` Andre McCurdy
2020-04-01 22:16         ` Richard Purdie
2020-04-03 23:22           ` Tim Orling [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CA7CE9BB-3AFE-40B8-B1A6-22BBB43A23F5@linux.intel.com \
    --to=timothy.t.orling@linux.intel.com \
    --cc=armccurdy@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    --cc=ticotimo@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox