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

Python 3.10 #769

Merged
merged 5 commits into from
Nov 23, 2021
Merged

Python 3.10 #769

merged 5 commits into from
Nov 23, 2021

Conversation

esc
Copy link
Member

@esc esc commented Sep 2, 2021

As title

@esc
Copy link
Member Author

esc commented Oct 7, 2021

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

@esc
Copy link
Member Author

esc commented Oct 7, 2021

@sklam and I agreed that a 0.37.1 may be in the cards for next week.

@esc
Copy link
Member Author

esc commented Oct 11, 2021

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

@@ -183,7 +183,8 @@ def __call__(self, *args, **kwargs):
for _lib_path in _lib_paths:
try:
lib = ctypes.CDLL(_lib_path)
except OSError:
except OSError as e:
print(e)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this leftover from debugging?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes probably, but we may to leave it it. This solves the issue, where errors of the form libllvmlite.so could not be loaded masquerade the real error, which makes these kinds of errors hard to debug. If the lib can not be loaded, we can't continue anyway, so maybe a lone print here is the right thing to do?

Copy link
Member

@sklam sklam Oct 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer buffering the messages and report it later when it does raise OSError at

raise OSError("Could not load shared object file: {}".format(_lib_name))

Right now, if the last path is successful, the earlier error are still being printed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, that makes sense

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in: 8cc3c39

Here is a sample failure:

Python 3.9.5 (default, May 18 2021, 12:31:01)
[Clang 10.0.0 ] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
i>>> import llvmlite
>>> import llvmlite.binding
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/vhaenel/git/llvmlite/llvmlite/binding/__init__.py", line 4, in <module>
    from .dylib import *
  File "/Users/vhaenel/git/llvmlite/llvmlite/binding/dylib.py", line 3, in <module>
    from llvmlite.binding import ffi
  File "/Users/vhaenel/git/llvmlite/llvmlite/binding/ffi.py", line 195, in <module>
    raise OSError(msg)
OSError: Could not load shared object file: libllvmlite.dylib
Errors were: [OSError('dlopen(/Users/vhaenel/git/llvmlite/llvmlite/binding/libllvmlite.dylib, 6): image not found'), OSError('dlopen(libllvmlite.dylib, 6): image not found'), OSError('dlopen(./libllvmlite.dylib, 6): image not found'), OSError('dlopen(/Users/vhaenel/git/llvmlite/llvmlite/binding/libllvmlite.dylib, 6): image not found')]

This will avoid printing errors unnecessarily.
@esc esc added this to the 0.37.1 milestone Oct 13, 2021
@esc esc mentioned this pull request Oct 13, 2021
15 tasks
Copy link
Member

@sklam sklam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've manually tested the failed to find libllvmlite error and it looks good.

@sklam
Copy link
Member

sklam commented Oct 13, 2021

I've manually tested this on OSX on py3.10. ✅

@esc
Copy link
Member Author

esc commented Oct 13, 2021

The current CI failures:

pygments -> setuptools
python=3.10 -> pip -> setuptools
sphinx -> setuptoolsThe following specifications were found to be incompatible with your system:

  - feature:/linux-64::__glibc==2.27=0
  - python=3.10 -> libgcc-ng[version='>=7.5.0'] -> __glibc[version='>=2.17']

Are because the packages related to documentation are not available yet via the defaults channel on anaconda.org.

@esc
Copy link
Member Author

esc commented Oct 14, 2021

So, what should we do. I see three options:

a) Don't try to build the docs for 3.10
b) pip install the doc dependencies for 3.10 into the existing conda environment
c) Wait until the documentation packages become available for 3.10

We also still need to make changes to the anaconda internal build farm in order to build the conad-packages for 3.10 and the wheels too.

@esc
Copy link
Member Author

esc commented Oct 20, 2021

Build Farm ID: llvmlite_115.

@esc esc added Pending BuildFarm For PRs that have been reviewed but pending a push through our buildfarm 4 - Waiting on reviewer and removed 4 - Waiting on author labels Oct 20, 2021
@esc
Copy link
Member Author

esc commented Oct 25, 2021

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

@esc
Copy link
Member Author

esc commented Nov 16, 2021

#789 is now provided to circumvent the CI issues present on this PR.

@esc
Copy link
Member Author

esc commented Nov 18, 2021

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

@esc
Copy link
Member Author

esc commented Nov 18, 2021

Oh wow, it went green for the first time, yay!

@esc
Copy link
Member Author

esc commented Nov 18, 2021

Now running on the Anconda internal build farm as: llvmlite_119.

@esc
Copy link
Member Author

