diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index a85d315695ec..8df5f3709477 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -17,13 +17,13 @@ on: env: # Please ensure that this is in sync with graalVersion in build.sbt - graalVersion: 20.2.0 + graalVersion: 21.1.0 # Please ensure that this is in sync with javaVersion in build.sbt javaVersion: 11 # Please ensure that this is in sync with project/build.properties - sbtVersion: 1.4.1 + sbtVersion: 1.5.2 # Please ensure that this is in sync with rustVersion in build.sbt - rustToolchain: nightly-2019-11-04 + rustToolchain: nightly-2021-05-12 jobs: vuln-scan: diff --git a/.github/workflows/legal-review.yml b/.github/workflows/legal-review.yml index b8aa67d4afac..e3c2d6f8a0b2 100644 --- a/.github/workflows/legal-review.yml +++ b/.github/workflows/legal-review.yml @@ -8,13 +8,13 @@ on: env: # Please ensure that this is in sync with graalVersion in build.sbt - graalVersion: 21.0.0.2 + graalVersion: 21.1.0 # Please ensure that this is in sync with javaVersion in build.sbt javaVersion: 11 # Please ensure that this is in sync with project/build.properties - sbtVersion: 1.4.9 + sbtVersion: 1.5.2 # Please ensure that this is in sync with rustVersion in build.sbt - rustToolchain: nightly-2019-11-04 + rustToolchain: nightly-2021-05-12 excludedPaths: | .github/PULL_REQUEST_TEMPLATE.md .github/CODEOWNERS diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 53696cdb7b3b..2c206a4f59ab 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -10,13 +10,13 @@ on: env: # Please ensure that this is in sync with graalVersion in build.sbt - graalVersion: 21.0.0.2 + graalVersion: 21.1.0 # Please ensure that this is in sync with javaVersion in build.sbt javaVersion: 11 # Please ensure that this is in sync with project/build.properties - sbtVersion: 1.4.9 + sbtVersion: 1.5.2 # Please ensure that this is in sync with rustVersion in build.sbt - rustToolchain: nightly-2019-11-04 + rustToolchain: nightly-2021-05-12 concurrency: "releases" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 286e24b54b1f..3fc9ae08ab1b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,13 +7,13 @@ on: env: # Please ensure that this is in sync with graalVersion in build.sbt - graalVersion: 21.0.0.2 + graalVersion: 21.1.0 # Please ensure that this is in sync with javaVersion in build.sbt javaVersion: 11 # Please ensure that this is in sync with project/build.properties - sbtVersion: 1.4.9 + sbtVersion: 1.5.2 # Please ensure that this is in sync with rustVersion in build.sbt - rustToolchain: nightly-2019-11-04 + rustToolchain: nightly-2021-05-12 concurrency: "releases" diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index be032069d173..9c6b35cabb0e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -8,8 +8,8 @@ on: env: wasmpackVersion: 0.8.1 - nodeVersion: 12.18.4 - rustToolchain: nightly-2019-11-04 + nodeVersion: 14.16.1 + rustToolchain: nightly-2021-05-12 jobs: check: diff --git a/.github/workflows/scala.yml b/.github/workflows/scala.yml index f45a7631448e..a69f07dfbec0 100644 --- a/.github/workflows/scala.yml +++ b/.github/workflows/scala.yml @@ -8,13 +8,13 @@ on: env: # Please ensure that this is in sync with graalVersion in build.sbt - graalVersion: 21.0.0.2 + graalVersion: 21.1.0 # Please ensure that this is in sync with javaVersion in build.sbt javaVersion: 11 # Please ensure that this is in sync with project/build.properties - sbtVersion: 1.4.9 + sbtVersion: 1.5.2 # Please ensure that this is in sync with rustVersion in build.sbt - rustToolchain: nightly-2019-11-04 + rustToolchain: nightly-2021-05-12 jobs: test_and_publish: diff --git a/.gitignore b/.gitignore index f26a2f399bd8..9e18ef7872b6 100644 --- a/.gitignore +++ b/.gitignore @@ -106,6 +106,12 @@ project/metals.sbt build-cache/ +################## +## Native Image ## +################## + +*.build_artifacts.txt + ################### ## Enso-Specific ## ################### diff --git a/Cargo.lock b/Cargo.lock index 030a4cc95cbe..36adbcaa90da 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "Inflector" version = "0.11.4" @@ -12,9 +14,9 @@ dependencies = [ [[package]] name = "addr2line" -version = "0.14.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55f82cfe485775d02112886f4169bde0c5894d75e79ead7eafe7e40a25e45f7" +checksum = "1b6a2d3371669ab3ca9797670853d61402b03d0b4b9ebf33d677dfa720203072" dependencies = [ "gimli", ] @@ -63,9 +65,9 @@ name = "ast" version = "0.1.0" dependencies = [ "clap", - "itertools 0.9.0", - "proc-macro2 1.0.24", - "syn 1.0.58", + "itertools 0.10.0", + "proc-macro2 1.0.26", + "syn 1.0.72", "uuid", ] @@ -88,9 +90,9 @@ checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" [[package]] name = "backtrace" -version = "0.3.55" +version = "0.3.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5140344c85b01f9bbb4d4b7288a8aa4b3287ccef913a14bcc78a1063623598" +checksum = "707b586e0e2f247cbde68cdd2c3ce69ea7b7be43e1c5b426e37c9319c4b9838e" dependencies = [ "addr2line", "cfg-if 1.0.0", @@ -200,6 +202,15 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28b9d6de7f49e22cf97ad17fc4036ece69300032f45f78f30b4a4482cdc3f4a6" +[[package]] +name = "crc32fast" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" +dependencies = [ + "cfg-if 1.0.0", +] + [[package]] name = "criterion" version = "0.3.3" @@ -306,13 +317,13 @@ dependencies = [ [[package]] name = "derivative" -version = "1.0.4" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c6d883546668a3e2011b6a716a7330b82eabb0151b138217f632c8243e17135" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "syn 0.15.44", + "proc-macro2 1.0.26", + "quote 1.0.8", + "syn 1.0.72", ] [[package]] @@ -321,9 +332,9 @@ version = "0.99.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41cb0e6161ad61ed084a36ba71fbba9e3ac5aee3606fb607fe08da6acbcf3d8c" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.26", "quote 1.0.8", - "syn 1.0.58", + "syn 1.0.72", ] [[package]] @@ -340,29 +351,30 @@ checksum = "1056f553da426e9c025a662efa48b52e62e0a3a7648aa2d15aeaaf7f0d329357" [[package]] name = "enso-automata" -version = "0.1.5" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1c42481833866477dfa1ce036348866fcb70b2d411f0cf7bf18502b9eb0c66a" +checksum = "f9b028792f442d36cdd2df02a29ef988c219a9ebce952015bb1c2bcb5942d261" dependencies = [ "enso-prelude", ] [[package]] name = "enso-data" -version = "0.1.4" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0787d01cc3ba21f975e9c363c045499ccebbe1cb97a4f6941fa042c89bdfb95" +checksum = "39dba144366e08671b102fd6feca76be1623e05816a3ba43ab05b2aaa45a625a" dependencies = [ "enso-prelude", + "rustversion", "serde", "typenum", ] [[package]] name = "enso-flexer" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7db941e898d281386b6005e8ab2e9844abd94a693f0a746ae7312ed176c840b9" +checksum = "8b9c223330c46c505fed7c47894a22930eeacaa71fd914787754ee55baf8dd9a" dependencies = [ "enso-automata", "enso-lazy-reader", @@ -371,18 +383,18 @@ dependencies = [ "enso-prelude", "itertools 0.8.2", "nonempty", - "proc-macro2 1.0.24", + "proc-macro2 1.0.26", "quote 1.0.8", - "syn 1.0.58", + "syn 1.0.72", "unicode-segmentation", "wasm-bindgen", ] [[package]] name = "enso-lazy-reader" -version = "0.1.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "320382585413a94f90964bbf26b77ffcbf8480f41f4d4c971d4e51c6fec0e7ef" +checksum = "6b8cd22a53732103872eef4f1acbec0920ced09efb336fb06740a898d9762523" dependencies = [ "enso-prelude", "itertools 0.8.2", @@ -390,36 +402,38 @@ dependencies = [ [[package]] name = "enso-logger" -version = "0.1.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b83df37d882ae6c2c9863c14f9c242b817099492c14a455214866c681076f20" +checksum = "fed27bf8ac2768a9224fd66863de4384b42bf16e079e02dd507798ce71dd4d2d" dependencies = [ "enso-prelude", "enso-shapely", + "js-sys", "wasm-bindgen", "web-sys", ] [[package]] name = "enso-macro-utils" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616e099985be92ef3de01f4c062868b46ab06868e1fc9cd077050709ccc2d9ae" +checksum = "64e4c3aca9d82b782043ad1378929e03813ee00e444858caddd6ec32580eff08" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.26", "quote 1.0.8", - "syn 1.0.58", + "syn 1.0.72", ] [[package]] name = "enso-prelude" -version = "0.1.9" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2409070143fc0cd7c0cb312d44b5d397d68fb692f4c6e617a64f120385ce2596" +checksum = "8db3cd4b9ac308f393eed97f3539b8e81ece4d93a384cdfb10c109e56f1f61e3" dependencies = [ "anyhow", "backtrace", "boolinator", + "bumpalo", "derivative", "derive_more", "enclose", @@ -430,6 +444,7 @@ dependencies = [ "lazy_static", "nalgebra", "num", + "object", "paste", "shrinkwraprs", "smallvec", @@ -440,39 +455,30 @@ dependencies = [ [[package]] name = "enso-shapely" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "348f88e357acc17cb02d0e89f271a446067b0236dc01883a58e8a92273857f61" +checksum = "061a335e6068e8960a315f62813a7196c3cde2c650ebd0e744f26b479baf3cd8" dependencies = [ "derivative", "enso-shapely-macros", "paste", + "rustversion", "shrinkwraprs", ] [[package]] name = "enso-shapely-macros" -version = "0.1.1" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93efddfab94ddd125a5f5f9af5f6e463ad2ee4e647b8fa8688d930cda69a7c6a" +checksum = "3362771ca6e5a077479ae310c28e28abb56f4f62f2fe649719292227685dece0" dependencies = [ "Inflector", "boolinator", "enso-macro-utils", "itertools 0.8.2", - "proc-macro2 1.0.24", + "proc-macro2 1.0.26", "quote 1.0.8", - "syn 1.0.58", -] - -[[package]] -name = "error-chain" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" -dependencies = [ - "backtrace", - "version_check 0.9.2", + "syn 1.0.72", ] [[package]] @@ -491,12 +497,24 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.26", "quote 1.0.8", - "syn 1.0.58", + "syn 1.0.72", "synstructure", ] +[[package]] +name = "flate2" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd3aec53de10fe96d7d8c565eb17f2c687bb5518a2ec453b5b1252964526abe0" +dependencies = [ + "cfg-if 1.0.0", + "crc32fast", + "libc", + "miniz_oxide", +] + [[package]] name = "generic-array" version = "0.13.2" @@ -521,9 +539,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.23.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6503fe142514ca4799d4c26297c4248239fe8838d827db6bd6065c6ed29a6ce" +checksum = "aaf91faf136cb47367fa430cd46e37a788775e7fa104f8b4bcb3861dc389b724" [[package]] name = "half" @@ -591,6 +609,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37d572918e350e82412fe766d24b15e6682fb2ed2bbe018280caa810397cb319" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "0.4.7" @@ -599,15 +626,15 @@ checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" [[package]] name = "jni" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36bcc950632e48b86da402c5c077590583da5ac0d480103611d5374e7c967a3c" +checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" dependencies = [ "cesu8", "combine", - "error-chain", "jni-sys", "log", + "thiserror", "walkdir", ] @@ -735,7 +762,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" dependencies = [ "memchr", - "version_check 0.1.5", + "version_check", ] [[package]] @@ -834,9 +861,13 @@ dependencies = [ [[package]] name = "object" -version = "0.22.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d3b63360ec3cb337817c2dbd47ab4a0f170d285d8e5a2064600f3def1402397" +checksum = "37fd5004feb2ce328a52b0b3d01dbf4ffff72583493900ed15f22d4111c51693" +dependencies = [ + "flate2", + "wasmparser", +] [[package]] name = "oorandom" @@ -848,12 +879,11 @@ checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" name = "parser" version = "0.1.0" dependencies = [ - "anyhow", "criterion", "enso-data", "enso-logger", "enso-prelude", - "itertools 0.9.0", + "itertools 0.10.0", "lexer", ] @@ -919,9 +949,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.24" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec" dependencies = [ "unicode-xid 0.2.1", ] @@ -941,7 +971,7 @@ version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "991431c3519a3f36861882da93630ce66b52918dcf1b8e2fd66b397fc96f28df" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.26", ] [[package]] @@ -1067,6 +1097,12 @@ dependencies = [ "semver", ] +[[package]] +name = "rustversion" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb5d2a036dc6d2d8fd16fde3498b04306e29bd193bf306a57427019b823d5acd" + [[package]] name = "ryu" version = "1.0.5" @@ -1128,9 +1164,9 @@ version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ca2a8cb5805ce9e3b95435e3765b7b553cecc762d938d409434338386cb5775" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.26", "quote 1.0.8", - "syn 1.0.58", + "syn 1.0.72", ] [[package]] @@ -1152,9 +1188,9 @@ checksum = "e63e6744142336dfb606fe2b068afa2e1cca1ee6a5d8377277a92945d81fa331" dependencies = [ "bitflags", "itertools 0.8.2", - "proc-macro2 1.0.24", + "proc-macro2 1.0.26", "quote 1.0.8", - "syn 1.0.58", + "syn 1.0.72", ] [[package]] @@ -1200,11 +1236,11 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.58" +version = "1.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc60a3d73ea6594cd712d830cc1f0390fd71542d8c8cd24e70cc54cdfd5e05d5" +checksum = "a1e8cdbefb79a9a5a65e0db8b47b723ee907b7c7f8496c76a1770b5c310bab82" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.26", "quote 1.0.8", "unicode-xid 0.2.1", ] @@ -1215,9 +1251,9 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.26", "quote 1.0.8", - "syn 1.0.58", + "syn 1.0.72", "unicode-xid 0.2.1", ] @@ -1230,6 +1266,26 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "thiserror" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" +dependencies = [ + "proc-macro2 1.0.26", + "quote 1.0.8", + "syn 1.0.72", +] + [[package]] name = "thread_local" version = "1.1.0" @@ -1301,12 +1357,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" -[[package]] -name = "version_check" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" - [[package]] name = "walkdir" version = "2.3.1" @@ -1343,9 +1393,9 @@ dependencies = [ "bumpalo", "lazy_static", "log", - "proc-macro2 1.0.24", + "proc-macro2 1.0.26", "quote 1.0.8", - "syn 1.0.58", + "syn 1.0.72", "wasm-bindgen-shared", ] @@ -1365,9 +1415,9 @@ version = "0.2.58" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e85031354f25eaebe78bb7db1c3d86140312a911a106b2e29f9cc440ce3e7668" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2 1.0.26", "quote 1.0.8", - "syn 1.0.58", + "syn 1.0.72", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -1387,13 +1437,19 @@ dependencies = [ "anyhow", "heck", "log", - "proc-macro2 1.0.24", + "proc-macro2 1.0.26", "quote 1.0.8", - "syn 1.0.58", + "syn 1.0.72", "wasm-bindgen-backend", "weedle", ] +[[package]] +name = "wasmparser" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32fddd575d477c6e9702484139cf9f23dcd554b06d185ed0f56c857dd3a47aa6" + [[package]] name = "weak-table" version = "0.2.4" diff --git a/RELEASES.md b/RELEASES.md index 4838eaf481aa..f2c3b2ad6a95 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,5 +1,12 @@ # Enso Next +## Interpreter/Runtime + +- Upgraded the underlying runtime to + [GraalVM 21.1.0](https://github.com/graalvm/graalvm-ce-builds/releases/tag/vm-21.1.0) + ([#1738](https://github.com/enso-org/enso/pull/1738)). This brings a raft of + bug-fixes and improvements to how quickly Enso can reach its peak performance. + ## Tooling - Added support for higher-kinded types in suggestions in the language server diff --git a/build.sbt b/build.sbt index 410a455c208e..d7752bb66d79 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,6 @@ import org.enso.build.BenchTasks._ import org.enso.build.WithDebugCommand import sbt.Keys.{libraryDependencies, scalacOptions} import sbt.addCompilerPlugin -import sbtassembly.AssemblyPlugin.defaultUniversalScript import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType} import java.io.File @@ -12,8 +11,8 @@ import java.io.File // ============================================================================ val scalacVersion = "2.13.5" -val rustVersion = "1.40.0-nightly (b520af6fd 2019-11-03)" -val graalVersion = "21.0.0.2" +val rustVersion = "1.54.0-nightly" +val graalVersion = "21.1.0" val javaVersion = "11" val ensoVersion = "0.2.12-SNAPSHOT" // Note [Engine And Launcher Version] @@ -25,8 +24,8 @@ val ensoVersion = "0.2.12-SNAPSHOT" // Note [Engine And Launcher Version] * scripts at .github/workflows accordingly. */ -organization in ThisBuild := "org.enso" -scalaVersion in ThisBuild := scalacVersion +ThisBuild / organization := "org.enso" +ThisBuild / scalaVersion := scalacVersion lazy val gatherLicenses = taskKey[Unit]("Gathers licensing information for relevant dependencies") @@ -101,13 +100,13 @@ Global / onChangedBuildSource := ReloadOnSourceChanges // === Compiler Options ======================================================= // ============================================================================ -javacOptions in ThisBuild ++= Seq( +ThisBuild / javacOptions ++= Seq( "-encoding", // Provide explicit encoding (the next line) "UTF-8", // Specify character encoding used by Java source files. "-deprecation" // Shows a description of each use or override of a deprecated member or class. ) -scalacOptions in ThisBuild ++= Seq( +ThisBuild / scalacOptions ++= Seq( "-deprecation", // Emit warning and location for usages of deprecated APIs. "-encoding", // Provide explicit encoding (the next line) "utf-8", // Specify character encoding used by Scala source files. @@ -150,7 +149,7 @@ val jsSettings = Seq( scalaJSLinkerConfig ~= { _.withModuleKind(ModuleKind.ESModule) } ) -scalacOptions in (Compile, console) ~= (_ filterNot (_ == "-Xfatal-warnings")) +Compile / console / scalacOptions ~= (_ filterNot (_ == "-Xfatal-warnings")) // ============================================================================ // === Benchmark Configuration ================================================ @@ -455,7 +454,7 @@ lazy val syntax = crossProject(JVMPlatform, JSPlatform) Test / fork := true, testFrameworks := Nil, scalacOptions ++= Seq("-Ypatmat-exhaust-depth", "off"), - mainClass in (Compile, run) := Some("org.enso.syntax.text.Main"), + Compile / run / mainClass := Some("org.enso.syntax.text.Main"), version := "0.1", logBuffered := false, libraryDependencies ++= Seq( @@ -477,7 +476,7 @@ lazy val syntax = crossProject(JVMPlatform, JSPlatform) ) .jvmSettings( inConfig(Benchmark)(Defaults.testSettings), - unmanagedSourceDirectories in Benchmark += + Benchmark / unmanagedSourceDirectories += baseDirectory.value.getParentFile / "shared/src/bench/scala", libraryDependencies += "com.storm-enroute" %% "scalameter" % scalameterVersion % "bench", @@ -485,7 +484,7 @@ lazy val syntax = crossProject(JVMPlatform, JSPlatform) new TestFramework("org.scalatest.tools.Framework"), new TestFramework("org.scalameter.ScalaMeterFramework") ), - bench := (test in Benchmark).tag(Exclusive).value + bench := (Benchmark / test).tag(Exclusive).value ) .jsSettings( scalaJSUseMainModuleInitializer := false, @@ -500,8 +499,8 @@ lazy val `lexer-bench` = commands += WithDebugCommand.withDebug, inConfig(Compile)(truffleRunOptionsSettings), inConfig(Benchmark)(Defaults.testSettings), - parallelExecution in Test := false, - logBuffered in Test := false, + Test / parallelExecution := false, + Test / logBuffered := false, Test / fork := true, libraryDependencies ++= jmh ) @@ -515,9 +514,9 @@ lazy val `lexer-bench` = "-Xmx4096m", "-XX:+FlightRecorder" ), - mainClass in Benchmark := Some("org.openjdk.jmh.Main"), + Benchmark / mainClass := Some("org.openjdk.jmh.Main"), bench := Def.task { - (run in Benchmark).toTask("").value + (Benchmark / run).toTask("").value }, benchOnly := Def.inputTaskDyn { import complete.Parsers.spaceDelimited @@ -527,10 +526,10 @@ lazy val `lexer-bench` = throw new IllegalArgumentException("Expected one argument.") } Def.task { - (testOnly in Benchmark).toTask(" -- -z " + name).value + (Benchmark / testOnly).toTask(" -- -z " + name).value } }.evaluated, - parallelExecution in Benchmark := false + Benchmark / parallelExecution := false ) lazy val `parser-service` = (project in file("lib/scala/parser-service")) @@ -581,7 +580,7 @@ lazy val graph = (project in file("lib/scala/graph/")) lazy val pkg = (project in file("lib/scala/pkg")) .settings( - mainClass in (Compile, run) := Some("org.enso.pkg.Main"), + Compile / run / mainClass := Some("org.enso.pkg.Main"), version := "0.1", libraryDependencies ++= circe ++ Seq( "org.scalatest" %% "scalatest" % scalatestVersion % Test, @@ -647,7 +646,7 @@ lazy val cli = project "org.scalatest" %% "scalatest" % scalatestVersion % Test, "org.typelevel" %% "cats-core" % catsVersion ), - parallelExecution in Test := false + Test / parallelExecution := false ) lazy val `version-output` = (project in file("lib/scala/version-output")) @@ -696,10 +695,10 @@ lazy val `project-manager` = (project in file("lib/scala/project-manager")) ) ) .settings( - assemblyJarName in assembly := "project-manager.jar", - test in assembly := {}, - assemblyOutputPath in assembly := file("project-manager.jar"), - assemblyMergeStrategy in assembly := { + assembly / assemblyJarName := "project-manager.jar", + assembly / test := {}, + assembly / assemblyOutputPath := file("project-manager.jar"), + assembly / assemblyMergeStrategy := { case PathList("META-INF", file, xs @ _*) if file.endsWith(".DSA") => MergeStrategy.discard case PathList("META-INF", file, xs @ _*) if file.endsWith(".SF") => @@ -715,9 +714,7 @@ lazy val `project-manager` = (project in file("lib/scala/project-manager")) .buildNativeImage( "project-manager", staticOnLinux = true, - additionalOptions = Seq( - "--enable-all-security-services" // Note [HTTPS in the Native Images] - ) + initializeAtRuntime = Seq("scala.util.Random"), ) .dependsOn(VerifyReflectionSetup.run) .dependsOn(assembly) @@ -801,8 +798,8 @@ lazy val `core-definition` = (project in file("lib/scala/core-definition")) version := "0.1", inConfig(Compile)(truffleRunOptionsSettings), inConfig(Benchmark)(Defaults.testSettings), - parallelExecution in Test := false, - logBuffered in Test := false, + Test / parallelExecution := false, + Test / logBuffered := false, scalacOptions += "-Ymacro-annotations", libraryDependencies ++= jmh ++ Seq( "com.chuusai" %% "shapeless" % shapelessVersion, @@ -837,7 +834,7 @@ lazy val searcher = project .configs(Benchmark) .settings( inConfig(Benchmark)(Defaults.testSettings), - fork in Benchmark := true + Benchmark / fork := true ) .dependsOn(testkit % Test) .dependsOn(`polyglot-api`) @@ -889,7 +886,7 @@ lazy val `polyglot-api` = project ), scalacOptions ++= splainOptions, GenerateFlatbuffers.flatcVersion := flatbuffersVersion, - sourceGenerators in Compile += GenerateFlatbuffers.task + Compile / sourceGenerators += GenerateFlatbuffers.task ) .dependsOn(pkg) .dependsOn(`text-buffer`) @@ -911,15 +908,15 @@ lazy val `language-server` = (project in file("engine/language-server")) "org.scalacheck" %% "scalacheck" % scalacheckVersion % Test, "org.graalvm.sdk" % "polyglot-tck" % graalVersion % "provided" ), - testOptions in Test += Tests + Test / testOptions += Tests .Argument(TestFrameworks.ScalaCheck, "-minSuccessfulTests", "1000"), GenerateFlatbuffers.flatcVersion := flatbuffersVersion, - sourceGenerators in Compile += GenerateFlatbuffers.task + Compile / sourceGenerators += GenerateFlatbuffers.task ) .configs(Benchmark) .settings( inConfig(Benchmark)(Defaults.testSettings), - bench := (test in Benchmark).value, + bench := (Benchmark / test).value, libraryDependencies += "com.storm-enroute" %% "scalameter" % scalameterVersion % "bench", testFrameworks ++= List( new TestFramework("org.scalameter.ScalaMeterFramework") @@ -974,8 +971,8 @@ lazy val runtime = (project in file("engine/runtime")) cleanInstruments := FixInstrumentsGeneration.cleanInstruments.value, inConfig(Compile)(truffleRunOptionsSettings), inConfig(Benchmark)(Defaults.testSettings), - parallelExecution in Test := false, - logBuffered in Test := false, + Test / parallelExecution := false, + Test / logBuffered := false, scalacOptions += "-Ymacro-annotations", scalacOptions ++= Seq("-Ypatmat-exhaust-depth", "off"), libraryDependencies ++= jmh ++ jaxb ++ Seq( @@ -1040,7 +1037,7 @@ lazy val runtime = (project in file("engine/runtime")) .value ) .settings( - bench := (test in Benchmark).tag(Exclusive).value, + bench := (Benchmark / test).tag(Exclusive).value, benchOnly := Def.inputTaskDyn { import complete.Parsers.spaceDelimited val name = spaceDelimited("").parsed match { @@ -1048,16 +1045,16 @@ lazy val runtime = (project in file("engine/runtime")) case _ => throw new IllegalArgumentException("Expected one argument.") } Def.task { - (testOnly in Benchmark).toTask(" -- -z " + name).value + (Benchmark / testOnly).toTask(" -- -z " + name).value } }.evaluated, - parallelExecution in Benchmark := false + Benchmark / parallelExecution := false ) .settings( - assemblyJarName in assembly := "runtime.jar", - test in assembly := {}, - assemblyOutputPath in assembly := file("runtime.jar"), - assemblyMergeStrategy in assembly := { + assembly / assemblyJarName := "runtime.jar", + assembly / test := {}, + assembly / assemblyOutputPath := file("runtime.jar"), + assembly / assemblyMergeStrategy := { case PathList("META-INF", file, xs @ _*) if file.endsWith(".DSA") => MergeStrategy.discard case PathList("META-INF", file, xs @ _*) if file.endsWith(".SF") => @@ -1102,12 +1099,12 @@ lazy val `engine-runner` = project .mkString(File.pathSeparator) Seq(s"-Dtruffle.class.path.append=$runtimeClasspath") }, - mainClass in (Compile, run) := Some("org.enso.runner.Main"), - mainClass in assembly := (Compile / run / mainClass).value, - assemblyJarName in assembly := "runner.jar", - test in assembly := {}, - assemblyOutputPath in assembly := file("runner.jar"), - assemblyMergeStrategy in assembly := { + Compile / run / mainClass := Some("org.enso.runner.Main"), + assembly / mainClass := (Compile / run / mainClass).value, + assembly / assemblyJarName := "runner.jar", + assembly / test := {}, + assembly / assemblyOutputPath := file("runner.jar"), + assembly / assemblyMergeStrategy := { case PathList("META-INF", file, xs @ _*) if file.endsWith(".DSA") => MergeStrategy.discard case PathList("META-INF", file, xs @ _*) if file.endsWith(".SF") => @@ -1131,7 +1128,7 @@ lazy val `engine-runner` = project "org.jline" % "jline" % jlineVersion, "org.typelevel" %% "cats-core" % catsVersion ), - connectInput in run := true + run / connectInput := true ) .settings( assembly := assembly @@ -1164,7 +1161,6 @@ lazy val launcher = project "enso", staticOnLinux = true, additionalOptions = Seq( - "--enable-all-security-services", // Note [HTTPS in the Native Images] "-Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.NoOpLog", "-H:IncludeResources=.*Main.enso$" ), @@ -1182,15 +1178,15 @@ lazy val launcher = project "enso" ) .value, - test in assembly := {}, - assemblyOutputPath in assembly := file("launcher.jar") + assembly / test := {}, + assembly / assemblyOutputPath := file("launcher.jar") ) .settings( (Test / test) := (Test / test) .dependsOn(buildNativeImage) .dependsOn(LauncherShimsForTest.prepare(rustcVersion = rustVersion)) .value, - parallelExecution in Test := false + Test / parallelExecution := false ) .dependsOn(cli) .dependsOn(`runtime-version-manager`) @@ -1228,7 +1224,7 @@ lazy val `runtime-version-manager-test` = project "commons-io" % "commons-io" % commonsIoVersion ) ) - .settings(parallelExecution in Test := false) + .settings(Test / parallelExecution := false) .settings( (Test / test) := (Test / test) .dependsOn(`locking-test-helper` / assembly) @@ -1241,8 +1237,8 @@ lazy val `runtime-version-manager-test` = project lazy val `locking-test-helper` = project .in(file("lib/scala/locking-test-helper")) .settings( - test in assembly := {}, - assemblyOutputPath in assembly := file("locking-test-helper.jar") + assembly / test := {}, + assembly / assemblyOutputPath := file("locking-test-helper.jar") ) val `std-lib-root` = file("distribution/std-lib/") @@ -1274,18 +1270,6 @@ lazy val `std-bits` = project }.value ) -/* Note [HTTPS in the Native Images] - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * The launcher and project-manager use Akka Http for making web requests. They - * do not use Java's stdlib implementation, because there is a bug (not fixed in - * JDK 11) (https://bugs.openjdk.java.net/browse/JDK-8231449) in its HTTPS - * handling that causes long running requests to freeze forever. However, Akka - * Http still needs the stdlib's SSL implementation which is not included in the - * Native Images by default (because of its size). The - * `--enable-all-security-services` flag is used to ensure it is available in - * the built executable. - */ - /* Note [Native Image Workaround for GraalVM 20.2] * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * In GraalVM 20.2 the Native Image build of even simple Scala programs has diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 61b0266af2dd..6699e921d639 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -197,15 +197,15 @@ you will need to install [rustup](https://rustup.rs/) and then run the following commands: ```bash -rustup toolchain install nightly-2019-11-04 -rustup override set nightly-2019-11-04 +rustup toolchain install nightly-2021-05-12 +rustup override set nightly-2021-05-12 rustup component add clippy ``` You will also need `node` in order to run the `wasm` tests. We only support the latest LTS version of [NodeJS](https://nodejs.org/en/download) and NPM. We recommend using [`nvm`](https://github.com/nvm-sh/nvm) to manage node versions. -The current LTS is `v12.18.4`. +The current LTS is `v14.16.1. ### Getting Set Up (JVM) diff --git a/engine/runtime/src/main/java/org/enso/interpreter/Language.java b/engine/runtime/src/main/java/org/enso/interpreter/Language.java index 11515e8fd597..9cfe32045497 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/Language.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/Language.java @@ -1,13 +1,13 @@ package org.enso.interpreter; -import com.oracle.truffle.api.*; +import com.oracle.truffle.api.CallTarget; +import com.oracle.truffle.api.InstrumentInfo; +import com.oracle.truffle.api.Truffle; +import com.oracle.truffle.api.TruffleLanguage; import com.oracle.truffle.api.debug.DebuggerTags; import com.oracle.truffle.api.instrumentation.ProvidedTags; import com.oracle.truffle.api.instrumentation.StandardTags; -import com.oracle.truffle.api.library.ExportLibrary; import com.oracle.truffle.api.nodes.RootNode; -import java.util.Collections; - import org.enso.interpreter.epb.EpbLanguage; import org.enso.interpreter.instrument.IdExecutionInstrument; import org.enso.interpreter.node.ProgramRootNode; diff --git a/engine/runtime/src/main/java/org/enso/interpreter/epb/EpbLanguage.java b/engine/runtime/src/main/java/org/enso/interpreter/epb/EpbLanguage.java index 46e351f6a95d..169405841ced 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/epb/EpbLanguage.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/epb/EpbLanguage.java @@ -32,9 +32,7 @@ id = EpbLanguage.ID, name = "Enso Polyglot Bridge", characterMimeTypes = {EpbLanguage.MIME}, - // TODO mark this language as internal when https://github.com/oracle/graal/pull/3139 is - // released - internal = false, + internal = true, defaultMimeType = EpbLanguage.MIME, contextPolicy = TruffleLanguage.ContextPolicy.SHARED) public class EpbLanguage extends TruffleLanguage { diff --git a/engine/runtime/src/main/java/org/enso/interpreter/epb/node/ContextRewrapNode.java b/engine/runtime/src/main/java/org/enso/interpreter/epb/node/ContextRewrapNode.java index 6cf37390ea2e..39a57a8d3d88 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/epb/node/ContextRewrapNode.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/epb/node/ContextRewrapNode.java @@ -14,6 +14,7 @@ @GenerateUncached @ReportPolymorphism public abstract class ContextRewrapNode extends Node { + /** * Wraps a value originating from {@code origin} into a value valid in {@code target}. This method * is allowed to use interop library on {@code value} and therefore must be called with {@code @@ -64,7 +65,6 @@ Object doAlreadyProxied( return proxy; } - @Specialization(guards = "bools.isBoolean(b)") boolean doWrappedBoolean( Object b, diff --git a/engine/runtime/src/main/java/org/enso/interpreter/epb/node/ForeignEvalNode.java b/engine/runtime/src/main/java/org/enso/interpreter/epb/node/ForeignEvalNode.java index 5888978b0f89..03a5d35d26f7 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/epb/node/ForeignEvalNode.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/epb/node/ForeignEvalNode.java @@ -100,7 +100,7 @@ private void parseJs(ContextReference ctxRef) { + "\n};poly_enso_eval"; Source source = Source.newBuilder(code.getLanguage().getTruffleId(), wrappedSrc, "").build(); - CallTarget ct = ctxRef.get().getEnv().parseInternal(source); + CallTarget ct = ctxRef.get().getEnv().parsePublic(source); Object fn = rewrapNode.execute(ct.call(), inner, outer); foreign = insert(JsForeignNode.build(argNames.length, fn)); } catch (Throwable e) { @@ -115,10 +115,6 @@ private void parseJs(ContextReference ctxRef) { } private void parsePy(ContextReference ctxRef) { - EpbContext context = ctxRef.get(); - GuardedTruffleContext outer = context.getCurrentContext(); - GuardedTruffleContext inner = context.getInnerContext(); - Object p = inner.enter(this); try { String args = Arrays.stream(argNames) @@ -127,26 +123,23 @@ private void parsePy(ContextReference ctxRef) { String head = "import polyglot\n" + "@polyglot.export_value\n" - + "def poly_enso_py_eval(" + + "def polyglot_enso_python_eval(" + args + "):\n"; String indentLines = code.getForeignSource().lines().map(l -> " " + l).collect(Collectors.joining("\n")); Source source = Source.newBuilder(code.getLanguage().getTruffleId(), head + indentLines, "").build(); - CallTarget ct = ctxRef.get().getEnv().parseInternal(source); + CallTarget ct = ctxRef.get().getEnv().parsePublic(source); ct.call(); - Object fn = ctxRef.get().getEnv().importSymbol("poly_enso_py_eval"); - Object contextWrapped = rewrapNode.execute(fn, inner, outer); - foreign = insert(PyForeignNodeGen.create(contextWrapped)); + Object fn = ctxRef.get().getEnv().importSymbol("polyglot_enso_python_eval"); + foreign = insert(PyForeignNodeGen.create(fn)); } catch (Throwable e) { if (InteropLibrary.getUncached().isException(e)) { - parseError = rewrapExceptionNode.execute((AbstractTruffleException) e, inner, outer); + parseError = (AbstractTruffleException) e; } else { throw e; } - } finally { - inner.leave(this, p); } } @@ -159,7 +152,7 @@ private void parseR(ContextReference ctxRef) { String args = String.join(",", argNames); String wrappedSrc = "function(" + args + "){\n" + code.getForeignSource() + "\n}"; Source source = Source.newBuilder(code.getLanguage().getTruffleId(), wrappedSrc, "").build(); - CallTarget ct = ctxRef.get().getEnv().parseInternal(source); + CallTarget ct = ctxRef.get().getEnv().parsePublic(source); Object fn = rewrapNode.execute(ct.call(), inner, outer); foreign = insert(RForeignNodeGen.create(fn)); } catch (Throwable e) { diff --git a/engine/runtime/src/main/java/org/enso/interpreter/runtime/Context.java b/engine/runtime/src/main/java/org/enso/interpreter/runtime/Context.java index 687d8a4831fe..887ee4443d5d 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/runtime/Context.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/runtime/Context.java @@ -1,6 +1,5 @@ package org.enso.interpreter.runtime; -import com.google.common.collect.HashBiMap; import com.oracle.truffle.api.CompilerDirectives.CompilationFinal; import com.oracle.truffle.api.TruffleFile; import com.oracle.truffle.api.TruffleLanguage; @@ -15,6 +14,7 @@ import java.util.List; import java.util.Map; import java.util.Optional; +import java.util.UUID; import java.util.function.Function; import java.util.stream.Collectors; import org.enso.compiler.Compiler; @@ -24,7 +24,6 @@ import org.enso.interpreter.runtime.builtin.Builtins; import org.enso.interpreter.runtime.callable.atom.AtomConstructor; import org.enso.interpreter.runtime.scope.TopLevelScope; -import org.enso.interpreter.runtime.type.Types.Pair; import org.enso.interpreter.runtime.util.ShadowedPackage; import org.enso.interpreter.runtime.util.TruffleFileSystem; import org.enso.interpreter.util.ScalaConversions; @@ -33,10 +32,6 @@ import org.enso.pkg.QualifiedName; import org.enso.polyglot.RuntimeOptions; -import java.io.*; -import java.util.*; -import java.util.stream.Collectors; - /** * The language context is the internal state of the language that is associated with each thread in * a running Enso program. diff --git a/engine/runtime/src/main/scala/org/enso/interpreter/instrument/job/ExecuteJob.scala b/engine/runtime/src/main/scala/org/enso/interpreter/instrument/job/ExecuteJob.scala index de9cfb5f5caa..06c4e19c6025 100644 --- a/engine/runtime/src/main/scala/org/enso/interpreter/instrument/job/ExecuteJob.scala +++ b/engine/runtime/src/main/scala/org/enso/interpreter/instrument/job/ExecuteJob.scala @@ -19,7 +19,7 @@ class ExecuteJob( isCancellable = true, // TODO[MK]: make this interruptible when https://github.com/oracle/graal/issues/3273 // is resolved - mayInterruptIfRunning = false + mayInterruptIfRunning = true ) { def this(exe: Executable) = diff --git a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeServerTest.scala b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeServerTest.scala index 49ee4edc9f28..e3f29ee0bc73 100644 --- a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeServerTest.scala +++ b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeServerTest.scala @@ -47,7 +47,8 @@ class RuntimeServerTest val pkg: Package[File] = PackageManager.Default.create(tmpDir, packageName, "0.0.1") - val out: ByteArrayOutputStream = new ByteArrayOutputStream() + val out: ByteArrayOutputStream = new ByteArrayOutputStream() + val logOut: ByteArrayOutputStream = new ByteArrayOutputStream() val executionContext = new PolyglotContext( Context .newBuilder(LanguageInfo.ID) @@ -59,6 +60,7 @@ class RuntimeServerTest .option(RuntimeOptions.ENABLE_PROJECT_SUGGESTIONS, "false") .option(RuntimeOptions.ENABLE_GLOBAL_SUGGESTIONS, "false") .option(RuntimeServerInfo.ENABLE_OPTION, "true") + .logHandler(logOut) .out(out) .serverTransport { (uri, peer) => if (uri.toString == RuntimeServerInfo.URI) { diff --git a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeVisualisationsTest.scala b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeVisualisationsTest.scala index 110a8e092d79..ae4ceaa6fe4d 100644 --- a/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeVisualisationsTest.scala +++ b/engine/runtime/src/test/scala/org/enso/interpreter/test/instrument/RuntimeVisualisationsTest.scala @@ -46,7 +46,8 @@ class RuntimeVisualisationsTest val pkg: Package[File] = PackageManager.Default.create(tmpDir, packageName, "0.0.1") - val out: ByteArrayOutputStream = new ByteArrayOutputStream() + val out: ByteArrayOutputStream = new ByteArrayOutputStream() + val logOut: ByteArrayOutputStream = new ByteArrayOutputStream() val executionContext = new PolyglotContext( Context .newBuilder(LanguageInfo.ID) @@ -58,6 +59,7 @@ class RuntimeVisualisationsTest .option(RuntimeOptions.ENABLE_PROJECT_SUGGESTIONS, "false") .option(RuntimeOptions.ENABLE_GLOBAL_SUGGESTIONS, "false") .option(RuntimeServerInfo.ENABLE_OPTION, "true") + .logHandler(logOut) .out(out) .serverTransport { (uri, peer) => if (uri.toString == RuntimeServerInfo.URI) { diff --git a/lib/rust/ast/Cargo.toml b/lib/rust/ast/Cargo.toml index 7924ca7085a4..3090f5d0bdcb 100644 --- a/lib/rust/ast/Cargo.toml +++ b/lib/rust/ast/Cargo.toml @@ -22,8 +22,8 @@ test = true bench = true [dependencies] -clap = { version = "2.33.1" } -itertools = { version = "0.9.0" } -proc-macro2 = { version = "1.0.19" } -syn = { version = "1.0.12", features = ["full", "extra-traits", "visit-mut", "visit"] } +clap = { version = "2.33.3" } +itertools = { version = "0.10.0" } +proc-macro2 = { version = "1.0.26" } +syn = { version = "1.0.72", features = ["full", "extra-traits", "visit-mut", "visit"] } uuid = { version = "0.8.1" , features = ["serde","v4","wasm-bindgen"] } diff --git a/lib/rust/lexer/definition/Cargo.toml b/lib/rust/lexer/definition/Cargo.toml index 6f4a2beca621..8520adf6237d 100644 --- a/lib/rust/lexer/definition/Cargo.toml +++ b/lib/rust/lexer/definition/Cargo.toml @@ -12,7 +12,7 @@ test = true bench = true [dependencies] -enso-flexer = { version = "0.1.3" } -enso-prelude = { version = "0.1.7" } +enso-flexer = { version = "0.2.0" } +enso-prelude = { version = "0.2.0" } uuid = { version = "0.8.1" , features = ["serde","v4","wasm-bindgen"] } diff --git a/lib/rust/lexer/definition/src/lexer.rs b/lib/rust/lexer/definition/src/lexer.rs index 7a1354b00ab3..d9f21ced5258 100644 --- a/lib/rust/lexer/definition/src/lexer.rs +++ b/lib/rust/lexer/definition/src/lexer.rs @@ -35,6 +35,7 @@ use std::cmp::Ordering; type Logger = Disabled; type Flexer = enso_flexer::Flexer,token::Stream,Logger>; +type DebugLevel = enso_flexer::prelude::logger::entry::level::Debug; @@ -1885,7 +1886,8 @@ pub struct State { comment_state : CommentLexingState, } -impl> State { +impl State +where Logger : AnyLogger + LoggerOps { /// Get a reference to the group for the provided identifier. pub fn group(&self, group:group::Identifier) -> &Group { self.groups().group(group) @@ -1900,7 +1902,8 @@ impl> State { // === Trait Impls === -impl> enso_flexer::State for State { +impl enso_flexer::State for State +where Logger : AnyLogger + LoggerOps { fn new(parent_logger:&impl AnyLogger) -> Self { let logger = ::sub(parent_logger, "State"); let bookmarks = default(); @@ -2040,7 +2043,8 @@ pub struct Offset { logger : Logger } -impl Offset { +impl Offset +where Logger : AnyLogger + LoggerOps { /// Create a new offset state. pub fn new(logger:Logger) -> Self { let current = default(); @@ -2098,7 +2102,8 @@ pub struct NumberLexingState { logger : Logger, } -impl NumberLexingState { +impl NumberLexingState +where Logger : AnyLogger + LoggerOps { /// Create a new number lexing state. pub fn new(logger:Logger) -> Self { let base = default(); @@ -2162,7 +2167,8 @@ pub struct BlockLexingState { logger : Logger, } -impl BlockLexingState { +impl BlockLexingState +where Logger : AnyLogger + LoggerOps { /// Construct a new block lexing state. pub fn new(logger:Logger) -> Self { let stack = default(); @@ -2353,7 +2359,8 @@ pub struct TextLexingState { logger : Logger } -impl TextLexingState { +impl TextLexingState +where Logger : AnyLogger + LoggerOps { /// Construct a new text lexing state. pub fn new(logger:Logger) -> TextLexingState { let text_stack = default(); @@ -2621,7 +2628,8 @@ pub struct CommentLexingState { logger : Logger } -impl CommentLexingState { +impl CommentLexingState +where Logger : AnyLogger + LoggerOps { /// Construct a new comment state with the provided `logger`. pub fn new(logger:Logger) -> Self { let current_comment = default(); diff --git a/lib/rust/lexer/generation/Cargo.toml b/lib/rust/lexer/generation/Cargo.toml index e5a509c678f9..5a7a67f56f0c 100644 --- a/lib/rust/lexer/generation/Cargo.toml +++ b/lib/rust/lexer/generation/Cargo.toml @@ -12,12 +12,12 @@ test = true bench = true [dependencies] -enso-flexer = { version = "0.1.3" } -enso-prelude = { version = "0.1.7" } +enso-flexer = { version = "0.2.0" } +enso-prelude = { version = "0.2.0" } lexer-definition = { path = "../definition", version = "0.1.0" } [build-dependencies] -enso-flexer = { version = "0.1.3" } +enso-flexer = { version = "0.2.0" } lexer-definition = { path = "../definition", version = "0.1.0" } [dev-dependencies] diff --git a/lib/rust/parser-jni/Cargo.toml b/lib/rust/parser-jni/Cargo.toml index b060e4489657..3da43fb73562 100644 --- a/lib/rust/parser-jni/Cargo.toml +++ b/lib/rust/parser-jni/Cargo.toml @@ -21,5 +21,5 @@ test = true bench = true [dependencies] -jni = { version = "0.17.0" } +jni = { version = "0.19.0" } ast = { version = "0.1.0", path = "../ast" } diff --git a/lib/rust/parser-jni/src/jni.rs b/lib/rust/parser-jni/src/jni.rs index bba0a177f102..ed6654e8401a 100644 --- a/lib/rust/parser-jni/src/jni.rs +++ b/lib/rust/parser-jni/src/jni.rs @@ -55,6 +55,7 @@ use jni::sys::*; // ====================== /// Parses a content a of single source file. +#[allow(unsafe_code)] #[no_mangle] pub extern "system" fn Java_org_enso_parser_Parser_parseStr( env : JNIEnv, @@ -83,6 +84,7 @@ pub extern "system" fn Java_org_enso_parser_Parser_parseStr( } /// Parses a single source file. +#[allow(unsafe_code)] #[no_mangle] pub extern "system" fn Java_org_enso_parser_Parser_parseFile( env : JNIEnv, @@ -96,6 +98,7 @@ pub extern "system" fn Java_org_enso_parser_Parser_parseFile( // === Tokens === /// Parses a content of a single source file into a stream of tokens. +#[allow(unsafe_code)] #[no_mangle] pub extern "system" fn Java_org_enso_parser_Parser_lexStr( env : JNIEnv, @@ -106,6 +109,7 @@ pub extern "system" fn Java_org_enso_parser_Parser_lexStr( } /// Parses a single source file into a stream of tokens. +#[allow(unsafe_code)] #[no_mangle] pub extern "system" fn Java_org_enso_parser_Parser_lexFile( env : JNIEnv, diff --git a/lib/rust/parser/Cargo.toml b/lib/rust/parser/Cargo.toml index 713e5a993265..3724a8358d3c 100644 --- a/lib/rust/parser/Cargo.toml +++ b/lib/rust/parser/Cargo.toml @@ -12,14 +12,11 @@ test = true bench = true [dependencies] -enso-data = { version = "0.1.3" } -enso-logger = { version = "0.1.3" } -enso-prelude = { version = "0.1.8" } +enso-data = { version = "0.2.0" } +enso-logger = { version = "0.3.0" } +enso-prelude = { version = "0.2.0" } lexer = { version = "0.1.0", path = "../lexer/generation" } -itertools = { version = "0.9.0" } -# Pinned packages -# TODO: [DB] Remove after switching to new Rust toolchain version. -anyhow = { version = "<=1.0.37" } +itertools = { version = "0.10.0" } [build-dependencies] diff --git a/lib/rust/parser/src/lib.rs b/lib/rust/parser/src/lib.rs index 94f705039f2c..c8b59cdedeaa 100644 --- a/lib/rust/parser/src/lib.rs +++ b/lib/rust/parser/src/lib.rs @@ -14,8 +14,7 @@ pub mod prelude { /// The Enso logging library. pub mod logger { pub use enso_logger::*; - pub use enso_logger::disabled::Logger as Disabled; - pub use enso_logger::enabled::Logger as Enabled; + pub use enso_logger::Logger; } /// The lexer types. diff --git a/lib/rust/parser/src/macros.rs b/lib/rust/parser/src/macros.rs index 9cd988086c25..08e9a2221883 100644 --- a/lib/rust/parser/src/macros.rs +++ b/lib/rust/parser/src/macros.rs @@ -11,6 +11,13 @@ use crate::macros::definition::Definition; use crate::macros::registry::Registry; +// ==================== +// === Type Aliases === +// ==================== + +type DebugLevel = crate::prelude::logger::entry::level::Debug; + + // ================ // === Resolver === @@ -25,7 +32,7 @@ pub struct Resolver { } impl Resolver -where Logger : AnyLogger { +where Logger : AnyLogger + LoggerOps { /// Constructor. pub fn new(macros:Vec, parent_logger:&Logger) -> Self { let logger = ::sub(parent_logger,"Resolver"); diff --git a/project/EnvironmentCheck.scala b/project/EnvironmentCheck.scala index 568ebc4dcda8..ecc2caacd396 100644 --- a/project/EnvironmentCheck.scala +++ b/project/EnvironmentCheck.scala @@ -76,14 +76,17 @@ object EnvironmentCheck { val cmd = "rustc --version" try { - val versionStr = cmd.!!.trim.substring(6) + val versionStr = cmd.!!.trim - if (versionStr != expectedVersion) + val contained = versionStr.contains(expectedVersion) + + if (!contained) { log.error( s"Rust version mismatch. $expectedVersion is expected, " + s"but it seems $versionStr is installed." ) - versionStr == expectedVersion + } + contained } catch { case _ @(_: RuntimeException | _: IOException) => log.error("Rust version check failed. Make sure rustc is in your PATH.") diff --git a/project/GenerateFlatbuffers.scala b/project/GenerateFlatbuffers.scala index 06c6a306ff4a..722a0c6d7af2 100644 --- a/project/GenerateFlatbuffers.scala +++ b/project/GenerateFlatbuffers.scala @@ -28,7 +28,7 @@ object GenerateFlatbuffers { streams.value.cacheStoreFactory.make("flatc_generated_sources") val schemaSourcesStore = streams.value.cacheStoreFactory.make("flatc_schemas") - val out = (sourceManaged in Compile).value + val out = (Compile / sourceManaged).value val generatedSources = gatherGeneratedSources(schemas, out, log) Tracked.diffOutputs(generatedSourcesStore, FileInfo.exists)( diff --git a/project/NativeImage.scala b/project/NativeImage.scala index 3098f1a00982..30c9666b73d8 100644 --- a/project/NativeImage.scala +++ b/project/NativeImage.scala @@ -34,8 +34,8 @@ object NativeImage { * build time by default * @param additionalOptions additional options for the Native Image build * tool - * @param memoryLimitGigabytes a memory limit for the build tool, in - * gigabytes; it is good to set this limit to + * @param memoryLimitMegabytes a memory limit for the build tool, in + * megabytes; it is good to set this limit to * make GC more aggressive thus allowing it to * build successfully even with limited memory * @param initializeAtRuntime a list of classes that should be initialized at @@ -47,7 +47,7 @@ object NativeImage { staticOnLinux: Boolean, initializeAtBuildtime: Boolean = true, additionalOptions: Seq[String] = Seq.empty, - memoryLimitGigabytes: Option[Int] = Some(3), + memoryLimitMegabytes: Option[Int] = Some(3584), initializeAtRuntime: Seq[String] = Seq.empty ): Def.Initialize[Task[Unit]] = Def .task { @@ -99,7 +99,7 @@ object NativeImage { } val memoryLimitOptions = - memoryLimitGigabytes.map(gigs => s"-J-Xmx${gigs}G").toSeq + memoryLimitMegabytes.map(megs => s"-J-Xmx${megs}M").toSeq val initializeAtRuntimeOptions = if (initializeAtRuntime.isEmpty) Seq() diff --git a/project/build.properties b/project/build.properties index dbae93bcfd51..19479ba46ff2 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.4.9 +sbt.version=1.5.2 diff --git a/test/Tests/src/Network/Http_Spec.enso b/test/Tests/src/Network/Http_Spec.enso index 660d8af7a27f..da0eee28e314 100644 --- a/test/Tests/src/Network/Http_Spec.enso +++ b/test/Tests/src/Network/Http_Spec.enso @@ -44,7 +44,7 @@ spec = { "headers": { "Content-Length": "0", - "User-Agent": "Java-http-client/11.0.10" + "User-Agent": "Java-http-client/11.0.11" }, "origin": "127.0.0.1", "url": "", @@ -58,7 +58,7 @@ spec = { "headers": { "Content-Length": "0", - "User-Agent": "Java-http-client/11.0.10" + "User-Agent": "Java-http-client/11.0.11" }, "origin": "127.0.0.1", "url": "", @@ -73,7 +73,7 @@ spec = { "headers": { "Content-Length": "0", - "User-Agent": "Java-http-client/11.0.10" + "User-Agent": "Java-http-client/11.0.11" }, "origin": "127.0.0.1", "url": "", @@ -94,7 +94,7 @@ spec = { "headers": { "Content-Length": "0", - "User-Agent": "Java-http-client/11.0.10" + "User-Agent": "Java-http-client/11.0.11" }, "origin": "127.0.0.1", "url": "", @@ -113,7 +113,7 @@ spec = { "headers": { "Content-Length": "0", - "User-Agent": "Java-http-client/11.0.10" + "User-Agent": "Java-http-client/11.0.11" }, "origin": "127.0.0.1", "url": "", @@ -133,7 +133,7 @@ spec = "headers": { "Content-Length": "12", "Content-Type": "text/plain", - "User-Agent": "Java-http-client/11.0.10" + "User-Agent": "Java-http-client/11.0.11" }, "origin": "127.0.0.1", "url": "", @@ -153,7 +153,7 @@ spec = "headers": { "Content-Length": "7", "Content-Type": "application/x-www-form-urlencoded", - "User-Agent": "Java-http-client/11.0.10" + "User-Agent": "Java-http-client/11.0.11" }, "origin": "127.0.0.1", "url": "", @@ -173,7 +173,7 @@ spec = "headers": { "Content-Length": "7", "Content-Type": "application/x-www-form-urlencoded", - "User-Agent": "Java-http-client/11.0.10" + "User-Agent": "Java-http-client/11.0.11" }, "origin": "127.0.0.1", "url": "", @@ -203,7 +203,7 @@ spec = "headers": { "Content-Length": "13", "Content-Type": "application/json", - "User-Agent": "Java-http-client/11.0.10" + "User-Agent": "Java-http-client/11.0.11" }, "origin": "127.0.0.1", "url": "", @@ -226,7 +226,7 @@ spec = "headers": { "Content-Length": "13", "Content-Type": "application/json", - "User-Agent": "Java-http-client/11.0.10" + "User-Agent": "Java-http-client/11.0.11" }, "origin": "127.0.0.1", "url": "", @@ -249,7 +249,7 @@ spec = "headers": { "Content-Length": "12", "Content-Type": "application/octet-stream", - "User-Agent": "Java-http-client/11.0.10" + "User-Agent": "Java-http-client/11.0.11" }, "origin": "127.0.0.1", "url": "", @@ -269,7 +269,7 @@ spec = { "headers": { "Content-Length": "0", - "User-Agent": "Java-http-client/11.0.10" + "User-Agent": "Java-http-client/11.0.11" }, "origin": "127.0.0.1", "url": "", @@ -285,7 +285,7 @@ spec = "headers": { "Content-Length": "13", "Content-Type": "application/json", - "User-Agent": "Java-http-client/11.0.10" + "User-Agent": "Java-http-client/11.0.11" }, "origin": "127.0.0.1", "url": "", @@ -310,7 +310,7 @@ spec = "headers": { "Content-Length": "16", "Content-Type": "application/json", - "User-Agent": "Java-http-client/11.0.10" + "User-Agent": "Java-http-client/11.0.11" }, "origin": "127.0.0.1", "url": "", diff --git a/test/Tests/src/Semantic/Python_Interop_Spec.enso b/test/Tests/src/Semantic/Python_Interop_Spec.enso index 91cc00f1a4db..2aa9dcf15d8d 100644 --- a/test/Tests/src/Semantic/Python_Interop_Spec.enso +++ b/test/Tests/src/Semantic/Python_Interop_Spec.enso @@ -26,8 +26,8 @@ type My_Type foreign python do_catch = """ try: self.do_throw() - except Exception as e: - return e.a + except: # Polyglot exceptions can only be caught with except-all. + return self.a foreign python make_object = """ class My: @@ -90,7 +90,8 @@ spec = _ -> False t.should_be_true - Test.specify "should make Python numbers type pattern-matchable" <| + pending_pat = "Python numbers are currently not being converted." + Test.specify "should make Python numbers type pattern-matchable" pending=pending_pat <| int_match = case here.make_int of Integer -> True int_match.should_be_true @@ -111,8 +112,7 @@ spec = err.cause.args.at 0 . should_equal 'Error!' err.cause.to_text . should_equal "RuntimeError('Error!')" - pending_msg = "Graalpython does not support handling interop exceptions" - Test.specify "should allow Python to catch Enso exceptions" pending=pending_msg <| + Test.specify "should allow Python to catch Enso exceptions" <| value = My_Type 7 2 result = value.do_catch result . should_equal 7 diff --git a/tools/run b/tools/run index 441f553a4583..0e330512e2a1 100755 --- a/tools/run +++ b/tools/run @@ -6,8 +6,8 @@ const spawn = require('child_process').spawn const path = require('path') // Versions -const nodeJsVersion = "v12.18.0" -const rustcVersion = "1.40.0-nightly" +const nodeJsVersion = "v14.16.1" +const rustcVersion = "1.54.0-nightly" // Configuration const libImplDirName = 'impl'