Skip to content

Groestlcoin hash #1288

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

Merged
merged 1 commit into from
Sep 19, 2018
Merged

Groestlcoin hash #1288

merged 1 commit into from
Sep 19, 2018

Conversation

tshirtman
Copy link
Member

Adds a recipe for groestlcoin_hash, a hash algorithm used by the Groestlcoin cryptocurrency.

This PR depends on #1217 because as with any electrum fork, the app using this recipe uses this patched p4a to allow using ssl with python3crystax, so this recipe wasn't tested on p4a master.

The overriden get_recipe_env could maybe be removed and the change it does be backported to the CythonRecipe.get_recipe_env method, at the same place `-lpython{}m' is added, so other recipes could benefit from it. I don't know if it could potentially lead to issues with others though, so that's an open question for me.

@tshirtman tshirtman requested a review from inclement May 27, 2018 13:32
@tshirtman tshirtman force-pushed the groestlcoin_hash branch 2 times, most recently from c4e4c0c to c21de6e Compare May 27, 2018 18:26
ndk_path = os.path.join(
ndk_dir, 'sources', 'python', python_version, 'libs', arch.arch
)
env['LDFLAGS'] = ' -L {}'.format(ndk_path) + env['LDFLAGS']
Copy link
Member

Choose a reason for hiding this comment

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

This change makes sense, but I don't understand why it wouldn't be needed by other CythonRecipes.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

@inclement inclement left a comment

Choose a reason for hiding this comment

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

Looks good to me - I'm glad that the CythonRecipe worked almost out of the box, with only this one env var that can probably be added to the CythonRecipe itself.

I'll make some comments on the openssl PR, I guess once that's merged it will be easier to come back and stick this one in.

@tshirtman
Copy link
Member Author

If the pr #1217 is not going to be merged, i might rebase the PR on master instead to simplify the job of the users of these PR, as they would only need one recipe to patch, not two? Since this doesn't technically depends on it, and could be used separately.

@tshirtman
Copy link
Member Author

So i did the rebase, and additionally, i moved the get_recipe_env patch to CythonRecipe, as the comments seemed to agree on the usefulness of that.

Didn't test, but that seems straightforward, if the tests pass, we should be fine, right? :D

@AndreMiras
Copy link
Member

AndreMiras commented Aug 28, 2018

Yes the recipe looks straightforward indeed, make sure tests are passing. Basically just fix the PEP8 and let's see 🤞
Edit: Also maybe it's worth having just one commit rather than two for such a simple change, no?

Copy link
Member

@AndreMiras AndreMiras left a comment

Choose a reason for hiding this comment

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

Do we really need to update pythonforandroid/recipe.py even with the recent changes on master?

@tshirtman
Copy link
Member Author

Maybe i missed something, i looked if there was recent changes to CythonRecipe and didn't see anything more recent, so i applied it directly, maybe there was something elsewhere?

@AndreMiras
Copy link
Member

Yes I was thinking maybe it's already covered by the recent changes to PythonRecipe.get_recipe_env() since it's a parent class, see this pull request/file: https://github.com/kivy/python-for-android/pull/793/files#diff-ba2a2345fbe0c6c42bd6eb8536bf4564
Anyway If it's the case I don't think it's a big deal for now to have -L redundancy as long as the builds are passing.
If you could simply fix the PEP8 errors raised by Travis build that would be awesome, that would be enough to verify if covered recipes still build.

@AndreMiras
Copy link
Member

Thanks for the update, we're getting closer 🥂
FYI you can run the linter locally, by simply calling the tox command.
Also I think the commit history would look way nicer if we squash one feature into one single commit.

@AndreMiras AndreMiras force-pushed the groestlcoin_hash branch 2 times, most recently from 76585ca to bd399dd Compare September 18, 2018 11:36
This recipe depends on python3crystax, and has only been tested with
python3.6 crystax, but should work with 3.5 too.
Tested under provided Dockerfile and compiled fine with:
```
python setup_testapp_python3.py apk --sdk-dir /opt/android/android-sdk
--ndk-dir /opt/android/crystax-ndk --requirements
python3crystax,setuptools,android,groestlcoin_hash
```
@AndreMiras
Copy link
Member

Comments addressed and compiled fine in my Docker container.
Compiled command was:

python setup_testapp_python3.py apk --sdk-dir /opt/android/android-sdk --ndk-dir /opt/android/crystax-ndk --requirements python3crystax,setuptools,android,groestlcoin_hash

Copy link
Member

@AndreMiras AndreMiras left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -1068,6 +1068,12 @@ def get_recipe_env(self, arch, with_flags_in_cc=True):
env['LIBLINK_PATH'] = liblink_path
ensure_dir(liblink_path)

ndk_dir = self.ctx.ndk_dir
python_version = '.'.join(self.ctx.python_recipe.version.split('.')[:2])
ndk_path = os.path.join(
Copy link
Member

Choose a reason for hiding this comment

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

Looking great, please simply fix the other import error introduced 😕
https://travis-ci.org/kivy/python-for-android/jobs/423234368

pythonforandroid/recipe.py:1073:20: F821 undefined name 'os'

FYI you can run tox in your local copy to check theses before Travis does so for you.
Simply replace os.path.join by simply join since that's the one being already imported here https://github.com/kivy/python-for-android/blob/cbe9e8e/pythonforandroid/recipe.py#L1
Also it would be awesome if you could squash all three commits into one. I can deal with both things if you give me write access to your PR.

from pythonforandroid.recipe import CythonRecipe


class groestlcoin_hashRecipe(CythonRecipe):
Copy link
Member

Choose a reason for hiding this comment

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

Looking good! Maybe we should make it a bit Pythonic by calling it GroestlcoinHashRecipe what do you think?

class groestlcoin_hashRecipe(CythonRecipe):
version = '1.0.1'
url = 'https://pypi.python.org/packages/source/g/groestlcoin_hash/groestlcoin_hash-{version}.tar.gz' # noqa
depends = ['python3crystax']
Copy link
Member

Choose a reason for hiding this comment

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

I have to say, I like NOT having Python2 support just like you did, well done! I think we should all go to that direction and slowly drop it 👍

ndk_path = os.path.join(
ndk_dir, 'sources', 'python', python_version, 'libs', arch.arch
)
env['LDFLAGS'] = ' -L {}'.format(ndk_path) + env['LDFLAGS']
Copy link
Member

Choose a reason for hiding this comment

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

Minor remark, for records, as suggested in the other conversation, maybe this now already covered by https://github.com/kivy/python-for-android/pull/793/files#diff-ba2a2345fbe0c6c42bd6eb8536bf4564
But not a big deal living it here 😉

@tshirtman tshirtman merged commit 91558c5 into master Sep 19, 2018
@AndreMiras AndreMiras deleted the groestlcoin_hash branch September 19, 2018 09:29
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.

3 participants