Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building of onepassword sdk binary wheel #131

Open
matejsp opened this issue Oct 25, 2024 · 4 comments
Open

Building of onepassword sdk binary wheel #131

matejsp opened this issue Oct 25, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@matejsp
Copy link

matejsp commented Oct 25, 2024

Scenario & Reproduction Steps

We build wheels ourself due to security concerns on linux. And then pass it over to auditwheel.
Auditwheel checks if there are any binary libraries that needs to be fixed.

Actual Behavior

* Creating venv isolated environment...

* Installing packages in isolated environment... (setuptools >= 40.8.0)

* Getting build dependencies for sdist...

running egg_info

creating src/onepassword_sdk.egg-info

writing src/onepassword_sdk.egg-info/PKG-INFO

writing dependency_links to src/onepassword_sdk.egg-info/dependency_links.txt

writing requirements to src/onepassword_sdk.egg-info/requires.txt

writing top-level names to src/onepassword_sdk.egg-info/top_level.txt

writing manifest file 'src/onepassword_sdk.egg-info/SOURCES.txt'

reading manifest file 'src/onepassword_sdk.egg-info/SOURCES.txt'

reading manifest template 'MANIFEST.in'

writing manifest file 'src/onepassword_sdk.egg-info/SOURCES.txt'

* Building sdist...

running sdist

running egg_info

writing src/onepassword_sdk.egg-info/PKG-INFO

writing dependency_links to src/onepassword_sdk.egg-info/dependency_links.txt

writing requirements to src/onepassword_sdk.egg-info/requires.txt

writing top-level names to src/onepassword_sdk.egg-info/top_level.txt

reading manifest file 'src/onepassword_sdk.egg-info/SOURCES.txt'

reading manifest template 'MANIFEST.in'

writing manifest file 'src/onepassword_sdk.egg-info/SOURCES.txt'

running check

creating onepassword_sdk-0.1.3

creating onepassword_sdk-0.1.3/src/onepassword

creating onepassword_sdk-0.1.3/src/onepassword/lib/x86_64

creating onepassword_sdk-0.1.3/src/onepassword_sdk.egg-info

copying files to onepassword_sdk-0.1.3...

copying MANIFEST.in -> onepassword_sdk-0.1.3

copying README.md -> onepassword_sdk-0.1.3

copying setup.py -> onepassword_sdk-0.1.3

copying version.py -> onepassword_sdk-0.1.3

copying src/onepassword/__init__.py -> onepassword_sdk-0.1.3/src/onepassword

copying src/onepassword/build_number.py -> onepassword_sdk-0.1.3/src/onepassword

copying src/onepassword/client.py -> onepassword_sdk-0.1.3/src/onepassword

copying src/onepassword/core.py -> onepassword_sdk-0.1.3/src/onepassword

copying src/onepassword/defaults.py -> onepassword_sdk-0.1.3/src/onepassword

copying src/onepassword/items.py -> onepassword_sdk-0.1.3/src/onepassword

copying src/onepassword/iterator.py -> onepassword_sdk-0.1.3/src/onepassword

copying src/onepassword/secrets.py -> onepassword_sdk-0.1.3/src/onepassword

copying src/onepassword/test_client.py -> onepassword_sdk-0.1.3/src/onepassword

copying src/onepassword/types.py -> onepassword_sdk-0.1.3/src/onepassword

copying src/onepassword/vaults.py -> onepassword_sdk-0.1.3/src/onepassword

copying src/onepassword/lib/x86_64/libop_uniffi_core.so -> onepassword_sdk-0.1.3/src/onepassword/lib/x86_64

copying src/onepassword/lib/x86_64/op_uniffi_core.py -> onepassword_sdk-0.1.3/src/onepassword/lib/x86_64

copying src/onepassword_sdk.egg-info/PKG-INFO -> onepassword_sdk-0.1.3/src/onepassword_sdk.egg-info

copying src/onepassword_sdk.egg-info/SOURCES.txt -> onepassword_sdk-0.1.3/src/onepassword_sdk.egg-info

copying src/onepassword_sdk.egg-info/dependency_links.txt -> onepassword_sdk-0.1.3/src/onepassword_sdk.egg-info

