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

Issue when running sourcery from binary #1202

Closed
ugoArangino opened this issue Sep 18, 2023 · 18 comments · Fixed by #1203
Closed

Issue when running sourcery from binary #1202

ugoArangino opened this issue Sep 18, 2023 · 18 comments · Fixed by #1203

Comments

@ugoArangino
Copy link

Version: 2.1.0

SourceryJS/resource_bundle_accessor.swift:11: Fatal error: could not load resource bundle: from /Users/…/Documents/ios/bin/Sourcery_SourceryJS.bundle or /Users/art-divin/Documents/Projects/Sourcery-master/build/arm64-apple-macosx/release/Sourcery_SourceryJS.bundle

@ugoArangino
Copy link
Author

@art-divin Looks like this PR has introduced this: #1188

@JohnEstropia
Copy link

We're seeing this issue as well

@art-divin
Copy link
Collaborator

👋🏻 Hello

Thank you for reporting @ugoArangino and @JohnEstropia ,

I'll need some time to figure this out. Could you please fallback to using 2.0.2 or, if performance is not that big of a deal, 2.0.3?

I'll keep you posted ⏲️

@alpha-moisol
Copy link

Same issue here

@piwo33
Copy link

piwo33 commented Sep 18, 2023

@art-divin how exactly should we rollback to version 2.0.2 / 2.0.3 with brew?

@art-divin
Copy link
Collaborator

@piwo33 thank you, makes sense, very cumbersome with Brew.

Testing on CI #1203 , if green I'll merge it and try to release 2.1.1 hotfix today.

@dafurman
Copy link

If anyone using homebrew wants a workaround, run this from your download directory to downgrade down to 2.0.3

curl -L https://github.com/krzysztofzablocki/Sourcery/releases/download/2.0.3/sourcery-2.0.3.zip --output sourcery-2.0.3.zip && unzip -d sourcery-2.0.3 sourcery-2.0.3.zip && sudo cp sourcery-2.0.3/bin/sourcery /opt/homebrew/bin/sourcery

@art-divin
Copy link
Collaborator

art-divin commented Sep 18, 2023

Update: I figured a way to workaround the issue.

Context

For swift test to work, a different way of searching for ejs template on macOS was implemented according to "best practices" due to issues with SPM (more info here).
But the problem with this is that when running Sourcery from CLI, it is packaged differently for release mode, and so, it cannot find the required resources like for swift test.

Workaround

  1. Revert changes for before the migration to swift test
  2. Create a separate version of implementation that works with swift test and put it under #if DEBUG because swift test runs tests in DEBUG, and Sourcery CLI is distributed with -c release compilation mode.

Waiting for CI ⏲️

I am very sorry for the disturbance, but I suspect that there are missing integration tests because otherwise I would not merge that MR. So, I have added this use case to explore into TODO - #1198 .

@art-divin
Copy link
Collaborator

I have re-opened this issue until the new release is out ⏲️

@diegoccastano
Copy link

diegoccastano commented Sep 18, 2023

curl -L https://github.com/krzysztofzablocki/Sourcery/releases/download/2.0.3/sourcery-2.0.3.zip --output sourcery-2.0.3.zip && unzip -d sourcery-2.0.3 sourcery-2.0.3.zip && sudo cp sourcery-2.0.3/bin/sourcery /opt/homebrew/bin/sourcery

In a similar way, I also solved the problem by doing brew install sourcery, which will install the most current version, and then I give the brew info sourcery command to find out where the installation was done, so I find out where the binary folder is, and I overwrite it with this command above that I will repeat here to make it easier:

curl -L https://github.com/krzysztofzablocki/Sourcery/releases/download/2.0.3/sourcery-2.0.3.zip --output sourcery -2.0.3.zip && unzip -d sourcery-2.0.3 sourcery-2.0.3.zip && sudo cp sourcery-2.0.3/bin/sourcery /usr/local/Cellar/sourcery/2.1.0/bin/sourcery

In this case, /usr/local/Cellar/sourcery/2.1.0/bin/sourcery is the copy destination, that's what I discovered with the help of brew info. The version overwritten by version 2.0.3 is 2.1.0 (most current). If you want to install other versions, just go to releases in the Sourcery repository on GitHub.

@art-divin
Copy link
Collaborator

👋🏻 Update:

2.1.1 release was published. Please see if you have any issues, thank you 🙏🏻

@philprime
Copy link

@art-divin when is the release 2.1.1 going to be available on Homebrew?

@art-divin
Copy link
Collaborator

👋🏻 @philprime, thank you for your question 💯

I think it happens automatically, for 2.1.0 I did exactly nothing to make it available there. ⏲️

@mol-ideals
Copy link

@art-divin when is the release 2.1.1 going to be available on Homebrew?

👋🏻 @philprime, thank you for your question 💯

I think it happens automatically, for 2.1.0 I did exactly nothing to make it available there. ⏲️

It seems like the PR actually needs to be done manually. Fortunately, someone has already done it: Homebrew/homebrew-core#143894

@chenrui333
Copy link

@art-divin when is the release 2.1.1 going to be available on Homebrew?

👋🏻 @philprime, thank you for your question 💯
I think it happens automatically, for 2.1.0 I did exactly nothing to make it available there. ⏲️

It seems like the PR actually needs to be done manually. Fortunately, someone has already done it: Homebrew/homebrew-core#143894

just raise an issue on the homebrew release part, #1205 (should be pretty straightforward for maintainer to pick it up.)

@art-divin
Copy link
Collaborator

Thank you all for your input and for raising this issue.

Homebrew MR was merged some 45 minutes ago, and so, please check if the 2.1.1 would work in your environments, I do not have much to test it against, except very basic setups.

@ericklborges
Copy link

ericklborges commented Sep 19, 2023

It is already available, I just upgraded to 2.1.1 and it worked just fine!

@art-divin
Copy link
Collaborator

Thanks for your feedback @ericklborges , it was a tough release, my internet barely made it 😓 😄

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.