Commit Graph

3708 Commits

Author SHA1 Message Date
Michał Wawrzyniec Urbańczyk
8021109d8c
Build script fixes & improvements (#8285) 2023-11-23 21:19:31 +01:00
Hubert Plociniczak
36996c8938
Don't NPE on op ._ when translating tree to IR (#8381)
Encountered a random NPE when playing with bookclubs. Test case demonstrating the problem is attached.

Threw in a bunch of minor tweaks to logs to make life of the person debugging code more pleasant.
2023-11-23 19:56:56 +00:00
Michael Mauderer
76fb9f5c4b
All ways of creating node (+ button, dragging out edges) (#8341)
Closes #8054

[Peek 2023-11-20 13-50.webm](https://github.com/enso-org/enso/assets/1428930/064ad921-25dc-44f4-bed4-10b4f0ec0242)
2023-11-23 17:47:53 +00:00
Dmitry Bushev
f1825f3f32
Gather diagnostics from annotations (#8380)
close #8289

Changelog
- feat: `GatherDiagnostics` compiler pass works with annotations
2023-11-23 17:18:39 +00:00
Adam Obuchowicz
ce584862ff
Fix a set of issues in Component Browser (#8377)
Part of #8372

* Sorting was broken (sort's argument was removed)
* searching by initials now does not skip words
* icons: now we use same logic as existing nodes.
* local entities has worse score if "showLocals" option is toggled off.

# Important Notes
Please be aware that there is still an important issue with groups; sometimes they're not loaded. Reported [here](8376)
2023-11-23 15:53:59 +00:00
Dmitry Bushev
4b3ba78b52
Add shortcuts to start and stop the backend profiling (#8358)
close #8329

Changelog:
- add: `cmd`+`shift`+`,` and `cmd`+`shift`+`.` shortcuts to start and stop the backend profiling. Profiling data is stored on disk.
2023-11-23 15:31:17 +00:00
somebody1234
87dfb57f53
Show diagnostics in Code Editor (#8375)
As suggested by @JaroslavTulach.

- Shows diagnostics sent by `executionContext/executionStatus`
- Shows `Panic`s and `DataflowError`s sent by `executionContext/expressionUpdates`

# Important Notes
None
2023-11-23 14:15:48 +00:00
Pavel Marek
a9099ddce5
Fix Java log initialization in std-table (#8364) 2023-11-23 14:10:22 +01:00
Hubert Plociniczak
af5be19be8
Minor tweaks post jdk21 upgrade (#8373) 2023-11-23 11:58:49 +00:00
Adam Obuchowicz
2ddcaad6fe
Fix startup in the electron package (#8365)
Fixes #8334

There were two issues: one is bad code generated by vite. I needed to rephrase Rect.Zero definition. The second were missing widgets - that was caused by the fact that Vue components have a bit different properties than on test builds, apparently.
2023-11-23 11:03:23 +00:00
Adam Obuchowicz
fbe4221c46
Edges from alias analysis (#8316)
Fixes #8252

As we use proper alias analysis, we no longer display connections to overshadowed identifiers.

![Screenshot from 2023-11-16 15-50-27](https://github.com/enso-org/enso/assets/3919101/691aac6c-1951-4988-a338-4449c0413ef7)

# Important Notes
I've changed the meaning of edge's "source" - now it's expression ID of the constituted identifier, not the node ID. This will allow proper handling nodes like `[x, y] = Main.get_point` once the engine will support them.
2023-11-23 10:54:35 +00:00
James Dunkerley
ed9e71c4eb
Make ICON section work consistently between old and new GUI. (#8369)
- Handle name mismatch in icons between old and new IDE.
- Set the default icon for a few types.
- If can't find and icon use the Enso logo.

![image](https://github.com/enso-org/enso/assets/4699705/43d828b4-58cf-429e-b659-b1c389953b23)
2023-11-23 09:03:34 +00:00
somebody1234
1cf5ea96d6
More consistent reactive indices (#8353)
- Renames all `ReactiveIndex` and `ReactiveDb`s into the format `<key>To<value>`
- `ReactiveMapping`s (in `graphDatabase.ts`) currently have not been renamed - I'm not sure they need to be
- Removes various methods that have been made unnecessary by this change
- Simplifies some other methods
- Changes `SuggestionDb` to extend `ReactiveDb`

# Important Notes
None
2023-11-23 04:48:12 +00:00
Pavel Marek
268e595ec1
Add Chrome devtools and DAP tools for debugging (#8344)
Adds chrome-inspector tool and Debug Adapter protocol tool for debugging Enso.

# Important Notes
The chrome devtools seems to be broken (tracked in https://github.com/oracle/graal/issues/7636). Even `graalpy --inspect ...` fails (Chrome devtools freezes after connecting to the server). This PR adds Debug adapter protocol tool for debugging as a workaround for chrome inspector. There is docs in [dap.md](https://github.com/enso-org/enso/pull/8344/files#diff-421574b50574cfe546e86d4b3d32d79b8b2087f2fe204f68e5cf2693af43bbe1)
2023-11-22 17:18:41 +00:00
James Dunkerley
f60836d9e1
Apply ICONs (#8360)
- Amend a couple of missed groups.
- Add the first pass of some ICONs.

The linter tool has been updated to support rewriting the ICON as well.
2023-11-22 15:24:16 +00:00
Paweł Grabarz
e492d3f260
[GUI2] Render widget arguments (#8339)
Fixes #8256 #8257

Implemented displaying node argument placeholders. Refactored widgets to allow arbitrary input types, and split widget matching into two phases, separating input type validation step and allowing it to influence the derived TypeScript type of widget component props.

Connecting an edge to the placeholder is not implemented yet. Only connections to existing arguments are supported for now.

https://github.com/enso-org/enso/assets/919491/ad3bf254-5f56-4f2f-8c0d-616a7195c6d8


Nested argument lists are also supported:
<img width="396" alt="image" src="https://github.com/enso-org/enso/assets/919491/b61f6870-0f01-48c3-9b45-c7c6bc464638">
2023-11-22 14:43:58 +00:00
James Dunkerley
347b5a7cf5
Linting and Groups update (#8357)
- Fix issues from the linter.
- Rename the constructors for `Blank_Selector`.
- Update various GROUP tags.
2023-11-21 18:12:27 +00:00
Pavel Marek
8eed0f1dd6
Update Dockerfile to GraalVM JDK21 (#8349) 2023-11-21 13:03:25 +01:00
somebody1234
d136c8e40c
Fix dashboard issues (#8347)
- Fixes https://github.com/enso-org/cloud-v2/issues/770
- Fixes https://github.com/enso-org/cloud-v2/issues/772
- Fixes https://github.com/enso-org/cloud-v2/issues/775
- Fixes #8335

# Important Notes
The fix for "Reopening cloud projects" has not been tested, as opening projects on the cloud are currently broken - *however*, the logic change is very small - the only thing it does is make the reopening conditional. This means that, at the very least, it should not be a regression.
2023-11-21 10:37:45 +00:00
somebody1234
feb59be0a1
Fix styles for confirm delete modal (#8312)
The background for the "confirm delete" modal was offset - the fix is to add `inset-0`.

# Important Notes
None
2023-11-21 06:51:15 +00:00
somebody1234
5e1a3124dc
Download and upgrade buttons (#8265)
- Adds a download button in the user menu

# Important Notes
- The "upgrade to" button will be absent when the user already has a plan, as the only place where an "upgrade to" button shows up is the cloud view, when the user's account has not yet been enabled.
- The upgrade button currently links to https://enso.org/pricing - which does not yet exist. This is intentional, as another PR would be required to switch the URL, if we were to initially point to the one at https://enso-org.github.io.
- The pricing page would still not work, as that requires payment functionality, which is not yet complete
2023-11-21 06:34:46 +00:00
James Dunkerley
ecaca12df1
Integrating Enso Cloud with the libraries (part 1...) (#8006)
- Add a `File_For_Read` type. Used for `File_Format` to read files.
- Added `Enso_User` representing the current user in `Enso_Cloud`.
- *Will be later able to list known users.*
- Added `Enso_Secret` representing a value defined in `Enso_Cloud`.
- Value not used within Enso only accessed within polyglot Java.
- Integrated into `Username_And_Password` and can be used within JDBC connections.
- Integrated into HTTP Headers so a secret can be used as a value.
- New `URI_With_Query` with the same API as `URI`. Supporting secrets in the value.
- *Will be integrated with AWS credentials.*
- Added `Enso_File` representing a file or a folder in the cloud.
- Support the same API as `File` (like the `S3_File`).
- *Will support `enso://` URI style access.*
2023-11-20 23:21:14 +00:00
Jaroslav Tulach
1138dfe147
Specify expression to get more advanced results on_return callback (#8331) 2023-11-20 18:47:11 +01:00
Dmitry Bushev
53d1f727da
Always create events log when profiling (#8337)
Changelog:
- update: always create an event log next to the profiling file when the engine is started with the `--profiling-path` flag
- remove: `--profiling-events-log-path` flag
2023-11-20 16:01:25 +00:00
Jaroslav Tulach
705d6f192c
Syntax error on unexpected unary minus (#8333) 2023-11-20 16:14:19 +01:00
somebody1234
375e610660
Layout nodes without position (#8326)
- Closes #8071

# Important Notes
There is currently no way to predict the width a node, taking into account the width of widgets.
This should probably be done in another task.
2023-11-20 14:17:34 +00:00
somebody1234
062992bb8b
Fixes for GUI2 (#8310)
Addresses several issues found during book club.
- Add placeholder icons for visualizations (see screenshot)
- Also add the corresponding export to visualizations, and relevant support in the visualization store and visualization metadata DB.
- Show icon both on the visualization selector button, and in each visualization selector entry
- Adjust gaps between visualization selector entries
- Port table viz fixes (#8102) to Vue
- Fix height of table rows to avoid cutting off descenders on letters like `y` and `g`
- Make the space and enter keys work on visualization toolbar buttons, if they are selected
- `.blur()` code editor when clicking outside of it
- And similarly `.blur()` visualization selector
- Move selection brush on scroll by scaling the delta of `scrollTop` and `scrollLeft`
- Note that mouse position is technically still incorrect when scrolling past the end. I think this is fine - the new behavior is less broken, plus I am not aware of any way to fix this.

# Important Notes
None
2023-11-20 13:23:50 +00:00
Pavel Marek
1c936cc69f
Make sure that runtime/benchmarks are dry-run in CI tests (#8330)
Ensure that `-Dbench.compileOnly` system property is correctly forwarded to the benchmarks' runner. So that in the CI Engine tests, benchmarks are *dry run*.

# Important Notes
- Fixes dry run benchmarks in Engine Test Action
- Fixes Engine Benchmark Action
2023-11-20 12:35:43 +00:00
Dmitry Bushev
b224f95639
On-deman backend heap and thread dump (#8320)
close #8249

Changelog:
- add: `profiling/snapshot` request that takes a heap dump of the language server and puts it in the `ENSO_DATA_DIRECTORY/profiling` direcotry
2023-11-20 11:41:01 +00:00
Hubert Plociniczak
b8ebed69c3
Report failures when upserting visualizations (#8306)
Attaching or modifying a visualizations returns early on, to avoid a situation when a background job is stalled (by other jobs) and eventually the request timeouts.

This has an unfortunate consequence that any error reported in the `UpsertVisualizationJob` cannot be reported as a directly reply to a request because the sender has already been removed from the list.

Added more logs to discover why we get errors in the first place.

Modified the API a bit so that we carry `VisualizationContext` instead of three parameters all over the place.

Bonus:
Modified `JsonRpcServerTestKit` to implicitly require a position so that we get better error reporting on failures.
2023-11-20 11:38:51 +00:00
somebody1234
9edc94afa0
Unify GUI2 headers (#8327)
- Closes #8304

# Important Notes
- A better long-term solution may be to remove COOP/COEP/CORP headers instead, but that is out of scope of this PR.
- Feel free to create a new issue, or discuss elsewhere, if this is something we want to do eventually
2023-11-20 11:32:40 +00:00
somebody1234
078260d8e7
Fix Geo Map visualization (#8311)
- Fixes #8300
- Fixes Geo Map visualization being completely broken
- Fixes Mapbox attribution icon in bottom right being invisible
- Fixes Mapbox attribution button being unclickable

# Important Notes
None
2023-11-20 11:25:23 +00:00
Hubert Plociniczak
b4405f6b06
Fix annotation processing warnings (#8319) 2023-11-20 08:43:32 +00:00
Jaroslav Tulach
ba19813511
Speeding up "hello world" example by 16% 2023-11-19 16:38:31 +01:00
Pavel Marek
5a7ad6bfe4
Upgrade enso to GraalVM for jdk 21 (#7991)
Upgrade to GraalVM JDK 21.
```
> java -version
openjdk version "21" 2023-09-19
OpenJDK Runtime Environment GraalVM CE 21+35.1 (build 21+35-jvmci-23.1-b15)
OpenJDK 64-Bit Server VM GraalVM CE 21+35.1 (build 21+35-jvmci-23.1-b15, mixed mode, sharing)
```

With SDKMan, download with `sdk install java 21-graalce`.

# Important Notes
- After this PR, one can theoretically run enso with any JRE with version at least 21.
- Removed `sbt bootstrap` hack and all the other build time related hacks related to the handling of GraalVM distribution.
- `project-manager` remains backward compatible - it can open older engines with runtimes. New engines now do no longer require a separate runtime to be downloaded.
- sbt does not support compilation of `module-info.java` files in mixed projects - https://github.com/sbt/sbt/issues/3368
- Which means that we can have `module-info.java` files only for Java-only projects.
- Anyway, we need just a single `module-info.class` in the resulting `runtime.jar` fat jar.
- `runtime.jar` is assembled in `runtime-with-instruments` with a custom merge strategy (`sbt-assembly` plugin). Caching is disabled for custom merge strategies, which means that re-assembly of `runtime.jar` will be more frequent.
- Engine distribution contains multiple JAR archives (modules) in `component` directory, along with `runner/runner.jar` that is hidden inside a nested directory.
- The new entry point to the engine runner is [EngineRunnerBootLoader](https://github.com/enso-org/enso/pull/7991/files#diff-9ab172d0566c18456472aeb95c4345f47e2db3965e77e29c11694d3a9333a2aa) that contains a custom ClassLoader - to make sure that everything that does not have to be loaded from a module is loaded from `runner.jar`, which is not a module.
- The new command line for launching the engine runner is in [distribution/bin/enso](https://github.com/enso-org/enso/pull/7991/files#diff-0b66983403b2c329febc7381cd23d45871d4d555ce98dd040d4d1e879c8f3725)
- [Newest version of Frgaal](https://repo1.maven.org/maven2/org/frgaal/compiler/20.0.1/) (20.0.1) does not recognize `--source 21` option, only `--source 20`.
2023-11-17 18:02:36 +00:00
Michael Mauderer
85e2c72204
Fix component browser interactions. (#8303)
Fixes: #8064

Fixes broken interactions with of the component browser.
2023-11-17 15:28:45 +00:00
Dmitry Bushev
a286ab7daa
Backend self sampling (#8309)
close #8248

Changelog:
- add: `profiling/start` request starts the sampler and starts collecting runtime events to the log file
- add: `profiling/stop` request stop the sampler and write the profiling data to the `$ENSO_DATA_DIR/profiling` directory
- refactor: rewrite the profiling logic into Java
2023-11-17 15:04:10 +00:00
Hubert Plociniczak
348f5170ab
Avoid NPE during instrumentation (#8317)
Fixes a random crash (*) during instrumentation. Notice how `onTailCallReturn` calls `onReturnValue` with `null` frame.

Bonus: noticed that for some reason we weren't getting logs for `ExecutionService`. This turned out to be the problem with the logger name which by default was `[enso]` not
`[enso.org.enso.interpreter.service.ExecutionService`] and there is some logic there that normalizes the name and assumed a dot after `enso`. This change fixes the logic.

(*)
```
[enso.org.enso.interpreter.service.ExecutionService] Execution of function main failed (Cannot invoke "com.oracle.truffle.api.frame.VirtualFrame.materialize()" because "frame" is null).
java.lang.NullPointerException: Cannot invoke "com.oracle.truffle.api.frame.VirtualFrame.materialize()" because "frame" is null
at org.enso.interpreter.instrument.IdExecutionInstrument$IdEventNodeFactory$IdExecutionEventNode.onReturnValue(IdExecutionInstrument.java:246)
at org.enso.interpreter.instrument.IdExecutionInstrument$IdEventNodeFactory$IdExecutionEventNode.onTailCallReturn(IdExecutionInstrument.java:274)
at org.enso.interpreter.instrument.IdExecutionInstrument$IdEventNodeFactory$IdExecutionEventNode.onReturnExceptional(IdExecutionInstrument.java:258)
at org.graalvm.truffle/com.oracle.truffle.api.instrumentation.ProbeNode$EventProviderChainNode.innerOnReturnExceptional(ProbeNode.java:1395)
at org.graalvm.truffle/com.oracle.truffle.api.instrumentation.ProbeNode$EventChainNode.onReturnExceptional(ProbeNode.java:1031)
at org.graalvm.truffle/com.oracle.truffle.api.instrumentation.ProbeNode.onReturnExceptionalOrUnwind(ProbeNode.java:296)
at org.enso.interpreter.node.ExpressionNodeWrapper.executeGeneric(ExpressionNodeWrapper.java:119)
at org.enso.interpreter.node.ClosureRootNode.execute(ClosureRootNode.java:85)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.executeRootNode(OptimizedCallTarget.java:718)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.profiledPERoot(OptimizedCallTarget.java:641)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callBoundary(OptimizedCallTarget.java:574)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.doInvoke(OptimizedCallTarget.java:558)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedCallTarget.callDirect(OptimizedCallTarget.java:504)
at jdk.internal.vm.compiler/org.graalvm.compiler.truffle.runtime.OptimizedDirectCallNode.call(OptimizedDirectCallNode.java:69)
at org.enso.interpreter.node.callable.thunk.ThunkExecutorNode.doCached(ThunkExecutorNode.java:69)
at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeAndSpecialize(ThunkExecutorNodeGen.java:207)
at org.enso.interpreter.node.callable.thunk.ThunkExecutorNodeGen.executeThunk(ThunkExecutorNodeGen.java:167)
...
```

# Important Notes
Fixes regressions introduced in #8148 and #8162
2023-11-17 14:38:27 +00:00
Michael Mauderer
aef3a4ffc0
enso-8194 Copy and pasting a single node (#8298)
Implements  #8194

[Peek 2023-11-13 14-15.webm](https://github.com/enso-org/enso/assets/1428930/22882487-7288-4eb7-af08-6539060b4967)
2023-11-17 03:57:30 +00:00
Michał Wawrzyniec Urbańczyk
4b181c38d0
Bump electron-builder on CI macOS runners. (#8284)
This PR avoids #8119 by selectively bumping the `electron-builder` on macOS CI runners. We do this only on macOS, as we do not want to trigger https://github.com/electron-userland/electron-builder/issues/6865 on Windows.
2023-11-16 19:07:29 +00:00
Paweł Grabarz
febce5dad7
[GUI2] Selection and rendering of basic node widgets (#8253) 2023-11-15 16:26:18 +00:00
Jaroslav Tulach
f86e1b3aa5
Using compiler that supports JDK 21 features (#8286) 2023-11-15 17:19:47 +01:00
Adam Obuchowicz
dc4de729b6
Fix CORS problems on built package (#8301)
Fixes #8297

Some external resources were failing due to CORS policies. This is the simplest fix.
2023-11-14 17:31:11 +00:00
Michael Mauderer
198fdece0b
Opening searcher with source node (#8279)
Implements #8065.
2023-11-14 14:42:33 +00:00
somebody1234
85a1bda213
Fix build-dashboard (#8292) 2023-11-14 15:34:33 +01:00
somebody1234
3046e152dc
Add Google Analytics (#8278)
- Add Google Analytics
- Add cross-domain linking between website homepage and cloud dashboard
- Highlight buttons on authentication flows on hover
- Save logged in state as `logged_in` cookie
- Remove saved access token from disk when signing out
- Support `redirect_to` parameter on `/register` page

# Important Notes
None
2023-11-14 12:28:10 +00:00
Hubert Plociniczak
c649ed87af
Let logging to file respect log level (#8264)
This change fixes a regression introduced in #7918, which prevented the execution from setting the right log level either via env var or parameter.

Now passing either of the options returns logs of the expected level in the log file:
- `ENSO_LOG_TO_FILE_LOG_LEVEL = trace`
- ... `-vv` ...

Fixes #8274
2023-11-14 11:59:27 +00:00
Adam Obuchowicz
5baec46466
Fix node placement (#8277)
Fixes: #8230

Fixes some rare cases caught by property tests, involving nodes with 0 width. `MultiRange` does not handle those. The thing is fixed by not using MultiRange, but by sorting nodes by the axis along which we're searching for free place.

All three reported seeds seem to be fixed.

# Important Notes
`MultiRange` is not used now, but I decided to spare it, violating YAGNI rule, as it is tested, and I feel it's a structure which may be useful.
2023-11-14 08:53:07 +00:00
Dmitry Bushev
565a858c5f
Inline Execution (#8148)
close #8132

Update the `executionContext/executeExpression` request to execute expressions in the local scope.
2023-11-13 16:05:05 +00:00
Ilya Bogdanov
876cbd7b5d
Displaying progress for file uploads (#8227)
Closes #8182

Also, improved handling of multiple files – they are placed with a small vertical gap now.

The design for uploading files is non-existent, so I implemented something simple and good-looking. We can easily adjust it at any time.

You can’t move or otherwise interact with nodes while they are uploading.

https://github.com/enso-org/enso/assets/6566674/c0709d8f-3b95-4913-a6eb-caae225b6598
2023-11-13 13:50:57 +00:00