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

steep check fails with no messages #158

Closed
tadd opened this issue Jun 30, 2020 · 3 comments · Fixed by #171
Closed

steep check fails with no messages #158

tadd opened this issue Jun 30, 2020 · 3 comments · Fixed by #171

Comments

@tadd
Copy link
Contributor

tadd commented Jun 30, 2020

Versions

  • Steep 0.17.1
  • RBS 0.4.0

Concrete example

https://github.com/tadd/exp-steep-net-http (including --verbose log files)

Details

I wrote a signature net-http.rbs:

class Net::HTTP
  def self.start: (String, Integer) { (instance) -> void } -> void
end

And an implementation app.rb:

require 'net/http'

class App
  def m
    # invalid call
    Net::HTTP.start
  end
end

Then, I executed a command bundle exec steep check app.rb but steep command failed without any outputs.

$ bundle exec steep check app.rb
$ echo $?
1

It runs well if I commented out the Net::HTTP.start line.

$ bundle exec steep check app.rb
$ echo $?
0

I tried the --verbose option in each run. The output message slightly differed.

-[Steep 0.17.1] [target=root] [target#type_check(target_sources: [app.rb], validate_signatures: true)] type checking 1 files took 0.023457556 seconds
-[Steep 0.17.1] [target=root] [target#type_check(target_sources: [app.rb], validate_signatures: true)] load signature and type check took 6.499966611 seconds
-[Steep 0.17.1] No type error found
+[Steep 0.17.1] [target=root] [target#type_check(target_sources: [app.rb], validate_signatures: true)] [synthesize:(1:1)] [synthesize:(3:1)] [synthesize:(4:3)] [synthesize:(6:5)] send
+[Steep 0.17.1] [target=root] [target#type_check(target_sources: [app.rb], validate_signatures: true)] [synthesize:(1:1)] [synthesize:(3:1)] [synthesize:(4:3)] [synthesize:(6:5)] [synthesize:(6:5)] const
+[Steep 0.17.1] [target=root] [target#type_check(target_sources: [app.rb], validate_signatures: true)] type checking 1 files took 0.010424531 seconds
+[Steep 0.17.1] [target=root] [target#type_check(target_sources: [app.rb], validate_signatures: true)] load signature and type check took 6.561480807 seconds

I doubt this is an internal bug of Steep.

@jeromegn
Copy link

jeromegn commented Jul 22, 2020

I have the same issue in a small/medium rails app.

Versions:

  • rbs (0.7.0)
  • steep (0.21.0)
  • rbs_rails (master)

What I did:

  • I used rbs_rails to get Rails typings. Things still work fine when I do that
  • I generated typings for all our models. This is when things got weird.

If I generate my types and they're in sig/app/models/model_name.rbs, it works fine. If I put them in sig/gen/app/models/... or sig/app/models/gen/..., it starts exhibiting the behavior mentioned in this issue.

I get similar logs with --verbose

$ bundle exec steep check --verbose
...
[Steep 0.21.0] [target=app] [target#type_check(target_sources: [app/models/organization.rb, app/models/application_record.rb], validate_signatures: true)] Validating class definition `::ActionController::Base`...
[Steep 0.21.0] [target=app] [target#type_check(target_sources: [app/models/organization.rb, app/models/application_record.rb], validate_signatures: true)] [::ActionController::Base] sig/rbs_rails/sig/generated/actionpack.rbs:907:32...907:39: Validating untyped...
[Steep 0.21.0] [target=app] [target#type_check(target_sources: [app/models/organization.rb, app/models/application_record.rb], validate_signatures: true)] load signature and type check took 6.528883814 seconds

$ echo $?
1

Our app is too big to try and create a minimal reproduction.

Edit: Things do not work with rbs_rails signature files from master. They do use a different (but valid) syntax.

@tadd
Copy link
Contributor Author

tadd commented Jul 29, 2020

Unfortunately, this issue seems to be occurred again. I updated my example repository to use Steep master.
https://github.com/tadd/exp-steep-net-http
https://github.com/tadd/exp-steep-net-http/blob/5b276fd/Gemfile.lock#L2-L3

@tadd
Copy link
Contributor Author

tadd commented Jul 29, 2020

I might be wrong... It may be another problem. I'll try to investigate.

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 a pull request may close this issue.

2 participants