copying src/onepassword_sdk.egg-info/requires.txt -> onepassword_sdk-0.1.3/src/onepassword_sdk.egg-info

copying src/onepassword_sdk.egg-info/top_level.txt -> onepassword_sdk-0.1.3/src/onepassword_sdk.egg-info

copying src/onepassword_sdk.egg-info/SOURCES.txt -> onepassword_sdk-0.1.3/src/onepassword_sdk.egg-info

Writing onepassword_sdk-0.1.3/setup.cfg

Creating tar archive

removing 'onepassword_sdk-0.1.3' (and everything under it)

Successfully built onepassword_sdk-0.1.3.tar.gz

✔ Runing wheel!

Looking in indexes: https://bitstamp:****@nxsbts.bitstamp.net/repository/pypi-blessed/simple

Processing ./onepassword_sdk-0.1.3.tar.gz

  File was already downloaded /source/python311-onepassword-sdk-0.1.3/dist/onepassword_sdk-0.1.3.tar.gz

  Preparing metadata (setup.py): started

  Preparing metadata (setup.py): finished with status 'done'

Collecting pydantic>=2.5 (from onepassword-sdk==0.1.3)

  Downloading https://nxsbts.bitstamp.net/repository/pypi-blessed/packages/pydantic/2.9.2/pydantic-2.9.2-py3-none-any.whl (434 kB)

     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 434.9/434.9 kB 4.0 MB/s eta 0:00:00

Collecting annotated-types>=0.6.0 (from pydantic>=2.5->onepassword-sdk==0.1.3)

  Downloading https://nxsbts.bitstamp.net/repository/pypi-blessed/packages/annotated-types/0.7.0/annotated_types-0.7.0-py3-none-any.whl (13 kB)

Collecting pydantic-core==2.23.4 (from pydantic>=2.5->onepassword-sdk==0.1.3)

  Downloading https://nxsbts.bitstamp.net/repository/pypi-blessed/packages/pydantic-core/2.23.4/pydantic_core-2.23.4-cp311-cp311-musllinux_1_2_x86_64.whl (2.0 MB)

     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 32.3 MB/s eta 0:00:00

Collecting typing-extensions>=4.6.1 (from pydantic>=2.5->onepassword-sdk==0.1.3)

  Downloading https://nxsbts.bitstamp.net/repository/pypi-blessed/packages/typing-extensions/4.12.2/typing_extensions-4.12.2-py3-none-any.whl (37 kB)

Saved ./pydantic-2.9.2-py3-none-any.whl

Saved ./pydantic_core-2.23.4-cp311-cp311-musllinux_1_2_x86_64.whl

Saved ./annotated_types-0.7.0-py3-none-any.whl

Saved ./typing_extensions-4.12.2-py3-none-any.whl

Building wheels for collected packages: onepassword-sdk

  Building wheel for onepassword-sdk (setup.py): started

  Building wheel for onepassword-sdk (setup.py): finished with status 'done'

  Created wheel for onepassword-sdk: filename=onepassword_sdk-0.1.3-cp311-cp311-linux_x86_64.whl size=4371109 sha256=9a51465726679bbdbf042ac745afbdac745de5d53dc629d34d1cba907c025b64

  Stored in directory: /tmp/pip-ephem-wheel-cache-qqqxrj5u/wheels/37/41/43/183eeca0ac519d9803c40de1f8c3ee0220557ff6514a30f738

Successfully built onepassword-sdk

✔ No postbuild script - finishing build

+ echo onepassword-sdk

+ tr '[:upper:]-' '[:lower:]_'

+ PACKAGE_WHEEL_NAME=onepassword_sdk

+ uname -m

+ SYS_ARCH=x86_64

+ echo onepassword_sdk

+ cd /source/python311-onepassword-sdk-0.1.3/dist

+ ls -la

onepassword_sdk

total 10972

drwxr-xr-x    2 appuser  appuser        160 Oct 24 07:59 .

drwxr-xr-x    3 appuser  appuser         60 Oct 24 07:58 ..

-rw-r--r--    1 root     root         13643 Oct 24 07:59 annotated_types-0.7.0-py3-none-any.whl

