Skip to content

Commit

Permalink
version 1.6 public release
Browse files Browse the repository at this point in the history
  • Loading branch information
chengniansun committed Apr 10, 2023
1 parent 782478b commit ec4b9df
Show file tree
Hide file tree
Showing 939 changed files with 104,773 additions and 52,619 deletions.
4 changes: 3 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
build --workspace_status_command "./version/org/perses/version/compute_workspace_buildstamp.sh"
build --workspace_status_command "./version/org/perses/version/compute_workspace_buildstamp.sh"
# build --aspects=@rules_rust//rust:defs.bzl%rust_clippy_aspect
build --output_groups=+clippy_checks
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/bazel*
.ijwb
.clwb
.idea
*.tmp

Expand Down Expand Up @@ -39,4 +40,4 @@ __pycache__
perses_result*
t.c.*.orig

perses-fuzzer
perses-fuzzer
50 changes: 25 additions & 25 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,8 @@ package(
default_visibility = ["//visibility:public"],
)

###################################################################################################
#
# The following is copied from
# https://github.com/bazelbuild/buildtools/tree/master/buildifier
#
###################################################################################################
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier")
load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "define_kt_toolchain")

buildifier(
name = "buildifier",
)

alias(
name = "antlr_tool",
actual = "@maven//:org_antlr_antlr4",
Expand All @@ -26,8 +15,17 @@ alias(
)

alias(
name = "jgrapht",
actual = "@maven//:org_jgrapht_jgrapht_core",
)

java_library(
name = "asm",
actual = "@maven//:org_ow2_asm_asm_all",
exports = [
"@maven//:org_ow2_asm_asm",
"@maven//:org_ow2_asm_asm_commons",
"@maven//:org_ow2_asm_asm_util",
],
)

alias(
Expand Down Expand Up @@ -67,22 +65,15 @@ java_binary(
alias(
name = "guava",
actual = "@maven//:com_google_guava_guava",
visibility = ["//visibility:public"],
)

java_library(
alias(
name = "flogger",
visibility = ["//visibility:public"],
exports = [
"//src/org/perses/util:flogger_kt_exts",
"@maven//:com_google_flogger_flogger",
"@maven//:com_google_flogger_flogger_system_backend",
],
actual = "//src/org/perses/util:flogger_kt_exts",
)

java_library(
name = "jackson",
visibility = ["//visibility:public"],
exports = [
"@maven//:com_fasterxml_jackson_core_jackson_annotations",
"@maven//:com_fasterxml_jackson_core_jackson_core",
Expand All @@ -96,21 +87,30 @@ java_library(
alias(
name = "jcommander",
actual = "@maven//:com_beust_jcommander",
visibility = ["//visibility:public"],
)

java_library(
name = "truth",
visibility = ["//visibility:public"],
exports = [
"@maven//:com_google_truth_truth",
"@maven//:com_googlecode_java_diff_utils_diffutils",
],
)

java_library(
name = "gumtree",
exports = [
"@maven//:com_github_gumtreediff_core",
],
)

define_kt_toolchain(
name = "kotlin_toolchain",
api_version = "1.5",
# Can't upgrade to 1.7 because it is still experimental which has limited JSR223 compatibility
# TODO(cnsun): upgrade when JSR is ready and revert back to 1.6
api_version = "1.6",
jvm_target = "1.8",
language_version = "1.5",
language_version = "1.6",
)

exports_files(["README.md"])
23 changes: 16 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,22 @@ search space by avoiding generating syntactically invalid programs.

Currently, Perses supports reduction for the following programming languages:

+ C
+ Rust
+ Java 8
+ Go
+ System Verilog

Support for other languages is comming soon.
+ C: [c]
+ Cpp: [cc, cpp, cxx]
+ Rust: [rs]
+ Scala: [scala, sc]
+ Java: [java]
+ JavaScript: [javascript, js]
+ Python3: [py, py3]
+ Go: [go]
+ PHP: [php]
+ Ruby: [rb]
+ SQLite: [sqlite]
+ Solidity: [sol]
+ System_Verilog: [v, sv]
+ SMTLIBv2: [smt2]

Support for other languages is coming soon.

### Obtain and Run ###

Expand Down
130 changes: 96 additions & 34 deletions WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

RULES_JVM_EXTERNAL_TAG = "2.6"
RULES_JVM_EXTERNAL_TAG = "4.4.2"

RULES_JVM_EXTERNAL_SHA = "064b9085b21c349c8bd8be015a73efd6226dd2ff7d474797b3507ceca29544bb"
RULES_JVM_EXTERNAL_SHA = "735602f50813eb2ea93ca3f5e43b1959bd80b213b836a07a62a29d757670b77b"

http_archive(
name = "rules_jvm_external",
Expand All @@ -13,37 +13,47 @@ http_archive(

load("@rules_jvm_external//:defs.bzl", "maven_install")

jackson_version = "2.14.2"

antlr_version = "4.12.0"

flogger_version = "0.7.4"

maven_install(
name = "maven",
artifacts = [
"com.beust:jcommander:1.81",
"com.fasterxml.jackson.core:jackson-core:2.12.3",
"com.fasterxml.jackson.core:jackson-databind:2.12.3",
"com.fasterxml.jackson.core:jackson-annotations:2.12.3",
"com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.12.3",
"com.fasterxml.jackson.datatype:jackson-datatype-guava:2.12.3",
"com.fasterxml.jackson.module:jackson-module-kotlin:2.12.3",
"com.beust:jcommander:1.82",
"com.fasterxml.jackson.core:jackson-core:%s" % jackson_version,
"com.fasterxml.jackson.core:jackson-databind:%s" % jackson_version,
"com.fasterxml.jackson.core:jackson-annotations:%s" % jackson_version,
"com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:%s" % jackson_version,
"com.fasterxml.jackson.datatype:jackson-datatype-guava:%s" % jackson_version,
"com.fasterxml.jackson.module:jackson-module-kotlin:%s" % jackson_version,
"com.google.errorprone:error_prone_annotations:2.3.4",
"com.google.flogger:flogger-system-backend:0.5.1",
"com.google.flogger:flogger:0.5.1",
"com.google.googlejavaformat:google-java-format:1.7",
"com.google.guava:guava:30.1-jre",
"com.google.truth:truth:1.1.2",
"com.google.flogger:flogger-system-backend:%s" % flogger_version,
"com.google.flogger:flogger:%s" % flogger_version,
"com.google.googlejavaformat:google-java-format:1.15.0",
"com.google.guava:guava:31.1-jre",
"com.google.truth:truth:1.1.3",
"com.googlecode.java-diff-utils:diffutils:1.3.0",
"com.pinterest:ktlint:0.42.1",
"com.guardsquare:proguard-base:7.2.1",
"com.github.gumtreediff:core:3.0.0",
"com.pinterest:ktlint:0.48.2",
"io.gitlab.arturbosch.detekt:detekt-cli:1.16.0",
"it.unimi.dsi:fastutil:8.5.2",
"me.lemire.integercompression:JavaFastPFOR:0.1.9",
"org.antlr:antlr4-runtime:4.9.3",
"org.antlr:antlr4:4.9.3",
"org.antlr:antlr4-runtime:%s" % antlr_version,
"org.antlr:antlr4:%s" % antlr_version,
"org.apache.commons:commons-exec:1.3",
"org.apache.commons:commons-lang3:3.9",
"org.apache.commons:commons-text:1.9",
"org.checkerframework:checker-qual:2.11.0",
"org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31",
"org.jetbrains.kotlin:kotlin-scripting-jsr223:1.8.20", # Delete this. @TODO(gaosen)
"org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20",
"org.jfree:jfreechart:1.5.0",
"org.jgrapht:jgrapht-core:1.3.0",
"org.ow2.asm:asm-all:5.2",
"org.ow2.asm:asm:9.3",
"org.ow2.asm:asm-commons:9.3",
"org.ow2.asm:asm-util:9.3",
"junit:junit:4.13.2",
# Do not include org.jgrapht:jgrapht-io. It depends on antlr4-runtime:4.7.1
],
Expand All @@ -57,9 +67,9 @@ maven_install(

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

rules_kotlin_version = "v1.5.0-beta-4"
rules_kotlin_version = "v1.8-RC-1"

rules_kotlin_sha = "6cbd4e5768bdfae1598662e40272729ec9ece8b7bded8f0d2c81c8ff96dc139d"
rules_kotlin_sha = "1779628569eb3b0fe97a3fb5c3ed8090e6503e425600b401c7b1afb6b23a3098"

http_archive(
name = "io_bazel_rules_kotlin",
Expand All @@ -77,6 +87,44 @@ load("@io_bazel_rules_kotlin//kotlin:kotlin.bzl", "kt_register_toolchains")

register_toolchains("//:kotlin_toolchain")

###################################################################################################
# Configure rules for rust
###################################################################################################
rust_rules_version = "0.6.0"

rust_rules_sha256 = "872b04538ca20dad94791c348623f079ba93daf274c1d57ae6bfe0930ec77f0d"

# To find additional information on this release or newer ones visit:
# https://github.com/bazelbuild/rules_rust/releases
http_archive(
name = "rules_rust",
sha256 = rust_rules_sha256,
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_rust/releases/download/%s/rules_rust-v%s.tar.gz" % (rust_rules_version, rust_rules_version),
"https://github.com/bazelbuild/rules_rust/releases/download/%s/rules_rust-v%s.tar.gz" % (rust_rules_version, rust_rules_version),
],
)

load(
"@rules_rust//rust:repositories.bzl",
"rules_rust_dependencies",
"rust_register_toolchains",
)

rules_rust_dependencies()

rust_register_toolchains(
edition = "2018",
rustfmt_version = "1.59.0",
version = "1.59.0",
)

load("@rules_rust//proto:repositories.bzl", "rust_proto_repositories")

rust_proto_repositories()

load("@rules_rust//proto:transitive_repositories.bzl", "rust_proto_transitive_repositories")

###################################################################################################
#
# The following is copied from
Expand All @@ -85,27 +133,35 @@ register_toolchains("//:kotlin_toolchain")
###################################################################################################
# buildifier is written in Go and hence needs rules_go to be built.
# See https://github.com/bazelbuild/rules_go for the up to date setup instructions.
go_rules_version = "0.31.0"

go_rules_sha = "f2dcd210c7095febe54b804bb1cd3a58fe8435a909db2ec04e31542631cf715c"

http_archive(
name = "io_bazel_rules_go",
sha256 = "2b1641428dff9018f9e85c0384f03ec6c10660d935b750e3fa1492a281a53b0f",
sha256 = go_rules_sha,
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v0.29.0/rules_go-v0.29.0.zip",
"https://github.com/bazelbuild/rules_go/releases/download/v0.29.0/rules_go-v0.29.0.zip",
"https://mirror.bazel.build/github.com/bazelbuild/rules_go/releases/download/v%s/rules_go-v%s.zip" % (go_rules_version, go_rules_version),
"https://github.com/bazelbuild/rules_go/releases/download/v%s/rules_go-v%s.zip" % (go_rules_version, go_rules_version),
],
)

load("@io_bazel_rules_go//go:deps.bzl", "go_register_toolchains", "go_rules_dependencies")

go_rules_dependencies()

go_register_toolchains(version = "1.17.1")
go_register_toolchains(version = "1.18.1")

bazel_gazelle_version = "0.24.0"

bazel_gazelle_sha = "de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb"

http_archive(
name = "bazel_gazelle",
sha256 = "de69a09dc70417580aabf20a28619bb3ef60d038470c7cf8442fafcf627c21cb",
sha256 = bazel_gazelle_sha,
urls = [
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v0.24.0/bazel-gazelle-v0.24.0.tar.gz",
"https://mirror.bazel.build/github.com/bazelbuild/bazel-gazelle/releases/download/v%s/bazel-gazelle-v%s.tar.gz" % (bazel_gazelle_version, bazel_gazelle_version),
"https://github.com/bazelbuild/bazel-gazelle/releases/download/v%s/bazel-gazelle-v%s.tar.gz" % (bazel_gazelle_version, bazel_gazelle_version),
],
)

Expand All @@ -119,19 +175,25 @@ gazelle_dependencies()
# https://github.com/bazelbuild/buildtools/tree/master/buildifier
#
###################################################################################################
protobuf_rules_version = "3.20.1"

protobuf_rules_sha256 = "662879e41508a5ecce3be2c65563a8fac3301a48adef3113913ec4010f405a33"

http_archive(
name = "com_google_protobuf",
sha256 = "985bb1ca491f0815daad825ef1857b684e0844dc68123626a08351686e8d30c9",
strip_prefix = "protobuf-3.15.6",
urls = ["https://github.com/protocolbuffers/protobuf/archive/v3.15.6.zip"],
sha256 = protobuf_rules_sha256,
strip_prefix = "protobuf-%s" % protobuf_rules_version,
urls = ["https://github.com/protocolbuffers/protobuf/archive/v%s.zip" % protobuf_rules_version],
)

load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")

protobuf_deps()

buildtools_version = "5.1.0"

http_archive(
name = "com_github_bazelbuild_buildtools",
strip_prefix = "buildtools-4.0.1",
url = "https://github.com/bazelbuild/buildtools/archive/4.0.1.zip",
strip_prefix = "buildtools-%s" % buildtools_version,
url = "https://github.com/bazelbuild/buildtools/archive/%s.zip" % buildtools_version,
)
4 changes: 2 additions & 2 deletions antlropt/src/org/perses/antlr/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ kt_jvm_library(
"RuleType.kt",
],
deps = [
"//src/org/perses/util:perses_kt_exts",
"@maven//:org_antlr_antlr4",
"//:antlr_tool",
"//src/org/perses/util",
],
)
2 changes: 1 addition & 1 deletion antlropt/src/org/perses/antlr/RuleType.kt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ enum class RuleType(val signaturePrefix: String, val isLexerRule: Boolean) {
TOKEN("AUX_TOKEN__", isLexerRule = true),

/** The other rules */
OTHER_RULE("aux_rule__", isLexerRule = false);
OTHER_RULE("aux_rule__", isLexerRule = false), ;

val isParserRule: Boolean
get() = !isLexerRule
Expand Down
Loading

0 comments on commit ec4b9df

Please sign in to comment.