Path: csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod From: Craig Small Newsgroups: linux.debian.maint.python Subject: Re: python3-mastodon fails CI due to bad magic? Date: Thu, 28 Jan 2021 21:40:01 +0100 Message-ID: References: X-Mailbox-Line: From debian-python-request@lists.debian.org Thu Jan 28 20:31:55 2021 Old-Return-Path: X-Amavis-Spam-Status: No, score=-4.408 tagged_above=-10000 required=5.3 tests=[BAYES_00=-2, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=2, LDO_WHITELIST=-5, RDNS_NONE=0.793] autolearn=no autolearn_force=no X-Policyd-Weight: using cached result; rate: -3.5 X-Greylist: delayed 35530 seconds by postgrey-1.36 at bendel; Thu, 28 Jan 2021 20:31:43 UTC Dkim-Signature: v=1; a=rsa-sha256; c=simple/simple; d=debian.org; s=debian1.csmall.user; t=1611865900; bh=cr2mXUDS4On5gjJfgGtNcCn/hdW2DCvrSLDh7dOKp7Y=; h=References:In-Reply-To:From:Date:Subject:To:From; b=SOil0uSOPgnKfNVEiWhDXf4ef9Aidr6ViZqbLv0FZ/gbbac3TRVEp5/AqbhoBda/4 hiS1+xGaz6CT4mHcafc/489e0eqn0c7DCVhHMuKoY+x8pOP8HCA5az6DQ1w0zXhS3d 5mmr09vwr2tnPwAr6bf319rdJFAu/qXoz2mARo2g= X-Gm-Message-State: AOAM530UaIyovuyXyBYHe7oUlhJF1NshC0CCSETdFnAAmPrrMCpg1nfm CwObAKtS3EKE6uXLVI6aXRcMPflwwGCl2UD/THh1lw== X-Google-SMTP-Source: ABdhPJyIeEvg26HRos3egvPZrTGwX4eseK8ihPE14OuMuN7u9CFjK2Jr0n1RTRAdM19UN84IuSCruWkOYnbdjY4H8wU= X-Received: by 2002:a05:6214:1322:: with SMTP id c2mr1346487qvv.50.1611865898068; Thu, 28 Jan 2021 12:31:38 -0800 (PST) MIME-Version: 1.0 X-Gmail-Original-Message-ID: Content-Type: multipart/alternative; boundary="00000000000047c31405b9fbc68f" X-Mailing-List: archive/latest/18931 List-ID: List-URL: List-Archive: https://lists.debian.org/msgid-search/CALy8Cw7izaBoaAeP2mnwMg--jAgZ=-hUa2bgjGnspLox0PWCUw@mail.gmail.com Approved: robomod@news.nic.it Lines: 175 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Date: Fri, 29 Jan 2021 07:31:26 +1100 X-Original-Message-ID: X-Original-References: Xref: csiph.com linux.debian.maint.python:13153 --00000000000047c31405b9fbc68f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I saw that too, and yet the logs have: import magic File "/usr/lib/python3/dist-packages/magic/__init__.py", line 361, in That's a python3-magic file, so it exists. However, a bit of googling showed up this [1] where due to the fact that python3-magic uses ctype.util.find.library if the environment is "strange" (e.g. in a snap) the load fails. Possibly the reprotest environment qualifies as "strange" and the load line is failing in an odd way? return ctypes.cdll.LoadLibrary(find_library('magic')) Anyone else use python3-magic and reprotest? Does it work and why? - Craig 1: https://bugs.launchpad.net/snapcraft/+bug/1861026 On Fri, 29 Jan 2021 at 03:08, Emmanuel Arias wrote: > Seems that reprotest on salsa, is not installing the python3-magic. > > I don't think that can be a problem with cpython. > > On Thu, Jan 28, 2021 at 8:39 AM H=C3=A5vard Flaget Aasen < > haavard_aasen@yahoo.no> wrote: > >> tor. 28. jan. 2021 kl. 10:48 skrev Craig Small : >> > >> > Hi, >> > I'm trying to understand why python3-mastodon fails the unit tests. >> >> I'm not sure what you found out so far. When I grepped the log you >> linked, I couldn't find python3-magic or libmagic. I believe the >> packages isn't installed and the test therefore fails. >> I'm guessing now, but I think this has to do with reproducible build in >> salsa. >> >> > >> > An example is at [1] and it seems that importing magic is enough to >> trigger it. The compat line is to handle both python3-magic and a libmag= ic >> module both wanting magic. >> > >> > Is this a cpython thing? I'm not sure what I can do to fix this. >> > >> > File >> "/tmp/reprotest.7a4W2G/build-experiment-1/build-experiment-1/.pybuild/cp= ython3_3.9_mastodon/build/mastodon/Mastodon.py", >> line 55, in >> > import magic >> > File "/usr/lib/python3/dist-packages/magic/__init__.py", line 361, i= n >> >> > add_compat(globals()) >> > File "/usr/lib/python3/dist-packages/magic/__init__.py", line 325, i= n >> add_compat >> > from magic import compat >> > File "/usr/lib/python3/dist-packages/magic/compat.py", line 61, in >> >> > _open =3D _libraries['magic'].magic_open >> > File "/usr/lib/python3.9/ctypes/__init__.py", line 387, in __getattr= __ >> > func =3D self.__getitem__(name) >> > File "/usr/lib/python3.9/ctypes/__init__.py", line 392, in __getitem= __ >> > func =3D self._FuncPtr((name_or_ordinal, self)) >> > AttributeError: python3.9: undefined symbol: magic_open >> > >> > >> > >> > >> > >> > 1: >> https://salsa.debian.org/python-team/packages/mastodon/-/jobs/1312190 >> > >> >> --00000000000047c31405b9fbc68f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I saw that too, and yet the logs have:
=C2=A0import=C2= =A0magic
=C2=A0 File "/usr/lib/pyth= on3/dist-packages/magic/__init__.py", = line 361, in <module>

