-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
added recipe for openjdk #5792
added recipe for openjdk #5792
Conversation
This comment has been minimized.
This comment has been minimized.
recipes/openjdk/all/conanfile.py
Outdated
destination=self._source_subfolder, strip_root=True) | ||
|
||
def build(self): | ||
pass # nothing to do, but this shall trigger no warnings ;-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a no_copy_source
to skip this
This comment has been minimized.
This comment has been minimized.
Please do not force push we need to restart the reviewing |
You need to open an issue against the hooks to add this as an exception. You can see the Zulu or for more information |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to ask if this recipe is needed by some other recipe. According to our packaging policy, we allow only packages that are built from sources. If they are needed for other PRs or libraries, better to say it in the description of the PR.
Thanks!
@jgsogo this recipe is not needed by any other other recipe. I prepared this recipe as I needed it for my own project and I thought it may be useful for other people as well. |
This comment has been minimized.
This comment has been minimized.
AFAIK, there is no official binaries of OpenJDK, anyone (e.g. Zulu) can make his own distribution from the sources. |
return "source_subfolder" | ||
|
||
def configure(self): | ||
if self.settings.arch != "x86_64": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This checks should go in validate()
https://docs.conan.io/en/latest/reference/conanfile/methods.html#validate
from conans.errors import ConanException | ||
from io import StringIO | ||
|
||
required_conan_version = ">=1.36.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if you're running an older version? The main recipe works and then it errors out during test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It raises a ConanException
error: https://docs.conan.io/en/latest/reference/conanfile/other.html#requiring-a-conan-version-for-the-recipe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I know it raises an error, but I'm talking about the placement.
I usually see this line in the main conanfile.py. By having it on the test_package's conanfile.py, would you allow the package to build and then error out during test?
Are both conanfiles evaluated before build?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test_package is not evaluated before the build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so should I add the required_conan_version
to the main conanfile ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you are correct here.
The main recipe needs conan 1.33. -> you need to add it there too
The test recipe needs conan 1.36.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it does not make sense to require two different versions. lets use 1.36 in main recipe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can build the main recipe without a test recipe (-tf None
) or build with a different test recipe (-tf other_test_package
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ok. For a client using 1.33
it will fail in a conan create
command, but it is accurate and, as said before, you can avoid running these tests, or use a different test folder... and a conan install ... --build=openjdk
won't fail, which is the command you would run when retrieving this recipe from a remote (test_package
is not uploaded to the remote).
This comment has been minimized.
This comment has been minimized.
the assumption is that OP reacted to the review and applied the required changes! Testing locally this caught 7 PRs including conan-io/conan-center-index#5792 which was well over due
Refining my bot caught this PR.... it had lots of approvals and OP applied the required changes... Please review again! |
test_type = "build_requires" | ||
|
||
def build(self): | ||
pass # nothing to build, but tests should not warn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps compiling something JNI?
|
||
def test(self): | ||
output = StringIO() | ||
self.run("java --version", output=output, run_environment=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be run conditionally, when not cross building.
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We talked about this PR some time ago. We decided that as long as the tool is required to build some other project or used by other projects, it would be ok to redistribute already built packages. Of course, if building from sources is not possible at the moment and redistribution is allowed by the licensing.
from conans.errors import ConanException | ||
from io import StringIO | ||
|
||
required_conan_version = ">=1.36.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ok. For a client using 1.33
it will fail in a conan create
command, but it is accurate and, as said before, you can avoid running these tests, or use a different test folder... and a conan install ... --build=openjdk
won't fail, which is the command you would run when retrieving this recipe from a remote (test_package
is not uploaded to the remote).
Co-authored-by: Javier G. Sogo <jgsogo@gmail.com>
This comment has been minimized.
This comment has been minimized.
Co-authored-by: Chris Mc <prince.chrismc@gmail.com>
All green in build 17 (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
We can improve the recipe in following PRs (checks that should go to validate()
)
Added recipe for openjdk
inspired by https://github.com/conan-io/conan-center-index/tree/master/recipes/zulu-openjdk
conan-center hook activated.