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

[ruby] Builtin type-stubs for Ruby #4501

Merged
merged 18 commits into from
Apr 30, 2024
Merged

Conversation

AndreiDreyer
Copy link
Contributor

This PR handles:

  • Downloads compressed type-stubs from joern-type-stubs release during sbt stage and sha512 checksums the downloaded files with the sha512 on joern-type-stubs release page
  • Populates the initial namespaceToType map from the builtin type-stubs

Todo:

  • Filter out types from the namespaceToType map that are not imported

@AndreiDreyer AndreiDreyer added the ruby Relates to rubysrc2cpg label Apr 29, 2024
@AndreiDreyer AndreiDreyer self-assigned this Apr 29, 2024
Copy link
Collaborator

@DavidBakerEffendi DavidBakerEffendi left a comment

Choose a reason for hiding this comment

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

Very nice!

AndreiDreyer and others added 6 commits April 30, 2024 07:55
* Created a `typestub` package in `x2cpg` which specifies a config extension and meta-data to provide package path information
* Reworked type stubs to store the downloaded files in a similar strategy to AST Gen binaries
* Positioned the type stubs in a way that will allow for potentially more Ruby-related stubs
* Kept the SHA512 file otherwise it is downloaded everytime `sbt compile` is called
@DavidBakerEffendi
Copy link
Collaborator

@AndreiDreyer Could you also test that this works in the Joern shell before you merge?

@AndreiDreyer AndreiDreyer merged commit 1a813c9 into master Apr 30, 2024
5 checks passed
@DavidBakerEffendi DavidBakerEffendi deleted the andrei/ruby/pull-type-stubs branch May 1, 2024 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ruby Relates to rubysrc2cpg
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants