Commit Graph

147 Commits

Author SHA1 Message Date
Dmitry Bushev
3a4ac4f381
Fix compilation error in integration tests (#11611) 2024-11-21 09:59:39 +00:00
Jaroslav Tulach
afe4203f6a
Invoke Warning.getValue().to_text and use it from ReplDebuggerInstrument (#11591)
Fixes #11569 by using `.to_text` on the right _warning's value_ (as introduced by #10842) and sharing the code with the instrument.
2024-11-20 17:31:33 +00:00
Jaroslav Tulach
b3588490db
Give DebugBreakpointNode some section to prevent NPE (#11594)
Fixes `NullPointerException` by giving `DebugBreakpointNode` a source section.
2024-11-20 15:20:10 +00:00
Pavel Marek
04075c5ed7
Implement hasLanguage interop message for all enso objects (#11538)
* EnsoObject is an abstract class, not an interface.

- Also, EnsoObject exports hasLanguage and getLanguage interop messages.
- BranchRecord converted to class

* Implement public getters in BranchResult

* Fix compilation of EnsoFile

* Add test that all enso values must have language

* Revert EnsoException - remove

* DataflowError and PanicException implement hasLanguage and getLanguage

* DataflowError is not EnsoObject - change signatures in some builtins

* Add more members to Module.isMemberInvocable.

Keep in sync with doInvoke.

* Revert "DataflowError and PanicException implement hasLanguage and getLanguage"

This reverts commit b30f3961b7.

* Update the test - test only non-primitive and non-exception values

* Fix indexes in CodeLocationsTest

* Add more members to Function.isMemberInvocable

Keep in sync with doInvoke.

* EnsoObject.toDisplayString delegates to toString method

* EnsoObject.toDisplayString is behind TruffleBoundary

* Warning exports InteropLibrary which delegates to value.

With the exception of toDisplayString message.

* WithWarnings needs to explicitly export toDisplayString.

It is not automatically delegated because it is implemented in the super type.

* EnsoObject.toDisplayString just throws AssertionError

* AssertionError is behind TruffleBoundary

* Implement toDisplayString on some truffle objects

* Warning exports WarningsLibrary

* Revert "Warning exports WarningsLibrary"

This reverts commit a06c672db5.

* Add some warnings test

* Warning.isNull is always false

Even if it wraps Nothing

* Add some unnecessary methods to fix the compilation

* EnsoObject.toDisplayString is abstract

* ImportExportScope.toDisplayString is behind TruffleBoundary.

This fixes native-image build of engine-runner.

* Hide some toDisplayString methods behind TruffleBoundary

This fixes native-image build of engine-runner.
Bypassing failing test.
2024-11-20 13:23:33 +00:00
Jaroslav Tulach
d862a3cf08
HostValueToEnsoNode is not a builtin (#11593)
Bypassing failing check.
2024-11-20 08:15:36 +00:00
Jaroslav Tulach
ad9d0e5ab5
Allow (42 : Text & Integer) at the end of function (#11588)
Bypassing failing check.
2024-11-20 08:14:38 +00:00
Dmitry Bushev
6b810ee1e6
Rename unqualified method calls (#11556)
close #11281

Changelog:
- update: `refactoring/renameSymbol` can rename unqualified method calls

# Important Notes
https://github.com/user-attachments/assets/e03c4ec7-7620-4ce4-8eab-86b95f308be2
2024-11-15 13:10:57 +00:00
Hubert Plociniczak
2f2eeafceb
Fix Logger's name in stdlib (#11519)
* Fix Logger's name in stdlib

Somehow SLF4J is able to recognize correctly the provided Logger's name
and print it to the user. Java's Logger is
not.
In addition, we setup SLF4J's configuration, meaning that log-levels are
correctly respected.

For a simple project:
```
from Standard.Base import all
from Standard.Base.Logging import all

type Foo

main =
    IO.println "Hello World!"
    Foo.log_message level=..Warning "I should warn you about something..."
    Foo.log_message level=..Info "Should be seen? By default we only show up-to warnings level"
    Foo.log_message level=..Severe "Something went really bad!"
```

This change demonstrates the fix.

Before:
```
> enso --run simple-logging.enso
Hello World!
Nov 08, 2024 6:08:07 PM com.oracle.truffle.host.HostMethodDesc$SingleMethod$MHBase invokeHandle
WARNING: I should warn you about something...
Nov 08, 2024 6:08:07 PM com.oracle.truffle.host.HostMethodDesc$SingleMethod$MHBase invokeHandle
INFO: Should be seen? By default we only show up-to warnings level
Nov 08, 2024 6:08:07 PM com.oracle.truffle.host.HostMethodDesc$SingleMethod$MHBase invokeHandle
SEVERE: Something went really bad!
Foo
```

After:
```
> enso --run simple-logging.enso
Hello World!
[WARN] [2024-11-08T18:03:37+01:00] [simple-logging.Foo] I should warn you about something...
[ERROR] [2024-11-08T18:03:37+01:00] [simple-logging.Foo] Something went really bad!
Foo
```

* Update distribution/lib/Standard/Base/0.0.0-dev/src/Logging.enso

Co-authored-by: Radosław Waśko <radoslaw.wasko@enso.org>

* Test stdlib logs by using MemoryAppender

Added `getEvents` member to `MemoryAppender` so that it is possible to
retrieve individual log messages from tests and test their presence.
Required opening up to some modules to retrieve internals of loggers.

* nit

* small tweaks to eliminate module warnings

---------

Co-authored-by: Radosław Waśko <radoslaw.wasko@enso.org>
2024-11-13 10:20:41 +01:00
Jaroslav Tulach
67db825587
MetadataStorage is mutable - structural equals in copy isn't enough (#11513)
`MetadataStorage` is mutable. Using `Object.equals` in `IR.copy` methods to check whether a _copy is needed_ isn't enough. The fact that two storages are `Object.equal` may be just temporary. Replacing the checks in 69 `IR.copy` methods with identity check - e.g. `ne` in Scala which is `==` in Java.

Using proper structural check inside of `MetadataStorage` fixes #11171.

# Important Notes
I [used this regex](https://github.com/enso-org/enso/issues/11171#issuecomment-2463908932) to find out 69 instances of `IR.copy`:

![69 copy methods](https://github.com/user-attachments/assets/257580b9-54fc-4199-88ad-a22103b0041f)

and I modified all 69 of them.
2024-11-08 17:29:41 +00:00
Pavel Marek
701bba6504
Convert Array_Like_Helpers.map to a builtin to reduce stack size (#11363)
The ultimate goal is to reduce the method calls necessary for `Vector.map`.

# Important Notes
- I managed to reduce the number of Java stack frames needed for each `Vector.map` call from **150** to **22** (See https://github.com/enso-org/enso/pull/11363#issuecomment-2432996902)
- Introduced `Stack_Size_Spec` regression test that will ensure that Java stack frames needed for `Vector.map` method call does not exceed **40**.
2024-11-06 11:14:48 +00:00
Jaroslav Tulach
73abe909ef
Use GraphBuilder to construct an alias Graph (#11491) 2024-11-05 18:56:05 +01:00
Hubert Plociniczak
35e5ed53d2
Don't cancel aborted jobs immediately (#11375)
* Don't cancel aborted jobs immediately

Rather than cancelling Futures that capture jobs' logic,
this change introduces a two-level system:

- interrupt all jobs softly via ThreadInterrupted at safepoints
- if safepoint is not executed within some time period or it is
  but the job is still not cancelled, trigger a hard-interrupt
  by cancelling the job explicitly, if possible

Closes #11084.

* Only cancel Future when you mean it

Soft-cancelling a future only to later call it with `mayInterrupt` set
to `true` has no effect in the latter case.
Changed the logic so that interrupting a Future will really enforce it.

Ocassionally some commands should not attempt to run soft cancellations
- we know they will re-execute the program.

* Replace Thread.sleep with Future.get

No while loops etc, it's much easier to reason about what is soft and
hard interrupt supposed to do.

* Better comments/logs

* nit

* PR review

* Make test more robust
2024-11-05 10:33:02 +01:00
Jaroslav Tulach
988316f910
Make Graph.nextId() private (#11486) 2024-11-05 05:21:10 +01:00
Kaz Wesley
2b3bd2cc90
Move documentation into documentable types (#11441)
Move documentation into documentable types (implements #11302).

# Important Notes
GUI:
- Distinguish expression and statement
- `Ast.Ast` is still present, as the base class for AST objects. Most references to `Ast.Ast` are now references to `Ast.Expression`. Operations on blocks use `Ast.Statement`.
- `Ast.parse` has been replaced with: `Ast.parseExpression`, `Ast.parseStatement`, and `Ast.parseBlock`
- `syncToCode` is internally context-aware; it parses the provided code appropriately depending on whether its AST is an expression, a statement, or the top level of a module.
- Remove `wrappingExpression` / `innerExpression` APIs: Wrapper types have been eliminated; modifier lines are now fields inside parent types.
- Simplify AST printing:
- Fully implemented autospacing in `concreteChildren` implementations; the type returned by `concreteChildren` now ensures that spacing has been fully resolved.
- Eliminate `printBlock` / `printDocs`: `concreteChildren` is now aware of indentation context, and responsible for indentation of its child lines.
- The `Pattern` type is now parameterized to identify the AST type it constructs. The `Pattern.parseExpression` function helps create a `Pattern<Expression>`.
- Refactor `performCollape` for testability.
- e2e tests: Improve table viz test: It still doesn't pass on my Mac, but these changes are necessary if not sufficient.

Compiler (TreeToIr):
- An expression in statement context is now found in an `ExpressionStatement` wrapper.
- Documentation for a `Function` is now found inside the function node.
- Deduplicate some polyglot-function logic.
2024-11-04 15:33:53 +00:00
Jaroslav Tulach
4cb943b5ed
Occurences in Java. Don't expose setters for Scope vars. (#11464)
Another change motivated by work on #11365. Continuation of #11419.
2024-11-01 17:14:10 +00:00
Pavel Marek
536a49f35d
Fix Meta.get_qualified_type_name when run as single file (#11401)
`Meta.get_qualified_type_name` correctly returns fully qualified type name when running a single file from a project with `enso --run Proj/src/Main.enso`.
2024-10-31 15:25:45 +00:00
Jaroslav Tulach
15575b495a
Skeletal PanicExceptionTest and more logging when AssertionError happens (#11393) 2024-10-29 15:47:12 +01:00
Jaroslav Tulach
71acb83e7f
Removing useless GraphOccurrence.Global & some encapsulation (#11419)
Work on #11365 made me realize that `GraphOccurrence.Global` isn't really used anywhere. Simplifying the code by removing it and associated methods.
2024-10-29 10:23:22 +00:00
Jaroslav Tulach
48984454e3
Testing current behavior of if/then/else (#11395)
Related to #9165 work. Let's make sure the current behavior of `if`/`then`/`else` is properly tested by a unit test. Extracting test created as part of #11365 to verify it really describes the current behavior.
2024-10-24 15:03:41 +00:00
Jaroslav Tulach
fe45da98d7
Use enso.dev.insight property to turn Insight on (#11385) 2024-10-24 13:56:28 +02:00
Kaz Wesley
33904912ee
Move annotations into fields of Function and ConstructorDefinition (#11374)
Move annotations into fields of Function and ConstructorDefinition.

# Important Notes
New syntax: Constructor argument-definition lines
- Each argument in a type-constructor definition may be specified on its own (indented) line.

Relaxed syntax: Unparenthesized arguments to annotations
- A generic annotation now uses the rest of the line as its argument expression; the expression no longer needs to be parenthesized.
2024-10-23 20:35:06 +00:00
Kaz Wesley
4e4a1e1df2
Move TypeSignature into field of Function (#11364)
Move type-signature lines into `Function` field. Also implements #11293.

Stacked on #11346.
2024-10-22 19:50:14 +00:00
Kaz Wesley
d278ad636c
Replace private modifier node with field on supporting types (#11346)
Eliminate `private` modifier-node: `private` is a field in supporting types, or a single-token node in the case of `private` declarations.

# Important Notes
- Rust parser tests: Switch to a builder-style API for defining expected `Function` ASTs to allow further changes to `Function` fields without rewriting all the tests again.
- TreeToIr: Fix discarded module-level `diag`; add a test that covers module diagnostics.
- Syntax: Disallow `private` methods in function blocks. (Previously this was enforced in the compiler.)
2024-10-22 16:26:00 +00:00
Hubert Plociniczak
c6ec5c5399
Handle autoscoped constructor args with no UUID (#11354)
* Handle autoscoped constructor args with no UUID

An application involving >1 autoscoped atom constructor arguments
with no ID would lead to a silent type error in GUI. It was silent
because once IdMap gets updated, the original type error disappears and
users are left with a No_Such_Method on a Panic.

The type error may occur because the compiler was inferring the same
UUID for autoscoped constructors. Args with UUID are cached therefore a
type confict might occur on the second (or later) argument.

Added a unit test case demonstrating the problem (previously it would
fail). The search path is now a bit more careful when inferring
arguments.

* One more test
2024-10-18 20:43:18 +02:00
Kaz Wesley
4d4a2990a0
Distinguish assignment/thunk by statement context (#11324)
Align `Assignment`/`Function` distinction in AST with compiler's implemented semantics:
- The ambiguous case `funcOrVar = expression` is now parsed as a `Function` when in a `Type` definition or in the top level of a module. I.e. it is an `Assignment` in contexts where the RHS is evaluated immediately when the binding is evaluated, and a `Function` in contexts where the RHS is evaluated each time the bound name is evaluated.
- `Assignment` statements now may only occur in function bodies.

Correcting this distinction lays the groundwork for #11302.

Other changes:
- Fixed incorrect source code locations for negative literals and negated expressions.

# Important Notes
New APIs:
- The parser now exposes a `parse_block` entry point, which allows parsing input lines as if in the body of a function. The previous entry point has been renamed to `parse_module`.
2024-10-18 17:54:55 +00:00
Dmitry Bushev
7522acf925
Node added inside collapsed node is never executed (#11341)
close #11251

Changelog:
- add: `CachePreferences` configuration of the expressions that are marked for caching
- update: Invalidate the `self` keywords in the parent frames on function edit
- update: persistance config

# Important Notes
The demo shows that:

1. The new node created in the collapsed function is highlighted (GUI receives the expression update)
2. When the collapsed function is edited, the nodes in the `main` method are updated correctly

https://github.com/user-attachments/assets/41c406ed-ba76-41c8-9e3f-89ac9ff63c3f
2024-10-18 14:19:50 +00:00
Pavel Marek
fb821303ab
Inline doc comment is a compiler error (#11333)
Inline documentation comment is a syntax error

---------

Co-authored-by: Kaz Wesley <kaz@lambdaverse.org>
2024-10-16 06:24:18 -07:00
Pavel Marek
b36fd1c01b
Migrate some passes to Mini passes (#11191)
Gets ready for avoiding IR traversal by introducing _mini passes_ as proposed by #10981:
- creates [MiniPassFactory](762045a357) (that extends common `IRProcessingPass`) to transform an `IR` element to another `IR` element
- modifies `PassManager` to recognize such _mini passes_ and treat them in a special way - by using `MiniIRPass.compile`
- `MiniIRPass.compile` is using `IR.mapExpressions` to traverse the `IR` - alternative approach [withNewChildren](1abc70d33c) rejected for now, see _future work_ for details
- unlike _mega passes_ `IRMiniPass.compile` **does not  recursively** traverse, but with 0964711ba9 it invokes each _mini pass_ at constant stack depth - way better for profiling
- `MiniIRPass.prepare` _works on edges_ since ffd27dfe9b - there is `IRMiniPass prepare(parent, child)` to collect information while pre-order traversing from a particular `IR` parent to a particular `IR` child
- `PassManager` rewritten to group _subsequent mini passes_ together by `MiniIRPass.combine` and really and traverse the `IR` just once - done in 2736a76
- converted to _mini pass_: `LambdaShorthandToLambda`, `OperatorToFunction`, `SectionsToBinOp` and `TailCall`
- tested for 1:1 compatibility by [converting original code to test code](f54ba6d162) and _comparing `IR` produced by old and new_ implementations
2024-10-15 19:26:08 +00:00
Pavel Marek
4a2e522935
Show only fields from current atom constructor in the debugger (#11217)
Debugger shows only fields of the current atom constructor: (internal members shown in gray, "public" members shown in bold purple)
![image](https://github.com/user-attachments/assets/21815296-c8aa-4ea2-ae7b-6feac78a221f)

(Note that `static_method` is not displayed as a member of `My_Type` - not in scope of this PR)

# Important Notes
The *interop* contract for `Atom` is changed as follows:
- Members are all methods and fields of the current constructor.
- All methods are internal members.
- If the constructor is project-private, fields are internal members.
- All the members are both readable, and invocable.
- Fields are field getters, that is, they are just methods.
- Fields are not invocable
- Constructors and static methods are **not** members of an atom. They should be members of the type.
- Note that methods used to be atom members before #9692
2024-10-15 10:04:07 +00:00
Jaroslav Tulach
204b37c6c3
Special handling of last signature in a block (#11289) 2024-10-11 15:38:47 +02:00
Pavel Marek
d9b3c75c5d
Remove TailCall.TailPosition.NotTail metadata. (#11303)
`TailCall.TailPosition.NotTail` metadata is attached to every `IR` element that is not in tail position. Which is true for most IR elements. This is inefficient and unnecessary. This PR removes this metadata and keeps only `TailCall.TailPosition.Tail`. This removes few bytes from `MetadataStorage` from most of IR elements

# Important Notes
To check whether `ir` element is not in tail position, we used to check it with something like this `ir.getMetadata(TailCall) == Some(TailCall.TailPosition.NotTail)`, now, we simply can do it with `ir.getMetadata(TailCall) == None`
2024-10-11 11:17:12 +00:00
Dmitry Bushev
78993a0d1a
Run node in a different execution environment (#11173)
close #10719

Changelog:
- add: optional `expressionConfigs` parameter to the `executionContext/recompute` request
- update: `IdExecutionInstrument` allowing to run a single node in a specified execution environment
- refactor: move tests related to the recompute request to a separate test suite. Otherwise the `RuntimeServerTest` is becoming too bloated

# Important Notes
The updated `executionContext/recompute` request.

```typescript
interface ExecutionContextRecomputeParameters {
/** The execution context identifier. */
contextId: ContextId;

/** The expressions that will be invalidated before the execution.
*
*  Only the provided expression ids are invalidated excluding the dependencies.
*/
invalidatedExpressions?: "all" | ExpressionId[];

/** The execution environment that will be used in the execution. */
executionEnvironment?: ExecutionEnvironment;

/** The execution configurations for particular expressions.
*
*  The provided expressions will be invalidated from the cache with the
*  dependencies. The result of the execution will stay in the cache until the
*  cache is invalidated by editing the node or other means.
*/
expressionConfigs?: ExpressionConfig[];
}

interface ExpressionConfig {
/** The expression identifier. */
expressionId: ExpressionId;
/** The execution environment that should be used to run this expression. */
executionEnvironment?: ExecutionEnvironment;
}
```

#### Use cases

- to re-run a single node without re-running the dependent nodes (subtree), put the node id in the `invalidatedExpressions` parameter.
- to re-run a node with dependent nodes (subtree), put the node id in the `expressionConfigs` parameter with empty `executionEnvironment`
- to re-run a node in a different execution environment, put the node  id in the `expressionConfigs` and specify the `executionEnvieronment`
2024-10-09 12:09:45 +00:00
Dmitry Bushev
80317dc950
Eliminate scala.Some allocations (#11259)
close #10973

Changelog:
- update: `IR` interface add nullable `identifiedLocation()`, and create a `location()` getter
- update: IR nodes contain nullable `identifiedLocation` field
- update: persistence of `IdentifiedLocation` supports nullable values

# Important Notes
80% less allocations of `scala.Some`

#### Before

![2024-10-07-131421_1165x185_scrot](https://github.com/user-attachments/assets/1d84ef19-652c-4bef-8d7f-eed63a7b6b50)

#### After

![2024-10-07-131513_1163x186_scrot](https://github.com/user-attachments/assets/3d71a932-7861-4a97-bc84-eafc530dcce3)
2024-10-09 08:54:37 +00:00
Jaroslav Tulach
c85363f425
Compute the exception message sooner than context is closed (#11241) 2024-10-07 14:26:40 +02:00
Hubert Plociniczak
9429a4540a
Do not run visualizations on InterruptedException (#11250)
* Do not run visualizations on InterruptException

There is no point in running visualization for the expression value that
is InterruptedException. The latter is likely to bubble up the exception
or create one that will be confusing to the user.

Closes #11243 and partially addresses some of the symptomes of #11084.

* Add a test for confusing visualization failures

Previously a visualization failure would be reported:
```
Method `+` of type sleep interrupted could not be found.
```

* PR review

Nit
2024-10-07 12:29:17 +02:00
Jaroslav Tulach
837a4d53b5
Avoid NPE on missing @anno name (#11224) 2024-10-02 11:15:41 +02:00
Hubert Plociniczak
ad53c824ab
Don't send expression updates about interrupts (#11218)
There is no value in sending expression updates involving interrupts to the user:
![Screenshot from 2024-09-30 14-47-17-2](https://github.com/user-attachments/assets/78fca5bf-085d-4c1c-99fb-0acb5f0a31a3)

Adding more logging information to see how aborts affect execution.

Related to #11084.
2024-10-01 19:43:06 +00:00
James Dunkerley
28bbc34257
Widget support for Data.fetch and Data.post. (#11199)
- Add `pretty` for `Date` and `Time`.
- Add constructors for `JS_Object` and `Dictionary` to the component browser.
- Add widgets to `Dictionary` methods.
![image](https://github.com/user-attachments/assets/4f6c58d5-9eb5-40e5-96c1-2e06e23051d0)
- Add conversion from Vector to Dictionary.
- Add `pair` method shorthand for `Pair.Value`.
- Created widget for `Header`.
- Added widgets for `Data.fetch` and `Data.post`.
- Added widgets for `Request_Body` constructors.
- Update the Forbidden Operation message to be friendlier.
![image](https://github.com/user-attachments/assets/eaac5def-a91f-450f-b814-d776311962e3)

Video before fixing Forbidden Message:

https://github.com/user-attachments/assets/f9c4bde4-3f0a-49f1-a3ca-a0aaa3219286
2024-09-27 18:08:12 +00:00
Kaz Wesley
289198127f
Stateless parser API (#11147)
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.
2024-09-27 15:58:02 +00:00
Jaroslav Tulach
2fbd0aa92b
Special treatment of PanicSentinel in CatchPanicNode (#11167)
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.
2024-09-26 05:34:30 +00:00
Pavel Marek
9182f91e35
engine-runner and language-server are separate JPMS modules (#10823)
* 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>
2024-09-25 21:33:13 +02:00
Jaroslav Tulach
f37e50e87b
Propagate comparator warnings via Any.== (#11009)
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.
2024-09-25 09:48:34 +00:00
Jaroslav Tulach
c3456ad2df
Eliminate Blanks inside of Type.Ascription (#11155) 2024-09-24 08:57:27 +02:00
Jaroslav Tulach
37688033c8
Don't convert type to the same type (#11122) 2024-09-18 18:15:58 +02:00
Dmitry Bushev
8e0095e1f8
Stack Overflow Error not shown in GUI (#11064)
close #8648

Changelog:
- update: handle null messages in execution exceptions
2024-09-17 18:43:35 +00:00
Pavel Marek
3dd0fb95ae
Better error message for unresolved symbol (#11008)
* 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
2024-09-17 15:38:31 +02:00
Dmitry Bushev
e77a6067a0
Fix cached method pointers in expression updates (#11060)
close #11028

Changelog:
- update: hide cached method pointer info in expression updates of evaluated values

# Important Notes
https://github.com/user-attachments/assets/861bb2c8-7613-4fcf-a976-0e37acff4ec0
2024-09-13 11:02:30 +00:00
Jaroslav Tulach
8b5c6338f7
Log details when to_display_text invocation fails (#11025)
Closes #10770 by dumping out more information when `to_display_text` invocations fails.
2024-09-11 03:18:06 +00:00
Jaroslav Tulach
93252ee358
Avoid AliasAnalysis for Hello_World.enso (#10996) 2024-09-09 14:21:22 +02:00
Pavel Marek
19ff2a2bb7
Prepare for JPMS - rename packages (#10974)
* 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
2024-09-06 10:27:59 +02:00