That's a pytho= n3-magic file, so it exists.

However, a bit of goo= gling showed up this [1] where due to the fact that python3-magic uses ctyp= e.util.find.library if the environment is "strange" (e.g. in a sn= ap) the load fails.
Possibly the reprotest environment qualifies = as "strange" and the load line is failing in an odd way?

=C2=A0 =C2=A0return ctypes.cdll.LoadLibrary(find_library(&= #39;magic'))

Anyone else use python3-magic and reprot= est? Does it work and why?

=C2=A0- Craig



On Fri, 29 Jan 2021 at 03:08, Emmanuel Arias <eamanu@yaerobi.com> wrote:
Seems that reprote= st on salsa, is not installing the python3-magic.=C2=A0

= I don't think that can be a problem with cpython.

On Thu, Jan 28, = 2021 at 8:39 AM H=C3=A5vard Flaget Aasen <haavard_aasen@yahoo.no> wrote:
tor. 28. jan. 2021 kl. = 10:48 skrev Craig Small <csmall@debian.org>:
>
> Hi,
> I'm trying to understand why python3-mastodon fails the unit tests= .

I'm not sure what you found out so far. When I grepped the log you
linked, I=C2=A0 couldn't find python3-magic or libmagic. I believe the<= br> packages isn't installed and the test therefore fails.
I'm guessing now, but I think this has to do with reproducible build in= salsa.

>
> An example is at [1] and it seems that importing magic is enough to tr= igger it. The compat line is to handle both python3-magic and a libmagic mo= dule both wanting magic.
>
> Is this a cpython thing? I'm not sure what I can do to fix this. >
>=C2=A0 =C2=A0File "/tmp/reprotest.7a4W2G/build-experiment-1/build-= experiment-1/.pybuild/cpython3_3.9_mastodon/build/mastodon/Mastodon.py"= ;, line 55, in <module>
>=C2=A0 =C2=A0 =C2=A0import magic
>=C2=A0 =C2=A0File "/usr/lib/python3/dist-packages/magic/__init__.p= y", line 361, in <module>
>=C2=A0 =C2=A0 =C2=A0add_compat(globals())
>=C2=A0 =C2=A0File "/usr/lib/python3/dist-packages/magic/__init__.p= y", line 325, in add_compat
>=C2=A0 =C2=A0 =C2=A0from magic import compat
>=C2=A0 =C2=A0File "/usr/lib/python3/dist-packages/magic/compat.py&= quot;, line 61, in <module>
>=C2=A0 =C2=A0 =C2=A0_open =3D _libraries['magic'].magic_open >=C2=A0 =C2=A0File "/usr/lib/python3.9/ctypes/__init__.py", li= ne 387, in __getattr__
>=C2=A0 =C2=A0 =C2=A0func =3D self.__getitem__(name)
>=C2=A0 =C2=A0File "/usr/lib/python3.9/ctypes/__init__.py", li= ne 392, in __getitem__
>=C2=A0 =C2=A0 =C2=A0func =3D self._FuncPtr((name_or_ordinal, self))
> AttributeError: python3.9: undefined symbol: magic_open
>
>
>
>
>
> 1: https://salsa.debian.or= g/python-team/packages/mastodon/-/jobs/1312190
>

--00000000000047c31405b9fbc68f--