Skip to content

Change CI artifact to dmg - #256

Merged
hannesa2 merged 2 commits into
gitx:masterfrom
claytonrcarter:ci-artifacts-take-2
Feb 7, 2022
Merged

hannesa2 merged 2 commits into
gitx:masterfrom
claytonrcarter:ci-artifacts-take-2

Conversation

@claytonrcarter

Copy link
Copy Markdown
Collaborator

This changes the CI artifact from a .xcarchive directory to .dmg that contains a working GitX.app. I'm not sure what I was running into yesterday when it seemed like the .xcarchive was important. I suspect that it had to do w/ the artifact upload CI workflow losing some Mac specific info from some files, but that's just a guess.

I went deep into using xcodebuild to export an app directly from the .xcarchive, but that appears to require developer certificates, signing, etc, so I abandoned that and went back to study how it's done by UTM (which I'm not familiar with and have never used, but which was shared by @hannesa2). They have a package_mac.sh script running in CI that has a pretty clear "unsigned" code path, and produces a dmg containing a .app. The relevant parts of this PR are just lifted from that.

Notes

  • Personally, I would prefer a .zip to a .dmg. A zip gets extracted to a working .app w/o any need to mount/unmount a dmg. I find that simpler, but this isn't super important to me, as long as it works for other folks.
  • I also reordered the list of Xcode targets so they're in ascending order.
  • I changed the name of the artifact from GitX-Xcode_13.2.1 to GitX build by Xcode_13.2.1, but I'm fine to change it back if others prefer that.

@hannesa2

hannesa2 commented Feb 7, 2022

Copy link
Copy Markdown
Contributor

Nice 👍

Unfortunately, I downloaded 13.2.1 artifact, but it was not able to start

Termination Reason:    Namespace DYLD, Code 1 Library missing
Library not loaded: /usr/local/opt/[email protected]/lib/libcrypto.1.1.dylib
Referenced from: /Applications/GitX.app/Contents/Frameworks/ObjectiveGit.framework/Versions/A/ObjectiveGit
Reason: tried: '/usr/local/opt/[email protected]/lib/libcrypto.1.1.dylib' (no such file), '/usr/local/lib/libcrypto.1.1.dylib' (no such file), '/usr/lib/libcrypto.1.1.dylib' (no such file)
(terminated at launch; ignore backtrace)

Application Specific Information:
Library not loaded: /usr/local/opt/[email protected]/lib/libcrypto.1.1.dylib
Referenced from: /Applications/GitX.app/Contents/Frameworks/ObjectiveGit.framework/Versions/A/ObjectiveGit
Reason: tried: '/usr/local/opt/[email protected]/lib/libcrypto.1.1.dylib' (no such file), '/usr/local/lib/libcrypto.1.1.dylib' (no such file), '/usr/lib/libcrypto.1.1.dylib' (no such file)

@hannesa2

hannesa2 commented Feb 7, 2022 •

Copy link
Copy Markdown
Contributor

At least my M1 can't start it. Does it start on your side ?

@claytonrcarter

Copy link
Copy Markdown
Collaborator Author

Yes, it does. I'm not on an M1, though.

@claytonrcarter

claytonrcarter commented Feb 7, 2022 •

Copy link
Copy Markdown
Collaborator Author

There have been issues w/ GitX linking to missing openssl libraries in the past. For a while I had to keep my own local homebrew install of [email protected] just to keep it running. So it looks like it's building against [email protected] now (which is great, I think), but can you confirm that you have [email protected] installed?

Here's what I'm seeing locally:

❯ brew search openssl
==> Formulae
crcarter/local-openssl/[email protected] ✔        openssh                                        opencsg
glib-openssl                                   opensaml                                       open-sp
[email protected] ✔                                  opensc                                         homebrew/portable-ruby/portable-openssl
openssl@3                                      openfst
openslp                                        openmsx

