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

Fix OpenSSL versions 1.1.1 & newer for tvOS #1586

Merged
merged 2 commits into from
Jun 10, 2020
Merged

Conversation

faithfracture
Copy link
Contributor

fork() is unavailable on tvOS. This adds and applies a patch file when
building for tvOS and sets an argument for the compiler.

Specify library name and version: lib/1.0

  • I've read the guidelines for contributing.
  • I've followed the PEP8 style guides for Python code in the recipes.
  • I've used the latest Conan client version.
  • I've tried at least one configuration locally with the
    conan-center hook activated.

`fork()` is unavailable on tvOS. This adds and applies a patch file when
building for tvOS and sets an argument for the compiler.
@CLAassistant
Copy link

CLAassistant commented May 8, 2020

CLA assistant check
All committers have signed the CLA.

@conan-center-bot
Copy link
Collaborator

Sorry, the build is only launched for Early Access Program users. You can request access writing in this issue.

uilianries
uilianries previously approved these changes May 11, 2020
@uilianries uilianries requested review from SSE4, danimtb and jgsogo May 11, 2020 13:33
@madebr
Copy link
Contributor

madebr commented May 11, 2020

@faithfracture
Have you tried adding -DNO_FORK conditionally to the cflags list in the _create_targets method instead of patching?

@faithfracture
Copy link
Contributor Author

Yes - that doesn't work. See openssl/openssl#7607 (sorry, I should have added this to the original PR.)

danimtb
danimtb previously approved these changes May 11, 2020
jgsogo
jgsogo previously approved these changes May 12, 2020
@faithfracture
Copy link
Contributor Author

What needs to happen to move this forward? Looks like the 3 review approvals have happened. What's next?

@@ -413,6 +414,8 @@ def _configure_args(self):
if self._full_version >= "1.1.0":
args.append("--debug" if self.settings.build_type == "Debug" else "--release")

if str(self.settings.os) == "tvOS":
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if str(self.settings.os) == "tvOS":
if self.settings.os == "tvOS":

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If this is changed, then the rest of the if self.settings.os == statements that follow should also be changed. I didn't notice it before, but the usage of this is horribly inconsistent though the entire recipe. Is there a standardization somewhere that says one should be used over the other? I typically don't do "standardization" type changes for commits for things like this, but I'm happy to do it if you'd prefer it.

Copy link
Contributor

Choose a reason for hiding this comment

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

By dropping the str, conan is able to check whether tvOS is a valid os.
That way typos can be catched.
If the code is equivalent, I'ld say 'why not?'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, it doesn't matter to me one way or the other - I suck at Python & honestly don't know the difference.

Just because I'm curious and would like to know - how is it that Conan can check if it's a valid OS by doing self.settings.os rather than str(self.settings.os)? If self.settings.os is a string, then using str() really just turns an existing string into a string, right?

Maybe a better way to put it is - how is it that dropping str() makes it so Conan can check if tvOS is a valid OS?

Copy link
Contributor

@madebr madebr May 15, 2020

Choose a reason for hiding this comment

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

When you compare against self.settings.os, you're comparing against a SettingsItem object.
This class checks whether strings to which it is compared against would also be a valid setting (ie it is present in your settings.yml file).
By doing str, you compare against a string without an additional check.

Comment on lines +609 to +611
if self.settings.os == "tvOS":
tools.patch(patch_file=os.path.join("patches", "1.1.1-tvos.patch"),
base_path=self._source_subfolder)
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't like the conditional patching.
Can the patch be rewritten so it only changes behavior for WatchOS?
Maybe by checking for the existence for a certain preprocessor variable that can be set in the conanfile.py?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Considering this is the patch that is being used as the fix for this in the official OpenSSL repository, I don't think that makes sense. Furthermore, since even if you pass -DNO_FORK, it gets undefined in apps/ocsp.c, that is a bug in OpenSSL itself that is not specific to tvOS, so I would argue that it shouldn't be made specific to tvOS.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok. Good point.

This allows Conan to check against valid OSes, rather than just doing a
basic string comparison.
@faithfracture faithfracture dismissed stale reviews from jgsogo, danimtb, and uilianries via 83fba72 May 15, 2020 12:07
@conan-center-bot
Copy link
Collaborator

Sorry, the build is only launched for Early Access Program users. You can request access writing in this issue.

@conan-center-bot
Copy link
Collaborator

Sorry, the build is only launched for Early Access Program users. You can request access writing in this issue.

@conan-center-bot
Copy link
Collaborator

Sorry, the build is only launched for Early Access Program users. You can request access writing in this issue.

@faithfracture
Copy link
Contributor Author

bump

@danimtb
Copy link
Member

danimtb commented May 25, 2020

@faithfracture it seems that you did not request access to EAP in #4

@faithfracture
Copy link
Contributor Author

Oh - it wasn’t clear to me that I had to run the pr-merge build. It just says that I don’t have access to EAP. I just assumed that someone who did have access to it would run the build. I’ll request access.

Also, the PR still says I don’t have all the required approvals. (1 of 3)

@uilianries
Copy link
Member

@faithfracture It's documented in the Wiki: https://github.com/conan-io/conan-center-index/wiki#adding-packages-to-conancenter

One of required approvals is the EAP. Once approved, your recipe will be checked by the CCI.

@faithfracture
Copy link
Contributor Author

Ok - I requested EAP access.

@conan-center-bot
Copy link
Collaborator

All green in build 5 (83fba722eb54b2ba7d0dff9116d242d126ae75c9)! 😊

@faithfracture
Copy link
Contributor Author

@SSE4 looks like this is waiting on you for the final review

@SSE4 SSE4 merged commit 2c175a8 into conan-io:master Jun 10, 2020
@Croydon Croydon mentioned this pull request Jun 26, 2020
10 tasks
@Croydon Croydon mentioned this pull request Sep 9, 2021
10 tasks
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.

8 participants