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

[WIP] Add correct CFLAGS to hostpython3 and -fPIC flag to avoid relocation error for few recipes #2136

Draft
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

rdbisme
Copy link

@rdbisme rdbisme commented Apr 10, 2020

I think this fixes #2074 (and related), at least for me on macOS. I tried to build the KivyMD Kittchen Sink app for x86, armv7 and armv8-64, and went ok on my machine (macOS Catalina) using latest NDK 21.0.6113669 and also 19c.

PS: Most of the changes are related to automatic formatting using black.

Copy link
Member

@opacam opacam left a comment

Choose a reason for hiding this comment

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

Nice!!, but could you remove all the automatic black's formatting? 😁

We already have been discussed this at #1950 and doing some massive formating as you did I don't think that it's a good idea (specially now that we have some important changes, like python3 upgrade and the removal of python2 support)...It makes it hard to review and also it's easy to miss things...for instance...this has a tox error at here which blocks our tests.

@rdbisme
Copy link
Author

rdbisme commented Apr 10, 2020

Ok, I should have re-done all the edits disabling Black auto formatting (on my Vim 🤣 )

@rdbisme rdbisme force-pushed the develop branch 3 times, most recently from 469f555 to 2b18699 Compare April 10, 2020 16:03
@rdbisme
Copy link
Author

rdbisme commented Apr 10, 2020

Ok, everything looks like it's working now. Only thing, I don't know how to fix the Travis error...

@AndreMiras
Copy link
Member

The Travis error is probably a flaky test, I've restarted this specific job to see.
For future records this was the error:

    def test_blacklist():
        # First, get order without blacklist:
        build_order, python_modules, bs = get_recipe_order_and_bootstrap(
            ctx, ["python3", "kivy"], None
        )
        # Now, obtain again with blacklist:
        build_order_2, python_modules_2, bs_2 = get_recipe_order_and_bootstrap(
            ctx, ["python3", "kivy"], None, blacklist=["libffi"]
        )
        assert "libffi" not in build_order_2
>       assert set(build_order_2).union({"libffi"}) == set(build_order)
E       AssertionError: assert {'android', '...pyjnius', ...} == {'android', '...openssl', ...}
E         Extra items in the right set:
E         'genericndkbuild'
E         Use -v to get the full diff
tests/test_graph.py:96: AssertionError

And the PR looks good to me thanks 👍 I'll let @opacam have the final word for it

@rdbisme
Copy link
Author

rdbisme commented Apr 10, 2020

Ok, that test went well now.

Co-Authored-By: Pol Canelles <canellestudi@gmail.com>
@rdbisme
Copy link
Author

rdbisme commented Apr 12, 2020

Unfortunately, this does not fix the problem with pyconfig.h on macOS. I just realized that if I run the configure and then make command of the hostpython3 with a completely empty environment except for the CPPFLAG pointing to the pyconfig. It works. But then it breaks on Linux.

I also discovered this anomaly: https://bugs.python.org/issue40261

Can any of you with a mac try it out and check if it's getting the same?

@rdbisme rdbisme changed the title Add correct CFLAGS to hostpython3 and -fPIC flag to avoid relocation error for few recipes [WIP] Add correct CFLAGS to hostpython3 and -fPIC flag to avoid relocation error for few recipes Apr 12, 2020
@opacam
Copy link
Member

opacam commented Apr 29, 2020

@rubendibattista , there is an ongoing PR that fix the pyconfig.h issue (#2159)...could we deal with the -fPIC thing in here?

@rdbisme
Copy link
Author

rdbisme commented Apr 29, 2020

@opacam That's great. I guess those are two different problems. Maybe just land the PR about the pyconfig and I'll reabse and test againt the -fPIC flag. What do you think?

@rdbisme rdbisme marked this pull request as draft April 29, 2020 10:16
@opacam
Copy link
Member

opacam commented Apr 29, 2020

As you wish, but I think that you could do it whithout waiting if you want (I don't think that we have merge conflicts), whatever you decide is fine to me 😉

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

Successfully merging this pull request may close these issues.

pyconfig.h issue
3 participants