❯ brew list [email protected]
/usr/local/Cellar/[email protected]/1.1.1m/.bottle/etc/ (7 files)
/usr/local/Cellar/[email protected]/1.1.1m/bin/c_rehash
/usr/local/Cellar/[email protected]/1.1.1m/bin/openssl
/usr/local/Cellar/[email protected]/1.1.1m/include/openssl/ (104 files)
/usr/local/Cellar/[email protected]/1.1.1m/lib/libcrypto.1.1.dylib
/usr/local/Cellar/[email protected]/1.1.1m/lib/libssl.1.1.dylib
/usr/local/Cellar/[email protected]/1.1.1m/lib/engines-1.1/ (2 files)
/usr/local/Cellar/[email protected]/1.1.1m/lib/pkgconfig/ (3 files)
/usr/local/Cellar/[email protected]/1.1.1m/lib/ (4 other files)
/usr/local/Cellar/[email protected]/1.1.1m/share/doc/ (3975 files)
/usr/local/Cellar/[email protected]/1.1.1m/share/man/ (3975 files)

❯ ls -l /usr/local/opt/[email protected]
lrwxr-xr-x  1 crcarter  admin  28 Jan 15 08:46 /usr/local/opt/[email protected] -> ../Cellar/[email protected]/1.1.1m

So maybe brew install [email protected] might help?

@hannesa2

hannesa2 commented Feb 7, 2022

Copy link
Copy Markdown
Contributor

image

But an older gitx build for x86 is able to start. Only this one doesn't start. I've to check it on my old x86 Mac
image

Comment thread .github/workflows/BuildPR.yml Outdated
- name: pre build
run: cd External/objective-git && script/bootstrap && script/update_libgit2 && cd ../..
- name: Build project
run: xcodebuild -workspace GitX.xcworkspace -scheme GitX -archivePath ./GitX archive

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I just pushed this. If it builds, let me know if it helps.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It also feels curious that #234 (the M1 support PR) also has a lot of openssl related issues.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It finished, but I don't think it did anything:

Command line invocation:
    /Applications/Xcode_13.2.1.app/Contents/Developer/usr/bin/xcodebuild -workspace GitX.xcworkspace -scheme GitX -archivePath ./GitX archive "ARCHS=x86_64 arm64"

User defaults from command line:
    IDEArchivePathOverride = /Users/runner/work/gitx/gitx/GitX
    IDEPackageSupportUseBuiltinSCM = YES

Build settings from command line:
    ARCHS = x86_64 arm64

--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:x86_64, id:4203018E-580F-C1B5-9525-B745CECA79EB }

I don't see any other reference to arm64. 😕

@claytonrcarter

Copy link
Copy Markdown
Collaborator Author

What do you get when you do ls -l /usr/local/opt/[email protected]?

@hannesa2

hannesa2 commented Feb 7, 2022

Copy link
Copy Markdown
Contributor

What do you get when you do ls -l /usr/local/opt/[email protected]?

As expected with arm64 brew it's not there

image

For arm64 it's located at /opt/homebrew/opt/[email protected]
image

@hannesa2

hannesa2 commented Feb 7, 2022

Copy link
Copy Markdown
Contributor

Unfortunately it looks like a x86-only-build. This is x86 /usr/local

Termination Reason:    Namespace DYLD, Code 1 Library missing
Library not loaded: /usr/local/opt/[email protected]/lib/libcrypto.1.1.dylib
Referenced from: /Applications/GitX.app/Contents/Frameworks/ObjectiveGit.framework/Versions/A/ObjectiveGit
Reason: tried: '/usr/local/opt/[email protected]/lib/libcrypto.1.1.dylib' (no such file), '/usr/local/lib/libcrypto.1.1.dylib' (no such file), '/usr/lib/libcrypto.1.1.dylib' (no such file)
(terminated at launch; ignore backtrace)

@hannesa2

hannesa2 commented Feb 7, 2022

Copy link
Copy Markdown
Contributor

At least on my x86 Mac it works properly. Thank you !

@hannesa2
hannesa2 merged commit b3073a7 into gitx:master Feb 7, 2022
@hannesa2

hannesa2 commented Feb 8, 2022

Copy link
Copy Markdown
Contributor

Unfortunately it removes the pressure for other developers to fix the build. But thank you for this nice and necessary contribution.

@hannesa2 hannesa2 added the breaking-change breaking-change label Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking-change breaking-change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants