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

[changelog skip] Allow Nolockfile to get to compile phase #1008

Merged
merged 2 commits into from Jun 3, 2020

Conversation

schneems
Copy link
Contributor

@schneems schneems commented Jun 2, 2020

Nolockfile does not define a number of things that base needs in terms of subclass overrides. By simply changing the parent class, we get reasonable versions of those things and allow the build to get as far as compile, so that the error can be emitted.

The error output without this change looks like:

[builder] -----> Compiling Ruby/NoLockfile
[builder]
[builder]  !
[builder]  !     must subclass
[builder]  !
[builder] /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/base.rb:65:in `default_addons': must subclass (RuntimeError)
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/base.rb:124:in `build_release'
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/base.rb:132:in `write_release_toml'
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/base.rb:103:in `build'
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/bin/support/ruby_build:26:in `block (2 levels) in <main>'
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/base.rb:190:in `log'
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/bin/support/ruby_build:25:in `block in <main>'
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/instrument.rb:35:in `block in trace'
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/instrument.rb:17:in `block in instrument'
[builder]       from /tmp/tmp.dL7R7BOXyl/lib/ruby/2.6.0/benchmark.rb:308:in `realtime'
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/instrument.rb:16:in `instrument'
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/instrument.rb:35:in `trace'
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/bin/support/ruby_build:21:in `<main>'

Nolockfile does not define a number of things that base needs in terms of subclass overrides. By simply changing the parent class, we get reasonable versions of those things and allow the build to get as far as compile, so that the error can be emitted.

The error output without this change looks like:

```
[builder] -----> Compiling Ruby/NoLockfile
[builder]
[builder]  !
[builder]  !     must subclass
[builder]  !
[builder] /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/base.rb:65:in `default_addons': must subclass (RuntimeError)
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/base.rb:124:in `build_release'
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/base.rb:132:in `write_release_toml'
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/base.rb:103:in `build'
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/bin/support/ruby_build:26:in `block (2 levels) in <main>'
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/base.rb:190:in `log'
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/bin/support/ruby_build:25:in `block in <main>'
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/instrument.rb:35:in `block in trace'
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/instrument.rb:18:in `block (2 levels) in instrument'
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/instrument.rb:40:in `yield_with_block_depth'
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/instrument.rb:17:in `block in instrument'
[builder]       from /tmp/tmp.dL7R7BOXyl/lib/ruby/2.6.0/benchmark.rb:308:in `realtime'
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/instrument.rb:16:in `instrument'
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/lib/language_pack/instrument.rb:35:in `trace'
[builder]       from /cnb/buildpacks/heroku_ruby/0.0.1/bin/support/ruby_build:21:in `<main>'
```
@schneems
Copy link
Contributor Author

schneems commented Jun 2, 2020

We have a test for v2 of the buildpack API, but not for CNB. This failure mode happens with CNB

@schneems
Copy link
Contributor Author

schneems commented Jun 3, 2020

Here's a fix for the failing tests #1010

@schneems schneems merged commit 6ce99e0 into master Jun 3, 2020
@schneems schneems deleted the evanphx-patch-2 branch June 3, 2020 15:32
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.

None yet

3 participants