Skip to contentSkip to conversation

New: python-argon2_cffi no longer works

Buildroot [email protected] 1 participant 5 messages Mar 30, 2022 – Apr 3, 2022

lore
Share & tools
lore
#0 lore raw

https://bugs.busybox.net/show_bug.cgi?id=14721

Bug ID: 14721
Summary: python-argon2_cffi no longer works
Product: buildroot
Version: unspecified
Hardware: All
OS: Linux
Status: NEW
Severity: normal
Priority: P5
Component: Other
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Target Milestone: ---

Created attachment 9256
--> https://bugs.busybox.net/attachment.cgi?id=9256&action=edit
Snippet of the build log concerning argon2-cffi and argon2-cffi-bindings

Commit
https://github.com/buildroot/buildroot/commit/e2957f5ce743cfaf4fb3aaa98d619e83e8e6989e
breaks the argon2-cffi Python package for my ARM target (Beaglebone Black).

The installation of the argon2-cffi Python package somehow got broken with the version bump. Just before that commit, I get (via serial terminal):

# python -c 'help("modules")' | grep argon2
__future__          argon2              gzip                selectors
# python -c 'from argon2 import PasswordHasher;
print(PasswordHasher().hash("cor
rect horse battery staple"));'
$argon2id$v=19$m=102400,t=2,p=8$qHc/evoNvfGlp98pE26Ayw$tZWcHYjxFTKDUoaSysapPA

And just after that commit, I get:

# python -c 'help("modules")' | grep argon2
_argon2_cffi_bindings ast                 hmac                shutil

Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'argon2'

argon2-cffi is the only Python package I have enabled via menu xconfig for this test.

I've attached a snippet of the build log concerning argon2-cffi and argon2-cffi-bindings.

Signature · 6 lines
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

[Buildroot] [Bug 14721] python-argon2_cffi no longer works

https://bugs.busybox.net/show_bug.cgi?id=14721

--- Comment #1 from Emile Cormier <[email protected]> --- TL;DR: The new Python flit setup infrastructure seems to be deploying to the wrong destination directory.

-----

I see now that argon2-cffi now uses the new flit setup type. The argon2-cffi package now gets installed under

    /lib/python3.10/site-packages/argon2

whereas it used to be installed under

    /usr/lib/python3.10/site-packages

Here's the output of 'python -m site' on my BeagleBone Black device:

sys.path = [

    '/lib/python3.10/site-packages/argon2',
    '/usr/lib/python310.zip',
    '/usr/lib/python3.10',
    '/usr/lib/python3.10/lib-dynload',
    '/usr/lib/python3.10/site-packages',

]
USER_BASE: '/root/.local' (doesn't exist)
USER_SITE: '/root/.local/lib/python3.10/site-packages' (doesn't exist)
ENABLE_USER_SITE: True

If I add /lib/python3.10/site-packages to the "real" system-wide site-packages via:

    echo "/lib/python3.10/site-packages" >

/usr/lib/python3.10/site-packages/extra.pth

then argon2 now appears in

    python -c 'help("modules")'

and the following test command works!

    # python -c 'from argon2 import PasswordHasher;
print(PasswordHasher().hash("correct horse battery staple"));'

$argon2id$v=19$m=65536,t=3,p=4$CZO2H3qcZr/Vp9w0qVpLxA$eAz24Ry+cvSdRTJaPYDcf9HTc/Zyq/PmoFkFFPcQHm0

Signature · 6 lines
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

[Buildroot] [Bug 14721] python-argon2_cffi no longer works

In reply to [email protected]

https://bugs.busybox.net/show_bug.cgi?id=14721

--- Comment #2 from Emile Cormier <[email protected]> --- I've tracked it down to package/pkg-python.mk using

/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages

instead of

/usr/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages

Submitted a patch via the mailing list:
https://lists.buildroot.org/pipermail/buildroot/2022-March/639798.html

I can import and use the argon2 module in a Python program with those changes.

Signature · 6 lines
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

[Buildroot] [Bug 14721] python-argon2_cffi no longer works

In reply to [email protected]

https://bugs.busybox.net/show_bug.cgi?id=14721

Yann E. MORIN <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Yann E. MORIN <[email protected]> --- Emile, All,

Thans for your bug report. We believe this has now been fixed with commit 5bea8c9521b3 (package/pkg-python.mk: fix PEP517 paths).

Regards,
Yann E. MORIN.

Signature · 6 lines
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw

[Buildroot] [Bug 14721] python-argon2_cffi no longer works

In reply to [email protected]

https://bugs.busybox.net/show_bug.cgi?id=14721

--- Comment #4 from Emile Cormier <[email protected]> --- I confirm that the PasswordHasher test works for me with the latest master.

Signature · 6 lines
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot