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

setup.py --hpy-abi=universal build_ext --inplace doesn't work #140

Closed
antocuni opened this issue Dec 14, 2020 · 2 comments
Closed

setup.py --hpy-abi=universal build_ext --inplace doesn't work #140

antocuni opened this issue Dec 14, 2020 · 2 comments

Comments

@antocuni
Copy link
Collaborator

As the title says:

$ cd proof-of-concept
$ rm build -rf
$ python3 setup.py --hpy-abi=universal build_ext --inplace
...
writing hpy universal stub loader for pofpackage.foo to build/lib
copying build/lib/pof.hpy.so -> 
writing hpy universal stub loader for pof to build/lib
error: build/lib/pof.py already exists! Please delete.

cc @hodgestar

@antocuni
Copy link
Collaborator Author

I also tried to comment out the "please delete" check in hpy/devel/__init__.py, but things still don't work:

diff --git a/hpy/devel/__init__.py b/hpy/devel/__init__.py
index 33be1a0..c232029 100644
--- a/hpy/devel/__init__.py
+++ b/hpy/devel/__init__.py
@@ -240,8 +240,8 @@ class build_hpy_ext_mixin:
             ext._full_name, output_dir)
         stub_file = (os.path.join(output_dir, *ext._full_name.split('.')) +
                      '.py')
-        if compile and os.path.exists(stub_file):
-            raise DistutilsError(stub_file + " already exists! Please delete.")
+        ## if compile and os.path.exists(stub_file):
+        ##     raise DistutilsError(stub_file + " already exists! Please delete.")
         ext_file = os.path.basename(ext._file_name)
         module_name = ext_file.split(".")[0]
         if not self.dry_run:
$ python3 setup.py --hpy-abi=universal build_ext --inplace
...
copying build/lib/pof.hpy.so -> 
writing hpy universal stub loader for pof to build/lib
copying build/lib/pofpackage/foo.hpy.so -> pofpackage
writing hpy universal stub loader for pofpackage.foo to build/lib

$ python3 -c 'import pof'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'pof'

It seems that the stub pof.py is not copied to the inplace directory. If I copy it manually, it works.

@hodgestar
Copy link
Contributor

Fixed in #143.

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

2 participants