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

stub file error when --hpy-abi=universal #154

Closed
antocuni opened this issue Jan 14, 2021 · 4 comments
Closed

stub file error when --hpy-abi=universal #154

antocuni opened this issue Jan 14, 2021 · 4 comments

Comments

@antocuni
Copy link
Collaborator

I got this error when trying to install the antocuni/update-to-latest-hpy branch of ultrajson-hpy (hpy version fdc6047):

$ python setup.py --hpy-abi=universal install
[... build goes smoothly ...]
creating stub loader for ujson_hpy.hpy.so
stub file already created for ujson_hpy.hpy.so
error: file '/home/antocuni/pypy/misc/ultrajson-hpy/build/bdist.linux-x86_64/egg/ujson_hpy.py' does not exist

The same command succeeds for proof-of-concept, so I think it's something inside ujson's setup.py.
I think it might be related to cmdclass but I didn't investigate:

setup(
    name = 'ujson-hpy',
    ...
    cmdclass = {'build_ext': build_ext, 'build_clib': build_clib_without_warnings},
)

/cc @hodgestar as he's our setuptools expert by now :)

@hodgestar
Copy link
Contributor

I pushed a small fix to https://github.com/hpyproject/ultrajson-hpy/tree/antocuni/update-to-latest-hpy.

The high-level issue is that ultrajson-hpy's setup.py was passing the distutils version of build_ext rather than the setuptools one.

The question now is what to do about it on the HPy side? It's likely a common and confusing issue, so we should do something.

One option is to try detect the issue and either raise an error or warning. One way to detect the issue is to check whether the setuptools build_ext is somewhere in the inheritance hierarchy of the current build_ext. If it isn't, the build will probably fail anyway.

Another option is to somehow handle the case where only distutils is being used, but I don't really know what that should look like, other than that it would probably be even more of a mess.

@paugier
Copy link
Contributor

paugier commented Jan 15, 2021

My 2 cents: there is a discussion to depreciate distutils (https://www.python.org/dev/peps/pep-0632/). Now that we have pep517 and isolated builds with pyproject.toml, supporting builds using hpy with only distutils doesn't seem to be very useful.

@antocuni
Copy link
Collaborator Author

One option is to try detect the issue and either raise an error or warning. One way to detect the issue is to check whether the setuptools build_ext is somewhere in the inheritance hierarchy of the current build_ext. If it isn't, the build will probably fail anyway.
Another option is to somehow handle the case where only distutils is being used, but I don't really know what that should look like, other than that it would probably be even more of a mess.

I don't know enough on the subject to make a reasonable comment. I am fine with both options if they improve the current situation.

@hodgestar
Copy link
Contributor

Addressed by #178.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants