diff --git a/CHANGELOG.md b/CHANGELOG.md index 916f0f9c5264..09e9411f381d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -616,6 +616,7 @@ - [Added `Table.to_xml`.][8979] - [Implemented Write support for `S3_File`.][8921] - [Separate `Group_By` from `columns` into new argument on `aggregate`.][9027] +- [Allow `copy_to` and `move_to` to work between local and S3 files.][9054] [debug-shortcuts]: https://github.com/enso-org/enso/blob/develop/app/gui/docs/product/shortcuts.md#debug @@ -888,6 +889,7 @@ [8979]: https://github.com/enso-org/enso/pull/8979 [8921]: https://github.com/enso-org/enso/pull/8921 [9027]: https://github.com/enso-org/enso/pull/9027 +[9054]: https://github.com/enso-org/enso/pull/9054 #### Enso Compiler diff --git a/app/gui2/src/components/GraphEditor.vue b/app/gui2/src/components/GraphEditor.vue index 571810a44d1c..ff6e799e1cc7 100644 --- a/app/gui2/src/components/GraphEditor.vue +++ b/app/gui2/src/components/GraphEditor.vue @@ -90,12 +90,12 @@ projectStore.lsRpcConnection.then( }) }, (err) => { - toast.error(`Connection to language server failed: ${err}`) + toast.error(`Connection to language server failed: ${JSON.stringify(err)}`) }, ) projectStore.executionContext.on('executionFailed', (err) => { - toast.error(`Execution Failed: ${err}`, {}) + toast.error(`Execution Failed: ${JSON.stringify(err)}`, {}) }) onMounted(() => { diff --git a/app/gui2/src/stores/graph/index.ts b/app/gui2/src/stores/graph/index.ts index d84a8b5a0200..3da4ebf2496c 100644 --- a/app/gui2/src/stores/graph/index.ts +++ b/app/gui2/src/stores/graph/index.ts @@ -210,15 +210,12 @@ export const useGraphStore = defineStore('graph', () => { metadata: NodeMetadataFields = {}, withImports: RequiredImport[] | undefined = undefined, ): Opt { - const mod = proj.module - if (!mod) return - const ident = generateUniqueIdent() - const currentFunc = 'main' - const method = Ast.findModuleMethod(topLevel.value!, currentFunc) + const method = syncModule.value ? methodAstInModule(syncModule.value) : undefined if (!method) { console.error(`BUG: Cannot add node: No current function.`) return } + const ident = generateUniqueIdent() metadata.position = { x: position.x, y: position.y } return edit((edit) => { if (withImports) addMissingImports(edit, withImports) diff --git a/app/ide-desktop/lib/dashboard/e2e/actions.ts b/app/ide-desktop/lib/dashboard/e2e/actions.ts index 8b0fdca61e0f..0893baf11c78 100644 --- a/app/ide-desktop/lib/dashboard/e2e/actions.ts +++ b/app/ide-desktop/lib/dashboard/e2e/actions.ts @@ -589,6 +589,17 @@ export function getAssetRowLeftPx(locator: test.Locator) { return locator.evaluate(el => el.children[0]?.children[0]?.getBoundingClientRect().left ?? 0) } +// =================================== +// === expect functions for themes === +// =================================== + +/** A test assertion to confirm that the element has the class `selected`. */ +export async function expectClassSelected(locator: test.Locator) { + await test.test.step('Expect `selected`', async () => { + await test.expect(locator).toHaveClass(/(?:^| )selected(?: |$)/) + }) +} + // ============================ // === expectPlaceholderRow === // ============================ diff --git a/app/ide-desktop/lib/dashboard/e2e/copy.spec.ts b/app/ide-desktop/lib/dashboard/e2e/copy.spec.ts index fd75b27d7047..bc1e1c89164a 100644 --- a/app/ide-desktop/lib/dashboard/e2e/copy.spec.ts +++ b/app/ide-desktop/lib/dashboard/e2e/copy.spec.ts @@ -137,9 +137,14 @@ test.test('cut (keyboard)', async ({ page }) => { await actions.locateNewFolderIcon(page).click() await assetRows.nth(0).click() await actions.press(page, 'Mod+X') - test - .expect(await assetRows.nth(0).evaluate(el => Number(getComputedStyle(el).opacity))) - .toBeLessThan(1) + // This action is not a builtin `expect` action, so it needs to be manually retried. + await test + .expect(async () => { + test + .expect(await assetRows.nth(0).evaluate(el => Number(getComputedStyle(el).opacity))) + .toBeLessThan(1) + }) + .toPass() }) test.test('duplicate', async ({ page }) => { diff --git a/app/ide-desktop/lib/dashboard/playwright.config.ts b/app/ide-desktop/lib/dashboard/playwright.config.ts index be1ff8f514f0..1f178585b799 100644 --- a/app/ide-desktop/lib/dashboard/playwright.config.ts +++ b/app/ide-desktop/lib/dashboard/playwright.config.ts @@ -18,6 +18,7 @@ export default test.defineConfig({ toHaveScreenshot: { threshold: 0 }, timeout: 30_000, }, + timeout: 30_000, use: { baseURL: 'http://localhost:8080', launchOptions: { diff --git a/app/ide-desktop/lib/dashboard/src/components/DragModal.tsx b/app/ide-desktop/lib/dashboard/src/components/DragModal.tsx index c6bacb843575..1aebc87e97b3 100644 --- a/app/ide-desktop/lib/dashboard/src/components/DragModal.tsx +++ b/app/ide-desktop/lib/dashboard/src/components/DragModal.tsx @@ -56,14 +56,14 @@ export default function DragModal(props: DragModalProps) { unsetModal() } // Update position (non-FF) - document.addEventListener('drag', onDrag) + document.addEventListener('drag', onDrag, { capture: true }) // Update position (FF) - document.addEventListener('dragover', onDrag) - document.addEventListener('dragend', onDragEnd) + document.addEventListener('dragover', onDrag, { capture: true }) + document.addEventListener('dragend', onDragEnd, { capture: true }) return () => { - document.removeEventListener('drag', onDrag) - document.removeEventListener('dragover', onDrag) - document.removeEventListener('dragend', onDragEnd) + document.removeEventListener('drag', onDrag, { capture: true }) + document.removeEventListener('dragover', onDrag, { capture: true }) + document.removeEventListener('dragend', onDragEnd, { capture: true }) } // `doCleanup` is a callback, not a dependency. // eslint-disable-next-line react-hooks/exhaustive-deps diff --git a/app/ide-desktop/lib/dashboard/src/components/dashboard/DirectoryNameColumn.tsx b/app/ide-desktop/lib/dashboard/src/components/dashboard/DirectoryNameColumn.tsx index 1eff5412f2e5..d02bf7f3b758 100644 --- a/app/ide-desktop/lib/dashboard/src/components/dashboard/DirectoryNameColumn.tsx +++ b/app/ide-desktop/lib/dashboard/src/components/dashboard/DirectoryNameColumn.tsx @@ -39,7 +39,7 @@ export interface DirectoryNameColumnProps extends column.AssetColumnProps {} * This should never happen. */ export default function DirectoryNameColumn(props: DirectoryNameColumnProps) { const { item, setItem, selected, state, rowState, setRowState } = props - const { numberOfSelectedItems, assetEvents, dispatchAssetListEvent, nodeMap } = state + const { selectedKeys, assetEvents, dispatchAssetListEvent, nodeMap } = state const { doToggleDirectoryExpansion } = state const toastAndLog = toastAndLogHooks.useToastAndLog() const { backend } = backendProvider.useBackend() @@ -137,7 +137,7 @@ export default function DirectoryNameColumn(props: DirectoryNameColumnProps) { onClick={event => { if ( eventModule.isSingleClick(event) && - ((selected && numberOfSelectedItems === 1) || + ((selected && selectedKeys.current.size === 1) || shortcutManager.matchesMouseAction(shortcutManagerModule.MouseAction.editName, event)) ) { event.stopPropagation() diff --git a/app/ide-desktop/lib/dashboard/src/components/dashboard/ProjectNameColumn.tsx b/app/ide-desktop/lib/dashboard/src/components/dashboard/ProjectNameColumn.tsx index 91fca2699819..76b4f9554bb4 100644 --- a/app/ide-desktop/lib/dashboard/src/components/dashboard/ProjectNameColumn.tsx +++ b/app/ide-desktop/lib/dashboard/src/components/dashboard/ProjectNameColumn.tsx @@ -42,7 +42,7 @@ export interface ProjectNameColumnProps extends column.AssetColumnProps {} * This should never happen. */ export default function ProjectNameColumn(props: ProjectNameColumnProps) { const { item, setItem, selected, rowState, setRowState, state } = props - const { numberOfSelectedItems, assetEvents, dispatchAssetEvent, dispatchAssetListEvent } = state + const { selectedKeys, assetEvents, dispatchAssetEvent, dispatchAssetListEvent } = state const { nodeMap, doOpenManually, doOpenIde, doCloseIde } = state const toastAndLog = toastAndLogHooks.useToastAndLog() const { backend } = backendProvider.useBackend() @@ -277,7 +277,7 @@ export default function ProjectNameColumn(props: ProjectNameColumnProps) { } else if ( !isRunning && eventModule.isSingleClick(event) && - ((selected && numberOfSelectedItems === 1) || + ((selected && selectedKeys.current.size === 1) || shortcutManager.matchesMouseAction(shortcutManagerModule.MouseAction.editName, event)) ) { setRowState(object.merger({ isEditingName: true })) diff --git a/app/ide-desktop/lib/dashboard/src/events/assetEvent.ts b/app/ide-desktop/lib/dashboard/src/events/assetEvent.ts index cf4be27eb43f..b9d8a706692f 100644 --- a/app/ide-desktop/lib/dashboard/src/events/assetEvent.ts +++ b/app/ide-desktop/lib/dashboard/src/events/assetEvent.ts @@ -73,12 +73,12 @@ export interface AssetNewFolderEvent extends AssetBaseEvent { - readonly files: Map + readonly files: ReadonlyMap } /** A signal to update files with new versions. */ export interface AssetUpdateFilesEvent extends AssetBaseEvent { - readonly files: Map + readonly files: ReadonlyMap } /** A signal to create a Data Link. */ @@ -112,41 +112,41 @@ export interface AssetCancelOpeningAllProjectsEvent /** A signal that multiple assets should be copied. `ids` are the `Id`s of the newly created * placeholder items. */ export interface AssetCopyEvent extends AssetBaseEvent { - readonly ids: Set + readonly ids: ReadonlySet readonly newParentKey: backendModule.AssetId readonly newParentId: backendModule.DirectoryId } /** A signal to cut multiple assets. */ export interface AssetCutEvent extends AssetBaseEvent { - readonly ids: Set + readonly ids: ReadonlySet } /** A signal that a cut operation has been cancelled. */ export interface AssetCancelCutEvent extends AssetBaseEvent { - readonly ids: Set + readonly ids: ReadonlySet } /** A signal to move multiple assets. */ export interface AssetMoveEvent extends AssetBaseEvent { - readonly ids: Set + readonly ids: ReadonlySet readonly newParentKey: backendModule.AssetId readonly newParentId: backendModule.DirectoryId } /** A signal to delete assets. */ export interface AssetDeleteEvent extends AssetBaseEvent { - readonly ids: Set + readonly ids: ReadonlySet } /** A signal to restore assets from trash. */ export interface AssetRestoreEvent extends AssetBaseEvent { - readonly ids: Set + readonly ids: ReadonlySet } /** A signal to download assets. */ export interface AssetDownloadEvent extends AssetBaseEvent { - readonly ids: Set + readonly ids: ReadonlySet } /** A signal to download the currently selected assets. */ @@ -161,26 +161,26 @@ export interface AssetRemoveSelfEvent extends AssetBaseEvent { - readonly ids: Set + readonly ids: ReadonlySet readonly labelNames: ReadonlySet } /** A signal to temporarily remove labels from the selected assetss. */ export interface AssetTemporarilyRemoveLabelsEvent extends AssetBaseEvent { - readonly ids: Set + readonly ids: ReadonlySet readonly labelNames: ReadonlySet } /** A signal to add labels to the selected assetss. */ export interface AssetAddLabelsEvent extends AssetBaseEvent { - readonly ids: Set + readonly ids: ReadonlySet readonly labelNames: ReadonlySet } /** A signal to remove labels from the selected assetss. */ export interface AssetRemoveLabelsEvent extends AssetBaseEvent { - readonly ids: Set + readonly ids: ReadonlySet readonly labelNames: ReadonlySet } diff --git a/app/ide-desktop/lib/dashboard/src/layouts/dashboard/AssetsTable.tsx b/app/ide-desktop/lib/dashboard/src/layouts/dashboard/AssetsTable.tsx index 9e8869b9714d..f7eda5c97675 100644 --- a/app/ide-desktop/lib/dashboard/src/layouts/dashboard/AssetsTable.tsx +++ b/app/ide-desktop/lib/dashboard/src/layouts/dashboard/AssetsTable.tsx @@ -250,7 +250,7 @@ const CATEGORY_TO_FILTER_BY: Readonly> readonly visibilities: ReadonlyMap readonly category: Category readonly labels: Map @@ -352,9 +352,12 @@ export default function AssetsTable(props: AssetsTableProps) { const [extraColumns, setExtraColumns] = React.useState(() => new Set()) const [sortColumn, setSortColumn] = React.useState(null) const [sortDirection, setSortDirection] = React.useState(null) - const [selectedKeys, setSelectedKeys] = React.useState(() => new Set()) + const [selectedKeys, setSelectedKeysRaw] = React.useState>( + () => new Set() + ) + const selectedKeysRef = React.useRef(selectedKeys) const [pasteData, setPasteData] = React.useState + ReadonlySet > | null>(null) const [, setQueuedAssetEvents] = React.useState([]) const [, setNameOfProjectToImmediatelyOpen] = React.useState(initialProjectName) @@ -381,9 +384,9 @@ export default function AssetsTable(props: AssetsTableProps) { const scrollContainerRef = React.useRef(null) const headerRowRef = React.useRef(null) const assetTreeRef = React.useRef(assetTree) - const pasteDataRef = React.useRef> | null>( - null - ) + const pasteDataRef = React.useRef + > | null>(null) const nodeMapRef = React.useRef>( new Map() ) @@ -575,17 +578,17 @@ export default function AssetsTable(props: AssetsTableProps) { if (category === Category.trash) { setCanDownloadFiles(false) } else if (!isCloud) { - setCanDownloadFiles(selectedKeys.size !== 0) + setCanDownloadFiles(selectedKeysRef.current.size !== 0) } else { setCanDownloadFiles( - selectedKeys.size !== 0 && - Array.from(selectedKeys).every(key => { + selectedKeysRef.current.size !== 0 && + Array.from(selectedKeysRef.current).every(key => { const node = nodeMapRef.current.get(key) return node?.item.type === backendModule.AssetType.file }) ) } - }, [category, selectedKeys, isCloud, /* should never change */ setCanDownloadFiles]) + }, [category, isCloud, /* should never change */ setCanDownloadFiles]) React.useEffect(() => { const nodeToSuggestion = ( @@ -792,10 +795,7 @@ export default function AssetsTable(props: AssetsTableProps) { if (pasteDataRef.current == null) { return false } else { - dispatchAssetEvent({ - type: AssetEventType.cancelCut, - ids: pasteDataRef.current.data, - }) + dispatchAssetEvent({ type: AssetEventType.cancelCut, ids: pasteDataRef.current.data }) setPasteData(null) return } @@ -833,6 +833,18 @@ export default function AssetsTable(props: AssetsTableProps) { // eslint-disable-next-line react-hooks/exhaustive-deps }, [initialProjectName]) + const setSelectedKeys = React.useCallback( + (newSelectedKeys: ReadonlySet) => { + selectedKeysRef.current = newSelectedKeys + setSelectedKeysRaw(newSelectedKeys) + }, + [] + ) + + const clearSelectedKeys = React.useCallback(() => { + setSelectedKeys(new Set()) + }, [/* should never change */ setSelectedKeys]) + const overwriteNodes = React.useCallback( (newAssets: backendModule.AnyAsset[]) => { // This is required, otherwise we are using an outdated @@ -1057,10 +1069,10 @@ export default function AssetsTable(props: AssetsTableProps) { }, [extraColumns, initialized, /* should never change */ localStorage]) React.useEffect(() => { - if (selectedKeys.size !== 1) { + if (selectedKeysRef.current.size !== 1) { setAssetPanelProps(null) } - }, [selectedKeys.size, /* should never change */ setAssetPanelProps]) + }, [selectedKeysRef.current.size, /* should never change */ setAssetPanelProps]) const directoryListAbortControllersRef = React.useRef( new Map() @@ -1474,12 +1486,10 @@ export default function AssetsTable(props: AssetsTableProps) { break } case AssetListEventType.willDelete: { - if (selectedKeys.has(event.key)) { - setSelectedKeys(oldSelectedKeys => { - const newSelectedKeys = new Set(oldSelectedKeys) - newSelectedKeys.delete(event.key) - return newSelectedKeys - }) + if (selectedKeysRef.current.has(event.key)) { + const newSelectedKeys = new Set(selectedKeysRef.current) + newSelectedKeys.delete(event.key) + setSelectedKeys(newSelectedKeys) } break } @@ -1548,34 +1558,20 @@ export default function AssetsTable(props: AssetsTableProps) { const doCopy = React.useCallback(() => { unsetModal() - setSelectedKeys(oldSelectedKeys => { - queueMicrotask(() => { - setPasteData({ type: PasteType.copy, data: oldSelectedKeys }) - }) - return oldSelectedKeys - }) + setPasteData({ type: PasteType.copy, data: selectedKeysRef.current }) }, [/* should never change */ unsetModal]) const doCut = React.useCallback(() => { unsetModal() - setSelectedKeys(oldSelectedKeys => { - queueMicrotask(() => { - if (pasteData != null) { - dispatchAssetEvent({ - type: AssetEventType.cancelCut, - ids: pasteData.data, - }) - } - setPasteData({ type: PasteType.move, data: oldSelectedKeys }) - dispatchAssetEvent({ - type: AssetEventType.cut, - ids: oldSelectedKeys, - }) - }) - return new Set() - }) + if (pasteData != null) { + dispatchAssetEvent({ type: AssetEventType.cancelCut, ids: pasteData.data }) + } + setPasteData({ type: PasteType.move, data: selectedKeysRef.current }) + dispatchAssetEvent({ type: AssetEventType.cut, ids: selectedKeysRef.current }) + setSelectedKeys(new Set()) }, [ pasteData, + /* should never change */ setSelectedKeys, /* should never change */ unsetModal, /* should never change */ dispatchAssetEvent, ]) @@ -1626,9 +1622,9 @@ export default function AssetsTable(props: AssetsTableProps) { category={category} pasteData={pasteData} selectedKeys={selectedKeys} + clearSelectedKeys={clearSelectedKeys} nodeMapRef={nodeMapRef} event={{ pageX: 0, pageY: 0 }} - setSelectedKeys={setSelectedKeys} dispatchAssetEvent={dispatchAssetEvent} dispatchAssetListEvent={dispatchAssetListEvent} doCopy={doCopy} @@ -1638,11 +1634,12 @@ export default function AssetsTable(props: AssetsTableProps) { ), [ category, - pasteData, selectedKeys, + pasteData, doCopy, doCut, doPaste, + /* should never change */ clearSelectedKeys, /* should never change */ dispatchAssetEvent, /* should never change */ dispatchAssetListEvent, ] @@ -1660,7 +1657,7 @@ export default function AssetsTable(props: AssetsTableProps) { // The type MUST be here to trigger excess property errors at typecheck time. (): AssetsTableState => ({ visibilities, - numberOfSelectedItems: selectedKeys.size, + selectedKeys: selectedKeysRef, category, labels: allLabels, deletedLabelNames, @@ -1688,7 +1685,6 @@ export default function AssetsTable(props: AssetsTableProps) { }), [ visibilities, - selectedKeys.size, category, allLabels, deletedLabelNames, @@ -1755,7 +1751,7 @@ export default function AssetsTable(props: AssetsTableProps) { shortcutManagerModule.MouseAction.selectAdditionalRange, event ) && - selectedKeys.size !== 0 + selectedKeysRef.current.size !== 0 ) { setSelectedKeys(new Set()) } @@ -1764,7 +1760,7 @@ export default function AssetsTable(props: AssetsTableProps) { return () => { document.removeEventListener('click', onDocumentClick) } - }, [selectedKeys, /* should never change */ setSelectedKeys, shortcutManager]) + }, [shortcutManager, /* should never change */ setSelectedKeys]) React.useEffect(() => { if (isLoading) { @@ -1809,24 +1805,20 @@ export default function AssetsTable(props: AssetsTableProps) { event ) ) { - setSelectedKeys( - oldSelectedItems => new Set([...oldSelectedItems, ...getNewlySelectedKeys()]) - ) + setSelectedKeys(new Set([...selectedKeysRef.current, ...getNewlySelectedKeys()])) } else if ( shortcutManager.matchesMouseAction( shortcutManagerModule.MouseAction.selectAdditional, event ) ) { - setSelectedKeys(oldSelectedItems => { - const newItems = new Set(oldSelectedItems) - if (oldSelectedItems.has(key)) { - newItems.delete(key) - } else { - newItems.add(key) - } - return newItems - }) + const newSelectedKeys = new Set(selectedKeysRef.current) + if (selectedKeysRef.current.has(key)) { + newSelectedKeys.delete(key) + } else { + newSelectedKeys.add(key) + } + setSelectedKeys(newSelectedKeys) } else { setSelectedKeys(new Set([key])) } @@ -1882,10 +1874,10 @@ export default function AssetsTable(props: AssetsTableProps) { hidden={visibilities.get(item.key) === Visibility.hidden} selected={isSelected} setSelected={selected => { - setSelectedKeys(oldSelectedKeys => set.withPresence(oldSelectedKeys, key, selected)) + setSelectedKeys(set.withPresence(selectedKeysRef.current, key, selected)) }} isSoleSelectedItem={isSoleSelectedItem} - allowContextMenu={selectedKeys.size === 0 || !isSelected || isSoleSelectedItem} + allowContextMenu={selectedKeysRef.current.size === 0 || !isSelected || isSoleSelectedItem} onClick={onRowClick} onContextMenu={(_innerProps, event) => { if (!isSelected) { @@ -1896,148 +1888,132 @@ export default function AssetsTable(props: AssetsTableProps) { } }} onDragStart={event => { - if (!selectedKeys.has(key)) { + let newSelectedKeys = selectedKeysRef.current + if (!selectedKeysRef.current.has(key)) { setPreviouslySelectedKey(key) - setSelectedKeys(new Set([key])) + newSelectedKeys = new Set([key]) + setSelectedKeys(newSelectedKeys) } - setSelectedKeys(oldSelectedKeys => { - const nodes = assetTree - .preorderTraversal() - .filter(node => oldSelectedKeys.has(node.key)) - const payload: drag.AssetRowsDragPayload = nodes.map(node => ({ - key: node.key, - asset: node.item, - })) - drag.setDragImageToBlank(event) - drag.ASSET_ROWS.bind(event, payload) - queueMicrotask(() => { - setModal( - { - drag.ASSET_ROWS.unbind(payload) - }} - > - {nodes.map(node => ( - {}} - setItem={() => {}} - setRowState={() => {}} - /> - ))} - - ) - }) - return oldSelectedKeys - }) + const nodes = assetTree + .preorderTraversal() + .filter(node => newSelectedKeys.has(node.key)) + const payload: drag.AssetRowsDragPayload = nodes.map(node => ({ + key: node.key, + asset: node.item, + })) + drag.setDragImageToBlank(event) + drag.ASSET_ROWS.bind(event, payload) + setModal( + { + drag.ASSET_ROWS.unbind(payload) + }} + > + {nodes.map(node => ( + {}} + setItem={() => {}} + setRowState={() => {}} + /> + ))} + + ) }} onDragOver={event => { - setSelectedKeys(oldSelectedKeys => { - const payload = drag.LABELS.lookup(event) - if (payload != null) { - event.preventDefault() - event.stopPropagation() - const ids = oldSelectedKeys.has(key) ? oldSelectedKeys : new Set([key]) - // Expand ids to include ids of children as well. - for (const node of assetTree.preorderTraversal()) { - if (ids.has(node.key) && node.children != null) { - for (const child of node.children) { - ids.add(child.key) - } + const payload = drag.LABELS.lookup(event) + if (payload != null) { + event.preventDefault() + event.stopPropagation() + const ids = new Set( + selectedKeysRef.current.has(key) ? selectedKeysRef.current : [key] + ) + // Expand ids to include ids of children as well. + for (const node of assetTree.preorderTraversal()) { + if (ids.has(node.key) && node.children != null) { + for (const child of node.children) { + ids.add(child.key) } } - let labelsPresent = 0 - for (const selectedKey of ids) { - const labels = nodeMapRef.current.get(selectedKey)?.item.labels - if (labels != null) { - for (const label of labels) { - if (payload.has(label)) { - labelsPresent += 1 - } + } + let labelsPresent = 0 + for (const selectedKey of ids) { + const labels = nodeMapRef.current.get(selectedKey)?.item.labels + if (labels != null) { + for (const label of labels) { + if (payload.has(label)) { + labelsPresent += 1 } } } - const shouldAdd = labelsPresent * 2 < ids.size * payload.size - window.setTimeout(() => { - dispatchAssetEvent({ - type: shouldAdd - ? AssetEventType.temporarilyAddLabels - : AssetEventType.temporarilyRemoveLabels, - ids, - labelNames: payload, - }) - }) } - return oldSelectedKeys - }) - }} - onDragEnd={() => { - setSelectedKeys(oldSelectedKeys => { + const shouldAdd = labelsPresent * 2 < ids.size * payload.size window.setTimeout(() => { dispatchAssetEvent({ - type: AssetEventType.temporarilyAddLabels, - ids: oldSelectedKeys, - labelNames: set.EMPTY, + type: shouldAdd + ? AssetEventType.temporarilyAddLabels + : AssetEventType.temporarilyRemoveLabels, + ids, + labelNames: payload, }) }) - return oldSelectedKeys + } + }} + onDragEnd={() => { + dispatchAssetEvent({ + type: AssetEventType.temporarilyAddLabels, + ids: selectedKeysRef.current, + labelNames: set.EMPTY, }) }} onDrop={event => { - setSelectedKeys(oldSelectedKeys => { - const ids = oldSelectedKeys.has(key) ? new Set(oldSelectedKeys) : new Set([key]) - // Expand ids to include ids of children as well. - for (const node of assetTree.preorderTraversal()) { - if (ids.has(node.key) && node.children != null) { - for (const child of node.children) { - ids.add(child.key) - } + const ids = new Set(selectedKeysRef.current.has(key) ? selectedKeysRef.current : [key]) + // Expand ids to include ids of descendants as well. + for (const node of assetTree.preorderTraversal()) { + if (ids.has(node.key) && node.children != null) { + for (const child of node.children) { + ids.add(child.key) } } - const payload = drag.LABELS.lookup(event) - if (payload != null) { - event.preventDefault() - event.stopPropagation() - let labelsPresent = 0 - for (const selectedKey of ids) { - const labels = nodeMapRef.current.get(selectedKey)?.item.labels - if (labels != null) { - for (const label of labels) { - if (payload.has(label)) { - labelsPresent += 1 - } + } + const payload = drag.LABELS.lookup(event) + if (payload != null) { + event.preventDefault() + event.stopPropagation() + let labelsPresent = 0 + for (const selectedKey of ids) { + const labels = nodeMapRef.current.get(selectedKey)?.item.labels + if (labels != null) { + for (const label of labels) { + if (payload.has(label)) { + labelsPresent += 1 } } } - const shouldAdd = labelsPresent * 2 < ids.size * payload.size - window.setTimeout(() => { - dispatchAssetEvent({ - type: shouldAdd ? AssetEventType.addLabels : AssetEventType.removeLabels, - ids, - labelNames: payload, - }) - }) - } else { - window.setTimeout(() => { - dispatchAssetEvent({ - type: AssetEventType.temporarilyAddLabels, - ids, - labelNames: set.EMPTY, - }) - }) } - return oldSelectedKeys - }) + const shouldAdd = labelsPresent * 2 < ids.size * payload.size + dispatchAssetEvent({ + type: shouldAdd ? AssetEventType.addLabels : AssetEventType.removeLabels, + ids, + labelNames: payload, + }) + } else { + dispatchAssetEvent({ + type: AssetEventType.temporarilyAddLabels, + ids, + labelNames: set.EMPTY, + }) + } }} /> ) @@ -2057,7 +2033,7 @@ export default function AssetsTable(props: AssetsTableProps) { selectedKeys={selectedKeys} nodeMapRef={nodeMapRef} event={event} - setSelectedKeys={setSelectedKeys} + clearSelectedKeys={clearSelectedKeys} dispatchAssetEvent={dispatchAssetEvent} dispatchAssetListEvent={dispatchAssetListEvent} doCopy={doCopy} @@ -2073,15 +2049,10 @@ export default function AssetsTable(props: AssetsTableProps) { event.relatedTarget instanceof Node && !event.currentTarget.contains(event.relatedTarget) ) { - setSelectedKeys(oldSelectedKeys => { - window.setTimeout(() => { - dispatchAssetEvent({ - type: AssetEventType.temporarilyAddLabels, - ids: oldSelectedKeys, - labelNames: set.EMPTY, - }) - }) - return oldSelectedKeys + dispatchAssetEvent({ + type: AssetEventType.temporarilyAddLabels, + ids: selectedKeysRef.current, + labelNames: set.EMPTY, }) } }} @@ -2100,6 +2071,9 @@ export default function AssetsTable(props: AssetsTableProps) {
{ + setSelectedKeys(new Set()) + }} onDragEnter={onDragOver} onDragOver={onDragOver} onDrop={event => { diff --git a/app/ide-desktop/lib/dashboard/src/layouts/dashboard/AssetsTableContextMenu.tsx b/app/ide-desktop/lib/dashboard/src/layouts/dashboard/AssetsTableContextMenu.tsx index 1e9b3cd54aed..5b5a26dd50e5 100644 --- a/app/ide-desktop/lib/dashboard/src/layouts/dashboard/AssetsTableContextMenu.tsx +++ b/app/ide-desktop/lib/dashboard/src/layouts/dashboard/AssetsTableContextMenu.tsx @@ -43,9 +43,9 @@ const pluralize = string.makePluralize('item', 'items') export interface AssetsTableContextMenuProps { readonly hidden?: boolean readonly category: Category - readonly pasteData: pasteDataModule.PasteData> | null - readonly selectedKeys: Set - readonly setSelectedKeys: (items: Set) => void + readonly pasteData: pasteDataModule.PasteData> | null + readonly selectedKeys: ReadonlySet + readonly clearSelectedKeys: () => void readonly nodeMapRef: React.MutableRefObject> readonly event: Pick, 'pageX' | 'pageY'> readonly dispatchAssetEvent: (event: assetEvent.AssetEvent) => void @@ -61,7 +61,7 @@ export interface AssetsTableContextMenuProps { /** A context menu for an `AssetsTable`, when no row is selected, or multiple rows * are selected. */ export default function AssetsTableContextMenu(props: AssetsTableContextMenuProps) { - const { category, pasteData, selectedKeys, setSelectedKeys, nodeMapRef, event } = props + const { category, pasteData, selectedKeys, clearSelectedKeys, nodeMapRef, event } = props const { dispatchAssetEvent, dispatchAssetListEvent, hidden = false } = props const { doCopy, doCut, doPaste } = props const { backend } = backendProvider.useBackend() @@ -91,20 +91,14 @@ export default function AssetsTableContextMenu(props: AssetsTableContextMenuProp const doDeleteAll = () => { if (isCloud) { unsetModal() - dispatchAssetEvent({ - type: AssetEventType.delete, - ids: selectedKeys, - }) + dispatchAssetEvent({ type: AssetEventType.delete, ids: selectedKeys }) } else { setModal( { - setSelectedKeys(new Set()) - dispatchAssetEvent({ - type: AssetEventType.delete, - ids: selectedKeys, - }) + clearSelectedKeys() + dispatchAssetEvent({ type: AssetEventType.delete, ids: selectedKeys }) }} /> ) diff --git a/app/ide-desktop/lib/dashboard/src/utilities/__tests__/jsonSchema.test.ts b/app/ide-desktop/lib/dashboard/src/utilities/__tests__/jsonSchema.test.ts index 945402f85fec..c15025793a6a 100644 --- a/app/ide-desktop/lib/dashboard/src/utilities/__tests__/jsonSchema.test.ts +++ b/app/ide-desktop/lib/dashboard/src/utilities/__tests__/jsonSchema.test.ts @@ -9,7 +9,7 @@ import * as jsonSchema from '#/utilities/jsonSchema' // ============= fc.test.prop({ - value: fc.fc.anything(), + value: fc.fc.anything({ withNullPrototype: true }), })('converting between constant value and schema', ({ value }) => { const schema = jsonSchema.constantValueToSchema(value) if (schema != null) { @@ -25,6 +25,25 @@ fc.test.prop({ } }) +// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment +v.test.each([{ value: JSON.parse('{"__proto__":{}}') }])( + 'converting between constant value and schema', + ({ value }) => { + const schema = jsonSchema.constantValueToSchema(value) + if (schema != null) { + const extractedValue = jsonSchema.constantValue({}, schema)[0] + v.expect( + extractedValue, + `\`${JSON.stringify(value)}\` should round trip to schema and back` + ).toEqual(value) + v.expect( + jsonSchema.isMatch({}, schema, value), + `\`${JSON.stringify(value)}\` should match its converted schema` + ).toBe(true) + } + } +) + const STRING_SCHEMA = { type: 'string' } as const fc.test.prop({ value: fc.fc.string() })('string schema', ({ value }) => { const constSchema = { const: value, type: 'string' } diff --git a/app/ide-desktop/lib/dashboard/src/utilities/jsonSchema.ts b/app/ide-desktop/lib/dashboard/src/utilities/jsonSchema.ts index 4689eb7b5c68..3e6fc8060b20 100644 --- a/app/ide-desktop/lib/dashboard/src/utilities/jsonSchema.ts +++ b/app/ide-desktop/lib/dashboard/src/utilities/jsonSchema.ts @@ -56,7 +56,7 @@ export function constantValueToSchema(value: unknown): object | null { result = null break } - properties[key] = schema + Object.defineProperty(properties, key, { value: schema, enumerable: true }) } } break @@ -144,7 +144,7 @@ function constantValueHelper( result = [] break } else { - object[key] = value[0] ?? null + Object.defineProperty(object, key, { value: value[0] ?? null, enumerable: true }) } } break diff --git a/app/ide-desktop/lib/dashboard/src/utilities/set.ts b/app/ide-desktop/lib/dashboard/src/utilities/set.ts index f525a5002c78..a89623b514e8 100644 --- a/app/ide-desktop/lib/dashboard/src/utilities/set.ts +++ b/app/ide-desktop/lib/dashboard/src/utilities/set.ts @@ -23,7 +23,7 @@ export function setPresence(set: Set, value: T, presence: boolean) { * * This is an immutable version of {@link setPresence}, so it returns a new set if the old set * would have been mutated, and returns the original set if it would not have been mutated. */ -export function withPresence(set: Set, value: T, presence: boolean) { +export function withPresence(set: ReadonlySet, value: T, presence: boolean) { if (presence === set.has(value)) { return set } else { diff --git a/build.sbt b/build.sbt index f01c0a96f761..230bb01270ec 100644 --- a/build.sbt +++ b/build.sbt @@ -27,11 +27,11 @@ val scalacVersion = "2.13.11" // source version of the Java language val javaVersion = "21" // version of the GraalVM JDK -val graalVersion = "21.0.1" +val graalVersion = "21.0.2" // Version used for the Graal/Truffle related Maven packages // Keep in sync with GraalVM.version. Do not change the name of this variable, // it is used by the Rust build script via regex matching. -val graalMavenPackagesVersion = "23.1.0" +val graalMavenPackagesVersion = "23.1.2" val targetJavaVersion = "17" val defaultDevEnsoVersion = "0.0.0-dev" val ensoVersion = sys.env.getOrElse( diff --git a/build/build/src/engine/sbt.rs b/build/build/src/engine/sbt.rs index a628d4e6248a..90eae0ce8bf5 100644 --- a/build/build/src/engine/sbt.rs +++ b/build/build/src/engine/sbt.rs @@ -41,6 +41,10 @@ impl CommandProvider for Context { } // This prevents https://github.com/sbt/sbt-assembly/issues/496 cmd.env(ide_ci::env::known::LC_ALL, ide_ci::env::known::C_UTF8); + // This prevents https://github.com/sbt/sbt/issues/6777#issuecomment-1613316167 + cmd.set_env(ide_ci::programs::sbt::SBT_SERVER_FORCESTART, &true)?; + // Again. Preferably there should be no sbt server spawned at all. + cmd.apply(&sbt::ServerAutostart(false)); Ok(cmd) } } diff --git a/build/ci_utils/src/programs/sbt.rs b/build/ci_utils/src/programs/sbt.rs index 7e7d5537f93c..0b90ea025dca 100644 --- a/build/ci_utils/src/programs/sbt.rs +++ b/build/ci_utils/src/programs/sbt.rs @@ -1,7 +1,26 @@ use crate::prelude::*; +use crate::define_env_var; +use crate::program::command::Manipulator; + +define_env_var! { + /// Force the SBT server to start, avoiding `ServerAlreadyBootingException`. + /// See: https://github.com/sbt/sbt/issues/6777#issuecomment-1613316167 + SBT_SERVER_FORCESTART, bool; +} + +#[derive(Clone, Copy, Debug)] +pub struct ServerAutostart(pub bool); +impl Manipulator for ServerAutostart { + fn apply(&self, command: &mut C) { + let arg = "sbt.server.autostart"; + let arg = format!("-D{arg}={}", self.0); + command.arg(arg); + } +} + macro_rules! strong_string { ($name:ident($inner_ty:ty)) => { paste::paste! { diff --git a/distribution/engine/THIRD-PARTY/NOTICE b/distribution/engine/THIRD-PARTY/NOTICE index 2ceedaf9c694..fe2b0c83d4ea 100644 --- a/distribution/engine/THIRD-PARTY/NOTICE +++ b/distribution/engine/THIRD-PARTY/NOTICE @@ -313,77 +313,77 @@ Copyright notices related to this dependency can be found in the directory `org. 'js-language', licensed under the MIT License, is distributed with the engine. The license file can be found at `licenses/MIT`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.js.js-language-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.js.js-language-23.1.2`. 'llvm-api', licensed under the New BSD License (3-clause BSD license), is distributed with the engine. The license file can be found at `licenses/BSD-3-Clause`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.llvm.llvm-api-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.llvm.llvm-api-23.1.2`. 'polyglot', licensed under the Universal Permissive License, Version 1.0, is distributed with the engine. The license file can be found at `licenses/Universal_Permissive_License__Version_1.0`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.polyglot.polyglot-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.polyglot.polyglot-23.1.2`. 'python-language', licensed under the MIT License, is distributed with the engine. The license file can be found at `licenses/MIT`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.python.python-language-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.python.python-language-23.1.2`. 'python-resources', licensed under the MIT License, is distributed with the engine. The license file can be found at `licenses/MIT`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.python.python-resources-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.python.python-resources-23.1.2`. 'regex', licensed under the Universal Permissive License, Version 1.0, is distributed with the engine. The license file can be found at `licenses/Universal_Permissive_License__Version_1.0`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.regex.regex-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.regex.regex-23.1.2`. 'collections', licensed under the Universal Permissive License, Version 1.0, is distributed with the engine. The license file can be found at `licenses/Universal_Permissive_License__Version_1.0`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.sdk.collections-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.sdk.collections-23.1.2`. 'nativeimage', licensed under the Universal Permissive License, Version 1.0, is distributed with the engine. The license file can be found at `licenses/Universal_Permissive_License__Version_1.0`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.sdk.nativeimage-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.sdk.nativeimage-23.1.2`. 'word', licensed under the Universal Permissive License, Version 1.0, is distributed with the engine. The license file can be found at `licenses/Universal_Permissive_License__Version_1.0`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.sdk.word-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.sdk.word-23.1.2`. 'icu4j', licensed under the Unicode/ICU License, is distributed with the engine. The license information can be found along with the copyright notices. -Copyright notices related to this dependency can be found in the directory `org.graalvm.shadowed.icu4j-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.shadowed.icu4j-23.1.2`. 'json', licensed under the Universal Permissive License, Version 1.0, is distributed with the engine. The license file can be found at `licenses/Universal_Permissive_License__Version_1.0`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.shadowed.json-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.shadowed.json-23.1.2`. 'profiler-tool', licensed under the GNU General Public License, version 2, with the Classpath Exception, is distributed with the engine. The license file can be found at `licenses/GNU_General_Public_License__version_2__with_the_Classpath_Exception`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.tools.profiler-tool-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.tools.profiler-tool-23.1.2`. 'truffle-api', licensed under the Universal Permissive License, Version 1.0, is distributed with the engine. The license file can be found at `licenses/Universal_Permissive_License__Version_1.0`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.truffle.truffle-api-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.truffle.truffle-api-23.1.2`. 'truffle-nfi', licensed under the Universal Permissive License, Version 1.0, is distributed with the engine. The license file can be found at `licenses/Universal_Permissive_License__Version_1.0`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.truffle.truffle-nfi-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.truffle.truffle-nfi-23.1.2`. 'truffle-nfi-libffi', licensed under the Universal Permissive License, Version 1.0, is distributed with the engine. The license file can be found at `licenses/Universal_Permissive_License__Version_1.0`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.truffle.truffle-nfi-libffi-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.truffle.truffle-nfi-libffi-23.1.2`. 'jline', licensed under the The BSD License, is distributed with the engine. diff --git a/distribution/engine/THIRD-PARTY/org.graalvm.js.js-language-23.1.0/NOTICES b/distribution/engine/THIRD-PARTY/org.graalvm.js.js-language-23.1.2/NOTICES similarity index 100% rename from distribution/engine/THIRD-PARTY/org.graalvm.js.js-language-23.1.0/NOTICES rename to distribution/engine/THIRD-PARTY/org.graalvm.js.js-language-23.1.2/NOTICES diff --git a/distribution/engine/THIRD-PARTY/org.graalvm.llvm.llvm-api-23.1.0/NOTICES b/distribution/engine/THIRD-PARTY/org.graalvm.llvm.llvm-api-23.1.2/NOTICES similarity index 100% rename from distribution/engine/THIRD-PARTY/org.graalvm.llvm.llvm-api-23.1.0/NOTICES rename to distribution/engine/THIRD-PARTY/org.graalvm.llvm.llvm-api-23.1.2/NOTICES diff --git a/distribution/engine/THIRD-PARTY/org.graalvm.polyglot.polyglot-23.1.0/NOTICES b/distribution/engine/THIRD-PARTY/org.graalvm.polyglot.polyglot-23.1.2/NOTICES similarity index 100% rename from distribution/engine/THIRD-PARTY/org.graalvm.polyglot.polyglot-23.1.0/NOTICES rename to distribution/engine/THIRD-PARTY/org.graalvm.polyglot.polyglot-23.1.2/NOTICES diff --git a/distribution/engine/THIRD-PARTY/org.graalvm.python.python-language-23.1.0/NOTICES b/distribution/engine/THIRD-PARTY/org.graalvm.python.python-language-23.1.2/NOTICES similarity index 100% rename from distribution/engine/THIRD-PARTY/org.graalvm.python.python-language-23.1.0/NOTICES rename to distribution/engine/THIRD-PARTY/org.graalvm.python.python-language-23.1.2/NOTICES diff --git a/distribution/engine/THIRD-PARTY/org.graalvm.python.python-resources-23.1.0/NOTICES b/distribution/engine/THIRD-PARTY/org.graalvm.python.python-resources-23.1.2/NOTICES similarity index 100% rename from distribution/engine/THIRD-PARTY/org.graalvm.python.python-resources-23.1.0/NOTICES rename to distribution/engine/THIRD-PARTY/org.graalvm.python.python-resources-23.1.2/NOTICES diff --git a/distribution/engine/THIRD-PARTY/org.graalvm.regex.regex-23.1.0/NOTICES b/distribution/engine/THIRD-PARTY/org.graalvm.regex.regex-23.1.2/NOTICES similarity index 100% rename from distribution/engine/THIRD-PARTY/org.graalvm.regex.regex-23.1.0/NOTICES rename to distribution/engine/THIRD-PARTY/org.graalvm.regex.regex-23.1.2/NOTICES diff --git a/distribution/engine/THIRD-PARTY/org.graalvm.sdk.collections-23.1.0/NOTICES b/distribution/engine/THIRD-PARTY/org.graalvm.sdk.collections-23.1.2/NOTICES similarity index 100% rename from distribution/engine/THIRD-PARTY/org.graalvm.sdk.collections-23.1.0/NOTICES rename to distribution/engine/THIRD-PARTY/org.graalvm.sdk.collections-23.1.2/NOTICES diff --git a/distribution/engine/THIRD-PARTY/org.graalvm.sdk.nativeimage-23.1.0/NOTICES b/distribution/engine/THIRD-PARTY/org.graalvm.sdk.nativeimage-23.1.2/NOTICES similarity index 100% rename from distribution/engine/THIRD-PARTY/org.graalvm.sdk.nativeimage-23.1.0/NOTICES rename to distribution/engine/THIRD-PARTY/org.graalvm.sdk.nativeimage-23.1.2/NOTICES diff --git a/distribution/engine/THIRD-PARTY/org.graalvm.sdk.word-23.1.0/NOTICES b/distribution/engine/THIRD-PARTY/org.graalvm.sdk.word-23.1.2/NOTICES similarity index 100% rename from distribution/engine/THIRD-PARTY/org.graalvm.sdk.word-23.1.0/NOTICES rename to distribution/engine/THIRD-PARTY/org.graalvm.sdk.word-23.1.2/NOTICES diff --git a/distribution/engine/THIRD-PARTY/org.graalvm.shadowed.icu4j-23.1.0/LICENSE b/distribution/engine/THIRD-PARTY/org.graalvm.shadowed.icu4j-23.1.2/LICENSE similarity index 100% rename from distribution/engine/THIRD-PARTY/org.graalvm.shadowed.icu4j-23.1.0/LICENSE rename to distribution/engine/THIRD-PARTY/org.graalvm.shadowed.icu4j-23.1.2/LICENSE diff --git a/distribution/engine/THIRD-PARTY/org.graalvm.shadowed.icu4j-23.1.0/NOTICES b/distribution/engine/THIRD-PARTY/org.graalvm.shadowed.icu4j-23.1.2/NOTICES similarity index 100% rename from distribution/engine/THIRD-PARTY/org.graalvm.shadowed.icu4j-23.1.0/NOTICES rename to distribution/engine/THIRD-PARTY/org.graalvm.shadowed.icu4j-23.1.2/NOTICES diff --git a/distribution/engine/THIRD-PARTY/org.graalvm.shadowed.json-23.1.0/NOTICE b/distribution/engine/THIRD-PARTY/org.graalvm.shadowed.json-23.1.2/NOTICE similarity index 100% rename from distribution/engine/THIRD-PARTY/org.graalvm.shadowed.json-23.1.0/NOTICE rename to distribution/engine/THIRD-PARTY/org.graalvm.shadowed.json-23.1.2/NOTICE diff --git a/distribution/engine/THIRD-PARTY/org.graalvm.tools.profiler-tool-23.1.0/NOTICES b/distribution/engine/THIRD-PARTY/org.graalvm.tools.profiler-tool-23.1.2/NOTICES similarity index 100% rename from distribution/engine/THIRD-PARTY/org.graalvm.tools.profiler-tool-23.1.0/NOTICES rename to distribution/engine/THIRD-PARTY/org.graalvm.tools.profiler-tool-23.1.2/NOTICES diff --git a/distribution/engine/THIRD-PARTY/org.graalvm.truffle.truffle-api-23.1.0/NOTICES b/distribution/engine/THIRD-PARTY/org.graalvm.truffle.truffle-api-23.1.2/NOTICES similarity index 100% rename from distribution/engine/THIRD-PARTY/org.graalvm.truffle.truffle-api-23.1.0/NOTICES rename to distribution/engine/THIRD-PARTY/org.graalvm.truffle.truffle-api-23.1.2/NOTICES diff --git a/distribution/engine/THIRD-PARTY/org.graalvm.truffle.truffle-nfi-23.1.0/NOTICES b/distribution/engine/THIRD-PARTY/org.graalvm.truffle.truffle-nfi-23.1.2/NOTICES similarity index 100% rename from distribution/engine/THIRD-PARTY/org.graalvm.truffle.truffle-nfi-23.1.0/NOTICES rename to distribution/engine/THIRD-PARTY/org.graalvm.truffle.truffle-nfi-23.1.2/NOTICES diff --git a/distribution/engine/THIRD-PARTY/org.graalvm.truffle.truffle-nfi-libffi-23.1.0/NOTICES b/distribution/engine/THIRD-PARTY/org.graalvm.truffle.truffle-nfi-libffi-23.1.2/NOTICES similarity index 100% rename from distribution/engine/THIRD-PARTY/org.graalvm.truffle.truffle-nfi-libffi-23.1.0/NOTICES rename to distribution/engine/THIRD-PARTY/org.graalvm.truffle.truffle-nfi-libffi-23.1.2/NOTICES diff --git a/distribution/launcher/THIRD-PARTY/NOTICE b/distribution/launcher/THIRD-PARTY/NOTICE index 0584a5a5f8a0..7d588ada4554 100644 --- a/distribution/launcher/THIRD-PARTY/NOTICE +++ b/distribution/launcher/THIRD-PARTY/NOTICE @@ -118,27 +118,27 @@ Copyright notices related to this dependency can be found in the directory `org. 'polyglot', licensed under the Universal Permissive License, Version 1.0, is distributed with the launcher. The license file can be found at `licenses/Universal_Permissive_License__Version_1.0`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.polyglot.polyglot-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.polyglot.polyglot-23.1.2`. 'collections', licensed under the Universal Permissive License, Version 1.0, is distributed with the launcher. The license file can be found at `licenses/Universal_Permissive_License__Version_1.0`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.sdk.collections-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.sdk.collections-23.1.2`. 'nativeimage', licensed under the Universal Permissive License, Version 1.0, is distributed with the launcher. The license file can be found at `licenses/Universal_Permissive_License__Version_1.0`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.sdk.nativeimage-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.sdk.nativeimage-23.1.2`. 'word', licensed under the Universal Permissive License, Version 1.0, is distributed with the launcher. The license file can be found at `licenses/Universal_Permissive_License__Version_1.0`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.sdk.word-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.sdk.word-23.1.2`. 'truffle-api', licensed under the Universal Permissive License, Version 1.0, is distributed with the launcher. The license file can be found at `licenses/Universal_Permissive_License__Version_1.0`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.truffle.truffle-api-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.truffle.truffle-api-23.1.2`. 'reactive-streams', licensed under the CC0, is distributed with the launcher. diff --git a/distribution/launcher/THIRD-PARTY/org.graalvm.polyglot.polyglot-23.1.0/NOTICES b/distribution/launcher/THIRD-PARTY/org.graalvm.polyglot.polyglot-23.1.2/NOTICES similarity index 100% rename from distribution/launcher/THIRD-PARTY/org.graalvm.polyglot.polyglot-23.1.0/NOTICES rename to distribution/launcher/THIRD-PARTY/org.graalvm.polyglot.polyglot-23.1.2/NOTICES diff --git a/distribution/launcher/THIRD-PARTY/org.graalvm.sdk.collections-23.1.0/NOTICES b/distribution/launcher/THIRD-PARTY/org.graalvm.sdk.collections-23.1.2/NOTICES similarity index 100% rename from distribution/launcher/THIRD-PARTY/org.graalvm.sdk.collections-23.1.0/NOTICES rename to distribution/launcher/THIRD-PARTY/org.graalvm.sdk.collections-23.1.2/NOTICES diff --git a/distribution/launcher/THIRD-PARTY/org.graalvm.sdk.nativeimage-23.1.0/NOTICES b/distribution/launcher/THIRD-PARTY/org.graalvm.sdk.nativeimage-23.1.2/NOTICES similarity index 100% rename from distribution/launcher/THIRD-PARTY/org.graalvm.sdk.nativeimage-23.1.0/NOTICES rename to distribution/launcher/THIRD-PARTY/org.graalvm.sdk.nativeimage-23.1.2/NOTICES diff --git a/distribution/launcher/THIRD-PARTY/org.graalvm.sdk.word-23.1.0/NOTICES b/distribution/launcher/THIRD-PARTY/org.graalvm.sdk.word-23.1.2/NOTICES similarity index 100% rename from distribution/launcher/THIRD-PARTY/org.graalvm.sdk.word-23.1.0/NOTICES rename to distribution/launcher/THIRD-PARTY/org.graalvm.sdk.word-23.1.2/NOTICES diff --git a/distribution/launcher/THIRD-PARTY/org.graalvm.truffle.truffle-api-23.1.0/NOTICES b/distribution/launcher/THIRD-PARTY/org.graalvm.truffle.truffle-api-23.1.2/NOTICES similarity index 100% rename from distribution/launcher/THIRD-PARTY/org.graalvm.truffle.truffle-api-23.1.0/NOTICES rename to distribution/launcher/THIRD-PARTY/org.graalvm.truffle.truffle-api-23.1.2/NOTICES diff --git a/distribution/lib/Standard/AWS/0.0.0-dev/src/Internal/Request_Body.enso b/distribution/lib/Standard/AWS/0.0.0-dev/src/Internal/Request_Body.enso index d48ceb335284..80da7e0f3384 100644 --- a/distribution/lib/Standard/AWS/0.0.0-dev/src/Internal/Request_Body.enso +++ b/distribution/lib/Standard/AWS/0.0.0-dev/src/Internal/Request_Body.enso @@ -1,10 +1,11 @@ private from Standard.Base import all from Standard.Base.System.File import file_as_java +import Standard.Base.Errors.File_Error.File_Error polyglot java import software.amazon.awssdk.core.sync.RequestBody ## PRIVATE -from_local_file (file : File) = +from_local_file (file : File) = File_Error.handle_java_exceptions file <| java_file = file_as_java file RequestBody.fromFile java_file diff --git a/distribution/lib/Standard/AWS/0.0.0-dev/src/Internal/S3_File_Write_Strategy.enso b/distribution/lib/Standard/AWS/0.0.0-dev/src/Internal/S3_File_Write_Strategy.enso index eb739f92a9f3..f7171fe38759 100644 --- a/distribution/lib/Standard/AWS/0.0.0-dev/src/Internal/S3_File_Write_Strategy.enso +++ b/distribution/lib/Standard/AWS/0.0.0-dev/src/Internal/S3_File_Write_Strategy.enso @@ -6,10 +6,12 @@ import Standard.Base.Errors.File_Error.File_Error from Standard.Base.System.File.Generic.File_Write_Strategy import File_Write_Strategy, default_overwrite, default_append, default_raise_error, generic_remote_write_with_local_file import project.Errors.S3_Error +import project.S3.S3 +import project.S3.S3_File.S3_File ## PRIVATE instance = - File_Write_Strategy.Value default_overwrite default_append default_raise_error s3_backup create_dry_run_file remote_write_with_local_file + File_Write_Strategy.Value default_overwrite default_append default_raise_error s3_backup create_dry_run_file remote_write_with_local_file copy_from_local ## PRIVATE create_dry_run_file file copy_original = @@ -47,6 +49,12 @@ s3_backup file action = recover_errors <| with_failure_handler revert_backup <| file.with_output_stream [File_Access.Write, File_Access.Truncate_Existing] action +## PRIVATE +copy_from_local (source : File) (destination : S3_File) (replace_existing : Boolean) = + if replace_existing.not && destination.exists then Error.throw (File_Error.Already_Exists destination) else + S3.upload_file source destination.bucket destination.prefix destination.credentials . if_not_error <| + destination + ## PRIVATE with_failure_handler ~failure_action ~action = panic_handler caught_panic = diff --git a/distribution/lib/Standard/AWS/0.0.0-dev/src/S3/S3.enso b/distribution/lib/Standard/AWS/0.0.0-dev/src/S3/S3.enso index d0ee87d9ef87..64286c697f92 100644 --- a/distribution/lib/Standard/AWS/0.0.0-dev/src/S3/S3.enso +++ b/distribution/lib/Standard/AWS/0.0.0-dev/src/S3/S3.enso @@ -10,6 +10,7 @@ import project.Errors.More_Records_Available import project.Errors.S3_Bucket_Not_Found import project.Errors.S3_Key_Not_Found import project.Errors.S3_Error +import project.Internal.Request_Body polyglot java import java.io.IOException polyglot java import org.enso.aws.ClientBuilder @@ -142,15 +143,20 @@ get_object bucket key credentials:(AWS_Credential | Nothing)=Nothing = handle_s3 put_object (bucket : Text) (key : Text) credentials:(AWS_Credential | Nothing)=Nothing request_body = handle_s3_errors bucket=bucket key=key <| client = make_client credentials request = PutObjectRequest.builder.bucket bucket . key key . build - client.putObject request request_body - Nothing + client.putObject request request_body . if_not_error Nothing ## PRIVATE +upload_file (local_file : File) (bucket : Text) (key : Text) credentials:(AWS_Credential | Nothing)=Nothing = handle_s3_errors bucket=bucket key=key <| + request_body = Request_Body.from_local_file local_file + put_object bucket key credentials request_body + +## PRIVATE + Deletes the object. + It will not raise any errors if the object does not exist. delete_object (bucket : Text) (key : Text) credentials:(AWS_Credential | Nothing)=Nothing = handle_s3_errors bucket=bucket key=key <| client = make_client credentials request = DeleteObjectRequest.builder . bucket bucket . key key . build - client.deleteObject request - Nothing + client.deleteObject request . if_not_error Nothing ## PRIVATE copy_object (source_bucket : Text) (source_key : Text) (target_bucket : Text) (target_key : Text) credentials:(AWS_Credential | Nothing)=Nothing = handle_s3_errors bucket=source_bucket key=source_key <| @@ -161,8 +167,7 @@ copy_object (source_bucket : Text) (source_key : Text) (target_bucket : Text) (t . sourceBucket source_bucket . sourceKey source_key . build - client.copyObject request - Nothing + client.copyObject request . if_not_error Nothing ## PRIVATE Splits a S3 URI into bucket and key. diff --git a/distribution/lib/Standard/AWS/0.0.0-dev/src/S3/S3_File.enso b/distribution/lib/Standard/AWS/0.0.0-dev/src/S3/S3_File.enso index 0adcf9e23434..90cecd490369 100644 --- a/distribution/lib/Standard/AWS/0.0.0-dev/src/S3/S3_File.enso +++ b/distribution/lib/Standard/AWS/0.0.0-dev/src/S3/S3_File.enso @@ -1,5 +1,4 @@ from Standard.Base import all -import Standard.Base.Errors.Common.Forbidden_Operation import Standard.Base.Errors.Common.Syntax_Error import Standard.Base.Errors.File_Error.File_Error import Standard.Base.Errors.Illegal_Argument.Illegal_Argument @@ -11,11 +10,11 @@ import Standard.Base.System.File.Generic.Writable_File.Writable_File import Standard.Base.System.Input_Stream.Input_Stream import Standard.Base.System.Output_Stream.Output_Stream from Standard.Base.System.File import find_extension_from_name +from Standard.Base.System.File.Generic.File_Write_Strategy import generic_copy import project.AWS_Credential.AWS_Credential import project.Errors.S3_Error import project.Errors.S3_Key_Not_Found -import project.Internal.Request_Body import project.Internal.S3_File_Write_Strategy import project.S3.S3 @@ -49,7 +48,7 @@ type S3_File exists self = if self.bucket == "" then True else if self.prefix == "" then translate_file_errors self <| S3.head self.bucket "" self.credentials . is_error . not else pair = translate_file_errors self <| S3.read_bucket self.bucket self.prefix self.credentials max_count=1 - pair.second.length > 0 + pair.second.contains self.prefix ## GROUP Standard.Base.Metadata Checks if this is a folder. @@ -84,7 +83,7 @@ type S3_File value. The value is returned from this method. with_output_stream : Vector File_Access -> (Output_Stream -> Any ! File_Error) -> Any ! File_Error with_output_stream self (open_options : Vector) action = if self.is_directory then Error.throw (S3_Error.Error "S3 directory cannot be opened as a stream." self.uri) else - if Context.Output.is_enabled.not then Error.throw (Forbidden_Operation.Error "Writing to an S3_File is forbidden as the Output context is disabled.") else + Context.Output.if_enabled disabled_message="Writing to an S3_File is forbidden as the Output context is disabled." panic=False <| if open_options.contains File_Access.Append then Error.throw (S3_Error.Error "S3 does not support appending to a file. Instead you may read it, modify and then write the new contents." self.uri) else # The exists check is not atomic, but it is the best we can do with S3 check_exists = open_options.contains File_Access.Create_New @@ -98,8 +97,7 @@ type S3_File result = tmp_file.with_output_stream [File_Access.Write] action # Only proceed if the write succeeded result.if_not_error <| - request_body = Request_Body.from_local_file tmp_file - (translate_file_errors self <| S3.put_object self.bucket self.prefix self.credentials request_body) . if_not_error <| + (translate_file_errors self <| S3.upload_file tmp_file self.bucket self.prefix self.credentials) . if_not_error <| result @@ -172,12 +170,17 @@ type S3_File read_text self (encoding=Encoding.utf_8) (on_problems=Problem_Behavior.Report_Warning) = self.read (Plain_Text encoding) on_problems - ## UNSTABLE - Deletes the object. + ## Deletes the object. delete : Nothing delete self = if self.is_directory then Error.throw (S3_Error.Error "Deleting S3 folders is currently not implemented." self.uri) else - if Context.Output.is_enabled.not then Error.throw (Forbidden_Operation.Error "Deleting an S3_File is forbidden as the Output context is disabled.") else - translate_file_errors self <| S3.delete_object self.bucket self.prefix self.credentials . if_not_error <| Nothing + if self.exists.not then Error.throw (File_Error.Not_Found self) else + self.delete_if_exists + + ## Deletes the file if it had existed. + delete_if_exists : Nothing + delete_if_exists self = if self.is_directory then Error.throw (S3_Error.Error "Deleting S3 folders is currently not implemented." self.uri) else + Context.Output.if_enabled disabled_message="Deleting an S3_File is forbidden as the Output context is disabled." panic=False <| + translate_file_errors self <| S3.delete_object self.bucket self.prefix self.credentials . if_not_error Nothing ## Copies the file to the specified destination. @@ -185,22 +188,36 @@ type S3_File - destination: the destination to move the file to. - replace_existing: specifies if the operation should proceed if the destination file already exists. Defaults to `False`. - copy_to : S3_File -> Boolean -> Any ! File_Error - copy_to self (destination : Writable_File) replace_existing=False = + copy_to : Writable_File -> Boolean -> Any ! File_Error + copy_to self (destination : Writable_File) (replace_existing : Boolean = False) = if self.is_directory then Error.throw (S3_Error.Error "Copying S3 folders is currently not implemented." self.uri) else - if Context.Output.is_enabled.not then Error.throw (Forbidden_Operation.Error "Copying an S3_File is forbidden as the Output context is disabled.") else + Context.Output.if_enabled disabled_message="Copying an S3_File is forbidden as the Output context is disabled." panic=False <| case destination.file of # Special shortcut for more efficient handling of S3 file copying (no need to move the data to our machine) s3_destination : S3_File -> if replace_existing.not && s3_destination.exists then Error.throw (File_Error.Already_Exists destination) else translate_file_errors self <| S3.copy_object self.bucket self.prefix s3_destination.bucket s3_destination.prefix self.credentials . if_not_error <| s3_destination + _ -> generic_copy self destination.file replace_existing + + ## Moves the file to the specified destination. + + ! S3 Move is a Copy and Delete + + Since S3 does not support moving files, this operation is implemented + as a copy followed by delete. Keep in mind that the space usage of the + file will briefly be doubled and that the operation may not be as fast + as a local move often is. - # Generic implementation using streams - _ -> - self.with_input_stream [File_Access.Read] input_stream-> - open_settings = if replace_existing then [File_Access.Write, File_Access.Create, File_Access.Truncate_Existing] else [File_Access.Write, File_Access.Create_New] - destination.with_output_stream open_settings output_stream-> - output_stream.write_stream input_stream + Arguments: + - destination: the destination to move the file to. + - replace_existing: specifies if the operation should proceed if the + destination file already exists. Defaults to `False`. + move_to : Writable_File -> Boolean -> Nothing ! File_Error + move_to self (destination : Writable_File) (replace_existing : Boolean = False) = + Context.Output.if_enabled disabled_message="File moving is forbidden as the Output context is disabled." panic=False <| + r = self.copy_to destination replace_existing=replace_existing + r.if_not_error <| + self.delete.if_not_error r ## GROUP Standard.Base.Operators Join two path segments together. diff --git a/distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/NOTICE b/distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/NOTICE index 3b0392649529..2b8908af4d3a 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/NOTICE +++ b/distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/NOTICE @@ -23,20 +23,20 @@ Copyright notices related to this dependency can be found in the directory `com. 'polyglot', licensed under the Universal Permissive License, Version 1.0, is distributed with the Base. The license file can be found at `licenses/Universal_Permissive_License__Version_1.0`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.polyglot.polyglot-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.polyglot.polyglot-23.1.2`. 'collections', licensed under the Universal Permissive License, Version 1.0, is distributed with the Base. The license file can be found at `licenses/Universal_Permissive_License__Version_1.0`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.sdk.collections-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.sdk.collections-23.1.2`. 'nativeimage', licensed under the Universal Permissive License, Version 1.0, is distributed with the Base. The license file can be found at `licenses/Universal_Permissive_License__Version_1.0`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.sdk.nativeimage-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.sdk.nativeimage-23.1.2`. 'word', licensed under the Universal Permissive License, Version 1.0, is distributed with the Base. The license file can be found at `licenses/Universal_Permissive_License__Version_1.0`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.sdk.word-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.sdk.word-23.1.2`. diff --git a/distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/org.graalvm.polyglot.polyglot-23.1.2/NOTICES b/distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/org.graalvm.polyglot.polyglot-23.1.2/NOTICES new file mode 100644 index 000000000000..13ed7577befa --- /dev/null +++ b/distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/org.graalvm.polyglot.polyglot-23.1.2/NOTICES @@ -0,0 +1,5 @@ +Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. + +The above copyright notice and either this complete permission notice or at a + +copyright rights in the Software, and any and all patent rights owned or diff --git a/distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/org.graalvm.sdk.collections-23.1.2/NOTICES b/distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/org.graalvm.sdk.collections-23.1.2/NOTICES new file mode 100644 index 000000000000..4e1daf3209ba --- /dev/null +++ b/distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/org.graalvm.sdk.collections-23.1.2/NOTICES @@ -0,0 +1,7 @@ +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + +Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. + +The above copyright notice and either this complete permission notice or at a + +copyright rights in the Software, and any and all patent rights owned or diff --git a/distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/org.graalvm.sdk.nativeimage-23.1.2/NOTICES b/distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/org.graalvm.sdk.nativeimage-23.1.2/NOTICES new file mode 100644 index 000000000000..0bcf5ca20516 --- /dev/null +++ b/distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/org.graalvm.sdk.nativeimage-23.1.2/NOTICES @@ -0,0 +1,7 @@ +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + +Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved. + +The above copyright notice and either this complete permission notice or at a + +copyright rights in the Software, and any and all patent rights owned or diff --git a/distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/org.graalvm.sdk.word-23.1.2/NOTICES b/distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/org.graalvm.sdk.word-23.1.2/NOTICES new file mode 100644 index 000000000000..01e45ab0bed6 --- /dev/null +++ b/distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/org.graalvm.sdk.word-23.1.2/NOTICES @@ -0,0 +1,7 @@ +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + +DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + +The above copyright notice and either this complete permission notice or at a + +copyright rights in the Software, and any and all patent rights owned or diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Enso_Cloud/Enso_File.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Enso_Cloud/Enso_File.enso index feab8edfa96b..0d7939be1421 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Enso_Cloud/Enso_File.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Enso_Cloud/Enso_File.enso @@ -20,12 +20,15 @@ import project.Network.HTTP.HTTP import project.Network.HTTP.HTTP_Method.HTTP_Method import project.Network.HTTP.Request_Body.Request_Body import project.Nothing.Nothing +import project.Runtime.Context import project.System.File.File_Access.File_Access +import project.System.File.Generic.Writable_File.Writable_File import project.System.File_Format_Metadata.File_Format_Metadata import project.System.Input_Stream.Input_Stream import project.System.Output_Stream.Output_Stream from project.Data.Boolean import Boolean, False, True from project.Data.Text.Extensions import all +from project.System.File.Generic.File_Write_Strategy import generic_copy from project.System.File_Format import Auto_Detect, Bytes, File_Format, Plain_Text_Format type Enso_File @@ -253,7 +256,37 @@ type Enso_File uri = if self.is_directory then Utils.directory_api + "/" + self.id else self.internal_uri auth_header = Utils.authorization_header response = HTTP.post uri Request_Body.Empty HTTP_Method.Delete [auth_header] - response.if_not_error <| Nothing + response.if_not_error Nothing + + ## Deletes the file if it had existed. + delete_if_exists : Nothing + delete_if_exists self = + r = self.delete + r.catch File_Error err-> case err of + File_Error.Not_Found _ -> Nothing + _ -> r + + ## Copies the file to the specified destination. + + Arguments: + - destination: the destination to move the file to. + - replace_existing: specifies if the operation should proceed if the + destination file already exists. Defaults to `False`. + copy_to : Writable_File -> Boolean -> Any ! File_Error + copy_to self (destination : Writable_File) (replace_existing : Boolean = False) = + generic_copy self destination.file replace_existing + + ## Moves the file to the specified destination. + + Arguments: + - destination: the destination to move the file to. + - replace_existing: specifies if the operation should proceed if the + destination file already exists. Defaults to `False`. + move_to : Writable_File -> Boolean -> Nothing ! File_Error + move_to self (destination : Writable_File) (replace_existing : Boolean = False) = + _ = [destination, replace_existing] + Context.Output.if_enabled disabled_message="File moving is forbidden as the Output context is disabled." panic=False <| + Unimplemented.throw "Enso_File.move_to is not implemented" ## UNSTABLE GROUP Operators diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Enso_Cloud/Enso_Secret.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Enso_Cloud/Enso_Secret.enso index 1a010f46fd23..82154e2d4612 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Enso_Cloud/Enso_Secret.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Data/Enso_Cloud/Enso_Secret.enso @@ -6,7 +6,6 @@ import project.Data.Json.JS_Object import project.Data.Text.Text import project.Data.Vector.Vector import project.Error.Error -import project.Errors.Common.Forbidden_Operation import project.Errors.Common.Not_Found import project.Errors.Illegal_Argument.Illegal_Argument import project.Network.HTTP.HTTP @@ -35,7 +34,7 @@ type Enso_Secret created in the current working directory. create : Text -> Text -> Enso_File | Nothing -> Enso_Secret create name:Text value:Text parent:(Enso_File | Nothing)=Nothing = if name == "" then Error.throw (Illegal_Argument.Error "Secret name cannot be empty") else - if Context.Output.is_enabled.not then Error.throw (Forbidden_Operation.Error "Creating a secret is forbidden as the Output context is disabled.") else + Context.Output.if_enabled disabled_message="Creating a secret is forbidden as the Output context is disabled." panic=False <| if name.starts_with "connection-" then Error.throw (Illegal_Argument.Error "Secret name cannot start with 'connection-'") else if Enso_Secret.exists name parent then Error.throw (Illegal_Argument.Error "Secret with this name already exists.") else auth_header = Utils.authorization_header @@ -50,7 +49,7 @@ type Enso_Secret Deletes a secret. delete : Enso_Secret delete self = - if Context.Output.is_enabled.not then Error.throw (Forbidden_Operation.Error "Deleting a secret is forbidden as the Output context is disabled.") else + Context.Output.if_enabled disabled_message="Deleting a secret is forbidden as the Output context is disabled." panic=False <| auth_header = Utils.authorization_header uri = Utils.secrets_api + "/" + self.id response = HTTP.post uri Request_Body.Empty HTTP_Method.Delete [auth_header] @@ -101,7 +100,7 @@ type Enso_Secret - new_value: The new value of the secret update_value : Text -> Enso_Secret update_value self (new_value : Text) = - if Context.Output.is_enabled.not then Error.throw (Forbidden_Operation.Error "Updating a secret is forbidden as the Output context is disabled.") else + Context.Output.if_enabled disabled_message="Updating a secret is forbidden as the Output context is disabled." panic=False <| auth_header = Utils.authorization_header ## TODO I'd rather not have this obfuscated path in Enso code (well it's clearly visible in Java code anyway, so no real harm), diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Errors/Common.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Errors/Common.enso index a5617b5b167b..bec9bfa799d5 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Errors/Common.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Errors/Common.enso @@ -380,16 +380,17 @@ type No_Conversion_Currying @Builtin_Type type Forbidden_Operation ## PRIVATE - An error that occurs when the action is not allowed to perform the operation in the given context. + An error that occurs when the action is not allowed to perform the + operation in the given context. Arguments: - - operation: attempted context that is not allowed. - Error operation + - message: message describing the operation that was not allowed. + Error message ## PRIVATE Convert the Forbidden_Operation error to a human-readable format. to_display_text : Text - to_display_text self = "Forbidden operation: "+self.operation+"." + to_display_text self = "Forbidden operation: "+self.message type Dry_Run_Operation ## PRIVATE diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Errors/File_Error.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Errors/File_Error.enso index f4623dafeb63..18082551b390 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Errors/File_Error.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Errors/File_Error.enso @@ -12,6 +12,7 @@ import project.System.File_Format_Metadata.File_Format_Metadata polyglot java import java.io.FileNotFoundException polyglot java import java.io.IOException +polyglot java import java.io.UncheckedIOException polyglot java import java.nio.file.AccessDeniedException polyglot java import java.nio.file.FileAlreadyExistsException polyglot java import java.nio.file.NoSuchFileException @@ -71,8 +72,13 @@ type File_Error Utility method for running an action with Java exceptions mapping. handle_java_exceptions (file : File | Nothing) ~action = - Panic.catch IOException action caught_panic-> + handle_io_exception caught_panic = File_Error.wrap_io_exception file caught_panic.payload + handle_unchecked_io_exception caught_panic = + File_Error.wrap_io_exception file caught_panic.payload.getCause + Panic.catch IOException handler=handle_io_exception <| + Panic.catch UncheckedIOException handler=handle_unchecked_io_exception <| + action ## PRIVATE Raises an error indicating that the user does not have permission to diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/Runtime.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/Runtime.enso index 24d3d78b9827..f4d15615ca7a 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/Runtime.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/Runtime.enso @@ -1,9 +1,9 @@ import project.Any.Any import project.Data.Array.Array -import project.Data.Boolean.Boolean import project.Data.Text.Case.Case import project.Data.Text.Text import project.Data.Vector.Vector +import project.Error.Error import project.Errors.Common.Assertion_Error import project.Errors.Common.Forbidden_Operation import project.Errors.Common.Type_Error @@ -14,6 +14,7 @@ import project.Panic.Panic import project.Polyglot.Polyglot import project.Runtime.Source_Location.Source_Location import project.System +from project.Data.Boolean import Boolean, False, True from project.Data.Index_Sub_Range.Index_Sub_Range import First, Last from project.Data.Text.Extensions import all from project.Runtime.Context import Input, Output @@ -168,12 +169,20 @@ type Context function and returns the result. If not, panics. Arguments: - - environment: Name of the execution environment. - - context: The context to enable. - action: Action to be performed with the context enabled. - if_enabled : Function -> Text -> Any - if_enabled self ~action environment=Runtime.current_execution_environment = - if self.is_enabled environment then action else Panic.throw (Forbidden_Operation.Error self.name) + - environment: Name of the execution environment. + - disabled_message: Message to be used in the error if the context is + disabled. + - panic: If set to `True`, the error is raised as a Panic. + Otherwise, it is a dataflow error. + A dataflow error may be lost if the result of the action is not used, + so raising a `Panic` is safer. However, when we know that the result is + not discarded, the dataflow error is preferred. + if_enabled : Any -> Text -> Text -> Boolean -> Any ! Forbidden_Operation + if_enabled self ~action (environment : Text = Runtime.current_execution_environment) (disabled_message : Text = "The "+self.name+" context is disabled.") (panic : Boolean = True) = + if self.is_enabled environment then action else + error = Forbidden_Operation.Error disabled_message + if panic then Panic.throw error else Error.throw error ## PRIVATE ADVANCED diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/System/File.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/System/File.enso index 4206d8c85c39..5b93f30e4f79 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/System/File.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/System/File.enso @@ -12,7 +12,6 @@ import project.Data.Time.Date_Time.Date_Time import project.Data.Vector.Vector import project.Error.Error import project.Errors.Common.Dry_Run_Operation -import project.Errors.Common.Forbidden_Operation import project.Errors.Common.Type_Error import project.Errors.File_Error.File_Error import project.Errors.Illegal_Argument.Illegal_Argument @@ -188,7 +187,7 @@ type File _ -> stream Output_Stream.new wrapped (File_Error.handle_java_exceptions self) - if Context.Output.is_enabled.not then Error.throw (Forbidden_Operation.Error "File writing is forbidden as the Output context is disabled.") else + Context.Output.if_enabled disabled_message="File writing is forbidden as the Output context is disabled." panic=False <| Managed_Resource.bracket (new_output_stream self open_options) (_.close) action ## PRIVATE @@ -489,7 +488,7 @@ type File (Examples.data_dir / "my_directory") . create_directory create_directory : Nothing create_directory self = - if Context.Output.is_enabled.not then Error.throw (Forbidden_Operation.Error "Directory creation is forbidden as the Output context is disabled.") else + Context.Output.if_enabled disabled_message="Directory creation is forbidden as the Output context is disabled." panic=False <| self.create_directory_builtin @@ -627,7 +626,7 @@ type File file.delete delete : Nothing ! File_Error delete self = - if Context.Output.is_enabled.not then Error.throw (Forbidden_Operation.Error "File deleting is forbidden as the Output context is disabled.") else + Context.Output.if_enabled disabled_message="File deleting is forbidden as the Output context is disabled." panic=False <| File_Error.handle_java_exceptions self self.delete_builtin ## Copies the file to the specified destination. @@ -636,14 +635,12 @@ type File - destination: the destination to move the file to. - replace_existing: specifies if the operation should proceed if the destination file already exists. Defaults to `False`. - copy_to : File -> Boolean -> Nothing ! File_Error - copy_to self destination replace_existing=False = - if Context.Output.is_enabled.not then Error.throw (Forbidden_Operation.Error "File copying is forbidden as the Output context is disabled.") else - File_Error.handle_java_exceptions self <| case replace_existing of - True -> - copy_options = [StandardCopyOption.REPLACE_EXISTING] - self.copy_builtin destination copy_options - False -> self.copy_builtin destination [] + copy_to : Writable_File -> Boolean -> Nothing ! File_Error + copy_to self (destination : Writable_File) (replace_existing : Boolean = False) = + Context.Output.if_enabled disabled_message="File copying is forbidden as the Output context is disabled." panic=False <| + case destination.file of + _ : File -> local_file_copy self destination.file replace_existing + _ -> destination.copy_from_local self replace_existing ## Moves the file to the specified destination. @@ -651,14 +648,15 @@ type File - destination: the destination to move the file to. - replace_existing: specifies if the operation should proceed if the destination file already exists. Defaults to `False`. - move_to : File -> Boolean -> Nothing ! File_Error - move_to self destination replace_existing=False = - if Context.Output.is_enabled.not then Error.throw (Forbidden_Operation.Error "File moving is forbidden as the Output context is disabled.") else - File_Error.handle_java_exceptions self <| case replace_existing of - True -> - copy_options = [StandardCopyOption.REPLACE_EXISTING] - self.move_builtin destination copy_options - False -> self.move_builtin destination [] + move_to : Writable_File -> Boolean -> Nothing ! File_Error + move_to self (destination : Writable_File) (replace_existing : Boolean = False) = + Context.Output.if_enabled disabled_message="File moving is forbidden as the Output context is disabled." panic=False <| + case destination.file of + _ : File -> local_file_move self destination.file replace_existing + _ -> + r = destination.copy_from_local self replace_existing + r.if_not_error <| + self.delete . if_not_error r ## Deletes the file if it exists on disk. @@ -843,3 +841,17 @@ File_Like.from (that : File) = File_Like.Value that ## PRIVATE Writable_File.from (that : File) = Writable_File.Value that.absolute.normalize Local_File_Write_Strategy.instance + +## PRIVATE +local_file_copy : File -> File -> Boolean -> Nothing ! File_Error +local_file_copy source destination replace_existing = + File_Error.handle_java_exceptions source <| + copy_options = if replace_existing then [StandardCopyOption.REPLACE_EXISTING] else [] + source.copy_builtin destination copy_options + +## PRIVATE +local_file_move : File -> File -> Boolean -> Nothing ! File_Error +local_file_move source destination replace_existing = + File_Error.handle_java_exceptions source <| + copy_options = if replace_existing then [StandardCopyOption.REPLACE_EXISTING] else [] + source.move_builtin destination copy_options diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/System/File/Generic/File_Like.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/System/File/Generic/File_Like.enso index 3b9be6932b89..2bec67c7d405 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/System/File/Generic/File_Like.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/System/File/Generic/File_Like.enso @@ -1,4 +1,5 @@ import project.Data.Text.Text +import project.System.File.File ## PRIVATE A generic interface for file-like objects. @@ -19,3 +20,6 @@ type File_Like ## PRIVATE to_display_text self -> Text = self.underlying.to_display_text + +## PRIVATE +File_Like.from (that : Text) = File_Like.from (File.new that) diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/System/File/Generic/File_Write_Strategy.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/System/File/Generic/File_Write_Strategy.enso index 07a9382516a9..6e487ae1ac6f 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/System/File/Generic/File_Write_Strategy.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/System/File/Generic/File_Write_Strategy.enso @@ -1,5 +1,4 @@ import project.Error.Error -import project.Errors.Common.Forbidden_Operation import project.Errors.File_Error.File_Error import project.Panic.Panic import project.Runtime.Context @@ -31,7 +30,12 @@ type File_Write_Strategy A remote file is downloaded to a temporary file and the provided action is called with that local temporary file. Then that file is uploaded to replace the remote file. - Value write_overwriting write_appending write_raising_error write_backing_up create_dry_run_file write_with_local_file + + The `copy_from_local` action creates the file on a given backend from a + local file. It can be used to implement more efficient upload strategies + than ones based on just writing to an output stream. + The default `generic_copy` implementation can always be used here. + Value write_overwriting write_appending write_raising_error write_backing_up create_dry_run_file write_with_local_file copy_from_local ## PRIVATE Writes to a file according to the provided existing file behaviour. @@ -74,7 +78,7 @@ default_raise_error file action = ## PRIVATE generic_remote_write_with_local_file (file : Writable_File) existing_file_behavior action = - if Context.Output.is_enabled.not then Error.throw (Forbidden_Operation.Error "Writing to remote file backends is not allowed in dry-run mode.") else + Context.Output.if_enabled disabled_message="Writing to remote file backends is not allowed in dry-run mode." panic=False <| temp_file = File.create_temporary_file prefix="remote-write-" Panic.with_finalizer temp_file.delete <| tmp_synchronized = case file.exists of @@ -128,3 +132,12 @@ dry_run_behavior file behavior:Existing_File_Behavior -> Dry_Run_File_Settings = Dry_Run_File_Settings.Value Existing_File_Behavior.Overwrite copy_original=False Existing_File_Behavior.Append -> Dry_Run_File_Settings.Value Existing_File_Behavior.Append copy_original=True + +## PRIVATE + Generic `copy` implementation between two backends. + The files only need to support `with_input_stream` and `with_output_stream`. +generic_copy source destination replace_existing = + source.with_input_stream [File_Access.Read] input_stream-> + options = if replace_existing then [File_Access.Write, File_Access.Create, File_Access.Truncate_Existing] else [File_Access.Write, File_Access.Create_New] + destination.with_output_stream options output_stream-> + output_stream.write_stream input_stream . if_not_error destination diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/System/File/Generic/Writable_File.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/System/File/Generic/Writable_File.enso index 4a007baca782..2d91bf88048d 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/System/File/Generic/Writable_File.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/System/File/Generic/Writable_File.enso @@ -54,6 +54,13 @@ type Writable_File write_requiring_local_file self (existing_file_behavior : Existing_File_Behavior) (action : File -> Any) -> Any = self.write_strategy.write_with_local_file self.file existing_file_behavior action + ## PRIVATE + Writes a local file to this `Writable_File` destination. + This is used by `File.copy_to` and `File.move_to` to possibly implement + the upload more efficiently (avoiding duplicated temporary files). + copy_from_local self (source : File) (replace_existing : Boolean) = + self.write_strategy.copy_from_local source self.file replace_existing + ## PRIVATE with_output_stream self (open_options : Vector) action = self.file.with_output_stream open_options action @@ -69,10 +76,7 @@ type Writable_File to_display_text self -> Text = self.file.to_display_text ## PRIVATE -Writable_File.from (that : Text) = - ## Currently this only works for local filesystem paths - TODO We should extend it to also support custom paths like S3, through a ServiceProvider solution - Writable_File.from (File.new that) +Writable_File.from (that : Text) = Writable_File.from (File.new that) ## PRIVATE If a conversion to `File_Format_Metadata` is needed, we delegate to the underlying file. diff --git a/distribution/lib/Standard/Base/0.0.0-dev/src/System/File/Local_File_Write_Strategy.enso b/distribution/lib/Standard/Base/0.0.0-dev/src/System/File/Local_File_Write_Strategy.enso index 690ee4dc5806..f9c7c450cc8c 100644 --- a/distribution/lib/Standard/Base/0.0.0-dev/src/System/File/Local_File_Write_Strategy.enso +++ b/distribution/lib/Standard/Base/0.0.0-dev/src/System/File/Local_File_Write_Strategy.enso @@ -6,6 +6,7 @@ import project.Errors.Illegal_State.Illegal_State import project.Nothing.Nothing import project.Panic.Caught_Panic import project.Panic.Panic +import project.System.File.File import project.System.File.File_Access.File_Access import project.System.Output_Stream.Output_Stream from project.Data.Boolean import Boolean, False, True @@ -13,12 +14,15 @@ from project.System.File.Generic.File_Write_Strategy import File_Write_Strategy, ## PRIVATE instance = - File_Write_Strategy.Value default_overwrite default_append default_raise_error moving_backup create_dry_run_file write_with_local_file + File_Write_Strategy.Value default_overwrite default_append default_raise_error moving_backup create_dry_run_file write_with_local_file copy_local_from_local ## PRIVATE create_dry_run_file file copy_original = file.create_dry_run_file copy_original +## PRIVATE +copy_local_from_local (source : File) (destination : File) = source.copy_to destination + ## PRIVATE A `Backup` strategy that does the following: 1. If the file does not exist, we write to it. diff --git a/distribution/lib/Standard/Database/0.0.0-dev/src/Connection/Connection.enso b/distribution/lib/Standard/Database/0.0.0-dev/src/Connection/Connection.enso index a6d93156334d..ae7ef6eb74d2 100644 --- a/distribution/lib/Standard/Database/0.0.0-dev/src/Connection/Connection.enso +++ b/distribution/lib/Standard/Database/0.0.0-dev/src/Connection/Connection.enso @@ -1,6 +1,5 @@ from Standard.Base import all import Standard.Base.Errors.Common.Dry_Run_Operation -import Standard.Base.Errors.Common.Forbidden_Operation import Standard.Base.Errors.Illegal_Argument.Illegal_Argument import Standard.Base.Metadata.Display import Standard.Base.Metadata.Widget @@ -356,7 +355,7 @@ type Connection representing the query to execute. execute_update : Text | SQL_Statement -> Integer execute_update self query = - if Execution_Context.Output.is_enabled.not then Error.throw (Forbidden_Operation.Error "Executing update queries is forbidden as the Output context is disabled.") else + Execution_Context.Output.if_enabled disabled_message="Executing update queries is forbidden as the Output context is disabled." panic=False <| statement_setter = self.dialect.get_statement_setter self.jdbc_connection.with_prepared_statement query statement_setter stmt-> result = case self.supports_large_update.get of diff --git a/distribution/lib/Standard/Database/0.0.0-dev/src/Internal/Upload_Table.enso b/distribution/lib/Standard/Database/0.0.0-dev/src/Internal/Upload_Table.enso index 38fae6f292bd..307153dcf4a5 100644 --- a/distribution/lib/Standard/Database/0.0.0-dev/src/Internal/Upload_Table.enso +++ b/distribution/lib/Standard/Database/0.0.0-dev/src/Internal/Upload_Table.enso @@ -1,7 +1,6 @@ from Standard.Base import all import Standard.Base.Data.Vector.No_Wrap import Standard.Base.Errors.Common.Dry_Run_Operation -import Standard.Base.Errors.Common.Forbidden_Operation import Standard.Base.Errors.Illegal_Argument.Illegal_Argument import Standard.Base.Errors.Illegal_State.Illegal_State import Standard.Base.Runtime.Context diff --git a/distribution/lib/Standard/Image/0.0.0-dev/src/Data/Image.enso b/distribution/lib/Standard/Image/0.0.0-dev/src/Data/Image.enso index 19a9241ed73d..acb1eb78dcfc 100644 --- a/distribution/lib/Standard/Image/0.0.0-dev/src/Data/Image.enso +++ b/distribution/lib/Standard/Image/0.0.0-dev/src/Data/Image.enso @@ -1,5 +1,4 @@ from Standard.Base import all -import Standard.Base.Errors.Common.Forbidden_Operation import Standard.Base.Errors.File_Error.File_Error import Standard.Base.Runtime.Context import Standard.Base.System.File.Generic.Writable_File.Writable_File @@ -98,7 +97,7 @@ type Image image.write path image [Write_Flag.JPEG_Quality 40, Write_Flag.JPEG_Progressive] write : Writable_File -> (Write_Flag | Vector) -> Nothing ! File_Error write self location:Writable_File flags=[] = - if Context.Output.is_enabled.not then Error.throw (Forbidden_Operation.Error "Writing the image to a file is forbidden as the Output context is disabled.") else + Context.Output.if_enabled disabled_message="Writing the image to a file is forbidden as the Output context is disabled." panic=False <| write_flags = case flags of _ : Vector -> flags _ -> [flags] diff --git a/distribution/project-manager/THIRD-PARTY/NOTICE b/distribution/project-manager/THIRD-PARTY/NOTICE index baebff70cde4..bfaf09ee6ccd 100644 --- a/distribution/project-manager/THIRD-PARTY/NOTICE +++ b/distribution/project-manager/THIRD-PARTY/NOTICE @@ -248,27 +248,27 @@ Copyright notices related to this dependency can be found in the directory `org. 'polyglot', licensed under the Universal Permissive License, Version 1.0, is distributed with the project-manager. The license file can be found at `licenses/Universal_Permissive_License__Version_1.0`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.polyglot.polyglot-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.polyglot.polyglot-23.1.2`. 'collections', licensed under the Universal Permissive License, Version 1.0, is distributed with the project-manager. The license file can be found at `licenses/Universal_Permissive_License__Version_1.0`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.sdk.collections-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.sdk.collections-23.1.2`. 'nativeimage', licensed under the Universal Permissive License, Version 1.0, is distributed with the project-manager. The license file can be found at `licenses/Universal_Permissive_License__Version_1.0`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.sdk.nativeimage-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.sdk.nativeimage-23.1.2`. 'word', licensed under the Universal Permissive License, Version 1.0, is distributed with the project-manager. The license file can be found at `licenses/Universal_Permissive_License__Version_1.0`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.sdk.word-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.sdk.word-23.1.2`. 'truffle-api', licensed under the Universal Permissive License, Version 1.0, is distributed with the project-manager. The license file can be found at `licenses/Universal_Permissive_License__Version_1.0`. -Copyright notices related to this dependency can be found in the directory `org.graalvm.truffle.truffle-api-23.1.0`. +Copyright notices related to this dependency can be found in the directory `org.graalvm.truffle.truffle-api-23.1.2`. 'reactive-streams', licensed under the CC0, is distributed with the project-manager. diff --git a/distribution/project-manager/THIRD-PARTY/org.graalvm.polyglot.polyglot-23.1.0/NOTICES b/distribution/project-manager/THIRD-PARTY/org.graalvm.polyglot.polyglot-23.1.0/NOTICES deleted file mode 100644 index a6b2e1fc0d0b..000000000000 --- a/distribution/project-manager/THIRD-PARTY/org.graalvm.polyglot.polyglot-23.1.0/NOTICES +++ /dev/null @@ -1,5 +0,0 @@ -Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. - -Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. - -DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. diff --git a/distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/org.graalvm.polyglot.polyglot-23.1.0/NOTICES b/distribution/project-manager/THIRD-PARTY/org.graalvm.polyglot.polyglot-23.1.2/NOTICES similarity index 100% rename from distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/org.graalvm.polyglot.polyglot-23.1.0/NOTICES rename to distribution/project-manager/THIRD-PARTY/org.graalvm.polyglot.polyglot-23.1.2/NOTICES diff --git a/distribution/project-manager/THIRD-PARTY/org.graalvm.sdk.collections-23.1.0/NOTICES b/distribution/project-manager/THIRD-PARTY/org.graalvm.sdk.collections-23.1.0/NOTICES deleted file mode 100644 index b1d39d405064..000000000000 --- a/distribution/project-manager/THIRD-PARTY/org.graalvm.sdk.collections-23.1.0/NOTICES +++ /dev/null @@ -1,5 +0,0 @@ -Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. - -Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. - -DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. diff --git a/distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/org.graalvm.sdk.collections-23.1.0/NOTICES b/distribution/project-manager/THIRD-PARTY/org.graalvm.sdk.collections-23.1.2/NOTICES similarity index 100% rename from distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/org.graalvm.sdk.collections-23.1.0/NOTICES rename to distribution/project-manager/THIRD-PARTY/org.graalvm.sdk.collections-23.1.2/NOTICES diff --git a/distribution/project-manager/THIRD-PARTY/org.graalvm.sdk.nativeimage-23.1.0/NOTICES b/distribution/project-manager/THIRD-PARTY/org.graalvm.sdk.nativeimage-23.1.0/NOTICES deleted file mode 100644 index b2f56cdae464..000000000000 --- a/distribution/project-manager/THIRD-PARTY/org.graalvm.sdk.nativeimage-23.1.0/NOTICES +++ /dev/null @@ -1,3 +0,0 @@ -Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved. - -Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. diff --git a/distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/org.graalvm.sdk.nativeimage-23.1.0/NOTICES b/distribution/project-manager/THIRD-PARTY/org.graalvm.sdk.nativeimage-23.1.2/NOTICES similarity index 100% rename from distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/org.graalvm.sdk.nativeimage-23.1.0/NOTICES rename to distribution/project-manager/THIRD-PARTY/org.graalvm.sdk.nativeimage-23.1.2/NOTICES diff --git a/distribution/project-manager/THIRD-PARTY/org.graalvm.sdk.word-23.1.0/NOTICES b/distribution/project-manager/THIRD-PARTY/org.graalvm.sdk.word-23.1.0/NOTICES deleted file mode 100644 index 4cfb61c1c481..000000000000 --- a/distribution/project-manager/THIRD-PARTY/org.graalvm.sdk.word-23.1.0/NOTICES +++ /dev/null @@ -1,3 +0,0 @@ -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - -Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved. diff --git a/distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/org.graalvm.sdk.word-23.1.0/NOTICES b/distribution/project-manager/THIRD-PARTY/org.graalvm.sdk.word-23.1.2/NOTICES similarity index 100% rename from distribution/lib/Standard/Base/0.0.0-dev/THIRD-PARTY/org.graalvm.sdk.word-23.1.0/NOTICES rename to distribution/project-manager/THIRD-PARTY/org.graalvm.sdk.word-23.1.2/NOTICES diff --git a/distribution/project-manager/THIRD-PARTY/org.graalvm.truffle.truffle-api-23.1.0/NOTICES b/distribution/project-manager/THIRD-PARTY/org.graalvm.truffle.truffle-api-23.1.2/NOTICES similarity index 100% rename from distribution/project-manager/THIRD-PARTY/org.graalvm.truffle.truffle-api-23.1.0/NOTICES rename to distribution/project-manager/THIRD-PARTY/org.graalvm.truffle.truffle-api-23.1.2/NOTICES diff --git a/docs/runtime/ir-caching.md b/docs/runtime/ir-caching.md index 152cdbe6ba80..b4a8a6c07e59 100644 --- a/docs/runtime/ir-caching.md +++ b/docs/runtime/ir-caching.md @@ -171,6 +171,10 @@ Every `Persistance` class has a unique identifier. In order to keep definitions consistent one should not attempt to use smaller `id`s than previously assigned. One should also not delete any `Persistance` classes. +Additionally, `PerMap.serialVersionUID` version provides a seed to the version +stamp calculated from all `Persistance` classes. Increasing the +`serialVersionUID` will invalidate all caches. + ## Loading the IR Loading the IR is a multi-stage process that involves performing integrity diff --git a/engine/runtime-compiler/src/main/scala/org/enso/compiler/data/BindingsMap.scala b/engine/runtime-compiler/src/main/scala/org/enso/compiler/data/BindingsMap.scala index 1ac006718507..ed8010912e64 100644 --- a/engine/runtime-compiler/src/main/scala/org/enso/compiler/data/BindingsMap.scala +++ b/engine/runtime-compiler/src/main/scala/org/enso/compiler/data/BindingsMap.scala @@ -21,10 +21,6 @@ import scala.annotation.unused * @param definedEntities the list of entities defined in the current module * @param currentModule the module holding these bindings */ - -@SerialVersionUID( - 9057L // Use BindingsMap -) case class BindingsMap( definedEntities: List[DefinedEntity], currentModule: ModuleReference diff --git a/engine/runtime-instrument-common/src/main/java/org/enso/interpreter/instrument/command/ExecuteExpressionCommand.java b/engine/runtime-instrument-common/src/main/java/org/enso/interpreter/instrument/command/ExecuteExpressionCommand.java index cc0996b01b71..632b48c37b33 100644 --- a/engine/runtime-instrument-common/src/main/java/org/enso/interpreter/instrument/command/ExecuteExpressionCommand.java +++ b/engine/runtime-instrument-common/src/main/java/org/enso/interpreter/instrument/command/ExecuteExpressionCommand.java @@ -4,14 +4,13 @@ import org.enso.interpreter.instrument.execution.RuntimeContext; import org.enso.interpreter.instrument.job.ExecuteExpressionJob; import org.enso.interpreter.instrument.job.ExecuteJob; +import org.enso.polyglot.runtime.Runtime$Api$ContextNotExistError; import org.enso.polyglot.runtime.Runtime$Api$VisualizationAttached; import scala.Option; import scala.concurrent.ExecutionContext; -import scala.concurrent.Future; -import scala.runtime.BoxedUnit; /** The command that handles the execute expression request. */ -public final class ExecuteExpressionCommand extends ContextCmd { +public final class ExecuteExpressionCommand extends SynchronousCommand { private final UUID contextId; private final UUID visualizationId; @@ -33,7 +32,7 @@ public ExecuteExpressionCommand( UUID visualizationId, UUID expressionId, String expression) { - super(contextId, maybeRequestId); + super(maybeRequestId); this.contextId = contextId; this.visualizationId = visualizationId; this.expressionId = expressionId; @@ -41,10 +40,15 @@ public ExecuteExpressionCommand( } @Override - public Future executeCmd(RuntimeContext ctx, ExecutionContext ec) { - reply(new Runtime$Api$VisualizationAttached(), ctx); - return ctx.jobProcessor() - .run(new ExecuteExpressionJob(contextId, visualizationId, expressionId, expression)) - .flatMap(executable -> ctx.jobProcessor().run(ExecuteJob.apply(executable)), ec); + public void executeSynchronously(RuntimeContext ctx, ExecutionContext ec) { + if (ctx.contextManager().contains(contextId)) { + reply(new Runtime$Api$VisualizationAttached(), ctx); + ctx.jobControlPlane().abortJobs(contextId); + ctx.jobProcessor() + .run(new ExecuteExpressionJob(contextId, visualizationId, expressionId, expression)) + .flatMap(executable -> ctx.jobProcessor().run(ExecuteJob.apply(executable)), ec); + } else { + reply(new Runtime$Api$ContextNotExistError(contextId), ctx); + } } } diff --git a/engine/runtime-instrument-common/src/main/java/org/enso/interpreter/instrument/job/ExecuteExpressionJob.java b/engine/runtime-instrument-common/src/main/java/org/enso/interpreter/instrument/job/ExecuteExpressionJob.java index 2ef4f30f3582..c86b581b7785 100644 --- a/engine/runtime-instrument-common/src/main/java/org/enso/interpreter/instrument/job/ExecuteExpressionJob.java +++ b/engine/runtime-instrument-common/src/main/java/org/enso/interpreter/instrument/job/ExecuteExpressionJob.java @@ -3,13 +3,13 @@ import com.oracle.truffle.api.TruffleLogger; import java.util.UUID; import java.util.logging.Level; -import org.enso.interpreter.instrument.Visualization; +import org.enso.interpreter.instrument.OneshotExpression; import org.enso.interpreter.instrument.execution.Executable; import org.enso.interpreter.instrument.execution.RuntimeContext; import org.enso.interpreter.util.ScalaConversions; /** The job that schedules the execution of the expression. */ -public class ExecuteExpressionJob extends Job { +public class ExecuteExpressionJob extends Job implements UniqueJob { private final UUID contextId; private final UUID visualizationId; @@ -26,7 +26,7 @@ public class ExecuteExpressionJob extends Job { */ public ExecuteExpressionJob( UUID contextId, UUID visualizationId, UUID expressionId, String expression) { - super(ScalaConversions.cons(contextId, ScalaConversions.nil()), false, false); + super(ScalaConversions.cons(contextId, ScalaConversions.nil()), true, false); this.contextId = contextId; this.visualizationId = visualizationId; this.expressionId = expressionId; @@ -39,9 +39,9 @@ public Executable run(RuntimeContext ctx) { long lockTimestamp = ctx.locking().acquireContextLock(contextId); try { - Visualization visualization = - new Visualization.OneshotExpression(visualizationId, expressionId, contextId, expression); - ctx.contextManager().upsertVisualization(contextId, visualization); + OneshotExpression oneshotExpression = + new OneshotExpression(visualizationId, expressionId, contextId, expression); + ctx.contextManager().setOneshotExpression(contextId, oneshotExpression); var stack = ctx.contextManager().getStack(contextId); return new Executable(contextId, stack); @@ -55,4 +55,9 @@ public Executable run(RuntimeContext ctx) { }); } } + + @Override + public boolean equalsTo(UniqueJob that) { + return that instanceof ExecuteExpressionJob; + } } diff --git a/engine/runtime-instrument-common/src/main/java/org/enso/interpreter/service/ExecutionCallbacks.java b/engine/runtime-instrument-common/src/main/java/org/enso/interpreter/service/ExecutionCallbacks.java index ccec934ea0bc..a5db5144f24e 100644 --- a/engine/runtime-instrument-common/src/main/java/org/enso/interpreter/service/ExecutionCallbacks.java +++ b/engine/runtime-instrument-common/src/main/java/org/enso/interpreter/service/ExecutionCallbacks.java @@ -6,9 +6,9 @@ import java.util.UUID; import java.util.function.Consumer; import org.enso.interpreter.instrument.MethodCallsCache; +import org.enso.interpreter.instrument.OneshotExpression; import org.enso.interpreter.instrument.RuntimeCache; import org.enso.interpreter.instrument.UpdatesSynchronizationState; -import org.enso.interpreter.instrument.Visualization; import org.enso.interpreter.instrument.VisualizationHolder; import org.enso.interpreter.instrument.profiling.ExecutionTime; import org.enso.interpreter.instrument.profiling.ProfilingInfo; @@ -22,7 +22,6 @@ import org.enso.interpreter.service.ExecutionService.FunctionCallInfo; import org.enso.polyglot.debugger.ExecutedVisualization; import org.enso.polyglot.debugger.IdExecutionService; -import scala.collection.Iterator; final class ExecutionCallbacks implements IdExecutionService.Callbacks { @@ -164,24 +163,21 @@ private void callOnCachedCallback(UUID nodeId, Object result) { } private void executeOneshotExpressions(UUID nodeId, Object result, IdExecutionService.Info info) { - Iterator visualizations = findVisualizations(nodeId); - while (visualizations.hasNext()) { - Visualization visualization = visualizations.next(); - - if (visualization instanceof Visualization.OneshotExpression oneshotExpression) { - Object visualizationResult = null; - Throwable visualizationError = null; - try { - visualizationResult = info.eval(oneshotExpression.expression()); - } catch (Exception exception) { - visualizationError = exception; - } - - ExecutedVisualization executedVisualization = - new ExecutedVisualization( - visualizationResult, visualizationError, visualization.id(), nodeId, result); - callOnExecutedVisualizationCallback(executedVisualization); + OneshotExpression oneshotExpression = getOneshotExpression(nodeId); + + if (oneshotExpression != null) { + Object visualizationResult = null; + Throwable visualizationError = null; + try { + visualizationResult = info.eval(oneshotExpression.expression()); + } catch (Exception exception) { + visualizationError = exception; } + + ExecutedVisualization executedVisualization = + new ExecutedVisualization( + visualizationResult, visualizationError, oneshotExpression.id(), nodeId, result); + callOnExecutedVisualizationCallback(executedVisualization); } } @@ -196,8 +192,8 @@ private Object getCachedResult(UUID nodeId) { } @CompilerDirectives.TruffleBoundary - private Iterator findVisualizations(UUID nodeId) { - return visualizationHolder.find(nodeId).iterator(); + private OneshotExpression getOneshotExpression(UUID nodeId) { + return visualizationHolder.getOneshotExpression(nodeId); } @CompilerDirectives.TruffleBoundary diff --git a/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/CacheInvalidation.scala b/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/CacheInvalidation.scala index 8c501ddfbba0..8b209a7ebab3 100644 --- a/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/CacheInvalidation.scala +++ b/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/CacheInvalidation.scala @@ -153,9 +153,8 @@ object CacheInvalidation { command: Command, indexes: Set[IndexSelector] = Set() ): Unit = - visualizations.collect { - case visualization: Visualization.AttachedVisualization => - run(visualization.cache, command, indexes) + visualizations.foreach { visualization => + run(visualization.cache, command, indexes) } /** Run a cache invalidation instruction on an execution stack. diff --git a/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/ExecutionContextManager.scala b/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/ExecutionContextManager.scala index ca10d4d142ea..e56a7a2b4d01 100644 --- a/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/ExecutionContextManager.scala +++ b/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/ExecutionContextManager.scala @@ -90,6 +90,20 @@ class ExecutionContextManager { contexts.contains(contextId) } + /** Set oneshot expression for the specified context. + * + * @param contextId the identifier of the execution context + * @param oneshotExpression the oneshot visualization + */ + def setOneshotExpression( + contextId: ContextId, + oneshotExpression: OneshotExpression + ): Unit = + synchronized { + val state = contexts(contextId) + state.visualizations.setOneshotExpression(oneshotExpression) + } + /** Upserts a visualization for the specified context. * * @param contextId the identifier of the execution context diff --git a/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/Visualization.scala b/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/Visualization.scala index d1c31dfc3169..74ae1a70fe53 100644 --- a/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/Visualization.scala +++ b/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/Visualization.scala @@ -8,41 +8,34 @@ import org.enso.polyglot.runtime.Runtime.Api.{ VisualizationId } -sealed trait Visualization { - def id: VisualizationId - def expressionId: ExpressionId -} -object Visualization { - - /** An object containing visualization data. - * - * @param id the unique identifier of visualization - * @param expressionId the identifier of expression that the visualization is - * attached to - * @param callback the callable expression used to generate visualization data - */ - case class AttachedVisualization( - id: VisualizationId, - expressionId: ExpressionId, - cache: RuntimeCache, - module: Module, - config: VisualizationConfiguration, - visualizationExpressionId: Option[ExpressionId], - callback: AnyRef, - arguments: Vector[AnyRef] - ) extends Visualization +/** An object containing visualization data. + * + * @param id the unique identifier of visualization + * @param expressionId the identifier of expression that the visualization is + * attached to + * @param callback the callable expression used to generate visualization data + */ +case class Visualization( + id: VisualizationId, + expressionId: ExpressionId, + cache: RuntimeCache, + module: Module, + config: VisualizationConfiguration, + visualizationExpressionId: Option[ExpressionId], + callback: AnyRef, + arguments: Vector[AnyRef] +) - /** An expression that will be executed in the local scope. - * - * @param id the unique identifier of visualization - * @param expressionId the identifier of expression that provides the execution scope - * @param executionContextId the identifier of the execution context - * @param expression the expression to execute - */ - case class OneshotExpression( - id: VisualizationId, - expressionId: ExpressionId, - executionContextId: ContextId, - expression: String - ) extends Visualization -} +/** An expression that will be executed in the local scope. + * + * @param id the unique identifier of visualization + * @param expressionId the identifier of expression that provides the execution scope + * @param executionContextId the identifier of the execution context + * @param expression the expression to execute + */ +case class OneshotExpression( + id: VisualizationId, + expressionId: ExpressionId, + executionContextId: ContextId, + expression: String +) diff --git a/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/VisualizationHolder.scala b/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/VisualizationHolder.scala index 60ea14868f42..01065ee58802 100644 --- a/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/VisualizationHolder.scala +++ b/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/VisualizationHolder.scala @@ -9,6 +9,8 @@ import scala.collection.mutable */ class VisualizationHolder { + private var oneshotExpression: OneshotExpression = _ + private val visualizationMap: mutable.Map[ExpressionId, List[Visualization]] = mutable.Map.empty.withDefaultValue(List.empty) @@ -52,9 +54,9 @@ class VisualizationHolder { */ def findByModule( module: QualifiedName - ): Iterable[Visualization.AttachedVisualization] = + ): Iterable[Visualization] = visualizationMap.values.flatten.collect { - case visualization: Visualization.AttachedVisualization + case visualization: Visualization if visualization.module.getName == module => visualization } @@ -70,6 +72,24 @@ class VisualizationHolder { /** @return all available visualizations. */ def getAll: Iterable[Visualization] = visualizationMap.values.flatten + + /** @return the oneshot expression attached to the `expressionId`. */ + def getOneshotExpression( + expressionId: ExpressionId + ): OneshotExpression = { + if ( + oneshotExpression != null && oneshotExpression.expressionId == expressionId + ) { + return oneshotExpression + } + + null + } + + /** Set oneshot expression for execution. */ + def setOneshotExpression(oneshotExpression: OneshotExpression): Unit = { + this.oneshotExpression = oneshotExpression + } } object VisualizationHolder { diff --git a/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/job/EnsureCompiledJob.scala b/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/job/EnsureCompiledJob.scala index a36e2c5b995b..4613e58be57d 100644 --- a/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/job/EnsureCompiledJob.scala +++ b/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/job/EnsureCompiledJob.scala @@ -532,14 +532,10 @@ final class EnsureCompiledJob( private def getCacheMetadata( visualization: Visualization - ): Option[CachePreferenceAnalysis.Metadata] = - visualization match { - case visualization: Visualization.AttachedVisualization => - val module = visualization.module - module.getIr.getMetadata(CachePreferenceAnalysis) - case _: Visualization.OneshotExpression => - None - } + ): Option[CachePreferenceAnalysis.Metadata] = { + val module = visualization.module + module.getIr.getMetadata(CachePreferenceAnalysis) + } /** Get all project modules in the current compiler scope. */ private def getProjectModulesInScope(implicit diff --git a/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/job/ProgramExecutionSupport.scala b/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/job/ProgramExecutionSupport.scala index b22b7b4ac07c..6140da55f799 100644 --- a/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/job/ProgramExecutionSupport.scala +++ b/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/job/ProgramExecutionSupport.scala @@ -483,22 +483,21 @@ object ProgramExecutionSupport { contextId, value.getExpressionId ) - visualizations.collect { - case visualization: Visualization.AttachedVisualization => - executeAndSendVisualizationUpdate( - contextId, - syncState, - visualization, - value.getExpressionId, - value.getValue - ) + visualizations.foreach { visualization => + executeAndSendVisualizationUpdate( + contextId, + syncState, + visualization, + value.getExpressionId, + value.getValue + ) } } } private def executeVisualization( contextId: ContextId, - visualization: Visualization.AttachedVisualization, + visualization: Visualization, expressionId: UUID, expressionValue: AnyRef )(implicit ctx: RuntimeContext): Either[Throwable, AnyRef] = @@ -614,25 +613,23 @@ object ProgramExecutionSupport { visualization: Visualization, expressionId: UUID, expressionValue: AnyRef - )(implicit ctx: RuntimeContext): Unit = - visualization match { - case visualization: Visualization.AttachedVisualization => - val visualizationResult = executeVisualization( - contextId, - visualization, - expressionId, - expressionValue - ) - sendVisualizationUpdate( - visualizationResult, - contextId, - syncState, - visualization.id, - expressionId, - expressionValue - ) - case _: Visualization.OneshotExpression => - } + )(implicit ctx: RuntimeContext): Unit = { + val visualizationResult = + executeVisualization( + contextId, + visualization, + expressionId, + expressionValue + ) + sendVisualizationUpdate( + visualizationResult, + contextId, + syncState, + visualization.id, + expressionId, + expressionValue + ) + } /** Convert the result of Enso visualization function to a byte array. * diff --git a/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/job/UpsertVisualizationJob.scala b/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/job/UpsertVisualizationJob.scala index 1ad8aaa58071..78ac32396e58 100644 --- a/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/job/UpsertVisualizationJob.scala +++ b/engine/runtime-instrument-common/src/main/scala/org/enso/interpreter/instrument/job/UpsertVisualizationJob.scala @@ -210,39 +210,30 @@ object UpsertVisualizationJob { */ def upsertVisualization( visualization: Visualization - )(implicit ctx: RuntimeContext): Unit = - visualization match { - case visualization: Visualization.AttachedVisualization => - val visualizationConfig = visualization.config - val expressionId = visualization.expressionId - val visualizationId = visualization.id - val maybeCallable = - evaluateVisualizationExpression( - visualizationConfig.visualizationModule, - visualizationConfig.expression - ) - - maybeCallable.foreach { result => - updateAttachedVisualization( - visualizationId, - expressionId, - result.module, - visualizationConfig, - result.callback, - result.arguments - ) - val stack = - ctx.contextManager.getStack(visualizationConfig.executionContextId) - requireVisualizationSynchronization(stack, expressionId) - } - - case visualization: Visualization.OneshotExpression => - ctx.contextManager.upsertVisualization( - visualization.executionContextId, - visualization - ) + )(implicit ctx: RuntimeContext): Unit = { + val visualizationConfig = visualization.config + val expressionId = visualization.expressionId + val visualizationId = visualization.id + val maybeCallable = + evaluateVisualizationExpression( + visualizationConfig.visualizationModule, + visualizationConfig.expression + ) + maybeCallable.foreach { result => + updateAttachedVisualization( + visualizationId, + expressionId, + result.module, + visualizationConfig, + result.callback, + result.arguments + ) + val stack = + ctx.contextManager.getStack(visualizationConfig.executionContextId) + requireVisualizationSynchronization(stack, expressionId) } + } /** Find module by name. * @@ -509,7 +500,7 @@ object UpsertVisualizationJob { val visualizationExpressionId = findVisualizationExpressionId(module, visualizationConfig.expression) val visualization = - Visualization.AttachedVisualization( + Visualization( visualizationId, expressionId, new RuntimeCache(), @@ -603,19 +594,16 @@ object UpsertVisualizationJob { * * @param visualization the visualization to update */ - private def setCacheWeights(visualization: Visualization): Unit = - visualization match { - case visualization: Visualization.AttachedVisualization => - visualization.module.getIr - .getMetadata(CachePreferenceAnalysis) - .foreach { metadata => - CacheInvalidation.runVisualizations( - Seq(visualization), - CacheInvalidation.Command.SetMetadata(metadata) - ) - } - case _: Visualization.OneshotExpression => - } + private def setCacheWeights(visualization: Visualization): Unit = { + visualization.module.getIr + .getMetadata(CachePreferenceAnalysis) + .foreach { metadata => + CacheInvalidation.runVisualizations( + Seq(visualization), + CacheInvalidation.Command.SetMetadata(metadata) + ) + } + } /** Invalidate the first cached dependent node of the provided expression. * diff --git a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeExecutionEnvironmentTest.scala b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeExecutionEnvironmentTest.scala index f1ac5c801e57..2ee40cf8b6e4 100644 --- a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeExecutionEnvironmentTest.scala +++ b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/instrument/RuntimeExecutionEnvironmentTest.scala @@ -184,7 +184,10 @@ class RuntimeExecutionEnvironmentTest idRes, IF_ENABLED_METH_CALL, Api.ExpressionUpdate.Payload - .Panic("Forbidden operation: Output.", Seq(idRes)), + .Panic( + "Forbidden operation: The Output context is disabled.", + Seq(idRes) + ), false ), context.executionComplete(contextId) @@ -285,7 +288,10 @@ class RuntimeExecutionEnvironmentTest idRes, IF_ENABLED_METH_CALL, Api.ExpressionUpdate.Payload - .Panic("Forbidden operation: Input.", Seq(idRes)), + .Panic( + "Forbidden operation: The Input context is disabled.", + Seq(idRes) + ), false ), context.executionComplete(contextId) @@ -342,6 +348,6 @@ object RuntimeExecutionEnvironmentTest { "Standard.Base.Runtime.Context", "if_enabled" ), - Vector(2) + Vector(2, 3, 4) ) } diff --git a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/semantic/DesignExecutionEnvironmentTest.scala b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/semantic/DesignExecutionEnvironmentTest.scala index 888bb6de33b9..d6bbe3cbf257 100644 --- a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/semantic/DesignExecutionEnvironmentTest.scala +++ b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/semantic/DesignExecutionEnvironmentTest.scala @@ -24,7 +24,9 @@ class DesignExecutionEnvironmentTest extends InterpreterTest { | |main = Panic.catch Any (input_action 2) p-> p.payload.to_text |""".stripMargin - eval(code) shouldEqual "(Forbidden_Operation.Error 'Input')" + eval( + code + ) shouldEqual "(Forbidden_Operation.Error 'The Input context is disabled.')" } "error on invalid context actions" in { @@ -37,7 +39,9 @@ class DesignExecutionEnvironmentTest extends InterpreterTest { | |main = Panic.catch Any (Runtime.with_enabled_context Output (input_action 2)) p-> p.payload.to_text |""".stripMargin - eval(code) shouldEqual "(Forbidden_Operation.Error 'Input')" + eval( + code + ) shouldEqual "(Forbidden_Operation.Error 'The Input context is disabled.')" } "error on invalid environment actions" in { @@ -78,7 +82,9 @@ class DesignExecutionEnvironmentTest extends InterpreterTest { | |main = Panic.catch Any (output_action 2) p-> p.payload.to_text |""".stripMargin - eval(code) shouldEqual "(Forbidden_Operation.Error 'Output')" + eval( + code + ) shouldEqual "(Forbidden_Operation.Error 'The Output context is disabled.')" } "scope of context is limited" in { @@ -93,7 +99,9 @@ class DesignExecutionEnvironmentTest extends InterpreterTest { | res = Runtime.with_enabled_context Input action=(input_action 2) | Panic.catch Any (input_action 2) p-> res.to_text+" and "+p.payload.to_text |""".stripMargin - eval(code) shouldEqual "2 and (Forbidden_Operation.Error 'Input')" + eval( + code + ) shouldEqual "2 and (Forbidden_Operation.Error 'The Input context is disabled.')" } "allow locally running IO" in { diff --git a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/semantic/LiveExecutionEnvironmentTest.scala b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/semantic/LiveExecutionEnvironmentTest.scala index 84c3f3aad6e3..abefb5f39fa3 100644 --- a/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/semantic/LiveExecutionEnvironmentTest.scala +++ b/engine/runtime-integration-tests/src/test/scala/org/enso/interpreter/test/semantic/LiveExecutionEnvironmentTest.scala @@ -37,7 +37,9 @@ class LiveExecutionEnvironmentTest extends InterpreterTest { | |main = Panic.catch Any (Runtime.with_disabled_context Input action=(input_action 2)) p-> p.payload.to_text |""".stripMargin - eval(code) shouldEqual "(Forbidden_Operation.Error 'Input')" + eval( + code + ) shouldEqual "(Forbidden_Operation.Error 'The Input context is disabled.')" } "error on invalid environment actions" in { diff --git a/engine/runtime-parser/src/main/java/org/enso/compiler/core/IR.java b/engine/runtime-parser/src/main/java/org/enso/compiler/core/IR.java index f209b534de0e..1f446a948fc2 100644 --- a/engine/runtime-parser/src/main/java/org/enso/compiler/core/IR.java +++ b/engine/runtime-parser/src/main/java/org/enso/compiler/core/IR.java @@ -1,6 +1,5 @@ package org.enso.compiler.core; -import java.io.Serializable; import java.util.UUID; import java.util.function.Function; import org.enso.compiler.core.ir.DiagnosticStorage; @@ -28,9 +27,7 @@ * *

See also: Note [IR Equality and hashing] */ -public interface IR extends Serializable { - - long serialVersionUID = 9057L; // Scala to Java +public interface IR { /** * Storage for metadata that the node has been tagged with as the result of various compiler diff --git a/engine/runtime-parser/src/main/scala/org/enso/compiler/core/ir/Module.scala b/engine/runtime-parser/src/main/scala/org/enso/compiler/core/ir/Module.scala index 3bf03f2465fe..6c02caccbce9 100644 --- a/engine/runtime-parser/src/main/scala/org/enso/compiler/core/ir/Module.scala +++ b/engine/runtime-parser/src/main/scala/org/enso/compiler/core/ir/Module.scala @@ -19,9 +19,6 @@ import java.util.UUID * @param passData the pass metadata associated with this node * @param diagnostics compiler diagnostics for this node */ -@SerialVersionUID( - 9057L // Use BindingsMap -) // prevents reading broken caches, see PR-3692 for details final case class Module( imports: List[Import], exports: List[Export], diff --git a/engine/runtime/src/main/java/org/enso/interpreter/node/expression/builtin/error/ForbiddenOperation.java b/engine/runtime/src/main/java/org/enso/interpreter/node/expression/builtin/error/ForbiddenOperation.java index 28d0556dea3a..b0c0f648abda 100644 --- a/engine/runtime/src/main/java/org/enso/interpreter/node/expression/builtin/error/ForbiddenOperation.java +++ b/engine/runtime/src/main/java/org/enso/interpreter/node/expression/builtin/error/ForbiddenOperation.java @@ -14,6 +14,6 @@ protected String getConstructorName() { @Override protected List getConstructorParamNames() { - return List.of("operation"); + return List.of("message"); } } diff --git a/lib/java/persistance/src/main/java/org/enso/persist/PerMap.java b/lib/java/persistance/src/main/java/org/enso/persist/PerMap.java index fd640994c1f6..253884d825eb 100644 --- a/lib/java/persistance/src/main/java/org/enso/persist/PerMap.java +++ b/lib/java/persistance/src/main/java/org/enso/persist/PerMap.java @@ -7,6 +7,8 @@ import org.openide.util.lookup.Lookups; final class PerMap { + + private static final int serialVersionUID = 8689; // Use PR number private static final Collection ALL; static { @@ -20,7 +22,7 @@ final class PerMap { final int versionStamp; private PerMap() { - int hash = 0; + int hash = serialVersionUID; for (var orig : ALL) { var p = orig.newClone(); var prevId = ids.put(p.id, p); diff --git a/project/GraalVM.scala b/project/GraalVM.scala index 57a227e9c136..27db386ffe10 100644 --- a/project/GraalVM.scala +++ b/project/GraalVM.scala @@ -10,7 +10,7 @@ import scala.collection.immutable.Seq */ object GraalVM { // Keep in sync with graalMavenPackagesVersion in build.sbt - val version: String = "23.1.0" + val version: String = "23.1.2" /** The list of modules that are included in the `component` directory in engine distribution. * When invoking the `java` command, these modules need to be put on the module-path. diff --git a/test/AWS_Tests/src/Main.enso b/test/AWS_Tests/src/Main.enso index cd6ca27e9b92..ce5fe7875ca6 100644 --- a/test/AWS_Tests/src/Main.enso +++ b/test/AWS_Tests/src/Main.enso @@ -4,7 +4,7 @@ from Standard.Test import all import project.S3_Spec -main = +main filter=Nothing = suite = Test.build suite_builder-> S3_Spec.add_specs suite_builder - suite.run_with_filter + suite.run_with_filter filter diff --git a/test/AWS_Tests/src/S3_Spec.enso b/test/AWS_Tests/src/S3_Spec.enso index 348110169b51..f8f23b15a102 100644 --- a/test/AWS_Tests/src/S3_Spec.enso +++ b/test/AWS_Tests/src/S3_Spec.enso @@ -156,6 +156,10 @@ add_specs suite_builder = r.should_be_a Vector r.at 0 . get "name" . should_equal "Green St Green" + group_builder.specify "should work with Data.read" <| + r = Data.read "s3://"+bucket_name+"/examples/folder 2/hello.txt" + r.should_equal "Hello WORLD!" + group_builder.specify "should be able to read a file as bytes or stream" <| bytes = hello_txt.read_bytes bytes.should_equal "Hello WORLD!".utf_8 @@ -211,17 +215,18 @@ add_specs suite_builder = # AWS S3 does not record creation time, only last modified time. hello_txt.creation_time . should_fail_with S3_Error + writable_root = S3_File.new "s3://"+writable_bucket_name+"/" + my_writable_dir = writable_root / "test-run-"+(Date_Time.now.format "yyyy-MM-dd_HHmmss.fV")+"/" + delete_on_panic file ~action = + handler caught_panic = + file.delete + Panic.throw caught_panic + Panic.catch Any action handler + delete_afterwards file ~action = + Panic.with_finalizer file.delete action + suite_builder.group "S3_File writing" pending=api_pending group_builder-> - writable_root = S3_File.new "s3://"+writable_bucket_name+"/" - my_writable_dir = writable_root / "test-run-"+(Date_Time.now.format "yyyy-MM-dd_HHmmss.fV")+"/" assert my_writable_dir.is_directory - delete_on_panic file ~action = - handler caught_panic = - file.delete - Panic.throw caught_panic - Panic.catch Any action handler - delete_afterwards file ~action = - Panic.with_finalizer file.delete action group_builder.specify "should be able to write and delete a new file" <| new_file = my_writable_dir / "new_file1.txt" @@ -268,43 +273,6 @@ add_specs suite_builder = r.catch.to_display_text . should_contain "already exists" r.catch.to_display_text . should_contain "new_file-exists.txt" - group_builder.specify "should be able to copy a file" <| - base_file = my_writable_dir / "new_file-for-copy.txt" - "Hello".write base_file . should_succeed - delete_afterwards base_file <| - base_file.read . should_equal "Hello" - - dest_file = my_writable_dir / "new_file-the-copy-2.txt" - base_file.copy_to dest_file . should_succeed - delete_afterwards dest_file <| - dest_file.read . should_equal "Hello" - - group_builder.specify "will fail if source file does not exist" <| - base_file = my_writable_dir / "nonexistent-src-file.txt" - dest_file = my_writable_dir / "nonexistent-dest-file.txt" - r = base_file.copy_to dest_file - r.should_fail_with File_Error - r.catch.should_be_a File_Error.Not_Found - dest_file.exists . should_be_false - - group_builder.specify "respects replace_existing setting in copy_to" <| - base_file = my_writable_dir / "new_file-for-copy-2.txt" - "Hello".write base_file . should_succeed - delete_afterwards base_file <| - dest_file = my_writable_dir / "new_file-dest.txt" - "World".write dest_file . should_succeed - delete_afterwards dest_file <| - r1 = base_file.copy_to dest_file replace_existing=False - r1.should_fail_with File_Error - r1.catch.should_be_a File_Error.Already_Exists - r1.catch.to_display_text . should_contain "already exists" - - dest_file.read . should_equal "World" - - # Now allow the overwrite: - r2 = base_file.copy_to dest_file replace_existing=True - r2.should_equal dest_file - group_builder.specify "should be able to write a raw stream" <| new_file = my_writable_dir / "new_file-stream.txt" r = new_file.with_output_stream [File_Access.Write] stream-> @@ -348,7 +316,7 @@ add_specs suite_builder = bak_file.exists.should_be_false "version1".write my_file . should_succeed - delete_afterwards my_file <| + delete_on_panic my_file <| my_file.read . should_equal "version1" bak_file.exists . should_be_false @@ -371,6 +339,14 @@ add_specs suite_builder = parent_dir = my_file.parent parent_dir.list . should_contain_the_same_elements_as [my_file, bak_file] + # If the original file is deleted and the backup file remains, the original file should _not_ count as existing (this used to fail). + my_file.delete + bak_file.exists . should_be_true + my_file.exists . should_be_false + files = my_file.parent.list + files . should_contain bak_file + files . should_not_contain my_file + group_builder.specify "should fail cleanly if Auto_Detect fails to detect a format" <| weird_ext = my_writable_dir / "weird-ext.unknown" "Hello".write weird_ext . should_succeed @@ -432,14 +408,94 @@ add_specs suite_builder = group_builder.specify "should fail to delete a file if the Output context is not enabled" <| Context.Output.with_disabled <| - new_file = my_writable_dir / "new_file-ctx.txt" - new_file.delete . should_fail_with Forbidden_Operation + hello_txt = S3_File.new "s3://"+bucket_name+"/examples/folder 2/hello.txt" + hello_txt.delete . should_fail_with Forbidden_Operation - group_builder.specify "does not raise an exception if the file being deleted did not exist in the first place" <| + group_builder.specify "may fail with Not_Found if the file to delete does not exist, even if the Output Context is disabled" <| + Context.Output.with_disabled <| + new_file = my_writable_dir / "nonexistent-file.txt" + r = new_file.delete + r.should_fail_with File_Error + r.catch.should_be_a File_Error.Not_Found + + group_builder.specify "does not raise an exception if the file being `delete_if_exists` did not exist in the first place" <| new_file = my_writable_dir / "nonexistent-file.txt" - new_file.delete . should_succeed + new_file.delete_if_exists . should_succeed + + group_builder.specify "fails if the file being deleted did not exist" <| + new_file = my_writable_dir / "nonexistent-file2.txt" + r = new_file.delete + r.should_fail_with File_Error + r.catch.should_be_a File_Error.Not_Found + + sources = [my_writable_dir / "source1.txt", File.create_temporary_file "source2" ".txt"] + destinations = [my_writable_dir / "destination1.txt", File.create_temporary_file "destination2" ".txt"] + sources.each source_file-> destinations.each destination_file-> if source_file.is_a File && destination_file.is_a File then Nothing else + src_typ = Meta.type_of source_file . to_display_text + dest_typ = Meta.type_of destination_file . to_display_text + suite_builder.group "("+src_typ+" -> "+dest_typ+") copying/moving" pending=api_pending group_builder-> + group_builder.teardown <| + source_file.delete_if_exists + destination_file.delete_if_exists + + group_builder.specify "should be able to copy files" <| + "Hello".write source_file on_existing_file=Existing_File_Behavior.Overwrite . should_succeed + destination_file.delete_if_exists + + source_file.copy_to destination_file . should_succeed + destination_file.read . should_equal "Hello" + source_file.exists . should_be_true + + group_builder.specify "should be able to move files" <| + "Hello".write source_file on_existing_file=Existing_File_Behavior.Overwrite . should_succeed + destination_file.delete_if_exists + + source_file.move_to destination_file . should_succeed + destination_file.read . should_equal "Hello" + source_file.exists . should_be_false + + group_builder.specify "should fail if the source file does not exist" <| + source_file.delete_if_exists + destination_file.delete_if_exists + + r = source_file.copy_to destination_file + r.should_fail_with File_Error + r.catch.should_be_a File_Error.Not_Found + + r2 = source_file.move_to destination_file + r2.should_fail_with File_Error + r2.catch.should_be_a File_Error.Not_Found + + destination_file.exists . should_be_false + + group_builder.specify "should fail to copy/move a file if it exists and replace_existing=False" <| + "Hello".write source_file on_existing_file=Existing_File_Behavior.Overwrite . should_succeed + "World".write destination_file on_existing_file=Existing_File_Behavior.Overwrite . should_succeed + + r = source_file.copy_to destination_file + r.should_fail_with File_Error + r.catch.should_be_a File_Error.Already_Exists + + r2 = source_file.move_to destination_file + r2.should_fail_with File_Error + r2.catch.should_be_a File_Error.Already_Exists + + destination_file.read . should_equal "World" + + group_builder.specify "should overwrite existing destination in copy/move if replace_existing=True" <| + "Hello".write source_file on_existing_file=Existing_File_Behavior.Overwrite . should_succeed + "World".write destination_file on_existing_file=Existing_File_Behavior.Overwrite . should_succeed + + source_file.copy_to destination_file replace_existing=True . should_succeed + destination_file.read . should_equal "Hello" + source_file.exists . should_be_true + + "FooBar".write source_file on_existing_file=Existing_File_Behavior.Overwrite . should_succeed + source_file.move_to destination_file replace_existing=True . should_succeed + destination_file.read . should_equal "FooBar" + source_file.exists . should_be_false -main = +main filter=Nothing = suite = Test.build suite_builder-> add_specs suite_builder - suite.run_with_filter + suite.run_with_filter filter diff --git a/test/Base_Tests/src/Semantic/Runtime_Spec.enso b/test/Base_Tests/src/Semantic/Runtime_Spec.enso index 52a772680709..85bb17d7734f 100644 --- a/test/Base_Tests/src/Semantic/Runtime_Spec.enso +++ b/test/Base_Tests/src/Semantic/Runtime_Spec.enso @@ -28,7 +28,7 @@ add_specs suite_builder = res . should_equal 2 group_builder.specify "should prevent execution with explicitly disabled context" <| res = Panic.catch Any (Runtime.with_disabled_context Input environment=Runtime.current_execution_environment (in_fn 1)) p-> p.payload.to_text - res . should_equal "(Forbidden_Operation.Error 'Input')" + res . should_equal "(Forbidden_Operation.Error 'The Input context is disabled.')" group_builder.specify "should be configurable" <| r1 = Runtime.with_enabled_context Input environment=Runtime.current_execution_environment <| Runtime.with_enabled_context Output environment=Runtime.current_execution_environment <| @@ -36,10 +36,9 @@ add_specs suite_builder = r1.should_equal 22 r2 = Panic.catch Any (Runtime.with_disabled_context Input environment=Runtime.current_execution_environment <| in_fn (out_fn 10)) p-> p.payload.to_text - r2 . should_equal "(Forbidden_Operation.Error 'Input')" + r2 . should_equal "(Forbidden_Operation.Error 'The Input context is disabled.')" main = suite = Test.build suite_builder-> add_specs suite_builder suite.run_with_filter - diff --git a/test/micro-distribution/lib/Standard/Base/0.0.0-dev/src/Errors/Common.enso b/test/micro-distribution/lib/Standard/Base/0.0.0-dev/src/Errors/Common.enso index 9ba09260e433..0dabf3ab4b0b 100644 --- a/test/micro-distribution/lib/Standard/Base/0.0.0-dev/src/Errors/Common.enso +++ b/test/micro-distribution/lib/Standard/Base/0.0.0-dev/src/Errors/Common.enso @@ -73,6 +73,6 @@ type Arity_Error @Builtin_Type type Forbidden_Operation - Error operation + Error message - to_display_text self = "Forbidden operation: "+self.operation+"." + to_display_text self = "Forbidden operation: "+self.message diff --git a/test/micro-distribution/lib/Standard/Base/0.0.0-dev/src/Runtime.enso b/test/micro-distribution/lib/Standard/Base/0.0.0-dev/src/Runtime.enso index d8d5508736cc..9a7ba02992fe 100644 --- a/test/micro-distribution/lib/Standard/Base/0.0.0-dev/src/Runtime.enso +++ b/test/micro-distribution/lib/Standard/Base/0.0.0-dev/src/Runtime.enso @@ -1,10 +1,12 @@ import project.Any.Any import project.Data.Text.Text import project.Data.Boolean.Boolean +import project.Error.Error import project.Errors.Common.Forbidden_Operation import project.Function.Function import project.Panic.Panic +from project.Data.Boolean import True from project.Runtime.Context import Input, Output @Builtin_Type @@ -18,9 +20,11 @@ type Context Input -> "Input" Output -> "Output" - if_enabled : Function -> Text -> Any - if_enabled self ~action environment="design" = - if self.is_enabled environment then action else Panic.throw (Forbidden_Operation.Error self.name) + if_enabled : Any -> Text -> Text -> Boolean -> Any ! Forbidden_Operation + if_enabled self ~action environment="design" disabled_message="The "+self.name+" context is disabled." panic=True = + if self.is_enabled environment then action else + error = Forbidden_Operation.Error disabled_message + if panic then Panic.throw error else Error.throw error is_enabled : Text -> Boolean is_enabled self environment="design" = diff --git a/tools/legal-review/AWS/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.12.6/files-ignore b/tools/legal-review/AWS/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.12.6/files-ignore new file mode 100644 index 000000000000..8058ba1fb0e7 --- /dev/null +++ b/tools/legal-review/AWS/com.fasterxml.jackson.dataformat.jackson-dataformat-cbor-2.12.6/files-ignore @@ -0,0 +1 @@ +/FasterXML/jackson-dataformats-binary/blob/2.17/LICENSE diff --git a/tools/legal-review/project-manager/org.graalvm.polyglot.polyglot-23.1.0/copyright-ignore b/tools/legal-review/Base/org.graalvm.polyglot.polyglot-23.1.2/copyright-ignore similarity index 85% rename from tools/legal-review/project-manager/org.graalvm.polyglot.polyglot-23.1.0/copyright-ignore rename to tools/legal-review/Base/org.graalvm.polyglot.polyglot-23.1.2/copyright-ignore index 05ae6d6ba74c..a4a12c07600c 100644 --- a/tools/legal-review/project-manager/org.graalvm.polyglot.polyglot-23.1.0/copyright-ignore +++ b/tools/legal-review/Base/org.graalvm.polyglot.polyglot-23.1.2/copyright-ignore @@ -1,19 +1,19 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -The above copyright notice and either this complete permission notice or at a -copyright rights in the Software, and any and all patent rights owned or +Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2020, 2021, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. +DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. diff --git a/tools/legal-review/Base/org.graalvm.polyglot.polyglot-23.1.2/copyright-keep b/tools/legal-review/Base/org.graalvm.polyglot.polyglot-23.1.2/copyright-keep new file mode 100644 index 000000000000..51d52565aa7e --- /dev/null +++ b/tools/legal-review/Base/org.graalvm.polyglot.polyglot-23.1.2/copyright-keep @@ -0,0 +1,3 @@ +Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. +The above copyright notice and either this complete permission notice or at a +copyright rights in the Software, and any and all patent rights owned or diff --git a/tools/legal-review/project-manager/org.graalvm.sdk.collections-23.1.0/copyright-ignore b/tools/legal-review/Base/org.graalvm.sdk.collections-23.1.2/copyright-ignore similarity index 67% rename from tools/legal-review/project-manager/org.graalvm.sdk.collections-23.1.0/copyright-ignore rename to tools/legal-review/Base/org.graalvm.sdk.collections-23.1.2/copyright-ignore index 3cf75175a37f..773ca565e03b 100644 --- a/tools/legal-review/project-manager/org.graalvm.sdk.collections-23.1.0/copyright-ignore +++ b/tools/legal-review/Base/org.graalvm.sdk.collections-23.1.2/copyright-ignore @@ -1,9 +1,8 @@ -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -The above copyright notice and either this complete permission notice or at a -copyright rights in the Software, and any and all patent rights owned or +Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2021, 2023, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. +DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. diff --git a/tools/legal-review/Base/org.graalvm.sdk.collections-23.1.2/copyright-keep b/tools/legal-review/Base/org.graalvm.sdk.collections-23.1.2/copyright-keep new file mode 100644 index 000000000000..f42b45fe69fb --- /dev/null +++ b/tools/legal-review/Base/org.graalvm.sdk.collections-23.1.2/copyright-keep @@ -0,0 +1,4 @@ +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. +The above copyright notice and either this complete permission notice or at a +copyright rights in the Software, and any and all patent rights owned or diff --git a/tools/legal-review/project-manager/org.graalvm.sdk.nativeimage-23.1.0/copyright-ignore b/tools/legal-review/Base/org.graalvm.sdk.nativeimage-23.1.2/copyright-ignore similarity index 92% rename from tools/legal-review/project-manager/org.graalvm.sdk.nativeimage-23.1.0/copyright-ignore rename to tools/legal-review/Base/org.graalvm.sdk.nativeimage-23.1.2/copyright-ignore index 40098cef90df..9ed34bb03b2f 100644 --- a/tools/legal-review/project-manager/org.graalvm.sdk.nativeimage-23.1.0/copyright-ignore +++ b/tools/legal-review/Base/org.graalvm.sdk.nativeimage-23.1.2/copyright-ignore @@ -1,37 +1,35 @@ -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -The above copyright notice and either this complete permission notice or at a -copyright rights in the Software, and any and all patent rights owned or +Copyright (c) 2007, 2023, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2009, 2023, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2020, 2020, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2022, 2023, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved. +Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -Copyright (c) 2020, 2020, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2019, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2019, 2022, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2019, 2021, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2017, 2021, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2017, 2020, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2014, 2022, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2014, 2021, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2014, 2019, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2013, 2023, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2013, 2021, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2012, 2022, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2010, 2022, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2009, 2023, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2007, 2023, Oracle and/or its affiliates. All rights reserved. diff --git a/tools/legal-review/Base/org.graalvm.sdk.nativeimage-23.1.2/copyright-keep b/tools/legal-review/Base/org.graalvm.sdk.nativeimage-23.1.2/copyright-keep new file mode 100644 index 000000000000..c9dcc9380fbe --- /dev/null +++ b/tools/legal-review/Base/org.graalvm.sdk.nativeimage-23.1.2/copyright-keep @@ -0,0 +1,4 @@ +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved. +The above copyright notice and either this complete permission notice or at a +copyright rights in the Software, and any and all patent rights owned or diff --git a/tools/legal-review/project-manager/org.graalvm.sdk.word-23.1.0/copyright-ignore b/tools/legal-review/Base/org.graalvm.sdk.word-23.1.2/copyright-ignore similarity index 64% rename from tools/legal-review/project-manager/org.graalvm.sdk.word-23.1.0/copyright-ignore rename to tools/legal-review/Base/org.graalvm.sdk.word-23.1.2/copyright-ignore index 176d7dcc5498..c5849e5b8f7d 100644 --- a/tools/legal-review/project-manager/org.graalvm.sdk.word-23.1.0/copyright-ignore +++ b/tools/legal-review/Base/org.graalvm.sdk.word-23.1.2/copyright-ignore @@ -1,8 +1,6 @@ -The above copyright notice and either this complete permission notice or at a -copyright rights in the Software, and any and all patent rights owned or +Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2012, 2019, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2012, 2023, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2013, 2019, Oracle and/or its affiliates. All rights reserved. Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. -DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. diff --git a/tools/legal-review/Base/org.graalvm.sdk.word-23.1.2/copyright-keep b/tools/legal-review/Base/org.graalvm.sdk.word-23.1.2/copyright-keep new file mode 100644 index 000000000000..d3c8b9427343 --- /dev/null +++ b/tools/legal-review/Base/org.graalvm.sdk.word-23.1.2/copyright-keep @@ -0,0 +1,4 @@ +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +The above copyright notice and either this complete permission notice or at a +copyright rights in the Software, and any and all patent rights owned or diff --git a/tools/legal-review/Base/report-state b/tools/legal-review/Base/report-state index d11ec3de2bcd..96be37964c55 100644 --- a/tools/legal-review/Base/report-state +++ b/tools/legal-review/Base/report-state @@ -1,3 +1,3 @@ -44A2EB4467C91025C305D370F3E8C9430A69FCD957630A539385AB785B0A1C6D -5F5974B8673A2E82B0148235CCE1FC0DD9FB8D3ED9C9552A4D86A4EE14723DE5 +DB9DA9C510DFA8BEC90E4783DC4B38250348A933AC619F8B23F524468A717D66 +4D34F128EF38C7A04EAF5F44292BD67D157A107CF70DDB04080515EEF6541AF1 0 diff --git a/tools/legal-review/engine/org.graalvm.js.js-language-23.1.0/copyright-ignore b/tools/legal-review/engine/org.graalvm.js.js-language-23.1.2/copyright-ignore similarity index 100% rename from tools/legal-review/engine/org.graalvm.js.js-language-23.1.0/copyright-ignore rename to tools/legal-review/engine/org.graalvm.js.js-language-23.1.2/copyright-ignore diff --git a/tools/legal-review/engine/org.graalvm.js.js-language-23.1.0/copyright-keep b/tools/legal-review/engine/org.graalvm.js.js-language-23.1.2/copyright-keep similarity index 100% rename from tools/legal-review/engine/org.graalvm.js.js-language-23.1.0/copyright-keep rename to tools/legal-review/engine/org.graalvm.js.js-language-23.1.2/copyright-keep diff --git a/tools/legal-review/engine/org.graalvm.llvm.llvm-api-23.1.0/copyright-ignore b/tools/legal-review/engine/org.graalvm.llvm.llvm-api-23.1.2/copyright-ignore similarity index 100% rename from tools/legal-review/engine/org.graalvm.llvm.llvm-api-23.1.0/copyright-ignore rename to tools/legal-review/engine/org.graalvm.llvm.llvm-api-23.1.2/copyright-ignore diff --git a/tools/legal-review/engine/org.graalvm.llvm.llvm-api-23.1.0/copyright-keep b/tools/legal-review/engine/org.graalvm.llvm.llvm-api-23.1.2/copyright-keep similarity index 100% rename from tools/legal-review/engine/org.graalvm.llvm.llvm-api-23.1.0/copyright-keep rename to tools/legal-review/engine/org.graalvm.llvm.llvm-api-23.1.2/copyright-keep diff --git a/tools/legal-review/Base/org.graalvm.polyglot.polyglot-23.1.0/copyright-ignore b/tools/legal-review/engine/org.graalvm.polyglot.polyglot-23.1.2/copyright-ignore similarity index 100% rename from tools/legal-review/Base/org.graalvm.polyglot.polyglot-23.1.0/copyright-ignore rename to tools/legal-review/engine/org.graalvm.polyglot.polyglot-23.1.2/copyright-ignore diff --git a/tools/legal-review/Base/org.graalvm.polyglot.polyglot-23.1.0/copyright-keep b/tools/legal-review/engine/org.graalvm.polyglot.polyglot-23.1.2/copyright-keep similarity index 100% rename from tools/legal-review/Base/org.graalvm.polyglot.polyglot-23.1.0/copyright-keep rename to tools/legal-review/engine/org.graalvm.polyglot.polyglot-23.1.2/copyright-keep diff --git a/tools/legal-review/engine/org.graalvm.python.python-language-23.1.0/copyright-ignore b/tools/legal-review/engine/org.graalvm.python.python-language-23.1.2/copyright-ignore similarity index 100% rename from tools/legal-review/engine/org.graalvm.python.python-language-23.1.0/copyright-ignore rename to tools/legal-review/engine/org.graalvm.python.python-language-23.1.2/copyright-ignore diff --git a/tools/legal-review/engine/org.graalvm.python.python-language-23.1.0/copyright-keep b/tools/legal-review/engine/org.graalvm.python.python-language-23.1.2/copyright-keep similarity index 100% rename from tools/legal-review/engine/org.graalvm.python.python-language-23.1.0/copyright-keep rename to tools/legal-review/engine/org.graalvm.python.python-language-23.1.2/copyright-keep diff --git a/tools/legal-review/engine/org.graalvm.python.python-resources-23.1.0/copyright-keep b/tools/legal-review/engine/org.graalvm.python.python-resources-23.1.2/copyright-keep similarity index 100% rename from tools/legal-review/engine/org.graalvm.python.python-resources-23.1.0/copyright-keep rename to tools/legal-review/engine/org.graalvm.python.python-resources-23.1.2/copyright-keep diff --git a/tools/legal-review/engine/org.graalvm.python.python-resources-23.1.0/copyright-keep-context b/tools/legal-review/engine/org.graalvm.python.python-resources-23.1.2/copyright-keep-context similarity index 100% rename from tools/legal-review/engine/org.graalvm.python.python-resources-23.1.0/copyright-keep-context rename to tools/legal-review/engine/org.graalvm.python.python-resources-23.1.2/copyright-keep-context diff --git a/tools/legal-review/engine/org.graalvm.regex.regex-23.1.0/copyright-ignore b/tools/legal-review/engine/org.graalvm.regex.regex-23.1.2/copyright-ignore similarity index 100% rename from tools/legal-review/engine/org.graalvm.regex.regex-23.1.0/copyright-ignore rename to tools/legal-review/engine/org.graalvm.regex.regex-23.1.2/copyright-ignore diff --git a/tools/legal-review/engine/org.graalvm.regex.regex-23.1.0/copyright-keep b/tools/legal-review/engine/org.graalvm.regex.regex-23.1.2/copyright-keep similarity index 100% rename from tools/legal-review/engine/org.graalvm.regex.regex-23.1.0/copyright-keep rename to tools/legal-review/engine/org.graalvm.regex.regex-23.1.2/copyright-keep diff --git a/tools/legal-review/Base/org.graalvm.sdk.collections-23.1.0/copyright-ignore b/tools/legal-review/engine/org.graalvm.sdk.collections-23.1.2/copyright-ignore similarity index 100% rename from tools/legal-review/Base/org.graalvm.sdk.collections-23.1.0/copyright-ignore rename to tools/legal-review/engine/org.graalvm.sdk.collections-23.1.2/copyright-ignore diff --git a/tools/legal-review/Base/org.graalvm.sdk.collections-23.1.0/copyright-keep b/tools/legal-review/engine/org.graalvm.sdk.collections-23.1.2/copyright-keep similarity index 100% rename from tools/legal-review/Base/org.graalvm.sdk.collections-23.1.0/copyright-keep rename to tools/legal-review/engine/org.graalvm.sdk.collections-23.1.2/copyright-keep diff --git a/tools/legal-review/Base/org.graalvm.sdk.nativeimage-23.1.0/copyright-ignore b/tools/legal-review/engine/org.graalvm.sdk.nativeimage-23.1.2/copyright-ignore similarity index 100% rename from tools/legal-review/Base/org.graalvm.sdk.nativeimage-23.1.0/copyright-ignore rename to tools/legal-review/engine/org.graalvm.sdk.nativeimage-23.1.2/copyright-ignore diff --git a/tools/legal-review/Base/org.graalvm.sdk.nativeimage-23.1.0/copyright-keep b/tools/legal-review/engine/org.graalvm.sdk.nativeimage-23.1.2/copyright-keep similarity index 100% rename from tools/legal-review/Base/org.graalvm.sdk.nativeimage-23.1.0/copyright-keep rename to tools/legal-review/engine/org.graalvm.sdk.nativeimage-23.1.2/copyright-keep diff --git a/tools/legal-review/Base/org.graalvm.sdk.word-23.1.0/copyright-ignore b/tools/legal-review/engine/org.graalvm.sdk.word-23.1.2/copyright-ignore similarity index 100% rename from tools/legal-review/Base/org.graalvm.sdk.word-23.1.0/copyright-ignore rename to tools/legal-review/engine/org.graalvm.sdk.word-23.1.2/copyright-ignore diff --git a/tools/legal-review/Base/org.graalvm.sdk.word-23.1.0/copyright-keep b/tools/legal-review/engine/org.graalvm.sdk.word-23.1.2/copyright-keep similarity index 100% rename from tools/legal-review/Base/org.graalvm.sdk.word-23.1.0/copyright-keep rename to tools/legal-review/engine/org.graalvm.sdk.word-23.1.2/copyright-keep diff --git a/tools/legal-review/engine/org.graalvm.shadowed.icu4j-23.1.0/copyright-ignore b/tools/legal-review/engine/org.graalvm.shadowed.icu4j-23.1.2/copyright-ignore similarity index 100% rename from tools/legal-review/engine/org.graalvm.shadowed.icu4j-23.1.0/copyright-ignore rename to tools/legal-review/engine/org.graalvm.shadowed.icu4j-23.1.2/copyright-ignore diff --git a/tools/legal-review/engine/org.graalvm.shadowed.icu4j-23.1.0/copyright-keep b/tools/legal-review/engine/org.graalvm.shadowed.icu4j-23.1.2/copyright-keep similarity index 100% rename from tools/legal-review/engine/org.graalvm.shadowed.icu4j-23.1.0/copyright-keep rename to tools/legal-review/engine/org.graalvm.shadowed.icu4j-23.1.2/copyright-keep diff --git a/tools/legal-review/engine/org.graalvm.shadowed.icu4j-23.1.0/custom-license b/tools/legal-review/engine/org.graalvm.shadowed.icu4j-23.1.2/custom-license similarity index 100% rename from tools/legal-review/engine/org.graalvm.shadowed.icu4j-23.1.0/custom-license rename to tools/legal-review/engine/org.graalvm.shadowed.icu4j-23.1.2/custom-license diff --git a/tools/legal-review/engine/org.graalvm.shadowed.icu4j-23.1.0/files-keep b/tools/legal-review/engine/org.graalvm.shadowed.icu4j-23.1.2/files-keep similarity index 100% rename from tools/legal-review/engine/org.graalvm.shadowed.icu4j-23.1.0/files-keep rename to tools/legal-review/engine/org.graalvm.shadowed.icu4j-23.1.2/files-keep diff --git a/tools/legal-review/engine/org.graalvm.shadowed.json-23.1.0/files-add/NOTICE b/tools/legal-review/engine/org.graalvm.shadowed.json-23.1.2/files-add/NOTICE similarity index 100% rename from tools/legal-review/engine/org.graalvm.shadowed.json-23.1.0/files-add/NOTICE rename to tools/legal-review/engine/org.graalvm.shadowed.json-23.1.2/files-add/NOTICE diff --git a/tools/legal-review/engine/org.graalvm.tools.profiler-tool-23.1.0/copyright-ignore b/tools/legal-review/engine/org.graalvm.tools.profiler-tool-23.1.2/copyright-ignore similarity index 100% rename from tools/legal-review/engine/org.graalvm.tools.profiler-tool-23.1.0/copyright-ignore rename to tools/legal-review/engine/org.graalvm.tools.profiler-tool-23.1.2/copyright-ignore diff --git a/tools/legal-review/engine/org.graalvm.tools.profiler-tool-23.1.0/copyright-keep b/tools/legal-review/engine/org.graalvm.tools.profiler-tool-23.1.2/copyright-keep similarity index 100% rename from tools/legal-review/engine/org.graalvm.tools.profiler-tool-23.1.0/copyright-keep rename to tools/legal-review/engine/org.graalvm.tools.profiler-tool-23.1.2/copyright-keep diff --git a/tools/legal-review/engine/org.graalvm.truffle.truffle-api-23.1.0/copyright-ignore b/tools/legal-review/engine/org.graalvm.truffle.truffle-api-23.1.2/copyright-ignore similarity index 100% rename from tools/legal-review/engine/org.graalvm.truffle.truffle-api-23.1.0/copyright-ignore rename to tools/legal-review/engine/org.graalvm.truffle.truffle-api-23.1.2/copyright-ignore diff --git a/tools/legal-review/engine/org.graalvm.truffle.truffle-api-23.1.0/copyright-keep b/tools/legal-review/engine/org.graalvm.truffle.truffle-api-23.1.2/copyright-keep similarity index 100% rename from tools/legal-review/engine/org.graalvm.truffle.truffle-api-23.1.0/copyright-keep rename to tools/legal-review/engine/org.graalvm.truffle.truffle-api-23.1.2/copyright-keep diff --git a/tools/legal-review/engine/org.graalvm.truffle.truffle-nfi-23.1.0/copyright-ignore b/tools/legal-review/engine/org.graalvm.truffle.truffle-nfi-23.1.2/copyright-ignore similarity index 100% rename from tools/legal-review/engine/org.graalvm.truffle.truffle-nfi-23.1.0/copyright-ignore rename to tools/legal-review/engine/org.graalvm.truffle.truffle-nfi-23.1.2/copyright-ignore diff --git a/tools/legal-review/engine/org.graalvm.truffle.truffle-nfi-23.1.0/copyright-keep b/tools/legal-review/engine/org.graalvm.truffle.truffle-nfi-23.1.2/copyright-keep similarity index 100% rename from tools/legal-review/engine/org.graalvm.truffle.truffle-nfi-23.1.0/copyright-keep rename to tools/legal-review/engine/org.graalvm.truffle.truffle-nfi-23.1.2/copyright-keep diff --git a/tools/legal-review/engine/org.graalvm.truffle.truffle-nfi-libffi-23.1.0/copyright-ignore b/tools/legal-review/engine/org.graalvm.truffle.truffle-nfi-libffi-23.1.2/copyright-ignore similarity index 100% rename from tools/legal-review/engine/org.graalvm.truffle.truffle-nfi-libffi-23.1.0/copyright-ignore rename to tools/legal-review/engine/org.graalvm.truffle.truffle-nfi-libffi-23.1.2/copyright-ignore diff --git a/tools/legal-review/engine/org.graalvm.truffle.truffle-nfi-libffi-23.1.0/copyright-keep b/tools/legal-review/engine/org.graalvm.truffle.truffle-nfi-libffi-23.1.2/copyright-keep similarity index 100% rename from tools/legal-review/engine/org.graalvm.truffle.truffle-nfi-libffi-23.1.0/copyright-keep rename to tools/legal-review/engine/org.graalvm.truffle.truffle-nfi-libffi-23.1.2/copyright-keep diff --git a/tools/legal-review/engine/report-state b/tools/legal-review/engine/report-state index 769657194d34..8f4a434c3e24 100644 --- a/tools/legal-review/engine/report-state +++ b/tools/legal-review/engine/report-state @@ -1,3 +1,3 @@ -D8B011DD7E11E226FD042DCDEE28B22C5D74D2B7A666346317619CCB487832C4 -0035ED295654FAACCD79D0DA6D2CDDA8E2EC8D0BA9254722FB55C6F622A68B94 +6833A9EED918805113BD1177678C1FF1EB9CCF8AFCCF857F35EBBDC0F0F3F0F0 +37D2333BCB98AF28C3DCFAB020950FCEE7BAD01D9287AF4BDDB1D859E78F86A2 0 diff --git a/tools/legal-review/engine/org.graalvm.polyglot.polyglot-23.1.0/copyright-ignore b/tools/legal-review/launcher/org.graalvm.polyglot.polyglot-23.1.2/copyright-ignore similarity index 100% rename from tools/legal-review/engine/org.graalvm.polyglot.polyglot-23.1.0/copyright-ignore rename to tools/legal-review/launcher/org.graalvm.polyglot.polyglot-23.1.2/copyright-ignore diff --git a/tools/legal-review/engine/org.graalvm.polyglot.polyglot-23.1.0/copyright-keep b/tools/legal-review/launcher/org.graalvm.polyglot.polyglot-23.1.2/copyright-keep similarity index 100% rename from tools/legal-review/engine/org.graalvm.polyglot.polyglot-23.1.0/copyright-keep rename to tools/legal-review/launcher/org.graalvm.polyglot.polyglot-23.1.2/copyright-keep diff --git a/tools/legal-review/engine/org.graalvm.sdk.collections-23.1.0/copyright-ignore b/tools/legal-review/launcher/org.graalvm.sdk.collections-23.1.2/copyright-ignore similarity index 100% rename from tools/legal-review/engine/org.graalvm.sdk.collections-23.1.0/copyright-ignore rename to tools/legal-review/launcher/org.graalvm.sdk.collections-23.1.2/copyright-ignore diff --git a/tools/legal-review/engine/org.graalvm.sdk.collections-23.1.0/copyright-keep b/tools/legal-review/launcher/org.graalvm.sdk.collections-23.1.2/copyright-keep similarity index 100% rename from tools/legal-review/engine/org.graalvm.sdk.collections-23.1.0/copyright-keep rename to tools/legal-review/launcher/org.graalvm.sdk.collections-23.1.2/copyright-keep diff --git a/tools/legal-review/engine/org.graalvm.sdk.nativeimage-23.1.0/copyright-ignore b/tools/legal-review/launcher/org.graalvm.sdk.nativeimage-23.1.2/copyright-ignore similarity index 100% rename from tools/legal-review/engine/org.graalvm.sdk.nativeimage-23.1.0/copyright-ignore rename to tools/legal-review/launcher/org.graalvm.sdk.nativeimage-23.1.2/copyright-ignore diff --git a/tools/legal-review/engine/org.graalvm.sdk.nativeimage-23.1.0/copyright-keep b/tools/legal-review/launcher/org.graalvm.sdk.nativeimage-23.1.2/copyright-keep similarity index 100% rename from tools/legal-review/engine/org.graalvm.sdk.nativeimage-23.1.0/copyright-keep rename to tools/legal-review/launcher/org.graalvm.sdk.nativeimage-23.1.2/copyright-keep diff --git a/tools/legal-review/engine/org.graalvm.sdk.word-23.1.0/copyright-ignore b/tools/legal-review/launcher/org.graalvm.sdk.word-23.1.2/copyright-ignore similarity index 100% rename from tools/legal-review/engine/org.graalvm.sdk.word-23.1.0/copyright-ignore rename to tools/legal-review/launcher/org.graalvm.sdk.word-23.1.2/copyright-ignore diff --git a/tools/legal-review/engine/org.graalvm.sdk.word-23.1.0/copyright-keep b/tools/legal-review/launcher/org.graalvm.sdk.word-23.1.2/copyright-keep similarity index 100% rename from tools/legal-review/engine/org.graalvm.sdk.word-23.1.0/copyright-keep rename to tools/legal-review/launcher/org.graalvm.sdk.word-23.1.2/copyright-keep diff --git a/tools/legal-review/launcher/org.graalvm.truffle.truffle-api-23.1.0/copyright-ignore b/tools/legal-review/launcher/org.graalvm.truffle.truffle-api-23.1.2/copyright-ignore similarity index 100% rename from tools/legal-review/launcher/org.graalvm.truffle.truffle-api-23.1.0/copyright-ignore rename to tools/legal-review/launcher/org.graalvm.truffle.truffle-api-23.1.2/copyright-ignore diff --git a/tools/legal-review/launcher/org.graalvm.truffle.truffle-api-23.1.0/copyright-keep b/tools/legal-review/launcher/org.graalvm.truffle.truffle-api-23.1.2/copyright-keep similarity index 100% rename from tools/legal-review/launcher/org.graalvm.truffle.truffle-api-23.1.0/copyright-keep rename to tools/legal-review/launcher/org.graalvm.truffle.truffle-api-23.1.2/copyright-keep diff --git a/tools/legal-review/launcher/report-state b/tools/legal-review/launcher/report-state index 47cbd8faa811..b072922632c2 100644 --- a/tools/legal-review/launcher/report-state +++ b/tools/legal-review/launcher/report-state @@ -1,3 +1,3 @@ -7FD6B2CEF25DA9C73D447AAFC64AB53637F764914391B1A08BE19DC78C9A30E8 -BBDB37A47F71427476C52022158EA9E9BC3FF9AEFB6705E2BE56D8AF09A6A621 +6377D131E01C27868989472EC0E9E6BF00A6E4C908C46E125377135B12951858 +041766A0DBC4157B5B5D814069DE2F66CC9EEF5833B5156073A9F852ACF1D778 0 diff --git a/tools/legal-review/project-manager/org.graalvm.polyglot.polyglot-23.1.0/copyright-keep b/tools/legal-review/project-manager/org.graalvm.polyglot.polyglot-23.1.0/copyright-keep deleted file mode 100644 index e8cd72b6f25f..000000000000 --- a/tools/legal-review/project-manager/org.graalvm.polyglot.polyglot-23.1.0/copyright-keep +++ /dev/null @@ -1,3 +0,0 @@ -DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2019, 2023, Oracle and/or its affiliates. All rights reserved. diff --git a/tools/legal-review/launcher/org.graalvm.polyglot.polyglot-23.1.0/copyright-ignore b/tools/legal-review/project-manager/org.graalvm.polyglot.polyglot-23.1.2/copyright-ignore similarity index 100% rename from tools/legal-review/launcher/org.graalvm.polyglot.polyglot-23.1.0/copyright-ignore rename to tools/legal-review/project-manager/org.graalvm.polyglot.polyglot-23.1.2/copyright-ignore diff --git a/tools/legal-review/launcher/org.graalvm.polyglot.polyglot-23.1.0/copyright-keep b/tools/legal-review/project-manager/org.graalvm.polyglot.polyglot-23.1.2/copyright-keep similarity index 100% rename from tools/legal-review/launcher/org.graalvm.polyglot.polyglot-23.1.0/copyright-keep rename to tools/legal-review/project-manager/org.graalvm.polyglot.polyglot-23.1.2/copyright-keep diff --git a/tools/legal-review/project-manager/org.graalvm.sdk.collections-23.1.0/copyright-keep b/tools/legal-review/project-manager/org.graalvm.sdk.collections-23.1.0/copyright-keep deleted file mode 100644 index aad5c148f2d3..000000000000 --- a/tools/legal-review/project-manager/org.graalvm.sdk.collections-23.1.0/copyright-keep +++ /dev/null @@ -1,3 +0,0 @@ -Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. -DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -Copyright (c) 2017, 2019, Oracle and/or its affiliates. All rights reserved. diff --git a/tools/legal-review/launcher/org.graalvm.sdk.collections-23.1.0/copyright-ignore b/tools/legal-review/project-manager/org.graalvm.sdk.collections-23.1.2/copyright-ignore similarity index 100% rename from tools/legal-review/launcher/org.graalvm.sdk.collections-23.1.0/copyright-ignore rename to tools/legal-review/project-manager/org.graalvm.sdk.collections-23.1.2/copyright-ignore diff --git a/tools/legal-review/launcher/org.graalvm.sdk.collections-23.1.0/copyright-keep b/tools/legal-review/project-manager/org.graalvm.sdk.collections-23.1.2/copyright-keep similarity index 100% rename from tools/legal-review/launcher/org.graalvm.sdk.collections-23.1.0/copyright-keep rename to tools/legal-review/project-manager/org.graalvm.sdk.collections-23.1.2/copyright-keep diff --git a/tools/legal-review/project-manager/org.graalvm.sdk.nativeimage-23.1.0/copyright-keep b/tools/legal-review/project-manager/org.graalvm.sdk.nativeimage-23.1.0/copyright-keep deleted file mode 100644 index b4c2cb61258b..000000000000 --- a/tools/legal-review/project-manager/org.graalvm.sdk.nativeimage-23.1.0/copyright-keep +++ /dev/null @@ -1,2 +0,0 @@ -Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. -Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved. diff --git a/tools/legal-review/launcher/org.graalvm.sdk.nativeimage-23.1.0/copyright-ignore b/tools/legal-review/project-manager/org.graalvm.sdk.nativeimage-23.1.2/copyright-ignore similarity index 100% rename from tools/legal-review/launcher/org.graalvm.sdk.nativeimage-23.1.0/copyright-ignore rename to tools/legal-review/project-manager/org.graalvm.sdk.nativeimage-23.1.2/copyright-ignore diff --git a/tools/legal-review/launcher/org.graalvm.sdk.nativeimage-23.1.0/copyright-keep b/tools/legal-review/project-manager/org.graalvm.sdk.nativeimage-23.1.2/copyright-keep similarity index 100% rename from tools/legal-review/launcher/org.graalvm.sdk.nativeimage-23.1.0/copyright-keep rename to tools/legal-review/project-manager/org.graalvm.sdk.nativeimage-23.1.2/copyright-keep diff --git a/tools/legal-review/project-manager/org.graalvm.sdk.word-23.1.0/copyright-keep b/tools/legal-review/project-manager/org.graalvm.sdk.word-23.1.0/copyright-keep deleted file mode 100644 index eda8fd514c3c..000000000000 --- a/tools/legal-review/project-manager/org.graalvm.sdk.word-23.1.0/copyright-keep +++ /dev/null @@ -1,2 +0,0 @@ -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -Copyright (c) 2011, 2022, Oracle and/or its affiliates. All rights reserved. diff --git a/tools/legal-review/launcher/org.graalvm.sdk.word-23.1.0/copyright-ignore b/tools/legal-review/project-manager/org.graalvm.sdk.word-23.1.2/copyright-ignore similarity index 100% rename from tools/legal-review/launcher/org.graalvm.sdk.word-23.1.0/copyright-ignore rename to tools/legal-review/project-manager/org.graalvm.sdk.word-23.1.2/copyright-ignore diff --git a/tools/legal-review/launcher/org.graalvm.sdk.word-23.1.0/copyright-keep b/tools/legal-review/project-manager/org.graalvm.sdk.word-23.1.2/copyright-keep similarity index 100% rename from tools/legal-review/launcher/org.graalvm.sdk.word-23.1.0/copyright-keep rename to tools/legal-review/project-manager/org.graalvm.sdk.word-23.1.2/copyright-keep diff --git a/tools/legal-review/project-manager/org.graalvm.truffle.truffle-api-23.1.0/copyright-ignore b/tools/legal-review/project-manager/org.graalvm.truffle.truffle-api-23.1.2/copyright-ignore similarity index 100% rename from tools/legal-review/project-manager/org.graalvm.truffle.truffle-api-23.1.0/copyright-ignore rename to tools/legal-review/project-manager/org.graalvm.truffle.truffle-api-23.1.2/copyright-ignore diff --git a/tools/legal-review/project-manager/org.graalvm.truffle.truffle-api-23.1.0/copyright-keep b/tools/legal-review/project-manager/org.graalvm.truffle.truffle-api-23.1.2/copyright-keep similarity index 100% rename from tools/legal-review/project-manager/org.graalvm.truffle.truffle-api-23.1.0/copyright-keep rename to tools/legal-review/project-manager/org.graalvm.truffle.truffle-api-23.1.2/copyright-keep diff --git a/tools/legal-review/project-manager/report-state b/tools/legal-review/project-manager/report-state index 5d65f231dd65..ed9447697478 100644 --- a/tools/legal-review/project-manager/report-state +++ b/tools/legal-review/project-manager/report-state @@ -1,3 +1,3 @@ -578C28B786B877E41559F52CBDFBF45DE798CEB12FDF9632A93CC4B1B30C72C6 -D1B18FEE4514908AD689F9B25D7E4445E5F3D75296F136BED478DB855D891F88 +DF3A7C072085362B8D9DAA68A115C182E2EBD6E17191932A56FA10272C135BC1 +1FA74ED538D76E223FDEF2DCA2A21F81FF477406F006E854AAA3BECE938AACD1 0