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

Add PyJNIus recipe #6091

Merged
merged 7 commits into from
Jul 20, 2018
Merged

Add PyJNIus recipe #6091

merged 7 commits into from
Jul 20, 2018

Conversation

hanslovsky
Copy link
Contributor

@hanslovsky hanslovsky commented Jun 14, 2018

Closes #5075

conda-forge recipe for PyJNIus. Currently WIP, trying to figure out Windows build.

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I wanted to let you know that I linted all conda-recipes in your PR (recipes/pyjnius) and found some lint.

Here's what I've got...

For recipes/pyjnius:

  • Failed to even lint the recipe, probably because of a conda-smithy bug 😢. This likely indicates a problem in your meta.yaml, though. To get a traceback to help figure out what's going on, install conda-smithy and run conda smithy recipe-lint . from the recipe directory.

version: {{tagged_version}}

source:
git_url: https://github.com/kivy/pyjnius.git
Copy link
Member

Choose a reason for hiding this comment

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

Can you point to a git archive for this instead?

Copy link
Member

Choose a reason for hiding this comment

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

For now we need this, we have asked upstream for a new release. ( kivy/pyjnius#342 ) The last one is too old (from a year ago).

Since there are some build issues that need to get sorted here, we are hoping to work on this asynchronously while the release is being sorted out. Hopefully we can incorporate it at the end.

Copy link
Member

Choose a reason for hiding this comment

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

Should add that once we do have a release, we will be able to drop the Jinja above, which should fix the linter issue as well.

Copy link
Member

Choose a reason for hiding this comment

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

We could take a git archive from an arbitrary sha. Though i guess that doesn't differ much

Copy link
Member

Choose a reason for hiding this comment

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

It's true. Not to worried about it as this should be transient anyways.


build:
number: 0
string: py{{py}}_{{PKG_BUILDNUM}}
Copy link
Member

Choose a reason for hiding this comment

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

please remove the build string

- {{ compiler('cxx') }}
host:
- openjdk >=8
- python {{PY_VER}}*
Copy link
Member

Choose a reason for hiding this comment

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

remove the {{PYVER}}* bit here since we don't need it

host:
- openjdk >=8
- python {{PY_VER}}*
- cython
Copy link
Member

Choose a reason for hiding this comment

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

you'll want to add pip here

Copy link
Member

Choose a reason for hiding this comment

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

Think this is causing the build failure on Linux

- ant
run:
- openjdk >=8
- python {{PY_VER}}*
Copy link
Member

Choose a reason for hiding this comment

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

This one should be dropped too

about:
home: https://github.com/kivy/pyjnius
license: MIT
license_file: LICENSE
Copy link
Member

Choose a reason for hiding this comment

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

Also needs the maintainers section with your GitHub handle. Snippet from the example below.

extra:
recipe-maintainers:
# GitHub IDs for maintainers of the recipe.
# Always check with the people listed below if they are OK becoming maintainers of the recipe. (There will be spam!)
- LisaSimpson
- LandoCalrissian

 - ignore python2
 - add separate activate/deactivate files
 - fix PATH variable on Windows
@hanslovsky
Copy link
Contributor Author

We were able to fix the issues with the Windows build. Shoutout to @jjahanip and @jakirkham for their help! @jjahanip setting PATH variable was what fixed it in the end!

@jakirkham
Copy link
Member

Thanks for working on this, Phil. Glad we were able to get Windows building. 😄

SET "JDK_HOME_BACKUP=%JDK_HOME%"
SET "JDK_HOME=%JAVA_HOME%"
SET "PATH_BACKUP=%PATH%"
SET "PATH=%JDK_HOME%\jre\bin\server;%JDK_HOME%\bin;%PATH%"
Copy link
Member

Choose a reason for hiding this comment

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

Since %JDK_HOME% is just the %LIBRARY_PREFIX%, %JDK_HOME%\bin is already on the %PATH% as conda adds that for us. Given this, it appears the critical thing is having %JDK_HOME%\jre\bin\server added. Inspecting that directory reveals only one library, which is jvm.dll (needed by libraries using JNI). This explains the loading error and why we needed to add this to the %PATH%. Have submitted PR ( conda-forge/openjdk-feedstock#30 ) to have openjdk do this for us.

Copy link
Member

Choose a reason for hiding this comment

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

Another thing worth checking, it appears on macOS and Linux set JAVA_LD_LIBRARY_PATH to the equivalent location. Maybe setting this alone would also solve the issue on Windows?

SET "PYJNIUS_JAR_BACKUP=%PYJNIUS_JAR%"
SET "PYJNIUS_JAR=%CONDA_PREFIX%\share\pyjnius\pyjnius.jar"
SET "JDK_HOME_BACKUP=%JDK_HOME%"
SET "JDK_HOME=%JAVA_HOME%"
Copy link
Member

Choose a reason for hiding this comment

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

Would be curious to see if we can just drop the %JDK_HOME% stuff given we didn't need it on Unix and it seems like we have a better understanding of the problem now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The PyJNIus doc states that we should set it, so I'd just leave it in there.
http://pyjnius.readthedocs.io/en/latest/installation.html#installation-for-windows

@@ -0,0 +1,2 @@
export PYJNIUS_JAR_BACKUP=$PYJNIUS_JAR
export PYJNIUS_JAR=$CONDA_PREFIX/share/pyjnius/pyjnius.jar
Copy link
Member

Choose a reason for hiding this comment

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

Minor comment: Would be good to quote these paths in the event the user has spaces in them.

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipes/pyjnius) and found it was in an excellent condition.

@hanslovsky
Copy link
Contributor Author

I udpated meta.yaml to comply with the linter. All checks pass now. What is the way forward here?

@jakirkham
Copy link
Member

Seems fine to me. Thoughts @conda-forge/staged-recipes?

@scopatz
Copy link
Member

scopatz commented Jul 20, 2018

LGTM Thanks!

@scopatz scopatz merged commit 9cd51b6 into conda-forge:master Jul 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants