Shopify / tapioca

The swiss army knife of RBI generation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

DSL RBI generation crashes

begonaguereca opened this issue · comments

When running:

bin/tapioca dsl --verify

It crashes with the following error:

Loading Rails application... Done
Loading DSL compiler classes... Done
Checking for out-of-date RBIs...

Error: `Tapioca::Dsl::Compilers::MixedInClassAttributes` failed to generate RBI for `ActiveModel::API`
Error: `Tapioca::Dsl::Compilers::MixedInClassAttributes` failed to generate RBI for `ActiveModel::AttributeMethods`
/Users/begonaguereca/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sorbet-runtime-0.5.11108/lib/types/private/abstract/declare.rb:40:in `block (2 levels) in declare_abstract': RBI::Param is declared as abstract; it cannot be instantiated (RuntimeError)
        from <internal:kernel>:90:in `tap'
        from /Users/begonaguereca/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/sorbet-runtime-0.5.11108/lib/types/private/abstract/declare.rb:38:in `block in declare_abstract'
        from /Users/begonaguereca/.rbenv/versions/3.2.2/lib/ruby/gems/3.2.0/gems/tapioca-0.10.5/lib/tapioca/runtime/dynamic_mixin_compiler.rb:148:in `block (3 levels) in compile_class_attributes'

Here is a copy of our tapioca file:

#!/usr/bin/env ruby
# frozen_string_literal: true

#
# This file was generated by Bundler.
#
# The application 'tapioca' is installed as part of a gem, and
# this file is here to facilitate running it.
#

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

bundle_binstub = File.expand_path("bundle", __dir__)

if File.file?(bundle_binstub)
  if File.read(bundle_binstub, 300).include?("This file was generated by Bundler")
    load(bundle_binstub)
  else
    abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run.
Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.")
  end
end

require "rubygems"
require "bundler/setup"

app_filepath = File.join(__dir__, "..", "lib", "valet.rb")
require_relative app_filepath

load Gem.bin_path("tapioca", "tapioca")

👋 Hey @begonaguereca,

I believe this has been fixed since v0.11.5 (#1467), can you update your version of Tapioca and try again?

Thanks.