Skip to content

Fix bundle install step on CI for TruffleRuby - #1104

Merged
BobbyMcWho merged 1 commit into
omniauth:masterfrom
andrykonchin:ak/dont-cache-bundle-install-on-ci-for-truffleruby
Feb 17, 2023
Merged

BobbyMcWho merged 1 commit into
omniauth:masterfrom
andrykonchin:ak/dont-cache-bundle-install-on-ci-for-truffleruby

Conversation

@andrykonchin

@andrykonchin andrykonchin commented Feb 17, 2023 •

Copy link
Copy Markdown
Contributor

Currently CI builds agains TruffleRuby 22.3.1 are failed on the bundle install step.

...
Fetching webrick 1.7.0
  Installing webrick 1.7.0
  Fetching yard 0.9.28
  Installing yard 0.9.28
  --- ERROR REPORT TEMPLATE -------------------------------------------------------
  
...
  NoMethodError: undefined method `full_name' for nil:NilClass
    /home/runner/.rubies/truffleruby-22.3.0/lib/mri/bundler/installer/parallel_installer.rb:124:in `block (2 levels) in check_for_unmet_dependencies'
    /home/runner/.rubies/truffleruby-22.3.0/lib/mri/bundler/installer/parallel_installer.rb:123:in `each'
    /home/runner/.rubies/truffleruby-22.3.0/lib/mri/bundler/installer/parallel_installer.rb:123:in `block in check_for_unmet_dependencies'
    /home/runner/.rubies/truffleruby-22.3.0/lib/mri/bundler/installer/parallel_installer.rb:122:in `each'
    /home/runner/.rubies/truffleruby-22.3.0/lib/mri/bundler/installer/parallel_installer.rb:122:in `check_for_unmet_dependencies'
    /home/runner/.rubies/truffleruby-22.3.0/lib/mri/bundler/installer/parallel_installer.rb:[100](https://github.com/omniauth/omniauth/actions/runs/3970157787/jobs/6805553917#step:3:106):in `call'
    /home/runner/.rubies/truffleruby-22.3.0/lib/mri/bundler/installer/parallel_installer.rb:71:in `call'
    /home/runner/.rubies/truffleruby-22.3.0/lib/mri/bundler/installer.rb:262:in `install_in_parallel'
    /home/runner/.rubies/truffleruby-22.3.0/lib/mri/bundler/installer.rb:209:in `install'
    /home/runner/.rubies/truffleruby-22.3.0/lib/mri/bundler/installer.rb:89:in `block in run'
    /home/runner/.rubies/truffleruby-22.3.0/lib/mri/bundler/process_lock.rb:12:in `block in lock'
    <internal:core> core/io.rb:670:in `open'

https://github.com/omniauth/omniauth/actions/runs/3970157787/jobs/6805553917

I assume that the issue is related to invalid/incorrect cached Gemfile.lock file as far as locally I cannot reproduce the issue.

Removing bundler-cache: true option in the TruffleRuby workflow solves the issue.

I tried also to invalidate cache with cache-version option (https://github.com/ruby/setup-ruby#dealing-with-a-corrupted-cache) but it seems it doesn't work as I expected. My attempts are available in a fork repository https://github.com/andrykonchin/omniauth.

@BobbyMcWho BobbyMcWho left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will make CI slower on most builds, is there an alternative way to have truffle ruby install with a separate cache?

@andrykonchin

andrykonchin commented Feb 17, 2023 •

Copy link
Copy Markdown
Contributor Author

Yeah, it's a downside.

But looks like installing dependencies without caching works faster than using a broken cache.

A job without caching (link) - installing dependencies takes 34 s.
Jobs with caching enabled (link, link) - take 57 and 1m 5s.

I will probably create an issue for setup-ruby - to clarify how cache-version is supposed to work as far as it would be a proper solution here.

@BobbyMcWho

Copy link
Copy Markdown
Member

Ah, I forgot truffle Ruby has its own CI file, I'm fine with that in that case since it won't effect the other runtimes

@andrykonchin

Copy link
Copy Markdown
Contributor Author

Thank you!

@BobbyMcWho

Copy link
Copy Markdown
Member

@andrykonchin new errors in truffle, mind taking a look?

@andrykonchin

Copy link
Copy Markdown
Contributor Author

Failing specs (2 failed jobs) agains TruffleRuby 22.3.1 should be fixed by my another PR (#1105).

@BobbyMcWho
BobbyMcWho merged commit e21e096 into omniauth:master Feb 17, 2023
@andrykonchin
andrykonchin deleted the ak/dont-cache-bundle-install-on-ci-for-truffleruby branch February 17, 2023 17:21
@andrykonchin

Copy link
Copy Markdown
Contributor Author

Failed job with truffleruby-head looks like a transient failure (it looks to me caused by concurrent access to Hash).

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.

2 participants