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

Failed to build current master branch using Carthage #692

Open
mssun opened this issue Jun 10, 2019 · 13 comments
Open

Failed to build current master branch using Carthage #692

mssun opened this issue Jun 10, 2019 · 13 comments

Comments

@mssun
Copy link
Contributor

mssun commented Jun 10, 2019

Log:

...
Building for x86_64 i386 armv7 armv7s arm64
Building OpenSSL for iphonesimulator12.2 x86_64
Build log can be found in /.../Carthage/Checkouts/objective-git/External/build/log/OpenSSL-x86_64.log
Please stand by...
Building OpenSSL for iphonesimulator12.2 i386
Build log can be found in /.../Carthage/Checkouts/objective-git/External/build/log/OpenSSL-i386.log
Please stand by...
Can't open crypto/ui/ui_openssl.c: No such file or directory.
Command PhaseScriptExecution failed with a nonzero exit code

Should be caused by:

perl -i -pe 's|static volatile sig_atomic_t intr_signal|static volatile int intr_signal|' crypto/ui/ui_openssl.c

@tiennou
Copy link
Contributor

tiennou commented Jun 10, 2019

That's WIP in #688. I'm not doing enough iOS/Swift specific work to be sure I can fix CI, and there's a bunch of things that needs updating (on top of what you've identified in #693, there's Xcode itself, Quick/Nimble, and the xcconfigs).

A.k.a, help would be greatly appreciated.

@mssun
Copy link
Contributor Author

mssun commented Jun 10, 2019

Wish I can help, the building scripts look a little complex, and I don't know how to get involved actually.

@kengruven
Copy link
Contributor

I'd really like to get this working again. How can I help? Is the iOS build process documented anywhere?

@mssun
Copy link
Contributor Author

mssun commented Oct 9, 2019

@kengruven , I guess you should start with these scripts: https://github.com/libgit2/objective-git/tree/master/script

@kengruven
Copy link
Contributor

@mssun, yes, those are the scripts I'm trying to find documentation for. The comments there, when they exist (# LOL Cmake), aren't terribly helpful in enabling me to understand why it's doing what it's doing, or what might be going wrong.

@mssun
Copy link
Contributor Author

mssun commented Nov 18, 2019

Hi @kengruven, any progress can be shared? Let's fix this.

@tiennou
Copy link
Contributor

tiennou commented Nov 18, 2019

What do you mean by not terribly helpful 😁 ? The build system is managed by Travis, see .travis.yml.

  • scripts/bootstrap checks and builds the required dependencies that Homebrew has.
  • scripts/cibuild is the xcodebuild caller, the main "build" script.
  • scripts/update_lib{git2,ssh}{_ios,} are the "dependency checkers". They're supposed to cause a rebuild of the "manual dependencies", ie. libssh2, openssl, and thus need 6 arch build ? 4 iOS + 2 macOS, a manual lipo step.
  • scripts/repackage-dylibs.rb is the install_name_tool wrangler, which is the only thing I've added. It makes sure anything not found from what is hopefully a "vanilla OS image", from otool -L output, is duplicated into the final built product bundle, and all paths fixed-up.

I don't remember what causes what to be called, apart from what .travis.yml says. YMMV.

@kengruven
Copy link
Contributor

Hi @mssun. Sorry, I don't have anything to show for this.

Could it be as simple as updating the "static volatile sig_atomic_t intr_signal" Perl call? That line no longer exists in the submodule version of openssl that is used here.

(Aside: the scripts folder here use Perl, Bash, and Ruby!)

@mssun
Copy link
Contributor Author

mssun commented Nov 19, 2019

Hi, I tried to build the master branch with Carthage again. I don't know why, It seems that the current master works. Probably, this is related with the version of OS or Xcode?

Changes:

This is the log:

@kengruven
Copy link
Contributor

I tried again with my application against libgit2/objective-git master (with Xcode 10.3), and it builds without error here, too. What gives?

It's true crypto/ui/ui_openssl.c exists (and seems to have existed for a long time), but sig_atomic_t doesn't exist on iOS, does it? Does that file not get compiled?

I think the correct fix would be to not use perl to muck up the source code. That's fragile and will break if that C file gets moved or restructured (as it has at least once since that objective-git script was written).

I suggest:

  • Remove that perl hack
  • If necessary (is it?), try to get the openssl folks to add an iOS #ifdef case. There's already one for SunOS. I'm sure I've seen a similar patch for iOS somewhere but I guess it hasn't been merged.

@mssun
Copy link
Contributor Author

mssun commented Nov 23, 2019

I have my own fork (master...mssun:master), which has changed a lot. I abandon current openssl script but using openssl-apple.

@kengruven
Copy link
Contributor

I'm using master master, and it still built without error.

@marcuswestin
Copy link

See #699 for related issues and eventual solution.

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

No branches or pull requests

4 participants