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

gemspecs created by bundle gem won't build in Tebako images without access to the host git repo. #40

Open
bradgessler opened this issue Jan 15, 2025 · 3 comments

Comments

@bradgessler
Copy link

Continuing from issue tamatebako/tebako#233 where I discovered this issue.

When gems are created via bundle gem, the spec.files are pulled from a list of files created by git. When this is mounted inside of an image and built, the path git expects is from the host machine, not the container, so it fails silently and no files are returned to the gemspec.

Tebako then picks up the valid gemspec with no files and builds it, but nothing is in there, which creates surprisingly results when the tebako build fails.

@bradgessler
Copy link
Author

I created a PR at #41; however I think it's brittle. It only works assuming the host directory that's mounted into the container also has a git repe. If it doesn't, tebako may fail in this surprising way.

Another mitigation this problem might include Tebako doing a few sanity checks on the files its packaging. For example, if tebako detects there's no files its packaging, it could fail with a more helpful error message.

@maxirmx
Copy link
Member

maxirmx commented Jan 26, 2025

I guess the issue is that you checkout the repository with gem source using host installation of git ("host repo") and run tebako press that calls container installation of git.

Package using an ephemeral container shall work for "host repo"

At least it works for our CI tests for fontist gem that uses magic bundler definition

maxirmx added a commit that referenced this issue Jan 26, 2025
maxirmx added a commit that referenced this issue Jan 27, 2025
maxirmx added a commit that referenced this issue Jan 27, 2025
@bradgessler
Copy link
Author

I guess the issue is that you checkout the repository with gem source using host installation of git ("host repo") and run tebako press that calls container installation of git.

Correct, that's why this line in my PR has been added to the container: https://github.com/tamatebako/tebako-ci-containers/pull/41/files#diff-c3917ed6015b41275b16f95b557fffa7ed17fd34b4f6205a5c6b1855996a465bR46-R49

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

2 participants