Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #13667 > unrolled thread

platform.machine() on salsa i386 build?

Started byOle Streicher <olebole@debian.org>
First post2021-10-30 14:50 +0200
Last post2021-10-30 21:50 +0200
Articles 6 — 5 participants

Back to article view | Back to linux.debian.maint.python


Contents

  platform.machine() on salsa i386 build? Ole Streicher <olebole@debian.org> - 2021-10-30 14:50 +0200
    Re: platform.machine() on salsa i386 build? Andrey Rahmatullin <wrar@debian.org> - 2021-10-30 20:50 +0200
      Re: platform.machine() on salsa i386 build? Thomas Goirand <zigo@debian.org> - 2021-10-31 02:20 +0200
    Re: platform.machine() on salsa i386 build? Nilesh Patra <nilesh@nileshpatra.info> - 2021-10-30 21:30 +0200
      Re: platform.machine() on salsa i386 build? Ole Streicher <olebole@debian.org> - 2021-10-30 23:40 +0200
    Re: platform.machine() on salsa i386 build? Stefano Rivera <stefanor@debian.org> - 2021-10-30 21:50 +0200

#13667 — platform.machine() on salsa i386 build?

FromOle Streicher <olebole@debian.org>
Date2021-10-30 14:50 +0200
Subjectplatform.machine() on salsa i386 build?
Message-ID<DdVY6-22h-9@gated-at.bofh.it>
Hi,

I have a package (pyraf) where I need to switch off some tests for i386
(but not for other 32-bit platforms). I do this by

import platform
is_i386 = platform.machine() in ('i386', 'i486', 'i586', 'i686')

[...]
@pytest.mark.skipif(is_i386, reason='diff is not identical on i386')
 def test_gki_single_prow():

https://salsa.debian.org/debian-astro-team/pyraf/-/blob/master/debian/patches/Skip-tests-that-are-too-tight-for-i386.patch

However, on Salsa this fails; and it appears that this test is
ignored. Further investigation gave me that there -- during the regular
(pybuild) test -- platform.machine() gives "x86_64", despite of the
32-bit platform.

https://salsa.debian.org/debian-astro-team/pyraf/-/jobs/2130878#L2062

How can one find out the correct machine here?

Best regards

Ole

[toc] | [next] | [standalone]


#13668

FromAndrey Rahmatullin <wrar@debian.org>
Date2021-10-30 20:50 +0200
Message-ID<De1Au-5Jz-1@gated-at.bofh.it>
In reply to#13667

[Multipart message — attachments visible in raw view] — view raw

On Sat, Oct 30, 2021 at 02:20:40PM +0200, Ole Streicher wrote:
> I have a package (pyraf) where I need to switch off some tests for i386
> (but not for other 32-bit platforms). I do this by
> 
> import platform
> is_i386 = platform.machine() in ('i386', 'i486', 'i586', 'i686')
Yup, this is incorrect. This is the same as `uname -m` and so returns the
kernel architecture.
If you want to do this purely at the upstream side without checking
DEB_HOST_ARCH, AFAIK there is no 100% reliable way to do this.
Please read
https://docs.python.org/3/library/platform.html#platform.architecture for
further ideas and caveats.


-- 
WBR, wRAR

[toc] | [prev] | [next] | [standalone]


#13673

FromThomas Goirand <zigo@debian.org>
Date2021-10-31 02:20 +0200
Message-ID<De6JQ-Jb-5@gated-at.bofh.it>
In reply to#13668
On 10/30/21 8:43 PM, Andrey Rahmatullin wrote:
> On Sat, Oct 30, 2021 at 02:20:40PM +0200, Ole Streicher wrote:
>> I have a package (pyraf) where I need to switch off some tests for i386
>> (but not for other 32-bit platforms). I do this by
>>
>> import platform
>> is_i386 = platform.machine() in ('i386', 'i486', 'i586', 'i686')
> Yup, this is incorrect. This is the same as `uname -m` and so returns the
> kernel architecture.
> If you want to do this purely at the upstream side without checking
> DEB_HOST_ARCH, AFAIK there is no 100% reliable way to do this.

I would also advise to use DEB_HOST_ARCH... Maybe with some fallbacks if
you wish to upstream it?

Cheers,

Thomas Goirand (zigo)

[toc] | [prev] | [next] | [standalone]


#13669

FromNilesh Patra <nilesh@nileshpatra.info>
Date2021-10-30 21:30 +0200
Message-ID<De2db-6gj-9@gated-at.bofh.it>
In reply to#13667

[Multipart message — attachments visible in raw view] — view raw

Hi Ole,

On 10/30/21 5:50 PM, Ole Streicher wrote:
> Hi,
> https://salsa.debian.org/debian-astro-team/pyraf/-/jobs/2130878#L2062
> 
> How can one find out the correct machine here?

I just committed something to salsa -- sort of a hack, but it works (i386 pipeline passes). I do this
for one of my other package as well. Please consider taking a look.

Nilesh




[toc] | [prev] | [next] | [standalone]


#13672

FromOle Streicher <olebole@debian.org>
Date2021-10-30 23:40 +0200
Message-ID<De4f0-7xK-17@gated-at.bofh.it>
In reply to#13669
Hi Nilesh, Andrey,

Nilesh Patra <nilesh@nileshpatra.info> writes:
> On 10/30/21 5:50 PM, Ole Streicher wrote:
>> Hi,
>> https://salsa.debian.org/debian-astro-team/pyraf/-/jobs/2130878#L2062
>> How can one find out the correct machine here?
>
> I just committed something to salsa -- sort of a hack, but it works
> (i386 pipeline passes). I do this
> for one of my other package as well. Please consider taking a look.

Thank you, but I think I will not use it: This requires dpkg-dev (which
is the package with dpkg-architecture) being installed, which I would
not like to depend on just to have the possibility to test.

I will rather follow Stefanos hint to use sys.implementation._multiarch,
which is however hackish as well, since variables starting with "_"
should not considered as part of the API, and this may break without
warning.

Optimal would be a way to detect whether the internal floating point
processing happens with 80 bit FPU registers (i386) or 64 bit FPU
registers (other systems), since this is the relevant difference here.

Best regards

Ole

[toc] | [prev] | [next] | [standalone]


#13670

FromStefano Rivera <stefanor@debian.org>
Date2021-10-30 21:50 +0200
Message-ID<De2wy-6pp-3@gated-at.bofh.it>
In reply to#13667
Hi Ole (2021.10.30_12:20:40_+0000)
> How can one find out the correct machine here?

sys.implementation._multiarch will return the Debian multiarch tuple
that python was built for.

SR

-- 
Stefano Rivera
  http://tumbleweed.org.za/
  +1 415 683 3272

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.maint.python


csiph-web