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

chore: switch to an XcodeGen project file #32

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

ThomasK33
Copy link
Member

@ThomasK33 ThomasK33 commented Jan 24, 2025

This PR transitions the project from a manually maintained .xcodeproj file to an XcodeGen-managed project configuration.
It introduces a streamlined development workflow using XcodeGen to generate project files dynamically and includes necessary updates to documentation, .gitignore, and CI configuration.

Change-Id: I753a7652cdc730157ae7f8bc036338bae5e6b54b
Signed-off-by: Thomas Kosiewski [email protected]

Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ThomasK33 ThomasK33 linked an issue Jan 24, 2025 that may be closed by this pull request
@ThomasK33 ThomasK33 force-pushed the 01-24-chore_switch_to_an_xcodegen_project_file branch 10 times, most recently from 8f5f751 to 3b3eaf9 Compare January 24, 2025 15:00
@ThomasK33 ThomasK33 marked this pull request as ready for review January 24, 2025 15:00
@ThomasK33 ThomasK33 self-assigned this Jan 24, 2025
Copy link
Member

@ethanndickson ethanndickson left a comment

Choose a reason for hiding this comment

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

For some reason the runtime search paths for the frameworks has changed, despite the config looking mostly the same:

When starting the network extension I'm getting:

ASI found [dyld] (sensitive) 'Library not loaded: /Library/Frameworks/VPNLib.framework/Versions/A/VPNLib
  Referenced from: <306B8001-A2DD-3B40-8152-B2257E804958> /Library/SystemExtensions/0EB23306-84D3-465D-9069-4140FD750438/com.coder.Coder-Desktop.VPN.systemextension/Contents/MacOS/com.coder.Coder-Desktop.VPN
  Reason: tried: '/Library/Frameworks/VPNLib.framework/Versions/A/VPNLib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Library/Frameworks/VPNLib.framework/Versions/A/VPNLib' (no such file), '/Library/Frameworks/VPNLib.framework/Versions/A/VPNLib' (no such file)'

Previously, the build folder in XCode was included in the list of directories it would look for the library, not just the system stores I know this because the tried list would include it when I had the same error before I embedded them, here's that error message:

ASI found [dyld] (sensitive) 'Library not loaded: @rpath/VPNLib.framework/Versions/A/VPNLib
  Referenced from: <3CE45B2E-A079-384F-88F8-1CE9C94C7020> /Library/SystemExtensions/A55BDC5F-9B8D-4AEA-AFC7-B5D63AFADFD8/com.coder.Coder-Desktop.VPN.systemextension/Contents/MacOS/com.coder.Coder-Desktop.VPN
  Reason: tried: '/Users/ethan/Library/Developer/Xcode/DerivedData/Coder_Desktop-ffdgfuvlnrlswxdjjgbkxtwmhuwc/Build/Products/Debug/PackageFrameworks/VPNLib.framework/Versions/A/VPNLib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Users/ethan/Library/Developer/Xcode/DerivedData/Coder_Desktop-ffdgfuvlnrlswxdjjgbkxtwmhuwc/Build/Products/Debug/PackageFrameworks/VPNLib.framework/Versions/A/VPNLib' (no such file), '/Library/SystemExtensions/A55BDC5F-9B8D-4AEA-AFC7-B5D63AFADFD8/com.coder.Coder-Desktop.VPN.systemextension/Contents/Frameworks/VPNLib.framework/Versions/A/VPNLib' (no such file), '/Library/SystemExtensions/Frameworks/VPNLib.framework/Versions/A/VPNLib' (no such file), '/Users/ethan/Library/Devel<…>'

But curiously:
This is on main:
image
and this is on this branch:
image

Perhaps it could be worth scrapping the dynamic frameworks altogether, and just including the contents of VPNLib and CoderSDK as compile targets for the app and NE, i.e. this setting:
image
WDYT?

flake.nix Show resolved Hide resolved
Coder Desktop/project.yml Show resolved Hide resolved
Makefile Show resolved Hide resolved
base:
INFOPLIST_FILE: VPN/Info.plist
PRODUCT_MODULE_NAME: "$(PRODUCT_NAME:c99extidentifier)"
PRODUCT_NAME: "$(inherited)"
Copy link
Member

Choose a reason for hiding this comment

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

I had to set PRODUCT_NAME to $(PRODUCT_BUNDLE_IDENTIFIER for the app to get the OS to prompt me to install the NE.

Copy link
Member Author

Choose a reason for hiding this comment

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

Interesting. Was that already committed to the main branch?

When looking at the pbxproj file from main, it's set to inherit, so I carried it over as is.

Screenshot 2025-01-27 at 10.27.56.png

Copy link
Member

@ethanndickson ethanndickson Jan 27, 2025

Choose a reason for hiding this comment

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

I believe it's cause you have the base setting for PRODUCT_NAME set to $(TARGET_NAME):

PRODUCT_NAME: "$(TARGET_NAME)"

Whereas on main the base value for PRODUCT_NAME is currently empty.

Setting that base value (changing the setting when the project is selected in XCode) causes it to inherit from that.

Copy link
Member Author

Choose a reason for hiding this comment

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

Does the PRODUCT_NAME: "$(PRODUCT_BUNDLE_IDENTIFIER)" only apply to this system extension, or should I remove that default base value?

Copy link
Member

Choose a reason for hiding this comment

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

yeah only the system extension is $(inherited), everything else is $(TARGET_NAME) (with ..:c99extidentifier for the frameworks)

Coder Desktop/project.yml Show resolved Hide resolved
Makefile Show resolved Hide resolved
@ThomasK33 ThomasK33 force-pushed the 01-24-chore_switch_to_an_xcodegen_project_file branch 4 times, most recently from ea316ce to 81bc611 Compare January 27, 2025 15:22
@ThomasK33 ThomasK33 force-pushed the 01-24-chore_switch_to_an_xcodegen_project_file branch from 81bc611 to 54eb681 Compare January 28, 2025 11:33
Change-Id: I753a7652cdc730157ae7f8bc036338bae5e6b54b
Signed-off-by: Thomas Kosiewski <[email protected]>
@ThomasK33 ThomasK33 force-pushed the 01-24-chore_switch_to_an_xcodegen_project_file branch from 54eb681 to 4a91b6d Compare January 28, 2025 16:30
Copy link
Member

@ethanndickson ethanndickson left a comment

Choose a reason for hiding this comment

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

Coder Desktop runs end-to-end with this config, so LGTM!

@ThomasK33 ThomasK33 merged commit 511bafd into main Jan 29, 2025
4 checks passed
@ThomasK33 ThomasK33 deleted the 01-24-chore_switch_to_an_xcodegen_project_file branch January 29, 2025 07:29
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.

Autogenerate XCode project files in the repo
3 participants