Skip to content

Don't gitignore project file - #217

Open
composerinteralia wants to merge 1 commit into
ueno:masterfrom
composerinteralia:patch-1
Open

composerinteralia wants to merge 1 commit into
ueno:masterfrom
composerinteralia:patch-1

Conversation

@composerinteralia

@composerinteralia composerinteralia commented Oct 21, 2026 •

Copy link
Copy Markdown

I assume gpgme_n.* was added to ignore compiled files (.so or whatever), but it also has the effect of ignoring a project file: https://github.com/ueno/ruby-gpgme/blob/master/ext/gpgme/gpgme_n.c

That ends up causing problems when trying to use a Bundler git source for this gem, because Bundler git sources copy the repo contents into the cache, but the gitignored file won't ever make it into the outer git repository. Here's a semi-realistic reproduction of what we ran into:

# Set up project
mkdir gpgme-test
cd gpgme-test
git init
echo "vendor/gems" > .gitignore
bundle init
bundle config set --local path vendor/gems

# Add gpgme as a (cached) git source gem
bundle add gpgme --github=ueno/ruby-gpgme --skip-install
bundle cache --no-install
git add -A
git commit -m "Test"

# Simulate a fresh clone
rm -rf vendor/gems
git clean -fdx

bundle install --local
bundle exec ruby -rgpgme -e 'puts "hi"'

By the time the bundle install happens, gpgme_n.c is gone and you end up with an error:

cannot load such file -- gpgme_n (LoadError)

I assume `gpgme_n.*` was added to ignore compiled files (.so or whatever), but it also has the effect of ignoring a project file: https://github.com/ueno/ruby-gpgme/blob/master/ext/gpgme/gpgme_n.c

That ends up causing problems when trying to use a Bundler git source for this gem, because Bundler git sources copy the repo contents into the cache, but the git ignored file won't ever make it into the repository. Here's a semi-realistic reproduction of what we ran into:

```
# Set up project
mkdir gpgme-test
cd gpgme-test
git init
echo "vendor/gems" > .gitignore
bundle init
bundle config set --local path vendor/gems

# Add gpgme as a git source gem
bundle add gpgme --github=ueno/ruby-gpgme --skip-install
bundle cache --no-install
git add -A
git commit -m "Test"

# Simulate a fresh clone
rm -rf vendor/gems
git clean -fdx

bundle install --local
bundle exec ruby -rgpgme -e 'puts "hi"'
```

By the time the bundle install happens, gpgme_n.c is gone and you end up with an error:

```
cannot load such file -- gpgme_n (LoadError)
```
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.

1 participant