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

GitHub actions for building #695

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from

Conversation

karbassi
Copy link
Contributor

@karbassi karbassi commented Jul 28, 2021

This is a work in progress to allow GitHub Actions to build selfcontrol.

Here are the actions running on my fork/branch. https://github.com/karbassi/selfcontrol/actions/workflows/test_only.yml

Once it's working, I'll clean up this PR.

@karbassi karbassi force-pushed the feature/github-actions branch 2 times, most recently from eb689d3 to 527c695 Compare September 15, 2021 15:47
@karbassi
Copy link
Contributor Author

@cstigler I've been working on the build action for about a few weeks now (2-3 hours a day) and I'm stuck.

The current problem is the build command. It throws an error when trying to link Sentry to SCKillerHelper.

Ld /Users/runner/Library/Developer/Xcode/DerivedData/SelfControl-exwysobdegmaenckmlobgzzuvihv/Build/Intermediates.noindex/SelfControl.build/Release/SCKillerHelper.build/Objects-normal/x86_64/Binary/SCKillerHelper normal x86_64 (in target 'SCKillerHelper' from project 'SelfControl')
    cd /Users/runner/work/selfcontrol/selfcontrol
    /Applications/Xcode_12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target x86_64-apple-macos10.10 -isysroot /Applications/Xcode_12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -L/Users/runner/Library/Developer/Xcode/DerivedData/SelfControl-exwysobdegmaenckmlobgzzuvihv/Build/Products/Release -L/Users/runner/Library/Developer/Xcode/DerivedData/SelfControl-exwysobdegmaenckmlobgzzuvihv/Build/Products/Release/Sentry-library -F/Users/runner/Library/Developer/Xcode/DerivedData/SelfControl-exwysobdegmaenckmlobgzzuvihv/Build/Products/Release -filelist /Users/runner/Library/Developer/Xcode/DerivedData/SelfControl-exwysobdegmaenckmlobgzzuvihv/Build/Intermediates.noindex/SelfControl.build/Release/SCKillerHelper.build/Objects-normal/x86_64/SCKillerHelper.LinkFileList -Xlinker -object_path_lto -Xlinker /Users/runner/Library/Developer/Xcode/DerivedData/SelfControl-exwysobdegmaenckmlobgzzuvihv/Build/Intermediates.noindex/SelfControl.build/Release/SCKillerHelper.build/Objects-normal/x86_64/SCKillerHelper_lto.o -fobjc-arc -fobjc-link-runtime -ObjC -lSentry-library -lc++ -lz -framework Foundation -framework IOKit -framework Cocoa -framework Foundation -framework Security -lPods-SCKillerHelper -Xlinker -dependency_info -Xlinker /Users/runner/Library/Developer/Xcode/DerivedData/SelfControl-exwysobdegmaenckmlobgzzuvihv/Build/Intermediates.noindex/SelfControl.build/Release/SCKillerHelper.build/Objects-normal/x86_64/SCKillerHelper_dependency_info.dat -o /Users/runner/Library/Developer/Xcode/DerivedData/SelfControl-exwysobdegmaenckmlobgzzuvihv/Build/Intermediates.noindex/SelfControl.build/Release/SCKillerHelper.build/Objects-normal/x86_64/Binary/SCKillerHelper
ld: warning: directory not found for option '-L/Users/runner/Library/Developer/Xcode/DerivedData/SelfControl-exwysobdegmaenckmlobgzzuvihv/Build/Products/Release/Sentry-library'
ld: library not found for -lSentry-library
clang: error: linker command failed with exit code 1 (use -v to see invocation)

** BUILD FAILED **


The following build commands failed:
	Ld /Users/runner/Library/Developer/Xcode/DerivedData/SelfControl-exwysobdegmaenckmlobgzzuvihv/Build/Intermediates.noindex/SelfControl.build/Release/SCKillerHelper.build/Objects-normal/x86_64/Binary/SCKillerHelper normal x86_64
(1 failure)
Error: Process completed with exit code 65.

Any ideas?

@cstigler
Copy link
Member

cstigler commented Oct 2, 2021

@karbassi You are a hero for even trying :) sorry for slow replies, life is busy right now so haven't had a ton of time for SC things

Re linker error I'm unfortunately not sure... I assume you've installed all the CocoaPods including Sentry, right? I'm a little confused about why there'd be a directory not found error given that, but it sounds like they might be in the wrong location. Are you getting this every time you build the application, or only in your GH action workflow? Because it does build fine for me in Xcode...

@karbassi
Copy link
Contributor Author

karbassi commented Oct 2, 2021

@cstigler I can't get a build on my own machine either.

Can you try the following steps with a fresh checkout of the repo?

gem install bundler
bundle install --jobs 4 --retry 3
bundle exec pod update
bundle exec pod install
xcodebuild CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -workspace SelfControl.xcworkspace -scheme "SelfControl" -configuration Release clean build

or

gem install cocoapods
pod update
pod install
xcodebuild CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO -workspace SelfControl.xcworkspace -scheme "SelfControl" -configuration Release clean build

Does either of these work?

@cstigler
Copy link
Member

cstigler commented Oct 4, 2021

@karbassi I tried the pod option (I use CocoaPods and have never used bundler), and yes it ended in ** BUILD SUCCEEDED **. Not sure what the difference would be from your machine?

@karbassi
Copy link
Contributor Author

karbassi commented Oct 5, 2021

@cstigler Giving it another try.

It's failing on

error: Resource "/Users/runner/Library/Developer/Xcode/DerivedData/SelfControl-dpdwanchopaupoeqgmaigqitevtq/Build/Products/Release/MASPreferences/MASPreferences.framework/en.lproj/MASPreferencesWindow.nib" not found. Run 'pod install' to update the copy resources script.

See. https://github.com/karbassi/selfcontrol/runs/3798631253?check_suite_focus=true

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.

2 participants