-rw-r--r--    1 root     root       4371109 Oct 24 07:59 onepassword_sdk-0.1.3-cp311-cp311-linux_x86_64.whl

-rw-r--r--    1 appuser  appuser    4341662 Oct 24 07:59 onepassword_sdk-0.1.3.tar.gz

-rw-r--r--    1 root     root        434928 Oct 24 07:59 pydantic-2.9.2-py3-none-any.whl

-rw-r--r--    1 root     root       2020259 Oct 24 07:59 pydantic_core-2.23.4-cp311-cp311-musllinux_1_2_x86_64.whl

-rw-r--r--    1 root     root         37438 Oct 24 07:59 typing_extensions-4.12.2-py3-none-any.whl

+ uname

+ '[[' Linux '==' Darwin ]]

+ uname -s

+ '[[' Linux '==' Linux ]]

+ find . -iname 'onepassword_sdk*-linux_*.whl' -exec echo '{}' ';'

+ PACKAGE_WHEEL=./onepassword_sdk-0.1.3-cp311-cp311-linux_x86_64.whl

+ '[[' ./onepassword_sdk-0.1.3-cp311-cp311-linux_x86_64.whl '!='  ]]

+ echo 'Fixing linux wheels ./onepassword_sdk-0.1.3-cp311-cp311-linux_x86_64.whl'

+ auditwheel show ./onepassword_sdk-0.1.3-cp311-cp311-linux_x86_64.whl

Fixing linux wheels ./onepassword_sdk-0.1.3-cp311-cp311-linux_x86_64.whl

Traceback (most recent call last):

  File "/source/python311/bin/auditwheel", line 8, in <module>

    sys.exit(main())

             ^^^^^^

  File "/source/python311/lib/python3.11/site-packages/auditwheel/main.py", line 54, in main

    rval = args.func(args, p)

           ^^^^^^^^^^^^^^^^^^

  File "/source/python311/lib/python3.11/site-packages/auditwheel/main_show.py", line 38, in execute

    winfo = analyze_wheel_abi(wheel_policy, args.WHEEL_FILE, frozenset())

            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/source/python311/lib/python3.11/site-packages/auditwheel/wheel_abi.py", line 246, in analyze_wheel_abi

    ) = get_wheel_elfdata(wheel_policy, wheel_fn, exclude)

        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  File "/source/python311/lib/python3.11/site-packages/auditwheel/wheel_abi.py", line 117, in get_wheel_elfdata

    raise RuntimeError(

RuntimeError: Invalid binary wheel, found the following shared library/libraries in purelib folder:

	libop_uniffi_core.so

The wheel has to be platlib compliant in order to be repaired by auditwheel.

Expected Behavior

No response

SDK version

0.3.1

Additional information

No response

@matejsp matejsp added the bug Something isn't working label Oct 25, 2024
@MOmarMiraj
Copy link
Contributor

MOmarMiraj commented Oct 28, 2024

Hi @matejsp

Thanks for reporting your bug. What Linux OS are you running on? the SDKs are built on glibc 2.32+ and whether you are building from the wheel or the source, you would need a Linux OS that supports glibc 2.32+

@matejsp
Copy link
Author

matejsp commented Oct 28, 2024

We are building wheels ourselves on AL2023 (using glibc 2.34).

The issue is how you package binaries in a wheel (in a obsolete way).
https://stackoverflow.com/questions/10833962/in-python-when-is-platlib-purelib
https://peps.python.org/pep-0427/#what-s-the-deal-with-purelib-vs-platlib

Perhaps if you can install (https://github.com/pypa/auditwheel) and check your wheel:

pip3 install auditwheel
auditwheel show ./onepassword_sdk-0.1.3-cp311-cp311-linux_x86_64.whl

@MOmarMiraj
Copy link
Contributor

@matejsp Thanks for the information, I will raise an internal ticket with the team about this issue. Just to gauge priority, how urgent is this for you?

@matejsp
Copy link
Author

matejsp commented Oct 31, 2024

We are currently building sdk ourselves with some workarounds. So it is not extra high priority but would like to get it solved in timely manner.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants