objective-git icon indicating copy to clipboard operation
objective-git copied to clipboard

Failed to build current master branch using Carthage

Open mssun opened this issue 6 years ago • 13 comments

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:

https://github.com/libgit2/objective-git/blob/36681837c5d10e3bdc501e3e9fdec9c1cc05d72a/script/update_libssl_ios#L34

mssun avatar Jun 10 '19 03:06 mssun

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.

tiennou avatar Jun 10 '19 09:06 tiennou

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

mssun avatar Jun 10 '19 17:06 mssun

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

kengruven avatar Sep 27 '19 18:09 kengruven

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

mssun avatar Oct 09 '19 22:10 mssun

@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.

kengruven avatar Oct 10 '19 18:10 kengruven

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

mssun avatar Nov 18 '19 01:11 mssun

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.

tiennou avatar Nov 18 '19 12:11 tiennou

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!)

kengruven avatar Nov 18 '19 16:11 kengruven

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:

  • https://github.com/mssun/passforios/commit/6a2f43d03041636d7b4f258385a9c28027959635

This is the log:

  • https://travis-ci.org/mssun/passforios/jobs/613817218

mssun avatar Nov 19 '19 04:11 mssun

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.

kengruven avatar Nov 23 '19 18:11 kengruven

I have my own fork (https://github.com/libgit2/objective-git/compare/master...mssun:master), which has changed a lot. I abandon current openssl script but using openssl-apple.

mssun avatar Nov 23 '19 18:11 mssun

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

kengruven avatar Nov 23 '19 18:11 kengruven

See #699 for related issues and eventual solution.

marcuswestin avatar Dec 06 '19 16:12 marcuswestin