-
Notifications
You must be signed in to change notification settings - Fork 321
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
WIP: Initial Bazel integration #9777
Draft
hubertp
wants to merge
18
commits into
develop
Choose a base branch
from
wip/frizi/bazel
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 17 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
bdce72d
initial bazel config wip
Frizi 6836fa8
.bazelignore and .bazelversion
hubertp d9387ac
bump rules_nodejs to fix node version issue
hubertp f0fe74e
bazel gui2 start of vite build
Frizi 314af22
Merge branch 'wip/frizi/bazel' of github.com:enso-org/enso into wip/f…
Frizi 873b904
Initial build setup for backend
hubertp e8a67cc
nit
hubertp b3f9472
declare missing pnpm transitive deps
Frizi 51d55d2
Merge branch 'wip/frizi/bazel' of github.com:enso-org/enso into wip/f…
Frizi ab61bd0
compile with graalvm
hubertp cd8f504
common options
hubertp fede7ef
Mixed Scala/Java, fixed scala_rules for latest JDK
hubertp 94e3a35
update module lock
hubertp 0ae2b60
test
hubertp 5bb8e4b
ignore directories
hubertp 38604ca
tests setup
hubertp 2d52296
generate pom.xml via bazel-distribution
hubertp 01b8f4e
Merge branch 'develop' into wip/frizi/bazel
Frizi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# all node modules | ||
node_modules | ||
app/gui2/node_modules | ||
app/ide-desktop/node_modules | ||
app/ide-desktop/lib/assets/node_modules | ||
app/ide-desktop/lib/client/node_modules | ||
app/ide-desktop/lib/common/node_modules | ||
app/ide-desktop/lib/content-config/node_modules | ||
app/ide-desktop/lib/dashboard/node_modules | ||
app/ide-desktop/lib/esbuild-plugin-copy-directories/node_modules | ||
app/ide-desktop/lib/icons/node_modules | ||
app/ide-desktop/lib/project-manager-shim/node_modules | ||
app/ide-desktop/lib/ts-plugin-namespace-auto-import/node_modules | ||
|
||
# | ||
.bloop | ||
bazel-enso | ||
bazel-out | ||
bazel-testlogs | ||
build-cache | ||
.idea | ||
.vscode | ||
.dist | ||
target | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# passes an argument `--skipLibCheck` to *every* spawn of tsc | ||
common --@aspect_rules_ts//ts:skipLibCheck=always | ||
common --@aspect_rules_ts//ts:default_to_tsc_transpiler | ||
|
||
## GraalVM toolchain | ||
build --extra_toolchains=@graalvm//:bootstrap_runtime_toolchain | ||
|
||
## GraalVM versions | ||
common --tool_java_runtime_version=graalvm_21 | ||
common --tool_java_language_version=21 | ||
|
||
common --java_runtime_version=graalvm_21 | ||
common --java_language_version=21 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
7.1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
hoist=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,5 +23,6 @@ | |
], | ||
"files.watcherExclude": { | ||
"**/target": true | ||
} | ||
}, | ||
"vitest.workspaceConfig": "vitest.workspace.ts" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
load("@npm//:defs.bzl", "npm_link_all_packages") | ||
npm_link_all_packages(name = "node_modules") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
"enso-org/enso" | ||
|
||
bazel_dep(name = "aspect_rules_js", version = "1.41.2") | ||
|
||
####### Node.js version ######### | ||
bazel_dep(name = "rules_nodejs", version = "6.1.0") | ||
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node") | ||
node.toolchain(node_version = "20.11.1") | ||
################################# | ||
|
||
npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True) | ||
npm.npm_translate_lock( | ||
name = "npm", | ||
pnpm_lock = "//:pnpm-lock.yaml", | ||
verify_node_modules_ignored = "//:.bazelignore", | ||
) | ||
use_repo(npm, "npm") | ||
|
||
bazel_dep(name = "aspect_rules_ts", version = "2.2.0") | ||
|
||
rules_ts_ext = use_extension( | ||
"@aspect_rules_ts//ts:extensions.bzl", | ||
"ext", | ||
dev_dependency = True, | ||
) | ||
|
||
rules_ts_ext.deps() | ||
|
||
use_repo(rules_ts_ext, "npm_typescript") | ||
|
||
## JVM | ||
bazel_dep(name = "rules_java", version = "7.5.0") | ||
bazel_dep(name = "rules_graalvm", version = "0.11.1") ## upgrade to 0.11.2 once available in bazel central | ||
|
||
gvm = use_extension("@rules_graalvm//:extensions.bzl", "graalvm") | ||
|
||
gvm.graalvm( | ||
name = "graalvm", | ||
version = "23.1.0", # gvm sdk version format like `24.x.x` also supported | ||
distribution = "ce", # `oracle`, `ce`, or `community` | ||
java_version = "21", # `17`, `20`, `21`, or `22` as supported by the version provided | ||
) | ||
use_repo(gvm, "graalvm") | ||
register_toolchains("@graalvm//:jvm") | ||
register_toolchains("@graalvm//:sdk") ## Native-image | ||
register_toolchains("@graalvm//:toolchain") | ||
|
||
bazel_dep(name = "rules_jvm_external", version = "6.0") | ||
|
||
scala_logging_version = "3.9.4" | ||
scalatest_version = "3.3.0-SNAP4" | ||
cats_version = "2.9.0" | ||
circe_version = "0.14.5" | ||
circe_libs = ["circe-core", "circe-generic", "circe-parser"] | ||
circe = ["io.circe:%s_2.13:%s" % (x, circe_version) for x in circe_libs] | ||
commons_text_version = "1.10.0" | ||
http_components_version = "4.4.1" | ||
jackson_version = "2.15.2" | ||
commons_io_version = "2.12.0" | ||
commons_compress_version = "1.23.0" | ||
commons_lang_version = "3.12.0" | ||
junit_version = "4.13.2" | ||
hamcrest_version = "1.3" | ||
picocli_version = "4.6.1" | ||
minimal_json_version = "0.9.5" | ||
|
||
## TODO: Consider replacing maven extension with | ||
## https://github.com/bazeltools/bazel-deps | ||
## The downside of the approach is that a number of other rules rely on it. | ||
maven = use_extension("@rules_jvm_external//:extensions.bzl", "maven") | ||
## After updating a list of artifacts run | ||
## > bazel run @unpinned_maven//:pin | ||
maven.install( | ||
artifacts = [ | ||
"com.typesafe.scala-logging:scala-logging_2.13:%s" % scala_logging_version, | ||
"org.scalatest:scalatest_2.13:%s" % scalatest_version, | ||
"org.typelevel:cats-core_2.13:%s" % cats_version, | ||
"org.apache.commons:commons-text:%s" % commons_text_version, | ||
"org.apache.httpcomponents:httpclient:%s" % http_components_version, | ||
"com.fasterxml.jackson.core:jackson-databind:%s" % jackson_version, | ||
"commons-io:commons-io:%s" % commons_io_version, | ||
"org.apache.commons:commons-compress:%s" % commons_compress_version, | ||
"org.apache.commons:commons-lang3:%s" % commons_lang_version, | ||
"junit:junit:%s" % junit_version, | ||
"org.hamcrest:hamcrest-all:%s" % hamcrest_version, | ||
|
||
## bazel-distribution dependencies | ||
"info.picocli:picocli:%s" % picocli_version, | ||
"com.eclipsesource.minimal-json:minimal-json:%s" % minimal_json_version, | ||
] + circe, | ||
fail_if_repin_required = True, | ||
lock_file = "//:maven_install.json", | ||
repositories = [ | ||
"https://repo.maven.apache.org/maven2", | ||
"https://repo1.maven.org/maven2", | ||
], | ||
) | ||
use_repo( | ||
maven, | ||
"maven", | ||
"unpinned_maven", | ||
) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need picocli? What does
bazel-distribution dependencies
mean?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As the comment says, it is a dependency of
bazel-distribution
rules which are used for generatingpom.xml
.This doesn't mean that this dependency is added to any of subprojects. But it has to be listed for the rules so that the dependency (and its version) is discoverable.