esc commented Nov 18, 2021

This passed on the anaconda internal build farm:

Screen Shot 2021-11-18 at 22 33 14

@esc esc added BuildFarm Passed For PRs that have been through the buildfarm and passed and removed Pending BuildFarm For PRs that have been reviewed but pending a push through our buildfarm labels Nov 18, 2021
@jakirkham
Copy link
Contributor

Matti tracked the issue Marcel noted above to the finalization line here (622):

def get_sum(self, ee, func_name="sum"):
ee.finalize_object()
cfptr = ee.get_function_address(func_name)
self.assertTrue(cfptr)
return CFUNCTYPE(c_int, c_int, c_int)(cfptr)

More details in comment ( conda-forge/llvmlite-feedstock#58 (comment) )

@esc
Copy link
Member Author

esc commented Nov 19, 2021

Matti tracked the issue Marcel noted above to the finalization line here (622):

def get_sum(self, ee, func_name="sum"):
ee.finalize_object()
cfptr = ee.get_function_address(func_name)
self.assertTrue(cfptr)
return CFUNCTYPE(c_int, c_int, c_int)(cfptr)

More details in comment ( conda-forge/llvmlite-feedstock#58 (comment) )

@jakirkham thank you for posting this. It will probably make sense to debug this during the RC period when we have also built our binary artifacts.

@mbargull
Copy link
Contributor

See conda-forge/llvmlite-feedstock#58 (comment) : Building works fine in conda-forge's setup but testing with conda-forge::python=3.10 fails.

@mbargull
Copy link
Contributor

See conda-forge/llvmlite-feedstock#58 (comment) : Building works fine in conda-forge's setup but testing with conda-forge::python=3.10 fails.

@esc , this could/would also mean that you can probably test it in an environment created with your build artifact and conda-forge::python=3.10.

@mbargull
Copy link
Contributor

@esc, as an update: the segfault on osx-64 for conda-forge stems from the CPython 3.10 plus libffi 3.4 combination.
@jakirkham found and upstream issue for this: https://bugs.python.org/issue44556
I opened conda-forge/python-feedstock#523 for us to handle this.


TL;DR looks like llvmlite=0.37.0 works fine with python=3.10 overall and the one known encountered issue doesn't stem from llvmlite's code base :).

@esc
Copy link
Member Author

esc commented Nov 19, 2021

@esc, as an update: the segfault on osx-64 for conda-forge stems from the CPython 3.10 plus libffi 3.4 combination. @jakirkham found and upstream issue for this: https://bugs.python.org/issue44556 I opened conda-forge/python-feedstock#523 for us to handle this.

TL;DR looks like llvmlite=0.37.0 works fine with python=3.10 overall and the one known encountered issue doesn't stem from llvmlite's code base :).

Great finds! Thank you for keeping us in the loop. It is much appreciated!

@esc
Copy link
Member Author

esc commented Nov 20, 2021

@mbargull would you recommend we pin libffi in our recpie?

@jakirkham
Copy link
Contributor

No the issue was in how CPython was doing the build itself. We fixed that in conda-forge ( conda-forge/python-feedstock#525 ). Apparently the Python devs also fixed this, but it didn't make it into 3.10.0 ( https://bugs.python.org/issue45350 ).

@mbargull
Copy link
Contributor

mbargull commented Nov 22, 2021

Yep, what John wrote! All good from our side now. I'll open an issue on Anaconda's recipe repo (\edit: AnacondaRecipes/python-feedstock#50 ) too so we don't run into the same issue for the defaults channel if defaults::python=3.10.0 gets rebuild with libffi=3.4.

@esc
Copy link
Member Author

esc commented Nov 22, 2021

@sklam @stuartarchibald @seibert I think this one is ready, needs a final review, I believe.

@esc
Copy link
Member Author

esc commented Nov 22, 2021

Yep, what John wrote! All good from our side now. I'll open an issue on Anaconda's recipe repo (\edit: AnacondaRecipes/python-feedstock#50 ) too so we don't run into the same issue for the defaults channel if defaults::python=3.10.0 gets rebuild with libffi=3.4.

@mbargull Thank you, much appreciated!! 🙏

Copy link
Member

@gmarkall gmarkall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like all the issues brought up in the discussion are now resolved, so this looks good to me.

@esc
Copy link
Member Author

esc commented Nov 23, 2021

Thank you all for the reviews!

@esc esc merged commit 0cde753 into numba:master Nov 23, 2021
@esc esc deleted the python3.10 branch January 28, 2022 15:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to merge BuildFarm Passed For PRs that have been through the buildfarm and passed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants