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

XcodeGenKit/resource_bundle_accessor.swift:44: Fatal error: unable to find bundle named XcodeGen_XcodeGenKit #1445

Closed
persidskiy opened this issue Feb 14, 2024 · 17 comments · Fixed by #1448

Comments

@persidskiy
Copy link

persidskiy commented Feb 14, 2024

XcodeGen: 2.39.0
Xcode: 15.2

When I run the latest xcodegen, I see this error:

⚙️  Generating plists...
⚙️  Generating project...
XcodeGenKit/resource_bundle_accessor.swift:44: Fatal error: unable to find bundle named XcodeGen_XcodeGenKit
[1]    3755 trace trap  xcodegen

There were no such errors in version 2.38.0.

@freddi-kit
Copy link
Collaborator

It may be my fault due to artifact bundle, let me research

@freddi-kit
Copy link
Collaborator

Are you using XcodeGen from Swift Package? And what commands are you using?

@persidskiy
Copy link
Author

persidskiy commented Feb 14, 2024

@freddi-kit I download the binary from the Github releases page. I use xcodegen command to generate from the local project.yml file. You can checkout the repo and try it locally

@OdNairy
Copy link
Contributor

OdNairy commented Feb 14, 2024

@freddi-kit Here is the code we use to download xcodegen on the CircleCI:

XCODEGEN_DIR="$HOME/xcodegen" && mkdir -p $XCODEGEN_DIR
curl -L -f https://github.com/yonaskolb/XcodeGen/releases/download/2.38.0/xcodegen.zip -o "${HOME}/xcodegen.zip"
unzip "${HOME}/xcodegen.zip" -d "${XCODEGEN_DIR}/"
echo 'export PATH="$HOME/xcodegen/xcodegen/bin:$PATH"' >> $BASH_ENV
source $BASH_ENV

@freddi-kit
Copy link
Collaborator

I see, I'm sorry because I'm busy so let me investigate at Sunday in Japanese Time ... 🙇🙇🙇

@freddi-kit
Copy link
Collaborator

freddi-kit commented Feb 14, 2024

Or you can see my PR to how to fix it, please check my pr what I changed

@freddi-kit
Copy link
Collaborator

freddi-kit commented Feb 14, 2024

It's #1388. My change may wrong on loading Bundle

@kkebo
Copy link

kkebo commented Feb 14, 2024

By this change and this Bundle.module, the xcodegen command now seems to require XcodeGen_XcodeGenKit.bundle at runtime.

So, as a workaround, you can run xcodegen successfully by copying XcodeGen_XcodeGenKit.bundle from xcodegen.artifactbundle.zip into bin.

XCODEGEN_DIR="$HOME/xcodegen" && mkdir -p $XCODEGEN_DIR
curl -L -f https://github.com/yonaskolb/XcodeGen/releases/download/2.39.0/xcodegen.zip -o "${HOME}/xcodegen.zip"
unzip "${HOME}/xcodegen.zip" -d "${XCODEGEN_DIR}/"

curl -LO https://github.com/yonaskolb/XcodeGen/releases/download/2.39.0/xcodegen.artifactbundle.zip
unzip xcodegen.artifactbundle.zip
cp -rp xcodegen.artifactbundle/xcodegen-2.39.0-macosx/bin/XcodeGen_XcodeGenKit.bundle "$XCODEGEN_DIR/xcodegen/bin/"

echo 'export PATH="$HOME/xcodegen/xcodegen/bin:$PATH"' >> $BASH_ENV
source $BASH_ENV

Or, you can just use xcodegen.artifactbundle.zip instead of xcodegen.zip like this:

XCODEGEN_DIR="$HOME/xcodegen" && mkdir -p $XCODEGEN_DIR
curl -L -f https://github.com/yonaskolb/XcodeGen/releases/download/2.39.0/xcodegen.artifactbundle.zip -o "${HOME}/xcodegen.artifactbundle.zip"
unzip "${HOME}/xcodegen.artifactbundle.zip" -d "${XCODEGEN_DIR}/"

echo 'export PATH="$HOME/xcodegen/xcodegen.artifactbundle/xcodegen-2.39.0-macosx/bin:$PATH"' >> $BASH_ENV
source $BASH_ENV

@daltonclaybrook
Copy link
Contributor

I am experiencing this issue as well. Installing XcodeGen on CI using mint install yonaskolb/xcodegen

@kkebo
Copy link

kkebo commented Feb 14, 2024

@daltonclaybrook What version of Mint are you using? I'm using Mint 0.17.5 and have no issues. Mint versions older than 0.17.2 do not copy bundles.

https://github.com/yonaskolb/Mint/releases

@daltonclaybrook
Copy link
Contributor

I'm using 0.17.5 as well. Installing mint on CI with brew install mint

@kkebo
Copy link

kkebo commented Feb 14, 2024

I don't know why that issue didn't occur on my side, but your issue may be related to the following issue.

yonaskolb/Mint#261

@yonaskolb
Copy link
Owner

Can anyone having issues confirm that 2.39.1 fixes the issue?

@freddi-kit
Copy link
Collaborator

freddi-kit commented Feb 15, 2024

@freddi-kit
Copy link
Collaborator

sorry, please ignore above my comment

@freddi-kit
Copy link
Collaborator

It looks fixed from my sight with released binary in https://github.com/yonaskolb/XcodeGen/releases/tag/2.39.1

@persidskiy
Copy link
Author

The fix works, thank you all!

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 a pull request may close this issue.

6 participants