Stateless (static) parser interface. Buffer-reuse optimization is now hidden within `Parser` implementation. Fixes#11121 and prevents similar bugs.
# Important Notes
- Also simplify `EnsoParser` API, exposing only a higher-level interface.
* Cleanup list of Enso's project aggregates
`sbt> clean` didn't really clean everything as `engine-common` was
missing in the list of aggregates. This could turn out problematic for
incremental compilation.
Apart from adding `engine-common` to the list of aggregates,
re-organized the list alphabetically so that it is easier to figure out
what is missing there.
* engine-common wasn't being formatted
Ensures that the following command:
```
enso --no-global-cache --no-ir-caches --no-compile-dependencies --no-read-ir-caches --compile built-distribution/enso-engine-0.0.0-dev-linux-amd64/enso-0.0.0-dev/lib/Standard/Base/0.0.0-dev/
```
does not load IRs from caches, but actually compiles all the modules in `Standard.Base` library.
# Important Notes
- Add some logging on places, fix some typos.
Fixes#9402 by explicitly throwing `PanicSentinel` in `CatchPanicNode`. b89275bf2c enhances `CatchPanicNode` to provide a special treatment of `PanicSentinel` and a85c561d2a adds some tests to verify the treatment.
* Use moduleDependencies instead of modulePath
* Fix compilation of editions
* Fix compilation of distribution-manager
* polyglot-api needs to explicitly compile module-info
* Fix compilationOrder in library-manager and edition-updater
* engine-runner-common is module
* JPMSPlugin provides default implementation of compileModuleInfo
* Remove unused setting key from JPMSUtils.compileModuleInfo
* JPMSPlugin has internalModuleDependencies and exportedModule tasks.
* Use BuildVersion instead of buildInfo
* Manual compilation of module-info.java is reported as warning
* Define org.enso.scalalibs.wrapper meta project.
* Fix module check in JPMSPlugin.
This is a fix for projects that declare `Compile /exportJars := true`
* version-output is a module
* ydoc-server uses internalModuleDependencies
* persistance is module
* engine-common uses internalModuleDependencies
* polyglot-api does not override compileModuleInfo task
* runtime-parser uses internalModuleDependencies
* edition-updater is module
* Update moduleDependencies for distribution-manager
* editions is module
* Fix some dependencies of modules
* scala-yaml is a module
* Add scala-compiler to scala-libs-wrapper
* cli depends on scala-library module
* Add dependencies for distribution-manager module
* Add some scala-library dependencies in some modules
* engine-runner uses internalModuleDependencies
* Fix module dependencies of library-manager
* Rename org.enso.scalalibs.wrapper to org.enso.scala.wrapper
* Add jsoniter-scala-macros to org.enso.scala.wrapper fat module
* Fix dependencies of some projects
* polyglot-api does not depend on truffle-api
* Fix dependencies of some projects
* runtime does not use com.google.common
* runtime is a module
* text-buffer is a module
* refactoring-utils is a module
* runtime-compiler is a module
* runtime-instrument-common is a module
* connected-lock-manager is a module
* JPMSUtils reports project name in some error messages
* Modularize some instruments
* module-info compilation is cached
* runtime-instrument-runtime-server is module
* runtime-language-epb is module
* Remove runtime-fat-jar
* engine-runner is not a fat jar
* JPMSPlugin defines exportedModuleBin task
* Redefine componentModulesPaths task
* interpreter-dsl is module
* Redefine componentModulesPaths task
* fmt sbt
* scala-libs-wrapper is a modular fat jar
* Add some module deps to org.enso.runtime
* engine-runner is not a fat jar
* Rename package in logging-config
* Rename package in logging-service
* Rename package in logging-service-logback
* Fix dependencies of exportedModuleBin task
* Mixed projects have own compileJava task
this task does not compile only module-info.java but all the java sources. So that we can see errors more easily.
When only module-info.java is compiled, the only errors that we can see are that we did not include some modules on module-path.
* Fix definition of exportedModule task.
* Remove usages of non-existing buildInfo and replace it with BuildVersion
* Fix some dependencies of org.enso.runtime module
* module-info compilation is handled directly by FrgaalCompiler
* module-info compilation is forced for projects that has only Scala sources with single module-info.java
* Fix compilation of org.enso.runtime
* manual module-info compilation is not a warning
* Rename packages in logging-utils-akka
* Create org.enso.language.server.deps.wrapper module
* language-server is module
* Creat akka-wrapper modular fat jar
* fmt
* Define common settings for modularFatJarWrapper
* Fix compilation of json-rpc-server
* Use akka and zio wrappers
* language-server depends on org.eclipse.jgit
* Fix some dependencies - update library manifests works now!
* update library manifests invokes runner directly
* buildEngineDistribution does not copy runner.jar
* Remove EngineRunnerBootLoader
* Fix compilation of std libs
* --patch-module and --add-exports are also passed to javac
* Rename package in runtime-integration-tests.
The package name org.enso.compiler clashes with the package from the module
* Remove usage of buildInfo
* FrgaalJavaCompiler can deal with non-existing module-info.java when shouldCompileModuleInfo is true.
It just generates a warning in such case as it suggests that there is something wrong with the project configuration.
* Revert AliasAnalysisTest.scala
* Fix dependencies and java cmdline options for runtime-integration-tests
* Rename test package
* runtime-integration-test depends on logging-service-logback/Test/compile
* Rename package in logging-service-logback/Test
* Fix FrgaalJavaCompiler creation for projects
* Sanitize Test/javaOptions arguments
* Sanitize Test/javaOptions arguments
* All the JPMSPlugin settings are scoped
* Remove unused sbt tasks
* modularFatJarWrapperSettings do not override javacOptions
* Resolve issue "Cannot find TestLoggerProvider" in runtime-integration-tests
* org.enso.runtime module is open
* Test that test classes are unconditionally opened and exported
* polyglot-api-macros is a module
* JPMSPlugin handles --add-opens cmdline option
* RuntimeServerTest ensures instruments are initialized
* Add some exports to org.enso.runtime.compiler
* Add instruments on module-path to runtime-integration-tests
* Replace TestLogProviderOnClassPath with TestLogProviderOnModulePath
* Replace buildInfo with BuildVersion
* Add jpms-wrapper-scalatest
* ReportLogsOnFailure is in non-modular testkit project
* Add necessary dependencies to testkit project
* Revert "Add jpms-wrapper-scalatest"
This reverts commit 732b3427a2.
* modularize filewatcher and wrap its dependencies
* Initial fix for language-server/test
* frgaal compiler setting are scoped for Compile and Test
* Rename package in language-server/test
* Exclude com.sun.jna from wrapper jars
* Rename package in library-manager-test
* testkit is an automatic module
* process-utils is module
* akka-wrapper contains akka-http
* Some fixes for library-manager-test
* Fix dependencies for akka-wrapper
* scala-libs-wrapper exports shapeless
* lang server deps wrapper exports pureconfig
* json-rpc-server requires org.slf4j
* Add some dependencies
* lang server deps wrapper exports pureconfig.generic
* language server test requires bouncycastle provider
* language server depends on cli
* directory-watcher wrapper requires org.slf4j
* WatcherAdapter logs unsuccessful initialization errors
* Fix error reporting in WatcherAdapter
* Fix rest of the language-server tests
* language-server-deps-wrapper depends on scala-libs-wrapper
* Fix rest of the language-server tests
* Missing module-info.class in an internal project is a warning, not an error
* Rename jpms-methvin-directory-watcher-wrapper to a simpler name
* compileOrder has to be specified before libraryDependencies
* exclude module-info.java from polyglot-api-macros
* Remove temporary logging in customFrgaalCompilerSettings
* Fix compilation of logging-service-logback
* Fix compilation of runtime-benchmarks
* Fix runtime-benchmarks/run
* HostClassLoader delegates to org.graalvm.polyglot class loader if org.enso.runtime is not on boot layer
* org.enso.runtime.lnaguage.epb module must be opened to allow it to be used by annnotation processor
* fmt
* Fix afetr merge
* Add module deps after merge
* Print stack trace of the uncaught exception from the annotation processor
* Remove akka-actor-typed from akka-wrapper
* runtime-instrument-common depends on slf4j
* Fix module-path for runtime-instrument-repl-debugger
* runtime-benchmarks depends on runtime-language-arrow
* --module-path is passed directly to frgaal
* Fix some module-related cmd line options for std-benchmarks
* Revert "--module-path is passed directly to frgaal"
This reverts commit da63f66a0e.
* Avoid closing of System.err when closing Context
* Avoid processing altogether when requested annotations are empty
* Pass shouldNotLimitModules opt to frgaal
* Pass module-path and add-modules options with -J prefix to frgaal
* BenchProcessor annotation processor creates its own truffle module layer
* bench-processor and benchmarks-common are modules
* fmt
* Fix after mege
* Enable JMH annotation processor
* Fix compileOrder in some projects
* Insert TruffleBoundary to QualifiedName.
This is a revert
* Fix building of engine-runner native image
* Add more deps to the native image
* Force module-info compilation in instruments.
This fixes some weird sbt bug
* Don't run engine-runner/assembly from Rust build script
* Update docs of JPMSPlugin
* fmt
* runtime-benchmarks depends on benchmarks-common module
* Fix benchmark report writing
* std-benchmarks annot processing does not take settings from runtime-benchmarks
* Suppress interpreter only warning in annotation processor
* Runtime version manager does not expect runtime.jar fat jar
* fmt
* Fix module entry point
* Move some polyglot tests to runtime-integration-tests.
Also make their output silent
* pkg has no dependency on org.graalvm.truffle
* Fix compiler dependencies test
* Rename all runtime.jar in fake releases
* Add language-server with dependencies to component dir
* No module-info.class in target dir is warning not error
* language-server does not depend on netbeans lookup uitl
* Declare LanguageServerApi service provider in module-info
* connected-lock-manager-server is JPMS module
* task-progress-notifications is module
* Add fansi-wrapper module
* Fix compilation of connected-lock-manager-server
* Define correct Test/internalModuleDependencies for project-manager
* fmt
* Fix LauncherRunnerSpec - no runtime.jar
* Add fansi-wrapper to runtime-integration-tests and runtime-benchmarks
* Fix engine-runner native image build
* Use newer JNA version - fixes running of hyperd
* DRY
* scala-compiler DRY
* fmt
* More build.sbt refactoring
* Include runtime-instrument-id-execution in engine-runner native image
* TruffleBoundary for QualifiedName.toString
* Finding a needle in a haystack
🤦
* More scala-library DRY
* more mixed-java/scala goodies
* Fix compilation of syntax-rust-definition
* Test that engine-runner does not depend on language-server
* Append rather than assign `moduleDependencies`
`++=` is less error prone than `:=`. Also discovered some unnecessary
dependencies.
* Replace : with File.pathSeparator
* [WIP] Make logging in ProjectService more verbose
* language-server/test didn't start because of missing lookup and fansi modules
* Formatting
* org.enso.cli.task.notifications needs Akka and Circe to link
* project-manager/test depends on buildEngineDistribution
* [WIP] Even more verbose logging for creating projects
* [WIP] Even more verbose logging for creating projects
* Revert "[WIP] Even more verbose logging for creating projects"
This reverts commit a7067c8472.
* Revert "[WIP] Even more verbose logging for creating projects"
This reverts commit fc6f53d4f1.
* Revert "[WIP] Make logging in ProjectService more verbose"
This reverts commit 427428e142.
* All the project with JPMSPlugin has stripped artifact names
* Revert all placeholder fake release components to runtime.jar without version
* Eliminate a cross version hack
We shouldn't be specifying Scala dependencies with a Scala cross version
in the suffix.
* Address SBT lint warnings
* Revert "Eliminate a cross version hack"
This reverts commit 8861dab288.
* logging-service-logback is mixedJavaScalaProject
* fmt
* Stripped artifact name contains classifier.
This fixes tests as those were named like `artifact-tests.jar`.
* Don't use LocalProject unless really needed
* Add more logging when BenchProcessor fails
* logging-service-logback is not mixed project
* Work with java.io.File.getPath to avoid mixing slash and backslash on Windows
* Reapply "Eliminate a cross version hack"
This reverts commit edaa436ee8.
* Pass scalaBinaryVersion correctly
* Remove scala-compiler from the distribution
* Fix IllegalAccessErrors from serde
* typos
* License review
* fmt
* Move testLogProviderOnModulePath to TestJPMSConfiguration
* logging-service-logback is not a mixed project
---------
Co-authored-by: Jaroslav Tulach <jaroslav.tulach@enso.org>
Co-authored-by: Hubert Plociniczak <hubert.plociniczak@gmail.com>
Fixes#10679 by changing the return type of `EqualsXyzNode`s to `EqualsAndInfo`. This class holds the result of the comparation as well as any attached warnings. `EqualsBuiltinNode` then re-attaches the warnings, if there are any.
Motivation:
```
Caused by: java.lang.AssertionError: No polyglot context is entered. A language or context reference must not be used if there is no polyglot context entered.
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotFastThreadLocals.assertValidGet(PolyglotFastThreadLocals.java:481)
at org.graalvm.truffle/com.oracle.truffle.polyglot.PolyglotFastThreadLocals$ContextReferenceImpl.get(PolyglotFastThreadLocals.java:513)
at org.enso.runtime/org.enso.interpreter.runtime.EnsoContext.get(EnsoContext.java:246)
at org.enso.runtime/org.enso.interpreter.runtime.error.PanicException.computeMessage(PanicException.java:90)
```
Looks like `Throwable` thrown by the execution may be missing a message,
which later crashes when we want to send it over the wire.
Added some guards to prevent NPE.
* Add failing tests
* ExtensiomMethod resolution in the current module might be an error in GlobalNames
* Add another successful test
* Fix compilation error test
* Fix compilation of RedShift_Spec - `setup` is provided in compile scope
I am trying to compile Enso with GraalVM 24.2.0 snapshot to verify that https://github.com/oracle/graal/pull/8266 changes would work for Enso. Among the problems I am facing is a dependency on `org.graalvm.collections` because of using `Pair`. I don't think we need such dependency. Let's avoid it by using our own `record` with two components.
Fixes#11022 and in general fixes#5787 by avoiding calls to Scala's `assert` function and using regular one written in Java that uses `assert` keyword and is thus sensitive to `-ea` command line option of the JVM. Use `assertInJvm` in newly written Scala code to get typical JVM behavior on `assert`.
close#10970
Changelog:
- remove: FileManager actors pool
Language Server executes IO on a separate thread pool for blocking operations and does not block the actor
Loading IR caches and IdMap for a module don't play very well. Rather
than complicating logic and introducing yet another re-compilation
request let's not even attempt to deserialize a module if IdMap is
present. The cost of compiling a single module (right now containing the
project itself) is negligble, compared to a possibility of bugs that
we've encountered so far.
* Rename packages in logging-utils-akka
* Migrate buildInfo to Java
* Rename packages in logging
* Rename package in scala-yaml
* No usage of CompilerDirectives inside pkg
* log errors of initialization of directory watcher
* HashCodeNode does not use com.google.common.base.Objects
* Rename rest of the packages
* fmt
* Fix dependencies on version-output
* Add necessary dependencies to testkit
* Rename instruments in runtime-fat-jar module-info
* Fix compilation errors because of BuildVersion
* Fix logger renames
* Use java.util.List directly
* Fixes after merge
* Improve error message in NativeLauncherSpec
* Fix logger renames
* Fix json version formatting
* Revert "No usage of CompilerDirectives inside pkg"
This reverts commit cc7e078416.
* fmt
* Reduce akka logs in PM and LS
After #10905 we suddenly got a lot of (useless) logs from akka in
project-manager and language-server. After some investigation it turned
out that akka-typed had a special configuration to enable logging in
akka using slf4j.
As we don't need the whole library for that I only stole the
configuration.
* nit
* licensing
* missing license files
* Re-enable IR caching in Language Server
When an IR loaded from cache is being run through the same passes,
"interesting" errors may happen. We must ensure that IR is not run
through phases that have already done their transformations.
With this change, I'm no longer seeing failures after project startup.
* resetScope is also obsolete
* address PR review
* Akka-related startup improvements
Realized that Akka Typed and Spray were not used **at all** yet there
were in the list of dependencies.
Additionally, the former would also show up in the list of Akka's
library-extensions, initialized on startup.
* Hardcode list of library extensions
Hardcoding a list of library extensions is not recommended but I don't
see any other way of disabling expensive Serialization extension, which
we don't seem to use anyway.
* fmt
* licensing update
Scheduling of jobs is asynchronous and nothing prevents it from scheduling execution before compilation leading to stale nodes in GUI. The scenario is easily reproducible by adding a `Thread.sleep` before `EnsureCompiledJob` requests compilation locks.
This change ensures that execution is only scheduled after compilation is finished, when an edit request is being processed.
# Important Notes
This fix was prompted by me getting random stale nodes after edits:
![Screenshot from 2024-08-23 16-53-26](https://github.com/user-attachments/assets/2b017539-c4bf-4d42-b597-216d887a4f4c)
(it would never recover unless another edit was made)
When Ydoc requests to open file and encounters a timeout, it will
attempt to retry the request. At least that's the behaviour since
#10787.
Unfortunately, the write lock on the file might be already held and
identified by the client id and actor reference. The latter is always
determined by the request and therefore spurious. The same client should
always be given the same capability, even on retries.
* Reduce amount of IR copying
This PR ensures that we only perform IR copying when actually needed,
i.e. when one of the fields has changed.
Most of the changes should not be controversial except for equality
change in MetadataStorage. Without it, an empty pass metadata would be
treated as equal, therefore preventing duplication from happening.
* fmt
* missed a few spots
* Optimizations to copying
Avoid expensive computations for static methods.
* Avoid unnecessary unapply calls
Fixes#9749 by:
- [x] Adding `fn` option to `enso-debug-server` instrument - eb3b76e
- [x] Print warnings (if any) to stderr - 4fda04b
- [x] Improving output of `:list` to print out warnings - dbe3c45480
- [x] Print errors to stderr - 1312546
- [x] Exiting on `DataflowError` - 2cc7ef5 and e6fbf73
- [x] Using all of that inside of `runner/*Main` - 7df58ef
The core of the change is in instrumentation that wraps the `main` method and at its end checks for _warnings or errors_ among local variables. When an error is found, it wraps the original return value of `main` with a proxy that delegates to the original value, but also pretends to be _exit exception_ with exit code 173. That one is detected in `Main` launcher to exit the process with exit code 173.
# Important Notes
As a side-effect of this change, one can request an invocation of REPL at the end of any method just by providing a property to the VM:
```bash
$ enso --vm.D=polyglot.enso-debug-server.method-break-point=err_test.main --run err_test.enso --repl
```
stops at the end of `main` method of `err_test.enso` file.
* Add stub of FramePointerAnalysis pass
* Add stub of FramePointerAnalysisTest
* Add more framepointer tests
* FramePointer has constructor for better debugging
* Update tests - FramePointer metadata is also in Info.Def
* FramePointerAnalysis traverses the whole IR.
* Fix test - check for metadata
* Reorder methods in FramePointerAnalysis
* Fix argument processing
* Improve some toString methods for debugging
* Fix parent levels in tests
* FramePointerAnalysis does not copy IRs
* FramePointerAnalysis metadata is Persistable
* FramePointerAnalysis attaches metadata to atom constructors
* Synthetic self argument is handled specially
* IRDumperPass is run as the last compiler pass
This ensure that one can see all the metadata on the IR.
* IRDumper can dump alias analysis metadata
* FramePointerMeta has meaningful toString
* FramePointerAnalysis process case expressions
* Fix javadoc links
* FramePointer is attached to GenericAnnotation expression
* IRDumper handles case type patterns
* FramePointer is attached to argument default value expressions
* Add test for default argument value metadata
* Attach frame pointer to default value expressions even if they have no alias graph
* FramePointerAnalysis can run inline on expression
* Fixes after rebase
* Fix annotation processing
* Add tests for no frame pointers on global symbol usages
* Do not use AliasAnalysis in IrToTruffle.
Also refactor NameResolutionAlgorithm to not use AliasMetadata
* Remove unused methods from LocalScope
* Remove unused import
* fmt
* Fix scala.MatchError for case patterns
* Do not use absolute code locations in the test.
Test on Windows fails because of different length of new lines.
- Enables the `..` autoscoping style for creating Atoms in expressions.
- Add type checking to methods in columns.
- Auto wrap returns from method in expressions into a column as needed.
- Remove `Time_Period.Day` to remove confusion..
In order for widgets not to invalidate expression's results and trigger computations, we now cache self argument to which visualizations should be attached to.
It should help with #10730 but there is still a bug in GUI.
- Closes#10716 by un-marking the `Snowflake_Connection` as `private`.
- Does the same to `SQLServer_Connection`.
- Makes sure that `Snowflake_Connection` has correct visualization and enables links for it.
- Adds a fallback in `to_default_visualization_data` and in Table's `prepare_visualization` so that if `to_js_object` of a given type is malformed, we still get some kind of visualization + debug info about the underlying error.