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

Cannot find bundle with Bundle.module #261

Open
jagreenwood opened this issue Mar 9, 2023 · 5 comments
Open

Cannot find bundle with Bundle.module #261

jagreenwood opened this issue Mar 9, 2023 · 5 comments

Comments

@jagreenwood
Copy link

I have a simple executable package that defines a resource bundle and tries to reference the bundle with Bundle.module.

When the executable is installed with Mint and then run, it throws an error Fatal error: could not load resource bundle because it is looking for the bundle in ~/.mint/bin/ alongside the executable symlink when it is actually located in the ~/mint/packages/... directory alongside the executable.

I did some testing and moving the bundle to ~/.mint/bin/ resolves the issue.

@yonaskolb
Copy link
Owner

What's your mint --version? There were some changes around this in the newer releases

@jagreenwood
Copy link
Author

I was on 0.17.2 but updated to 0.17.5 and I've got the same issue.

Looking at the dynamically generated resource_bundle_accessor.swift source, I think it is looking for the bundle at

// For command-line tools.
Bundle.main.bundleURL,

I don't exactly know how the system treats running executables from symlinks, but in terms of looking for resources, it appears to not follow the link.

With the latest changes I see in 0.17.5, would it be reasonable to simply move all build artifacts to ~/mint/bin/ rather than create symlinks? I don't have the history of knowing why ~/mint/packages/ is important, apologies if that is a ridiculous suggestion.
I can make that change and PR it if that makes sense to do.

@jagreenwood
Copy link
Author

@yonaskolb What are your thoughts on a fix for this? I'd be happy to contribute to a fix.

@yaroslavyaroslav
Copy link

I think this one is related to that: SwiftGen/SwiftGen#905

@yonaskolb
Copy link
Owner

@jagreenwood ~/.mint/bin was created here #216 as a location for the single "globally" installed version of a package. ~/.mint/packages is for all build artefacts for all versions.

I'm not sure how to best resolve this situation, but have 2 thoughts:

  • these will still work if you use mint run ..., as opposed to using mint install ... and then running separately.
  • we can't really just copy the bundles into /bin as they would collide with bundles from other executables (and maybe even different versions of those same bundles)

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

No branches or pull requests

3 participants