From fced7740b5e1e97bb94ec71b1dcc3df41a9f0b64 Mon Sep 17 00:00:00 2001 From: Gavin Gray <20209337+gavinleroy@users.noreply.github.com> Date: Fri, 22 Nov 2024 11:06:13 -0500 Subject: [PATCH 1/5] [WIP] WASM kinda working... (#1) * WASM kinda working... * Fix issues w/ interpreter * Updating GH actions, flakes, infra * Remove ignored files and large directories * You wouldn't believe * Try flake=false for rustc derivation * Trim down actions for now * Update flake lock --------- Co-authored-by: Will Crichton --- .github/workflows/ci.yml | 23 +- .github/workflows/pre-release.yml | 119 -- .github/workflows/quick-setup/action.yml | 23 - .github/workflows/release.yml | 86 +- .github/workflows/run-on-remote/action.yml | 43 - .github/workflows/setup/action.yml | 52 - .gitignore | 4 + .gitmodules | 6 + Cargo.lock | 1092 +++--------- Cargo.toml | 8 +- Makefile.toml | 16 +- README.md | 2 +- crates/aquascope/Cargo.lock | 386 ----- crates/aquascope/Cargo.toml | 15 +- .../aquascope/src/analysis/find_bindings.rs | 6 +- .../src/analysis/ir_mapper/body_graph.rs | 38 +- .../aquascope/src/analysis/ir_mapper/mod.rs | 2 +- .../src/analysis/ir_mapper/post_dominators.rs | 28 +- .../src/analysis/permissions/context.rs | 2 +- .../src/analysis/permissions/flow.rs | 42 +- .../aquascope/src/analysis/permissions/mod.rs | 1 + .../src/analysis/permissions/output.rs | 31 +- .../src/analysis/permissions/utils.rs | 43 +- .../src/analysis/stepper/hir_steps.rs | 19 +- .../src/analysis/stepper/segmented_mir.rs | 4 +- .../src/analysis/stepper/table_builder.rs | 2 +- crates/aquascope/src/errors/mod.rs | 13 +- crates/aquascope/src/errors/silent_emitter.rs | 29 - crates/aquascope/src/interpreter/mapper.rs | 6 +- crates/aquascope/src/interpreter/miri.rs | 16 + .../aquascope/src/interpreter/miri_utils.rs | 11 +- crates/aquascope/src/interpreter/mod.rs | 18 +- crates/aquascope/src/interpreter/mvalue.rs | 74 +- crates/aquascope/src/interpreter/step.rs | 73 +- crates/aquascope/src/lib.rs | 1 + crates/aquascope/src/test_utils.rs | 20 +- crates/aquascope_front/Cargo.lock | 520 ------ crates/aquascope_front/Cargo.toml | 13 +- crates/aquascope_front/src/plugin.rs | 11 +- crates/aquascope_serve/Cargo.lock | 1527 ----------------- crates/aquascope_workspace_utils/Cargo.toml | 2 +- crates/aquascope_workspace_utils/src/lib.rs | 20 +- crates/mdbook-aquascope/build.rs | 2 +- crates/mdbook-aquascope/src/main.rs | 8 +- crates/mdbook-aquascope/src/preprocessor.rs | 30 +- flake.lock | 235 +++ flake.nix | 108 ++ frontend/package.json | 4 +- .../aquascope-standalone/vite.config.ts | 13 - .../{aquascope-editor => editor}/.gitignore | 0 .../{aquascope-editor => editor}/package.json | 4 +- .../src/editor-utils/boundaries.tsx | 2 +- .../src/editor-utils/interpreter.tsx | 2 +- .../src/editor-utils/misc.tsx | 4 +- .../src/editor-utils/permissions.tsx | 6 +- .../src/editor-utils/stepper.tsx | 4 +- .../{aquascope-editor => editor}/src/lib.tsx | 140 +- .../src/styles.scss | 0 frontend/packages/editor/src/types.ts | 0 .../tsconfig.json | 0 .../vitest.config.ts | 0 .../{aquascope-embed => embed}/package.json | 9 +- .../{aquascope-embed => embed}/src/main.tsx | 175 +- .../{aquascope-embed => embed}/src/setup.ts | 0 .../src/styles.scss | 2 +- .../tests/embed.test.ts | 10 +- .../{aquascope-embed => embed}/tsconfig.json | 0 .../{aquascope-embed => embed}/vite.config.ts | 14 +- .../aquascope-favicon.png | Bin .../index.html | 17 +- .../package.json | 13 +- .../public/android-chrome-192x192.png | Bin .../public/android-chrome-512x512.png | Bin .../public/apple-touch-icon.png | Bin .../public/favicon-16x16.png | Bin .../public/favicon-32x32.png | Bin .../public/favicon.ico | Bin .../public/site.webmanifest | 0 .../standalone/src/coi-serviceworker.js | 146 ++ .../src/index.tsx | 87 +- .../src/setup.ts | 0 .../styles.scss | 2 +- .../tests/standalone.test.ts | 23 +- .../tsconfig.json | 0 frontend/packages/standalone/vite.config.mts | 13 + frontend/packages/system/biome.json | 32 + frontend/packages/system/package.json | 26 + .../packages/system/src/assets/wasm-builds | 1 + .../packages/system/src/bindings/vite.d.ts | 1 + frontend/packages/system/src/lib.ts | 335 ++++ frontend/packages/system/src/wasi/debug.ts | 38 + frontend/packages/system/src/wasi/exports.ts | 11 + frontend/packages/system/src/wasi/fd.ts | 127 ++ frontend/packages/system/src/wasi/fs_mem.ts | 750 ++++++++ frontend/packages/system/src/wasi/fs_opfs.ts | 149 ++ frontend/packages/system/src/wasi/strace.ts | 20 + frontend/packages/system/src/wasi/wasi.ts | 873 ++++++++++ .../packages/system/src/wasi/wasi_defs.ts | 372 ++++ frontend/packages/system/tsconfig.json | 10 + frontend/packages/system/vitest.config.ts | 16 + frontend/packages/types/.gitignore | 1 + frontend/packages/types/biome.json | 6 + frontend/packages/types/package.json | 22 + .../types/src/bindings/Abbreviated.ts | 3 + .../types/src/bindings/AnalysisOutput.ts | 10 + .../src/bindings/AquascopeAnnotations.ts | 7 + .../types/src/bindings/AquascopeError.ts | 4 + .../src/bindings/BoundariesAnnotations.ts | 4 + .../packages/types/src/bindings/CharPos.ts | 3 + .../packages/types/src/bindings/CharRange.ts | 5 + .../types/src/bindings/FilenameIndex.ts | 3 + .../types/src/bindings/FlowBoundary.ts | 5 + .../types/src/bindings/FlowEdgeKind.ts | 3 + .../types/src/bindings/InterpAnnotations.ts | 4 + .../packages/types/src/bindings/LoanKey.ts | 3 + .../packages/types/src/bindings/LoanPoints.ts | 5 + .../types/src/bindings/LoanRegions.ts | 5 + .../packages/types/src/bindings/MFrame.ts | 5 + frontend/packages/types/src/bindings/MHeap.ts | 4 + .../types/src/bindings/MHeapAllocKind.ts | 3 + .../packages/types/src/bindings/MLocal.ts | 5 + .../types/src/bindings/MMemorySegment.ts | 3 + frontend/packages/types/src/bindings/MPath.ts | 5 + .../types/src/bindings/MPathSegment.ts | 3 + .../packages/types/src/bindings/MResult.ts | 4 + .../packages/types/src/bindings/MStack.ts | 4 + frontend/packages/types/src/bindings/MStep.ts | 5 + .../packages/types/src/bindings/MTrace.ts | 5 + .../types/src/bindings/MUndefinedBehavior.ts | 3 + .../packages/types/src/bindings/MValue.ts | 6 + .../packages/types/src/bindings/MdCharPos.ts | 3 + .../packages/types/src/bindings/MdLinePos.ts | 3 + .../packages/types/src/bindings/MoveKey.ts | 3 + .../packages/types/src/bindings/MovePoints.ts | 5 + .../types/src/bindings/MoveRegions.ts | 5 + .../types/src/bindings/PathMatcher.ts | 3 + .../types/src/bindings/Permissions.ts | 3 + .../types/src/bindings/PermissionsBoundary.ts | 7 + .../types/src/bindings/PermissionsData.ts | 6 + .../types/src/bindings/PermissionsDataDiff.ts | 7 + .../types/src/bindings/PermissionsDiff.ts | 4 + .../src/bindings/PermissionsLineDisplay.ts | 5 + .../src/bindings/PermissionsStepTable.ts | 5 + .../types/src/bindings/RefinementRegion.ts | 5 + .../packages/types/src/bindings/Refiner.ts | 5 + .../types/src/bindings/StepperAnnotations.ts | 5 + .../packages/types/src/bindings/ValueStep.ts | 3 + .../src/types.ts => types/src/lib.ts} | 47 +- frontend/packages/types/tsconfig.json | 14 + frontend/packages/types/vitest.config.ts | 16 + frontend/pnpm-lock.yaml | 1241 ++++---------- frontend/typedoc.json | 4 +- rust-toolchain.toml | 14 +- scripts/build-wasm.sh | 3 + 154 files changed, 4863 insertions(+), 4982 deletions(-) delete mode 100644 .github/workflows/pre-release.yml delete mode 100644 .github/workflows/quick-setup/action.yml delete mode 100644 .github/workflows/run-on-remote/action.yml delete mode 100644 .github/workflows/setup/action.yml create mode 100644 .gitmodules delete mode 100644 crates/aquascope/Cargo.lock delete mode 100644 crates/aquascope/src/errors/silent_emitter.rs create mode 100644 crates/aquascope/src/interpreter/miri.rs delete mode 100644 crates/aquascope_front/Cargo.lock delete mode 100644 crates/aquascope_serve/Cargo.lock create mode 100644 flake.lock create mode 100644 flake.nix delete mode 100644 frontend/packages/aquascope-standalone/vite.config.ts rename frontend/packages/{aquascope-editor => editor}/.gitignore (100%) rename frontend/packages/{aquascope-editor => editor}/package.json (88%) rename frontend/packages/{aquascope-editor => editor}/src/editor-utils/boundaries.tsx (99%) rename frontend/packages/{aquascope-editor => editor}/src/editor-utils/interpreter.tsx (99%) rename frontend/packages/{aquascope-editor => editor}/src/editor-utils/misc.tsx (99%) rename frontend/packages/{aquascope-editor => editor}/src/editor-utils/permissions.tsx (93%) rename frontend/packages/{aquascope-editor => editor}/src/editor-utils/stepper.tsx (99%) rename frontend/packages/{aquascope-editor => editor}/src/lib.tsx (74%) rename frontend/packages/{aquascope-editor => editor}/src/styles.scss (100%) create mode 100644 frontend/packages/editor/src/types.ts rename frontend/packages/{aquascope-editor => editor}/tsconfig.json (100%) rename frontend/packages/{aquascope-editor => editor}/vitest.config.ts (100%) rename frontend/packages/{aquascope-embed => embed}/package.json (77%) rename frontend/packages/{aquascope-embed => embed}/src/main.tsx (56%) rename frontend/packages/{aquascope-embed => embed}/src/setup.ts (100%) rename frontend/packages/{aquascope-embed => embed}/src/styles.scss (98%) rename frontend/packages/{aquascope-embed => embed}/tests/embed.test.ts (86%) rename frontend/packages/{aquascope-embed => embed}/tsconfig.json (100%) rename frontend/packages/{aquascope-embed => embed}/vite.config.ts (52%) rename frontend/packages/{aquascope-standalone => standalone}/aquascope-favicon.png (100%) rename frontend/packages/{aquascope-standalone => standalone}/index.html (88%) rename frontend/packages/{aquascope-standalone => standalone}/package.json (71%) rename frontend/packages/{aquascope-standalone => standalone}/public/android-chrome-192x192.png (100%) rename frontend/packages/{aquascope-standalone => standalone}/public/android-chrome-512x512.png (100%) rename frontend/packages/{aquascope-standalone => standalone}/public/apple-touch-icon.png (100%) rename frontend/packages/{aquascope-standalone => standalone}/public/favicon-16x16.png (100%) rename frontend/packages/{aquascope-standalone => standalone}/public/favicon-32x32.png (100%) rename frontend/packages/{aquascope-standalone => standalone}/public/favicon.ico (100%) rename frontend/packages/{aquascope-standalone => standalone}/public/site.webmanifest (100%) create mode 100644 frontend/packages/standalone/src/coi-serviceworker.js rename frontend/packages/{aquascope-standalone => standalone}/src/index.tsx (62%) rename frontend/packages/{aquascope-standalone => standalone}/src/setup.ts (100%) rename frontend/packages/{aquascope-standalone => standalone}/styles.scss (99%) rename frontend/packages/{aquascope-standalone => standalone}/tests/standalone.test.ts (84%) rename frontend/packages/{aquascope-standalone => standalone}/tsconfig.json (100%) create mode 100644 frontend/packages/standalone/vite.config.mts create mode 100644 frontend/packages/system/biome.json create mode 100644 frontend/packages/system/package.json create mode 160000 frontend/packages/system/src/assets/wasm-builds create mode 100644 frontend/packages/system/src/bindings/vite.d.ts create mode 100644 frontend/packages/system/src/lib.ts create mode 100644 frontend/packages/system/src/wasi/debug.ts create mode 100644 frontend/packages/system/src/wasi/exports.ts create mode 100644 frontend/packages/system/src/wasi/fd.ts create mode 100644 frontend/packages/system/src/wasi/fs_mem.ts create mode 100644 frontend/packages/system/src/wasi/fs_opfs.ts create mode 100644 frontend/packages/system/src/wasi/strace.ts create mode 100644 frontend/packages/system/src/wasi/wasi.ts create mode 100644 frontend/packages/system/src/wasi/wasi_defs.ts create mode 100644 frontend/packages/system/tsconfig.json create mode 100644 frontend/packages/system/vitest.config.ts create mode 100644 frontend/packages/types/.gitignore create mode 100644 frontend/packages/types/biome.json create mode 100644 frontend/packages/types/package.json create mode 100644 frontend/packages/types/src/bindings/Abbreviated.ts create mode 100644 frontend/packages/types/src/bindings/AnalysisOutput.ts create mode 100644 frontend/packages/types/src/bindings/AquascopeAnnotations.ts create mode 100644 frontend/packages/types/src/bindings/AquascopeError.ts create mode 100644 frontend/packages/types/src/bindings/BoundariesAnnotations.ts create mode 100644 frontend/packages/types/src/bindings/CharPos.ts create mode 100644 frontend/packages/types/src/bindings/CharRange.ts create mode 100644 frontend/packages/types/src/bindings/FilenameIndex.ts create mode 100644 frontend/packages/types/src/bindings/FlowBoundary.ts create mode 100644 frontend/packages/types/src/bindings/FlowEdgeKind.ts create mode 100644 frontend/packages/types/src/bindings/InterpAnnotations.ts create mode 100644 frontend/packages/types/src/bindings/LoanKey.ts create mode 100644 frontend/packages/types/src/bindings/LoanPoints.ts create mode 100644 frontend/packages/types/src/bindings/LoanRegions.ts create mode 100644 frontend/packages/types/src/bindings/MFrame.ts create mode 100644 frontend/packages/types/src/bindings/MHeap.ts create mode 100644 frontend/packages/types/src/bindings/MHeapAllocKind.ts create mode 100644 frontend/packages/types/src/bindings/MLocal.ts create mode 100644 frontend/packages/types/src/bindings/MMemorySegment.ts create mode 100644 frontend/packages/types/src/bindings/MPath.ts create mode 100644 frontend/packages/types/src/bindings/MPathSegment.ts create mode 100644 frontend/packages/types/src/bindings/MResult.ts create mode 100644 frontend/packages/types/src/bindings/MStack.ts create mode 100644 frontend/packages/types/src/bindings/MStep.ts create mode 100644 frontend/packages/types/src/bindings/MTrace.ts create mode 100644 frontend/packages/types/src/bindings/MUndefinedBehavior.ts create mode 100644 frontend/packages/types/src/bindings/MValue.ts create mode 100644 frontend/packages/types/src/bindings/MdCharPos.ts create mode 100644 frontend/packages/types/src/bindings/MdLinePos.ts create mode 100644 frontend/packages/types/src/bindings/MoveKey.ts create mode 100644 frontend/packages/types/src/bindings/MovePoints.ts create mode 100644 frontend/packages/types/src/bindings/MoveRegions.ts create mode 100644 frontend/packages/types/src/bindings/PathMatcher.ts create mode 100644 frontend/packages/types/src/bindings/Permissions.ts create mode 100644 frontend/packages/types/src/bindings/PermissionsBoundary.ts create mode 100644 frontend/packages/types/src/bindings/PermissionsData.ts create mode 100644 frontend/packages/types/src/bindings/PermissionsDataDiff.ts create mode 100644 frontend/packages/types/src/bindings/PermissionsDiff.ts create mode 100644 frontend/packages/types/src/bindings/PermissionsLineDisplay.ts create mode 100644 frontend/packages/types/src/bindings/PermissionsStepTable.ts create mode 100644 frontend/packages/types/src/bindings/RefinementRegion.ts create mode 100644 frontend/packages/types/src/bindings/Refiner.ts create mode 100644 frontend/packages/types/src/bindings/StepperAnnotations.ts create mode 100644 frontend/packages/types/src/bindings/ValueStep.ts rename frontend/packages/{aquascope-editor/src/types.ts => types/src/lib.ts} (71%) create mode 100644 frontend/packages/types/tsconfig.json create mode 100644 frontend/packages/types/vitest.config.ts create mode 100755 scripts/build-wasm.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f7651b74..a8e60344f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,17 +14,12 @@ jobs: test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Setup - uses: ./.github/workflows/setup - - name: Backend tests - uses: actions-rs/cargo@v1 - with: - command: insta - args: test --features=no-docker - - name: Build Aquascope server - run: cargo build -p aquascope_serve --features=no-docker - - name: Frontend tests - run: | - cargo run -p aquascope_serve --features=no-docker & - cd frontend && depot test + - uses: actions/checkout@v3 + + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: DeterminateSystems/flake-checker-action@main + + - name: Argus Test + #run: nix develop --command ci-check + run: echo "TODO tests disabled" diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml deleted file mode 100644 index 0f0a054ee..000000000 --- a/.github/workflows/pre-release.yml +++ /dev/null @@ -1,119 +0,0 @@ -name: pre-release - -on: - pull_request: - branches: - - "main" - types: [opened,labeled,synchronize] - -env: - IMAGE_TAG: aquascope:latest - -jobs: - test-authentication: - if: contains(github.event.pull_request.labels.*.name, 'release') - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Ping remote - uses: ./.github/workflows/run-on-remote - with: - file: deploy/ping.sh - credentials: ${{ secrets.GOOGLE_CREDENTIALS }} - project-id: ${{ secrets.GOOGLE_PROJECT_ID }} - ssh-key: ${{ secrets.GOOGLE_SSH_PRIVATE_KEY }} - - check-publishable-versions: - if: contains(github.event.pull_request.labels.*.name, 'release') - runs-on: ubuntu-latest - env: - LISP: ccl-bin - steps: - - run: echo Skipping silently - # - uses: actions/checkout@v3 - # - uses: 40ants/setup-lisp@v2 - # with: - # asdf-system: cl-info - # - name: Get Previous tag - # id: previoustag - # uses: WyriHaximus/github-action-get-previous-tag@v1 - # env: - # GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" - # - name: Validate Version - # run: | - # cd scripts - # ros versioning.ros check ${{ steps.previoustag.outputs.tag }} - - build-backend: - needs: [check-publishable-versions,test-authentication] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Build and save docker image - run: | - docker build --tag "${IMAGE_TAG}" . - docker save --output image.tar "${IMAGE_TAG}" - - name: Build Aquascope serve - run: cargo build -p aquascope_serve --release - - name: Zip artifacts - run : zip artifacts.zip ./image.tar ./target/release/aquascope_serve - - name: Authenticate to Google Cloud - uses: google-github-actions/auth@v1 - with: - credentials_json: ${{ secrets.GOOGLE_CREDENTIALS }} - - name: Set up Cloud SDK - uses: google-github-actions/setup-gcloud@v1 - with: - version: '>= 412.0.0' - - name: Upload artifacts - run: gcloud compute scp artifacts.zip gh-actions@aquascope:~/ --zone us-central1-a --tunnel-through-iap - - update-frontend: - needs: build-backend - runs-on: ubuntu-latest - env: - AQUASCOPE_SERVER: "https://aquascope.willcrichton.net" - steps: - - uses: actions/checkout@v3 - - name: Quick Setup - uses: ./.github/workflows/quick-setup - - name: Build docs - run: | - cargo doc --lib - mv ./target/doc ./frontend/packages/aquascope-standalone/dist/doc - - uses: JamesIves/github-pages-deploy-action@v4.3.0 - with: - branch: gh-pages - folder: ./frontend/packages/aquascope-standalone/dist - clean: true - clean-exclude: dev - - update-server: - needs: update-frontend - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Restart server - uses: ./.github/workflows/run-on-remote - with: - file: deploy/update.sh - credentials: ${{ secrets.GOOGLE_CREDENTIALS }} - project-id: ${{ secrets.GOOGLE_PROJECT_ID }} - ssh-key: ${{ secrets.GOOGLE_SSH_PRIVATE_KEY }} - - publish-crates: - needs: [update-frontend,update-server] - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions-rs/install@v0.1 - with: - crate: cargo-workspaces - version: latest - use-tool-cache: true - - name: Quick Setup - uses: ./.github/workflows/quick-setup - # Run cargo build to ensure crates/mdbook-aquascope/js is populated - - run: cargo build - # --allow-dirty is for JS files packaged w/ mdbook-aquascope - - run: cargo ws publish --from-git --allow-dirty --yes --token ${{ secrets.CRATES_IO_TOKEN }} diff --git a/.github/workflows/quick-setup/action.yml b/.github/workflows/quick-setup/action.yml deleted file mode 100644 index f3756236e..000000000 --- a/.github/workflows/quick-setup/action.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: setup -runs: - using: composite - steps: - - name: Stable rustc - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - uses: davidB/rust-cargo-make@v1 - with: - version: '0.36.4' - - name: Install cargo-insta - run: cargo +stable install cargo-insta - shell: bash - - name: Gen bindings - run: cargo make init-bindings - shell: bash - - name: Install Depot - run: curl https://raw.githubusercontent.com/cognitive-engineering-lab/depot/main/scripts/install.sh | sh - shell: bash - - name: Prepare frontend - run: cd frontend && depot build - shell: bash diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c41c4f072..a94b6cea7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,33 +6,81 @@ on: types: [labeled,closed] jobs: + tag: runs-on: ubuntu-latest if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release') steps: - uses: actions/checkout@v3 - - uses: christophebedard/tag-version-commit@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - version_regex: 'v([0-9]+\.[0-9]+\.[0-9]+)' - version_tag_prefix: 'v' + - name: Tag + run: echo "TODO explicitly not tagging" + # - uses: christophebedard/tag-version-commit@v1 + # with: + # token: ${{ secrets.GITHUB_TOKEN }} + # version_regex: 'v([0-9]+\.[0-9]+\.[0-9]+)' + # version_tag_prefix: 'v' - release-artifact: + + publish-crates: needs: tag runs-on: ubuntu-latest - if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release') + steps: + - name: Publish + run: echo "TODO explicitly not publishing" + # - uses: actions/checkout@v3 + # - uses: DeterminateSystems/nix-installer-action@main + # - uses: DeterminateSystems/magic-nix-cache-action@main + # - uses: DeterminateSystems/flake-checker-action@main + + # - name: Install aquascope and mdbook-aquascope + # run: nix develop --command ci-install + + # - name: Publish Crates + # run: nix develop --command ci-publish-crates ${{ secrets.CRATES_IO_TOKEN }} + + + update-frontend: + needs: publish-crates + runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Quick Setup - uses: ./.github/workflows/quick-setup - - name: Build artifact - run: cargo build --release -p mdbook-aquascope -p aquascope_front - - name: Package artifact - run: tar -czf aquascope-x86_64-unknown-linux-gnu.tar.gz mdbook-aquascope cargo-aquascope aquascope-driver - working-directory: target/release - - name: Release artifact - uses: softprops/action-gh-release@v1 + - uses: DeterminateSystems/nix-installer-action@main + - uses: DeterminateSystems/magic-nix-cache-action@main + - uses: DeterminateSystems/flake-checker-action@main + + - name: Build Docs and Standalone + run: nix develop .#minimal --command ci-build-pages + + - uses: JamesIves/github-pages-deploy-action@v4.3.0 with: - tag_name: ${{ github.event.pull_request.title }} - files: | - target/release/aquascope-x86_64-unknown-linux-gnu.tar.gz + branch: gh-pages + folder: ./frontend/packages/aquascope-standalone/dist + clean: true + clean-exclude: dev + + + release-artifact: + needs: publish-crates + runs-on: ubuntu-latest + if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release') + steps: + - name: Release Artifact + run: echo "TODO explicitly not releasing an artifact" + # - uses: actions/checkout@v3 + # - uses: DeterminateSystems/nix-installer-action@main + # - uses: DeterminateSystems/magic-nix-cache-action@main + # - uses: DeterminateSystems/flake-checker-action@main + + # - name: Install aquascope and mdbook-aquascope + # run: nix develop --command ci-build + + # - name: Package artifact + # run: tar -czf aquascope-x86_64-unknown-linux-gnu.tar.gz mdbook-aquascope cargo-aquascope aquascope-driver + # working-directory: target/release + + # - name: Release artifact + # uses: softprops/action-gh-release@v1 + # with: + # tag_name: ${{ github.event.pull_request.title }} + # files: | + # target/release/aquascope-x86_64-unknown-linux-gnu.tar.gz diff --git a/.github/workflows/run-on-remote/action.yml b/.github/workflows/run-on-remote/action.yml deleted file mode 100644 index 745805674..000000000 --- a/.github/workflows/run-on-remote/action.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: run-on-remote -inputs: - file: - required: true - credentials: - required: true - project-id: - required: true - ssh-key: - required: true -runs: - using: composite - steps: - - uses: actions/checkout@v3 - - name: Authenticate to Google Cloud - uses: google-github-actions/auth@v1 - with: - credentials_json: ${{ inputs.credentials }} - - name: Set up Cloud SDK - uses: google-github-actions/setup-gcloud@v1 - with: - version: '>= 412.0.0' - - name: Copy to server - run: gcloud compute scp ./${{ inputs.file }} gh-actions@aquascope:~/${{ inputs.file }} --zone us-central1-a --tunnel-through-iap - shell: bash - - name: Make executable - uses: google-github-actions/ssh-compute@v0 - with: - zone: 'us-central1-a' - project_id: ${{ inputs.project-id }} - ssh_private_key: ${{ inputs.ssh-key }} - instance_name: aquascope - user: gh-actions - command: "chmod +x ~/${{ inputs.file }}" - - name: Execute script - uses: google-github-actions/ssh-compute@v0 - with: - zone: 'us-central1-a' - project_id: ${{ inputs.project-id }} - ssh_private_key: ${{ inputs.ssh-key }} - instance_name: aquascope - user: gh-actions - command: /home/gh-actions/${{ inputs.file }} diff --git a/.github/workflows/setup/action.yml b/.github/workflows/setup/action.yml deleted file mode 100644 index ef6e9afd0..000000000 --- a/.github/workflows/setup/action.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: setup -runs: - using: composite - steps: - - uses: actions/checkout@v3 - - - name: Stable rustc - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - default: true - - - uses: davidB/rust-cargo-make@v1 - with: - version: '0.36.4' - - - name: Install cargo-insta - run: cargo +stable install cargo-insta - shell: bash - - - name: Gen bindings - run: cargo make init-bindings - shell: bash - - - name: Install mdbook - run: | - mkdir bin - curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.25/mdbook-v0.4.25-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin - echo "$(pwd)/bin" >> ${GITHUB_PATH} - shell: bash - - - name: Install Depot - run: curl https://raw.githubusercontent.com/cognitive-engineering-lab/depot/main/scripts/install.sh | sh - shell: bash - - - name: Prepare frontend - run: cd frontend && depot build - shell: bash - - - name: Install aquascope - run: cargo install --path crates/aquascope_front --debug --locked - shell: bash - - - name: Install mdbook-aquascope - run: cargo install --path crates/mdbook-aquascope --debug --locked - shell: bash - - - name: Build test book - run: | - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$($(rustup which --toolchain nightly-2023-08-25 rustc) --print target-libdir) - cd crates/mdbook-aquascope/test-book && mdbook build - shell: bash diff --git a/.gitignore b/.gitignore index b48242955..39e4eddfd 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,9 @@ tmp/ dist/ node_modules/ +.direnv/ +.envrc +bindings/ # Ignore generated credentials from google-github-actions/auth gha-creds-*.json @@ -20,3 +23,4 @@ sample-book/ # Rust things target/ debug/ +examples/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..10aa6771a --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "frontend/packages/rustc/src/assets/wasm-builds"] + path = frontend/packages/rustc/src/assets/wasm-builds + url = git@github.com:cognitive-engineering-lab/wasm-builds.git +[submodule "frontend/packages/system/src/assets/wasm-builds"] + path = frontend/packages/system/src/assets/wasm-builds + url = git@github.com:cognitive-engineering-lab/wasm-builds.git diff --git a/Cargo.lock b/Cargo.lock index f94f800b3..cbf28e081 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,21 +8,23 @@ version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -[[package]] -name = "addr2line" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" -dependencies = [ - "gimli", -] - [[package]] name = "adler" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + [[package]] name = "aho-corasick" version = "1.0.5" @@ -120,7 +122,7 @@ dependencies = [ "rustc_utils", "serde", "test-log", - "ts-rs", + "ts-rs 7.1.1", ] [[package]] @@ -138,27 +140,7 @@ dependencies = [ "rustc_utils", "serde", "serde_json", - "ts-rs", -] - -[[package]] -name = "aquascope_serve" -version = "0.1.0" -dependencies = [ - "async-trait", - "axum", - "bollard", - "env_logger 0.9.3", - "futures", - "lazy_static", - "log", - "serde", - "serde_json", - "snafu", - "tar", - "tempfile", - "tokio", - "tower-http", + "ts-rs 6.2.1", ] [[package]] @@ -166,18 +148,7 @@ name = "aquascope_workspace_utils" version = "0.3.2" dependencies = [ "anyhow", - "toml 0.5.11", -] - -[[package]] -name = "async-trait" -version = "0.1.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.29", + "toml 0.8.2", ] [[package]] @@ -197,74 +168,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" -[[package]] -name = "axum" -version = "0.5.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acee9fd5073ab6b045a275b3e709c163dd36c90685219cb21804a147b58dba43" -dependencies = [ - "async-trait", - "axum-core", - "bitflags 1.3.2", - "bytes", - "futures-util", - "http", - "http-body", - "hyper", - "itoa", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper", - "tokio", - "tower", - "tower-http", - "tower-layer", - "tower-service", -] - -[[package]] -name = "axum-core" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e5939e02c56fecd5c017c37df4238c0a839fa76b7f97acdd7efb804fd181cc" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http", - "http-body", - "mime", - "tower-layer", - "tower-service", -] - -[[package]] -name = "backtrace" -version = "0.3.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "bitflags" version = "1.3.2" @@ -286,44 +189,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "bollard" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82e7850583ead5f8bbef247e2a3c37a19bd576e8420cd262a6711921827e1e5" -dependencies = [ - "base64", - "bollard-stubs", - "bytes", - "futures-core", - "futures-util", - "hex", - "http", - "hyper", - "hyperlocal", - "log", - "pin-project-lite", - "serde", - "serde_derive", - "serde_json", - "serde_urlencoded", - "thiserror", - "tokio", - "tokio-util", - "url", - "winapi", -] - -[[package]] -name = "bollard-stubs" -version = "1.42.0-rc.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed59b5c00048f48d7af971b71f800fdf23e858844a6f9e4d32ca72e9399e7864" -dependencies = [ - "serde", - "serde_with", -] - [[package]] name = "bstr" version = "1.6.2" @@ -347,12 +212,6 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c676a478f63e9fa2dd5368a42f28bba0d6c560b775f38583c8bbaa7fcd67c9c" -[[package]] -name = "bytes" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" - [[package]] name = "camino" version = "1.1.6" @@ -401,14 +260,46 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.28" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ed24df0632f708f5f6d8082675bef2596f7084dee3dd55f632290bf35bfe0f" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", - "windows-targets 0.48.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "chrono-tz" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93698b29de5e97ad0ae26447b344c482a7284c737d9ddc5f9e52b74a336671bb" +dependencies = [ + "chrono", + "chrono-tz-build", + "phf", +] + +[[package]] +name = "chrono-tz-build" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c088aee841df9c3041febbb73934cfc39708749bf96dc827e3359cd39ef11b1" +dependencies = [ + "parse-zoneinfo", + "phf", + "phf_codegen", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", ] [[package]] @@ -591,56 +482,36 @@ dependencies = [ ] [[package]] -name = "darling" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.13.4" +name = "digest" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn 1.0.109", + "block-buffer", + "crypto-common", ] [[package]] -name = "darling_macro" -version = "0.13.4" +name = "directories" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" dependencies = [ - "darling_core", - "quote", - "syn 1.0.109", + "dirs-sys", ] [[package]] -name = "digest" -version = "0.10.7" +name = "dirs-sys" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" dependencies = [ - "block-buffer", - "crypto-common", + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", ] -[[package]] -name = "doc-comment" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" - [[package]] name = "either" version = "1.9.0" @@ -712,18 +583,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" -[[package]] -name = "filetime" -version = "0.2.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.3.5", - "windows-sys 0.48.0", -] - [[package]] name = "flate2" version = "1.0.27" @@ -740,110 +599,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "749cff877dc1af878a0b31a41dd221a753634401ea0ef2f87b62d3171522485a" -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "form_urlencoded" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "futures" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" - -[[package]] -name = "futures-executor" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" - -[[package]] -name = "futures-macro" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.29", -] - -[[package]] -name = "futures-sink" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" - -[[package]] -name = "futures-task" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" - -[[package]] -name = "futures-util" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -865,31 +620,6 @@ dependencies = [ "wasi", ] -[[package]] -name = "gimli" -version = "0.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" - -[[package]] -name = "h2" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap 1.9.3", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "handlebars" version = "4.4.0" @@ -922,6 +652,10 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "hello-world" +version = "0.1.0" + [[package]] name = "hermit-abi" version = "0.1.19" @@ -937,12 +671,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - [[package]] name = "html-escape" version = "0.2.13" @@ -952,89 +680,12 @@ dependencies = [ "utf8-width", ] -[[package]] -name = "http" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" -dependencies = [ - "bytes", - "http", - "pin-project-lite", -] - -[[package]] -name = "http-range-header" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" - [[package]] name = "humantime" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" -[[package]] -name = "hyper" -version = "0.14.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2 0.4.9", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyperlocal" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fafdf7b2b2de7c9784f76e02c0935e65a8117ec3b768644379983ab333ac98c" -dependencies = [ - "futures-util", - "hex", - "hyper", - "pin-project", - "tokio", -] - [[package]] name = "iana-time-zone" version = "0.1.57" @@ -1058,22 +709,6 @@ dependencies = [ "cc", ] -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "idna" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "indexmap" version = "1.9.3" @@ -1094,6 +729,15 @@ dependencies = [ "hashbrown 0.14.0", ] +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "generic-array", +] + [[package]] name = "insta" version = "1.31.0" @@ -1110,15 +754,6 @@ dependencies = [ "yaml-rust", ] -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - [[package]] name = "intervaltree" version = "0.2.7" @@ -1165,6 +800,16 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +[[package]] +name = "jemalloc-sys" +version = "0.5.4+5.3.0-patched" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac6c1946e1cea1788cbfde01c993b52a10e2da07f4bac608228d1bed20bfebf2" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "js-sys" version = "0.3.64" @@ -1207,12 +852,22 @@ dependencies = [ [[package]] name = "libloading" -version = "0.7.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "winapi", + "windows-targets 0.52.6", +] + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.4.0", + "libc", ] [[package]] @@ -1255,12 +910,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" -[[package]] -name = "matchit" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73cbba799671b762df5a175adf59ce145165747bb891505c43d09aefbbf38beb" - [[package]] name = "mdbook" version = "0.4.34" @@ -1308,7 +957,7 @@ dependencies = [ "serde", "serde_json", "tempfile", - "ts-rs", + "ts-rs 6.2.1", "wait-timeout", ] @@ -1329,9 +978,9 @@ dependencies = [ [[package]] name = "measureme" -version = "10.1.1" +version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1930d162935fecd56fc4e0f6729eb3483bac1264542eb4ea31570b86a434b6bc" +checksum = "dfa4a40f09af7aa6faef38285402a78847d0d72bf8827006cd2a332e1e6e4a8d" dependencies = [ "log", "memmap2", @@ -1365,12 +1014,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - [[package]] name = "minimal-lexical" version = "0.2.1" @@ -1386,29 +1029,21 @@ dependencies = [ "adler", ] -[[package]] -name = "mio" -version = "0.8.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" -dependencies = [ - "libc", - "wasi", - "windows-sys 0.48.0", -] - [[package]] name = "miri" version = "0.1.0" -source = "git+https://github.com/rust-lang/miri.git?rev=63c5542edf907dd797db82c4c2979e3c4df71a8b#63c5542edf907dd797db82c4c2979e3c4df71a8b" +source = "git+https://github.com/gavinleroy/miri.git?branch=wasm-patch#9aca60ae50d3950f7ffa299c94523111687de63e" dependencies = [ + "aes", + "chrono", + "chrono-tz", "ctrlc", - "env_logger 0.9.3", + "directories", "getrandom", + "jemalloc-sys", "libc", "libffi", "libloading", - "log", "measureme", "rand", "smallvec", @@ -1474,15 +1109,6 @@ dependencies = [ "libc", ] -[[package]] -name = "object" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ac5bbd07aea88c60a577a1ce218075ffd59208b2d7ca97adf9bfc5aeb21ebe" -dependencies = [ - "memchr", -] - [[package]] name = "once_cell" version = "1.18.0" @@ -1500,6 +1126,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + [[package]] name = "os_str_bytes" version = "6.5.1" @@ -1508,34 +1140,35 @@ checksum = "4d5d9eb14b174ee9aa2ef96dc2b94637a2d4b6e7cb873c7e171f0c20c6cf3eac" [[package]] name = "parking_lot" -version = "0.11.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ - "instant", "lock_api", "parking_lot_core", ] [[package]] name = "parking_lot_core" -version = "0.8.6" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", - "instant", "libc", - "redox_syscall 0.2.16", + "redox_syscall 0.5.3", "smallvec", - "winapi", + "windows-targets 0.52.6", ] [[package]] -name = "percent-encoding" -version = "2.3.0" +name = "parse-zoneinfo" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "1f2a05b18d44e2957b88f96ba460715e295bc1d7510468a2f3d3b44535d26c24" +dependencies = [ + "regex", +] [[package]] name = "perf-event-open-sys" @@ -1592,36 +1225,42 @@ dependencies = [ ] [[package]] -name = "pin-project" -version = "1.1.3" +name = "phf" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ - "pin-project-internal", + "phf_shared", ] [[package]] -name = "pin-project-internal" -version = "1.1.3" +name = "phf_codegen" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.29", + "phf_generator", + "phf_shared", ] [[package]] -name = "pin-project-lite" -version = "0.2.13" +name = "phf_generator" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared", + "rand", +] [[package]] -name = "pin-utils" -version = "0.1.0" +name = "phf_shared" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] [[package]] name = "ppv-lite86" @@ -1736,20 +1375,31 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ "bitflags 1.3.2", ] [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", +] + +[[package]] +name = "redox_users" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +dependencies = [ + "getrandom", + "libredox", + "thiserror", ] [[package]] @@ -1781,12 +1431,6 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - [[package]] name = "rustc-hash" version = "1.1.0" @@ -1795,8 +1439,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc_plugin" -version = "0.7.0-nightly-2023-08-25" -source = "git+https://github.com/cognitive-engineering-lab/rustc_plugin?rev=d4b3c43b0695d42030f9cb3a62fc27cc337019d1#d4b3c43b0695d42030f9cb3a62fc27cc337019d1" +version = "0.10.0-nightly-2024-05-20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5dce94a7ecc94714c9c0d34f2b887bc1a6d034faec96784684fdb3ed4d7e30e" dependencies = [ "cargo_metadata", "log", @@ -1814,8 +1459,9 @@ checksum = "b3c5a95edfa0c893236ae4778bb7c4752760e4c0d245e19b5eff33c5aa5eb9dc" [[package]] name = "rustc_utils" -version = "0.7.0-nightly-2023-08-25" -source = "git+https://github.com/cognitive-engineering-lab/rustc_plugin?rev=d4b3c43b0695d42030f9cb3a62fc27cc337019d1#d4b3c43b0695d42030f9cb3a62fc27cc337019d1" +version = "0.10.0-nightly-2024-05-20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c56fee46db087b17536125afa453444ddb8eacfe51b263c7dff6ce26f3e5f93" dependencies = [ "anyhow", "cfg-if", @@ -1824,7 +1470,7 @@ dependencies = [ "regex", "serde", "textwrap", - "ts-rs", + "ts-rs 7.1.1", ] [[package]] @@ -1915,40 +1561,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" -dependencies = [ - "serde", - "serde_with_macros", -] - -[[package]] -name = "serde_with_macros" -version = "1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "sha2" version = "0.10.7" @@ -1966,15 +1578,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" -[[package]] -name = "signal-hook-registry" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" -dependencies = [ - "libc", -] - [[package]] name = "similar" version = "2.2.1" @@ -1982,13 +1585,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "420acb44afdae038210c99e69aae24109f32f15500aa708e81d46c9f29d55fcf" [[package]] -name = "slab" -version = "0.4.9" +name = "siphasher" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "smallvec" @@ -2002,48 +1602,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" -[[package]] -name = "snafu" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4de37ad025c587a29e8f3f5605c00f70b98715ef90b9061a815b9e59e9042d6" -dependencies = [ - "doc-comment", - "snafu-derive", -] - -[[package]] -name = "snafu-derive" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "990079665f075b699031e9c08fd3ab99be5029b96f3b78dc0709e8f77e4efebf" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "socket2" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "socket2" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" -dependencies = [ - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "strsim" version = "0.10.0" @@ -2072,23 +1630,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "tar" -version = "0.4.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" -dependencies = [ - "filetime", - "libc", - "xattr", -] - [[package]] name = "tempfile" version = "3.8.0" @@ -2164,82 +1705,36 @@ dependencies = [ ] [[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tokio" -version = "1.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" -dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "num_cpus", - "pin-project-lite", - "signal-hook-registry", - "socket2 0.5.3", - "tokio-macros", - "windows-sys 0.48.0", -] - -[[package]] -name = "tokio-macros" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.29", -] - -[[package]] -name = "tokio-util" -version = "0.7.8" +name = "toml" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", - "tracing", + "serde", ] [[package]] name = "toml" -version = "0.5.11" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" dependencies = [ "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.19.14", ] [[package]] name = "toml" -version = "0.7.6" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" +checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_edit 0.20.2", ] [[package]] @@ -2265,94 +1760,42 @@ dependencies = [ ] [[package]] -name = "topological-sort" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea68304e134ecd095ac6c3574494fc62b909f416c4fca77e440530221e549d3d" - -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-http" -version = "0.3.5" +name = "toml_edit" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ - "bitflags 1.3.2", - "bytes", - "futures-core", - "futures-util", - "http", - "http-body", - "http-range-header", - "pin-project-lite", - "tower", - "tower-layer", - "tower-service", - "tracing", + "indexmap 2.0.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", ] [[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.37" +name = "topological-sort" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" -dependencies = [ - "cfg-if", - "log", - "pin-project-lite", - "tracing-core", -] +checksum = "ea68304e134ecd095ac6c3574494fc62b909f416c4fca77e440530221e549d3d" [[package]] -name = "tracing-core" -version = "0.1.31" +name = "ts-rs" +version = "6.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "4added4070a4fdf9df03457206cd2e4b12417c8560a2954d91ffcbe60177a56a" dependencies = [ - "once_cell", + "thiserror", + "ts-rs-macros 6.2.0", ] -[[package]] -name = "try-lock" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" - [[package]] name = "ts-rs" -version = "6.2.1" +version = "7.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4added4070a4fdf9df03457206cd2e4b12417c8560a2954d91ffcbe60177a56a" +checksum = "fc2cae1fc5d05d47aa24b64f9a4f7cba24cdc9187a2084dd97ac57bef5eccae6" dependencies = [ "thiserror", - "ts-rs-macros", + "ts-rs-macros 7.1.1", ] [[package]] @@ -2368,6 +1811,19 @@ dependencies = [ "termcolor", ] +[[package]] +name = "ts-rs-macros" +version = "7.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f7f9b821696963053a89a7bd8b292dc34420aea8294d7b225274d488f3ec92" +dependencies = [ + "Inflector", + "proc-macro2", + "quote", + "syn 2.0.29", + "termcolor", +] + [[package]] name = "typenum" version = "1.16.0" @@ -2389,12 +1845,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "unicode-bidi" -version = "0.3.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" - [[package]] name = "unicode-ident" version = "1.0.11" @@ -2407,32 +1857,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" -[[package]] -name = "unicode-normalization" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" -dependencies = [ - "tinyvec", -] - [[package]] name = "unicode-width" version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" -[[package]] -name = "url" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - [[package]] name = "utf8-width" version = "0.1.6" @@ -2460,15 +1890,6 @@ dependencies = [ "libc", ] -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2617,6 +2038,22 @@ dependencies = [ "windows_x86_64_msvc 0.48.5", ] +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.42.2" @@ -2629,6 +2066,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -2641,6 +2084,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -2653,6 +2102,18 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -2665,6 +2126,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -2677,6 +2144,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" @@ -2689,6 +2162,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -2701,6 +2180,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + [[package]] name = "winnow" version = "0.5.15" @@ -2710,15 +2195,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "xattr" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4686009f71ff3e5c4dbcf1a282d0a44db3f021ba69350cd42086b3e5f1c6985" -dependencies = [ - "libc", -] - [[package]] name = "yaml-rust" version = "0.4.5" diff --git a/Cargo.toml b/Cargo.toml index 5643320cc..86e8eaa64 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace] -members = [ "crates/*" ] -exclude = [ "files" ] +members = [ "crates/*" , "examples/hello-world"] +exclude = [ "files", "crates/aquascope_serve" ] resolver = "2" # Make snapshot testing faster @@ -9,7 +9,3 @@ opt-level = 3 [profile.dev.package.similar] opt-level = 3 - -[patch.crates-io] -rustc_plugin = { git = "https://github.com/cognitive-engineering-lab/rustc_plugin", rev = "d4b3c43b0695d42030f9cb3a62fc27cc337019d1" } -rustc_utils = { git = "https://github.com/cognitive-engineering-lab/rustc_plugin", rev = "d4b3c43b0695d42030f9cb3a62fc27cc337019d1" } diff --git a/Makefile.toml b/Makefile.toml index 37661d323..40e72a4f6 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -3,27 +3,21 @@ skip_core_tasks = true default_to_workspace = false [tasks.watch-front] -script = "cargo watch -i frontend -x 'install --path crates/aquascope_front --offline'" - -[tasks.watch-front-debug] -script = "cargo watch -i frontend -x 'install --path crates/aquascope_front --offline --debug'" +script = "cargo watch -i frontend -x 'install --path crates/aquascope_front --offline --locked'" [tasks.watch-mdbook] -script = "cargo watch -w crates/mdbook-aquascope/src -w frontend/packages/aquascope-embed/dist --no-vcs-ignores -x 'install --path crates/mdbook-aquascope --debug --offline'" - -[tasks.watch-server] -script = "cargo run --features=no-docker" +script = "cargo watch -w crates/mdbook-aquascope/src -w frontend/packages/embed/dist --no-vcs-ignores -x 'install --path crates/mdbook-aquascope --locked --debug --offline'" [tasks.watch.run_task] -name = ["watch-front", "watch-server", "watch-mdbook"] +name = ["watch-front", "watch-mdbook"] parallel = true [tasks.init-bindings] script = """ cargo run --bin export-ts --locked cargo test -p aquascope -p mdbook-aquascope --lib export_bindings --locked -mkdir -p frontend/packages/aquascope-editor/src/bindings -cp crates/**/bindings/* frontend/packages/aquascope-editor/src/bindings +mkdir -p frontend/packages/types/src/bindings +cp crates/**/bindings/* frontend/packages/types/src/bindings """ [tasks.install-aquascope] diff --git a/README.md b/README.md index 9e8365b47..c0444d0dd 100644 --- a/README.md +++ b/README.md @@ -194,4 +194,4 @@ Visualizing permission steps can be quite intrusive but oftentimes you may want ## Having trouble? -If you want to use Aquascope but are having trouble finding the relevant information, please leave an issue or email us at and . +If you want to use Aquascope but are having trouble finding the relevant information, please leave an issue or email us at and . diff --git a/crates/aquascope/Cargo.lock b/crates/aquascope/Cargo.lock deleted file mode 100644 index 1339cb868..000000000 --- a/crates/aquascope/Cargo.lock +++ /dev/null @@ -1,386 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" - -[[package]] -name = "aho-corasick" -version = "0.7.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" -dependencies = [ - "memchr", -] - -[[package]] -name = "anyhow" -version = "1.0.62" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1485d4d2cc45e7b201ee3767015c96faa5904387c9d87c6efdd0fb511f12d305" - -[[package]] -name = "aquascope" -version = "0.1.0" -dependencies = [ - "datafrog", - "env_logger", - "flowistry", - "log", - "rustc_plugin", - "serde", - "ts-rs", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - -[[package]] -name = "camino" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ad0e1e3e88dd237a156ab9f571021b8a158caa0ae44b1968a241efb5144c1e" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "datafrog" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0afaad2b26fa326569eb264b1363e8ae3357618c43982b3f285f0774ce76b69" - -[[package]] -name = "env_logger" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" -dependencies = [ - "atty", - "humantime", - "log", - "regex", - "termcolor", -] - -[[package]] -name = "flowistry" -version = "0.5.30" -dependencies = [ - "anyhow", - "cfg-if", - "fluid-let", - "intervaltree", - "log", - "serde", - "unicode-segmentation", -] - -[[package]] -name = "fluid-let" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "749cff877dc1af878a0b31a41dd221a753634401ea0ef2f87b62d3171522485a" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - -[[package]] -name = "intervaltree" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "270bc34e57047cab801a8c871c124d9dc7132f6473c6401f645524f4e6edd111" -dependencies = [ - "smallvec", -] - -[[package]] -name = "itoa" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" - -[[package]] -name = "libc" -version = "0.2.132" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" - -[[package]] -name = "log" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "proc-macro2" -version = "1.0.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "regex" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.6.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" - -[[package]] -name = "rustc_plugin" -version = "0.5.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a99f322d92a8eac7ba2025470880c6899447eeea4a704ee43bcea6ca2ed1ac13" -dependencies = [ - "cargo_metadata", - "log", - "rustc_tools_util", - "serde", - "serde_json", -] - -[[package]] -name = "rustc_tools_util" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3c5a95edfa0c893236ae4778bb7c4752760e4c0d245e19b5eff33c5aa5eb9dc" - -[[package]] -name = "ryu" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" - -[[package]] -name = "semver" -version = "1.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f6841e709003d68bb2deee8c343572bf446003ec20a583e76f7b15cebf3711" -dependencies = [ - "serde", -] - -[[package]] -name = "serde" -version = "1.0.144" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.144" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38dd04e3c8279e75b31ef29dbdceebfe5ad89f4d0937213c53f7d49d01b3d5a7" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "smallvec" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" - -[[package]] -name = "syn" -version = "1.0.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "termcolor" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "thiserror" -version = "1.0.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "ts-rs" -version = "6.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc59f479df54269b400dd95bc3b7e81623b3e4b9c70c8ca7125ab8341eafa64e" -dependencies = [ - "thiserror", - "ts-rs-macros", -] - -[[package]] -name = "ts-rs-macros" -version = "6.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f807fdb3151fee75df7485b901a89624358cd07a67a8fb1a5831bf5a07681ff" -dependencies = [ - "Inflector", - "proc-macro2", - "quote", - "syn", - "termcolor", -] - -[[package]] -name = "unicode-ident" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" - -[[package]] -name = "unicode-segmentation" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/crates/aquascope/Cargo.toml b/crates/aquascope/Cargo.toml index 443de7f36..076b3a40f 100644 --- a/crates/aquascope/Cargo.toml +++ b/crates/aquascope/Cargo.toml @@ -22,18 +22,19 @@ anyhow = "1.0.0" log = "0.4" itertools = "0.10.5" serde = { version = "1.0", features = ["derive"] } -ts-rs = "6.2" +ts-rs = "7.1.1" regex = "1" fluid-let = "1.0" -rustc_utils = {version = "0.7.0-nightly-2023-08-25", features = ["graphviz", "ts-rs", "serde", "test"]} - -# interpret module -miri = {git = "https://github.com/rust-lang/miri.git", rev = "63c5542edf907dd797db82c4c2979e3c4df71a8b"} +rustc_utils = { version = "0.10.0-nightly-2024-05-20", features = ["graphviz", "ts-rs", "serde", "test"] } aquascope_workspace_utils = { version = "0.3", path = "../aquascope_workspace_utils" } - -# testing utils lazy_static = { version = "1.4" } +[dependencies.miriwasm] +package = "miri" +git = "https://github.com/gavinleroy/miri.git" +branch = "wasm-patch" + + [dev-dependencies] insta = { version = "1.22.0", features = ["json", "yaml", "redactions"] } aquascope = { path = ".", features = ["testing"] } diff --git a/crates/aquascope/src/analysis/find_bindings.rs b/crates/aquascope/src/analysis/find_bindings.rs index f6f47eed6..56ff4390f 100644 --- a/crates/aquascope/src/analysis/find_bindings.rs +++ b/crates/aquascope/src/analysis/find_bindings.rs @@ -1,7 +1,7 @@ use rustc_data_structures::fx::FxHashMap as HashMap; use rustc_hir::{ intravisit::{self, Visitor}, - BindingAnnotation, HirId, Pat, PatKind, + BindingMode, HirId, Pat, PatKind, }; // use rustc_hir_analysis; use rustc_middle::{hir::nested_filter::OnlyBodies, ty::TyCtxt}; @@ -9,7 +9,7 @@ use rustc_middle::{hir::nested_filter::OnlyBodies, ty::TyCtxt}; struct BindingFinder<'tcx> { tcx: TyCtxt<'tcx>, // Mapping a HirId (identifier) with it's binding annotations. - bindings: HashMap, + bindings: HashMap, } impl<'tcx> Visitor<'tcx> for BindingFinder<'tcx> { @@ -29,7 +29,7 @@ impl<'tcx> Visitor<'tcx> for BindingFinder<'tcx> { } } -pub fn find_bindings(tcx: TyCtxt) -> HashMap { +pub fn find_bindings(tcx: TyCtxt) -> HashMap { let mut finder = BindingFinder { tcx, bindings: HashMap::default(), diff --git a/crates/aquascope/src/analysis/ir_mapper/body_graph.rs b/crates/aquascope/src/analysis/ir_mapper/body_graph.rs index dab2403bd..6d7f0e399 100644 --- a/crates/aquascope/src/analysis/ir_mapper/body_graph.rs +++ b/crates/aquascope/src/analysis/ir_mapper/body_graph.rs @@ -101,31 +101,21 @@ impl<'a, 'tcx: 'a> CleanedBody<'a, 'tcx> { impl DirectedGraph for CleanedBody<'_, '_> { type Node = BasicBlock; -} -impl WithStartNode for CleanedBody<'_, '_> { - fn start_node(&self) -> Self::Node { - self.0.basic_blocks.start_node() - } -} - -impl<'tcx> WithNumNodes for CleanedBody<'_, 'tcx> { fn num_nodes(&self) -> usize { self.0.basic_blocks.len() } } -impl<'tcx> GraphSuccessors<'_> for CleanedBody<'_, 'tcx> { - type Item = BasicBlock; - type Iter = smallvec::IntoIter<[BasicBlock; 4]>; +impl StartNode for CleanedBody<'_, '_> { + fn start_node(&self) -> Self::Node { + self.0.basic_blocks.start_node() + } } -impl<'tcx> WithSuccessors for CleanedBody<'_, 'tcx> { - fn successors( - &self, - node: Self::Node, - ) -> >::Iter { - ::successors(&self.0.basic_blocks, node) +impl<'tcx> Successors for CleanedBody<'_, 'tcx> { + fn successors(&self, node: Self::Node) -> impl Iterator { + ::successors(&self.0.basic_blocks, node) .filter(|bb| { let from_data = &self.0.basic_blocks[*bb]; CleanedBody::keep_block(from_data) @@ -136,17 +126,9 @@ impl<'tcx> WithSuccessors for CleanedBody<'_, 'tcx> { } } -impl<'tcx> GraphPredecessors<'_> for CleanedBody<'_, 'tcx> { - type Item = BasicBlock; - type Iter = smallvec::IntoIter<[BasicBlock; 4]>; -} - -impl<'tcx> WithPredecessors for CleanedBody<'_, 'tcx> { - fn predecessors( - &self, - node: Self::Node, - ) -> >::Iter { - ::predecessors(&self.0.basic_blocks, node) +impl<'tcx> Predecessors for CleanedBody<'_, 'tcx> { + fn predecessors(&self, node: Self::Node) -> impl Iterator { + ::predecessors(&self.0.basic_blocks, node) .filter(|bb| CleanedBody::keep_block(&self.0.basic_blocks[*bb])) .collect::>() .into_iter() diff --git a/crates/aquascope/src/analysis/ir_mapper/mod.rs b/crates/aquascope/src/analysis/ir_mapper/mod.rs index a4c222a02..6561e9d30 100644 --- a/crates/aquascope/src/analysis/ir_mapper/mod.rs +++ b/crates/aquascope/src/analysis/ir_mapper/mod.rs @@ -137,7 +137,7 @@ where ) } - pub fn local_assigned_place(&self, local: &hir::Local) -> Vec> { + pub fn let_assigned_place(&self, local: &hir::LetStmt) -> Vec> { use either::Either; use mir::{FakeReadCause as FRC, StatementKind as SK}; let id = local.hir_id; diff --git a/crates/aquascope/src/analysis/ir_mapper/post_dominators.rs b/crates/aquascope/src/analysis/ir_mapper/post_dominators.rs index 43c2ec60d..c73622812 100644 --- a/crates/aquascope/src/analysis/ir_mapper/post_dominators.rs +++ b/crates/aquascope/src/analysis/ir_mapper/post_dominators.rs @@ -66,35 +66,23 @@ mod tests { impl DirectedGraph for VG { type Node = N; - } - - impl<'graph, N: Idx> GraphSuccessors<'graph> for VG { - type Item = N; - type Iter = smallvec::IntoIter<[N; 10]>; - } - impl<'graph, N: Idx> GraphPredecessors<'graph> for VG { - type Item = N; - type Iter = smallvec::IntoIter<[N; 10]>; + fn num_nodes(&self) -> usize { + self.forward.num_nodes() + } } - impl WithStartNode for VG { + impl StartNode for VG { fn start_node(&self) -> N { self.source } } - impl WithNumNodes for VG { - fn num_nodes(&self) -> usize { - self.forward.num_nodes() - } - } - - impl WithSuccessors for VG { + impl Successors for VG { fn successors( &self, node: Self::Node, - ) -> >::Iter { + ) -> impl Iterator { self .forward .successors(node) @@ -105,11 +93,11 @@ mod tests { } } - impl WithPredecessors for VG { + impl Predecessors for VG { fn predecessors( &self, node: Self::Node, - ) -> >::Iter { + ) -> impl Iterator { self .backward .successors(node) diff --git a/crates/aquascope/src/analysis/permissions/context.rs b/crates/aquascope/src/analysis/permissions/context.rs index 9f6d5bd29..d5939a289 100644 --- a/crates/aquascope/src/analysis/permissions/context.rs +++ b/crates/aquascope/src/analysis/permissions/context.rs @@ -123,7 +123,7 @@ impl<'a, 'tcx> PermissionsCtxt<'a, 'tcx> { } } - pub fn path_to_moveable_path(&self, p: Path) -> MoveablePath { + pub fn path_to_moveable_path(&self, p: Path) -> Option { let place = self.path_to_place(p); self.move_data.rev_lookup.find_local(place.local) } diff --git a/crates/aquascope/src/analysis/permissions/flow.rs b/crates/aquascope/src/analysis/permissions/flow.rs index d67fe37f3..bb7e6d439 100644 --- a/crates/aquascope/src/analysis/permissions/flow.rs +++ b/crates/aquascope/src/analysis/permissions/flow.rs @@ -76,16 +76,20 @@ use std::time::Instant; use itertools::Itertools; -use rustc_borrowck::borrow_set::BorrowData; +use rustc_borrowck::{ + borrow_set::BorrowData, + consumers::{places_conflict, PlaceConflictBias}, +}; use rustc_data_structures::{ fx::FxHashSet as HashSet, graph::{ - scc::Sccs, vec_graph::VecGraph, DirectedGraph, WithNumNodes, WithSuccessors, + depth_first_search, scc::Sccs, vec_graph::VecGraph, DirectedGraph, + Successors, }, transitive_relation::{TransitiveRelation, TransitiveRelationBuilder}, }; use rustc_index::{bit_set::HybridBitSet, Idx}; -use rustc_utils::{mir::places_conflict, BodyExt}; +use rustc_utils::BodyExt; use serde::Serialize; use ts_rs::TS; @@ -93,6 +97,7 @@ use super::{Origin, PermissionsCtxt}; rustc_index::newtype_index! { #[debug_format = "scc{}"] + #[orderable] pub struct SccIdx {} } @@ -276,7 +281,7 @@ fn count_nodes(tups: &[(T, T)]) -> usize { /// The return closure answers queries of the form "for (v, s) did `s` flow to v?" fn flow_from_sources( sources: impl Iterator, - graph: impl DirectedGraph + WithSuccessors + WithNumNodes, + graph: impl DirectedGraph + Successors, ) -> TransitiveRelation where T: Idx, @@ -285,7 +290,7 @@ where // Compute the transitive closure, then assert that they're the same. for s in sources { - for t in graph.depth_first_search(s) { + for t in depth_first_search(&graph, s) { // `t` can point to `s` tcb.add(t, s); } @@ -301,7 +306,6 @@ fn check_for_invalidation_at_exit<'tcx>( ctxt: &PermissionsCtxt<'_, 'tcx>, borrow: &BorrowData<'tcx>, ) -> bool { - use places_conflict::AccessDepth::{Deep, Shallow}; use rustc_middle::{ mir::{PlaceElem, PlaceRef, ProjectionElem}, ty::TyCtxt, @@ -322,15 +326,15 @@ fn check_for_invalidation_at_exit<'tcx>( projection: &[], }; - let (might_be_alive, will_be_dropped) = + let will_be_dropped = if body.local_decls[root_place.local].is_ref_to_thread_local() { // Thread-locals might be dropped after the function exits // We have to dereference the outer reference because // borrows don't conflict behind shared references. root_place.projection = TyCtxtConsts::DEREF_PROJECTION; - (true, true) + true } else { - (false, ctxt.locals_are_invalidated_at_exit) + ctxt.locals_are_invalidated_at_exit }; if !will_be_dropped { @@ -341,16 +345,16 @@ fn check_for_invalidation_at_exit<'tcx>( return false; } - let sd = if might_be_alive { Deep } else { Shallow(None) }; - - places_conflict::borrow_conflicts_with_place( + // FIXME(gavinleroy): I'm concerned that the switch from `borrow_conflicts_with_place` + // to `places_conflict` will result in an over-approximation because we can no longer control + // the `AccessDepth` and `BorrowKind` parameters. The `places_conflict` implementation + // defaults to `Deep` and `Mut::TwoPhaseBorrow` for those, respectively. + places_conflict( tcx, body, place, - borrow.kind, - root_place, - sd, - places_conflict::PlaceConflictBias::Overlap, + root_place.to_place(ctxt.tcx), + PlaceConflictBias::Overlap, ) } @@ -374,7 +378,8 @@ pub fn compute_flows(ctxt: &mut PermissionsCtxt) { // Graph of constraints that need to be satisfied. This shows // us how data flows from one region into another. - let constraint_graph = VecGraph::new(count_nodes(&constraints), constraints); + let constraint_graph = + VecGraph::<_, false>::new(count_nodes(&constraints), constraints); let scc_constraints = Sccs::::new(&constraint_graph); let num_sccs = scc_constraints.num_sccs(); @@ -418,7 +423,8 @@ pub fn compute_flows(ctxt: &mut PermissionsCtxt) { // Allowed flows between abstract regions specified in the type signature. // // e.g. `fn foo<'a, 'b: 'a>(...) ...` would cause a `'b: 'a` specified flow in this graph. - let specified_flows_graph = VecGraph::new(num_sccs, placeholder_edges); + let specified_flows_graph = + VecGraph::<_, false>::new(num_sccs, placeholder_edges); // Compute the flow facts between abstract regions. let specified_flows = diff --git a/crates/aquascope/src/analysis/permissions/mod.rs b/crates/aquascope/src/analysis/permissions/mod.rs index e0fde860f..8535a7f91 100644 --- a/crates/aquascope/src/analysis/permissions/mod.rs +++ b/crates/aquascope/src/analysis/permissions/mod.rs @@ -39,6 +39,7 @@ impl polonius_engine::FactTypes for AquascopeFacts { rustc_index::newtype_index! { #[debug_format = "path{}"] + #[orderable] pub struct PathIndex {} } diff --git a/crates/aquascope/src/analysis/permissions/output.rs b/crates/aquascope/src/analysis/permissions/output.rs index 78555585e..3dfe7aede 100644 --- a/crates/aquascope/src/analysis/permissions/output.rs +++ b/crates/aquascope/src/analysis/permissions/output.rs @@ -10,7 +10,10 @@ use std::time::Instant; use datafrog::{Iteration, Relation, RelationLeaper, ValueFilter}; use polonius_engine::{Algorithm, FactTypes, Output as PEOutput}; -use rustc_borrowck::{borrow_set::BorrowSet, consumers::BodyWithBorrowckFacts}; +use rustc_borrowck::{ + borrow_set::BorrowSet, + consumers::{places_conflict, BodyWithBorrowckFacts, PlaceConflictBias}, +}; use rustc_data_structures::fx::{FxHashMap as HashMap, FxHashSet as HashSet}; use rustc_hir::{BodyId, Mutability}; use rustc_index::IndexVec; @@ -19,10 +22,7 @@ use rustc_middle::{ ty::TyCtxt, }; use rustc_mir_dataflow::move_paths::MoveData; -use rustc_utils::{ - mir::places_conflict::{self, AccessDepth, PlaceConflictBias}, - BodyExt, PlaceExt, -}; +use rustc_utils::{BodyExt, PlaceExt}; use super::{ context::PermissionsCtxt, flow, AquascopeFacts, Loan, Move, Path, Point, @@ -321,7 +321,7 @@ pub fn derive_permission_facts(ctxt: &mut PermissionsCtxt) { p == point2 && { let mp_assigned_to = ctxt.moveable_path_to_path(assigned_to); let place1 = ctxt.path_to_place(mp_assigned_to); - places_conflict::places_conflict( + places_conflict( tcx, body, place1, @@ -392,13 +392,11 @@ pub fn derive_permission_facts(ctxt: &mut PermissionsCtxt) { |(_origin, loan, _point)| { let borrow = ctxt.loan_to_borrow(*loan); places.iter().filter_map(|place| { - places_conflict::borrow_conflicts_with_place( + places_conflict( tcx, body, borrow.borrowed_place, - borrow.kind, - place.as_ref(), - AccessDepth::Deep, + *place, PlaceConflictBias::Overlap, ) .then_some((*loan, ctxt.place_to_path(place))) @@ -520,14 +518,11 @@ pub fn compute<'a, 'tcx>( let locals_are_invalidated_at_exit = tcx.hir().body_owner_kind(def_id).is_fn_or_closure(); - let move_data = match MoveData::gather_moves(body, tcx, tcx.param_env(def_id)) - { - Ok(move_data) => move_data, - Err((move_data, _illegal_moves)) => { - log::debug!("illegal moves found {_illegal_moves:?}"); - move_data - } - }; + + // FIXME: in 2024-05-20 `gather_moves` added the additional `FILTER` parameter. + // before merging double check that semantics don't depend on the filter. + let move_data = + MoveData::gather_moves(body, tcx, tcx.param_env(def_id), |_| true); let borrow_set = BorrowSet::build(tcx, body, locals_are_invalidated_at_exit, &move_data); let def_id = def_id.to_def_id(); diff --git a/crates/aquascope/src/analysis/permissions/utils.rs b/crates/aquascope/src/analysis/permissions/utils.rs index ce032d7b6..995579d5d 100644 --- a/crates/aquascope/src/analysis/permissions/utils.rs +++ b/crates/aquascope/src/analysis/permissions/utils.rs @@ -3,16 +3,50 @@ use std::collections::hash_map::Entry; use rustc_data_structures::fx::FxHashMap as HashMap; -use rustc_middle::mir::{Location, TerminatorEdges}; +use rustc_middle::{ + mir::{Body, Location, TerminatorEdges}, + ty::TyCtxt, +}; use rustc_mir_dataflow::{ - fmt::DebugWithContext, Analysis, AnalysisDomain, JoinSemiLattice, + self as engine, fmt::DebugWithContext, Analysis, AnalysisDomain, + JoinSemiLattice, }; -use rustc_utils::BodyExt; +use rustc_span::def_id::DefId; use super::{ context::PermissionsCtxt, Permissions, PermissionsData, PermissionsDomain, }; +// FIXME: this functionw as removed from `rustc_utils` because the `graphviz::Formatter` struct +// it now *private*. WTF, I know...but what can you do besides lobby for transparency? +fn write_analysis_results<'tcx, A>( + _body: &Body<'tcx>, + _results: &mut engine::Results<'tcx, A>, + _def_id: DefId, + _tcx: TyCtxt<'tcx>, +) -> anyhow::Result<()> +where + A: Analysis<'tcx>, + A::Domain: DebugWithContext, +{ + anyhow::bail!("graphviz `Formatter` currently private in rustc") + // use rustc_graphviz as dot; + // use rustc_mir_dataflow::graphviz; + // use rustc_utils::mir::body::run_dot; + // use std::path::Path; + + // let graphviz = + // graphviz::Formatter::new(body, results, graphviz::OutputStyle::AfterOnly); + // let mut buf = Vec::new(); + // dot::render(&graphviz, &mut buf)?; + + // let output_dir = Path::new("target"); + // let fname = tcx.def_path_debug_str(def_id); + // let output_path = output_dir.join(format!("{fname}.pdf")); + + // run_dot(&output_path, buf) +} + pub(crate) fn dump_permissions_with_mir(ctxt: &PermissionsCtxt) { // XXX: Unfortunately, the only way I know how to do this is to do a MIR // dataflow analysis and simply take the information from the context. @@ -36,7 +70,8 @@ pub(crate) fn dump_permissions_with_mir(ctxt: &PermissionsCtxt) { log::debug!("Dumping results for {:?}", name.as_str()); - if let Err(e) = ctxt.body_with_facts.body.write_analysis_results( + if let Err(e) = write_analysis_results( + &ctxt.body_with_facts.body, &mut results, def_id.to_def_id(), ctxt.tcx, diff --git a/crates/aquascope/src/analysis/stepper/hir_steps.rs b/crates/aquascope/src/analysis/stepper/hir_steps.rs index 7d59a226a..190f19af7 100644 --- a/crates/aquascope/src/analysis/stepper/hir_steps.rs +++ b/crates/aquascope/src/analysis/stepper/hir_steps.rs @@ -225,8 +225,13 @@ impl<'a, 'tcx: 'a> HirStepPoints<'a, 'tcx> { } fn pop_branch_start(&mut self, expecting: Location) { - if let Some(popped) = self.current_branch_start.pop() && popped != expecting { - report_unexpected!(self, "expecting popped location {expecting:?} but got {popped:?}") + if let Some(popped) = self.current_branch_start.pop() + && popped != expecting + { + report_unexpected!( + self, + "expecting popped location {expecting:?} but got {popped:?}" + ) } } @@ -517,8 +522,8 @@ impl<'a, 'tcx: 'a> HirVisitor<'tcx> for HirStepPoints<'a, 'tcx> { let scope = invoke_internal!(self, open_scope); - if let SK::Local(local) = stmt.kind { - let places = self.ir_mapper.local_assigned_place(local); + if let SK::Let(local) = stmt.kind { + let places = self.ir_mapper.let_assigned_place(local); let locals = places.into_iter().map(|p| p.local).collect::>(); if !locals.is_empty() { log::debug!("storing locals at scope {scope:?} {locals:?}"); @@ -549,8 +554,10 @@ impl<'a, 'tcx: 'a> HirVisitor<'tcx> for HirStepPoints<'a, 'tcx> { } // Insert the location and span for the else branch - if let Some(els) = else_opt && let Some(else_entry) = self.get_node_entry(els.hir_id) { - let else_span = self.span_of(els.hir_id).shrink_to_lo(); + if let Some(els) = else_opt + && let Some(else_entry) = self.get_node_entry(els.hir_id) + { + let else_span = self.span_of(els.hir_id).shrink_to_lo(); entry_to_spans.insert(else_entry, else_span); } diff --git a/crates/aquascope/src/analysis/stepper/segmented_mir.rs b/crates/aquascope/src/analysis/stepper/segmented_mir.rs index 6176de93d..952db51d7 100644 --- a/crates/aquascope/src/analysis/stepper/segmented_mir.rs +++ b/crates/aquascope/src/analysis/stepper/segmented_mir.rs @@ -471,9 +471,7 @@ impl<'a, 'tcx: 'a> SegmentedMirBuilder<'a, 'tcx> { let mapper = &self.mapper; // Find all basic blocks that are reachable from the root. - let reachable = mapper - .cleaned_graph - .depth_first_search(root) + let reachable = depth_first_search(&mapper.cleaned_graph, root) .filter(|&to| mapper.dominates(root, to)) .collect::>(); diff --git a/crates/aquascope/src/analysis/stepper/table_builder.rs b/crates/aquascope/src/analysis/stepper/table_builder.rs index c65b685d5..a2d31a2e0 100644 --- a/crates/aquascope/src/analysis/stepper/table_builder.rs +++ b/crates/aquascope/src/analysis/stepper/table_builder.rs @@ -361,7 +361,7 @@ pub(super) fn prettify_permission_steps<'tcx>( .collect::>(); master_table_vec - .sort_by_key(|(place, _)| (place.local.as_usize(), place.projection)); + .sort_by_key(|(place, _)| (place.local.as_usize(), place.projection.len())); let master_table = PermissionsStepTable { from, diff --git a/crates/aquascope/src/errors/mod.rs b/crates/aquascope/src/errors/mod.rs index 068291ee5..30a0e2513 100644 --- a/crates/aquascope/src/errors/mod.rs +++ b/crates/aquascope/src/errors/mod.rs @@ -1,8 +1,6 @@ -pub(crate) mod silent_emitter; - use std::cell::RefCell; -use rustc_errors::{Diagnostic, TRACK_DIAGNOSTICS}; +use rustc_errors::{DiagInner, ErrorGuaranteed, TRACK_DIAGNOSTIC}; use rustc_hir::def_id::LocalDefId; use rustc_span::Span; @@ -17,7 +15,10 @@ struct DiagnosticInfo { is_error: bool, } -fn track_diagnostic(d: &mut Diagnostic, f: &mut dyn FnMut(&mut Diagnostic)) { +fn track_diagnostic( + d: DiagInner, + f: &mut dyn FnMut(DiagInner) -> Option, +) -> Option { BODY_DIAGNOSTICS.with(|diagnostics| { let mut diagnostics = diagnostics.borrow_mut(); let d = DiagnosticInfo { @@ -30,7 +31,7 @@ fn track_diagnostic(d: &mut Diagnostic, f: &mut dyn FnMut(&mut Diagnostic)) { // We need to actually report the diagnostic with the // provided function. Otherwise, a `DelayedBugPanic` // will cause an ICE. - (*f)(d); + (*f)(d) } // ------------------------------------------------ @@ -39,7 +40,7 @@ fn track_diagnostic(d: &mut Diagnostic, f: &mut dyn FnMut(&mut Diagnostic)) { /// This should be called before analysing a new crate. pub fn initialize_error_tracking() { log::debug!("Track diagnostics updated"); - TRACK_DIAGNOSTICS.swap(&(track_diagnostic as _)); + TRACK_DIAGNOSTIC.swap(&(track_diagnostic as _)); } /// Initialize the error tracking for a given routine. It's recommended diff --git a/crates/aquascope/src/errors/silent_emitter.rs b/crates/aquascope/src/errors/silent_emitter.rs deleted file mode 100644 index 010708f6f..000000000 --- a/crates/aquascope/src/errors/silent_emitter.rs +++ /dev/null @@ -1,29 +0,0 @@ -//! Silent diagnostics emitter. -//! -//! See: -//! https://doc.rust-lang.org/nightly/nightly-rustc/rustfmt_nightly/parse/session/struct.SilentEmitter.html#impl-Translate-for-SilentEmitter - -use rustc_data_structures::sync::Lrc; -use rustc_errors::{emitter::Emitter, translation::Translate, Diagnostic}; -use rustc_span::source_map::SourceMap; - -/// Emitter which discards every error. -pub(crate) struct SilentEmitter; - -impl Translate for SilentEmitter { - fn fluent_bundle(&self) -> Option<&Lrc> { - None - } - - fn fallback_fluent_bundle(&self) -> &rustc_errors::FluentBundle { - panic!("silent emitter attempted to translate a diagnostic"); - } -} - -impl Emitter for SilentEmitter { - fn source_map(&self) -> Option<&Lrc> { - None - } - - fn emit_diagnostic(&mut self, _db: &Diagnostic) {} -} diff --git a/crates/aquascope/src/interpreter/mapper.rs b/crates/aquascope/src/interpreter/mapper.rs index 99b670c99..b6cfcb01a 100644 --- a/crates/aquascope/src/interpreter/mapper.rs +++ b/crates/aquascope/src/interpreter/mapper.rs @@ -7,13 +7,15 @@ use std::{ use either::Either; use itertools::Itertools; -use miri::InterpCx; use rustc_hir::{intravisit::Visitor, Body, Expr, ExprKind, HirId, Stmt}; use rustc_middle::{mir::Location, ty::InstanceDef}; use rustc_span::{BytePos, Span}; use rustc_utils::BodyExt; -use super::step::{MFrame, MStack, MStep, MTrace, MirLoc}; +use super::{ + miri::{self, InterpCx}, + step::{MFrame, MStack, MStep, MTrace, MirLoc}, +}; use crate::analysis::ir_mapper::{GatherDepth, GatherMode, IRMapper}; #[derive(Default)] diff --git a/crates/aquascope/src/interpreter/miri.rs b/crates/aquascope/src/interpreter/miri.rs new file mode 100644 index 000000000..03423b02a --- /dev/null +++ b/crates/aquascope/src/interpreter/miri.rs @@ -0,0 +1,16 @@ +//! Types constantly move from miri to rustc_const_eval and change visibility. +//! It's easier to manage that here while it stabilizes and we upstream patches. + +pub use miriwasm::{ + create_ecx, AllocExtra, FrameExtra, MiriAllocBytes, MiriConfig, MiriMachine, + Provenance, +}; +pub use rustc_const_eval::{ + interpret::{ + AllocId, AllocKind, AllocMap, AllocRange, Allocation, Frame, Immediate, + InterpCx, InterpError, InterpErrorInfo, InterpResult, LocalState, + LocalValue, MPlaceTy, Machine, MemPlaceMeta, MemoryKind, OpTy, Operand, + Projectable, Provenance as ProvenanceTrait, UndefinedBehaviorInfo, + }, + ReportErrorExt, +}; diff --git a/crates/aquascope/src/interpreter/miri_utils.rs b/crates/aquascope/src/interpreter/miri_utils.rs index f58a18edb..a33833f58 100644 --- a/crates/aquascope/src/interpreter/miri_utils.rs +++ b/crates/aquascope/src/interpreter/miri_utils.rs @@ -1,7 +1,3 @@ -use miri::{ - interpret::Provenance, InterpCx, InterpResult, MPlaceTy, Machine, - MemPlaceMeta, OpTy, -}; use rustc_abi::FieldsShape; use rustc_middle::{ mir::{Local, PlaceElem}, @@ -9,6 +5,11 @@ use rustc_middle::{ }; use rustc_target::abi::{FieldIdx, Size}; +use super::miri::{ + self, InterpCx, InterpResult, MPlaceTy, Machine, MemPlaceMeta, OpTy, + Projectable, ProvenanceTrait as Provenance, +}; + pub trait OpTyExt<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>>: Sized { fn field_by_name( &self, @@ -153,7 +154,7 @@ pub fn locate_address_in_type<'mir, 'tcx>( let index = offset / array_elem_size; // dbg!((array_elem_size, offset, index)); - let segment = match mplace.meta { + let segment = match mplace.meta() { MemPlaceMeta::Meta(meta) => { let end_offset = meta.to_u64().unwrap(); let to = index + end_offset / array_elem_size - 1; diff --git a/crates/aquascope/src/interpreter/mod.rs b/crates/aquascope/src/interpreter/mod.rs index 02dad325d..6b1a092ce 100644 --- a/crates/aquascope/src/interpreter/mod.rs +++ b/crates/aquascope/src/interpreter/mod.rs @@ -6,12 +6,13 @@ use rustc_data_structures::fx::FxIndexMap; use rustc_hir::def_id::LocalDefId; use rustc_middle::{ mir::{Body, BorrowCheckResult}, - query, ty::TyCtxt, + util, }; use rustc_utils::{source_map::range::CharRange, SpanExt}; mod mapper; +mod miri; mod miri_utils; mod mvalue; mod step; @@ -24,7 +25,9 @@ pub use step::MTrace; use crate::interpreter::mapper::Mapper; pub(crate) fn interpret(tcx: TyCtxt) -> Result> { + log::trace!("Interpretting ..."); let mut evaluator = step::VisEvaluator::new(tcx).unwrap(); + log::trace!("Evaluating ..."); let mir_steps = evaluator.eval()?; if log::log_enabled!(log::Level::Trace) { @@ -45,6 +48,8 @@ pub(crate) fn interpret(tcx: TyCtxt) -> Result> { let hir_steps = mapper::group_steps(mir_steps, |loc| mapper.abstract_loc(loc)); + log::trace!("Mapping ..."); + if log::log_enabled!(log::Level::Trace) { for step in &hir_steps.steps { let (_, hir_body_loc) = step.stack.frames.last().unwrap().location; @@ -101,19 +106,15 @@ fn fake_mir_borrowck( // if the MoveData is empty. Thankfully we can reset and ignore that error via // `Handler::reset_err_count` which we do by overriding optimized_mir. fn fake_optimized_mir(tcx: TyCtxt<'_>, did: LocalDefId) -> &'_ Body<'_> { - let mut providers = query::Providers::default(); + let mut providers = util::Providers::default(); rustc_mir_transform::provide(&mut providers); let body = (providers.optimized_mir)(tcx, did); - tcx.sess.diagnostic().reset_err_count(); + tcx.sess.dcx().reset_err_count(); body } // See `fake_mir_borrowck` -pub fn override_queries( - _session: &Session, - providers: &mut query::Providers, - _extern_providers: &mut query::ExternProviders, -) { +pub fn override_queries(_session: &Session, providers: &mut util::Providers) { providers.mir_borrowck = fake_mir_borrowck; providers.optimized_mir = fake_optimized_mir; } @@ -133,6 +134,7 @@ impl rustc_driver::Callbacks for InterpretCallbacks { ) -> rustc_driver::Compilation { queries.global_ctxt().unwrap().enter(|tcx| { self.result = Some(interpret(tcx)); + log::debug!("Interpretation done {:?}!", self.result); }); rustc_driver::Compilation::Stop } diff --git a/crates/aquascope/src/interpreter/mvalue.rs b/crates/aquascope/src/interpreter/mvalue.rs index 9139af949..81c3a518a 100644 --- a/crates/aquascope/src/interpreter/mvalue.rs +++ b/crates/aquascope/src/interpreter/mvalue.rs @@ -1,9 +1,5 @@ //! Interpreting memory as Rust data types -use miri::{ - AllocKind, AllocMap, Immediate, InterpError, InterpErrorInfo, InterpResult, - MPlaceTy, MemPlaceMeta, MemoryKind, OpTy, Projectable, UndefinedBehaviorInfo, -}; use rustc_abi::FieldsShape; use rustc_apfloat::Float; use rustc_middle::ty::{ @@ -16,6 +12,11 @@ use serde::{Deserialize, Serialize}; use ts_rs::TS; use super::{ + miri::{ + self, AllocKind, AllocMap, Immediate, InterpError, InterpErrorInfo, + InterpResult, MPlaceTy, MemPlaceMeta, MemoryKind, OpTy, Projectable, + UndefinedBehaviorInfo, + }, miri_utils::{locate_address_in_type, OpTyExt}, step::VisEvaluator, }; @@ -177,12 +178,22 @@ impl<'tcx> Reader<'_, '_, 'tcx> { &mut self, mplace: miri::MPlaceTy<'tcx, miri::Provenance>, ) -> InterpResult<'tcx, MValue> { + log::trace!("Reading pointer: {mplace:?}"); + + if mplace.ptr().provenance.is_none() { + log::warn!("mplace missing provenance: {mplace:?}"); + return Ok(MValue::Unallocated { alloc_id: None }); + } + // Determine the base allocation from the mplace's provenance - let (alloc_id, offset, _) = self.ev.ecx.ptr_get_alloc_id(mplace.ptr)?; + let (alloc_id, offset, _) = self.ev.ecx.ptr_get_alloc_id(mplace.ptr())?; let (alloc_size, _, alloc_status) = self.ev.ecx.get_alloc_info(alloc_id); if matches!(alloc_status, AllocKind::Dead) { - log::warn!("Reading a dead allocation"); + log::warn!("Reading a dead allocation: {mplace:?}"); + return Ok(MValue::Unallocated { + alloc_id: Some(self.ev.remap_alloc_id(alloc_id)), + }); } // Check if we have seen this allocation before @@ -243,7 +254,7 @@ impl<'tcx> Reader<'_, '_, 'tcx> { // The pointer could point anywhere inside the allocation, so we use // `get_path_segments` to reverse-engineer a path from the memory location. - let meta = mplace.meta; + let meta = mplace.meta(); let parts = self.get_path_segments(alloc_size, alloc_layout, mplace, offset); let path = MPath { segment, parts }; @@ -320,6 +331,7 @@ impl<'tcx> Reader<'_, '_, 'tcx> { TyKind::Adt(adt_def, _) => { let def_id = adt_def.did(); let name = self.ev.ecx.tcx.item_name(def_id).to_ident_string(); + log::trace!("Reading adt: {name}"); macro_rules! process_fields { ($op:expr, $fields:expr) => {{ @@ -432,6 +444,7 @@ impl<'tcx> Reader<'_, '_, 'tcx> { f32::from_bits(scalar.to_f32()?.to_bits() as u32) as f64 } FloatTy::F64 => f64::from_bits(scalar.to_f64()?.to_bits() as u64), + FloatTy::F16 | FloatTy::F128 => todo!(), }), _ => unreachable!(), } @@ -452,15 +465,18 @@ impl<'tcx> Reader<'_, '_, 'tcx> { } _ if ty.is_any_ptr() => { - let val = self.ev.ecx.read_immediate(op)?; - let mplace = self.ev.ecx.ref_to_mplace(&val)?; - if self.ev.ecx.check_mplace(&mplace).is_err() { - let alloc_id = match self.ev.ecx.ptr_get_alloc_id(mplace.ptr) { - Ok((alloc_id, _, _)) => Some(self.ev.remap_alloc_id(alloc_id)), - Err(_) => None, - }; - return Ok(MValue::Unallocated { alloc_id }); - } + log::trace!("Reading pointer type: {ty:?}"); + + let mplace = self.ev.ecx.deref_pointer(op)?; + + // if self.ev.ecx.check_mplace(&mplace).is_err() { + // let alloc_id = match self.ev.ecx.ptr_get_alloc_id(mplace.ptr()) { + // Ok((alloc_id, _, _)) => Some(self.ev.remap_alloc_id(alloc_id)), + // Err(_) => None, + // }; + // return Ok(MValue::Unallocated { alloc_id }); + // } + self.read_pointer(mplace)? } @@ -496,7 +512,7 @@ impl<'tcx> Reader<'_, '_, 'tcx> { } } - kind => todo!("{:?} / {:?}", **op, kind), + kind => todo!("{:?} / {:?}", op, kind), }; Ok(result) @@ -515,3 +531,27 @@ impl<'tcx> VisEvaluator<'_, 'tcx> { .read(op) } } + +// trait InterpCxExt<'tcx> { +// fn check_mplace( +// &self, +// mplace: &MPlaceTy<'tcx, miri::Provenance>, +// ) -> InterpResult<'tcx>; +// } + +// impl<'mir, 'tcx> InterpCxExt<'tcx> +// for miri::InterpCx<'mir, 'tcx, miri::MiriMachine<'mir, 'tcx>> +// { +// fn check_mplace( +// &self, +// mplace: &MPlaceTy<'tcx, miri::Provenance>, +// ) -> InterpResult<'tcx> { +// let (size, _align) = self +// .size_and_align_of_mplace(&mplace)? +// .unwrap_or((mplace.layout.size, mplace.layout.align.abi)); +// // Due to packed places, only `mplace.align` matters. +// let align = if M::enforce_alignment(self) { mplace.align } else { Align::ONE }; +// self.check_ptr_access_align(mplace.ptr(), size, align, miri::CheckInAllocMsg::MemoryAccessTest)?; +// Ok(()) +// } +// } diff --git a/crates/aquascope/src/interpreter/step.rs b/crates/aquascope/src/interpreter/step.rs index ac3d45a49..00b8517ae 100644 --- a/crates/aquascope/src/interpreter/step.rs +++ b/crates/aquascope/src/interpreter/step.rs @@ -9,13 +9,7 @@ use std::{ use anyhow::{anyhow, bail, Context, Result}; use either::Either; use itertools::Itertools; -use miri::{ - AllocId, AllocMap, AllocRange, Immediate, InterpCx, InterpError, - InterpErrorInfo, InterpResult, LocalState, LocalValue, Machine, MiriConfig, - MiriMachine, OpTy, Operand, UndefinedBehaviorInfo, -}; use rustc_abi::{FieldsShape, Size}; -use rustc_const_eval::ReportErrorExt; use rustc_hir::def_id::DefId; use rustc_middle::{ mir::{ @@ -33,7 +27,14 @@ use rustc_utils::{source_map::range::CharRange, PlaceExt}; use serde::Serialize; use ts_rs::TS; -use super::mvalue::{MMemorySegment, MPathSegment, MValue}; +use super::{ + miri::{ + self, AllocId, AllocMap, AllocRange, Immediate, InterpCx, InterpError, + InterpErrorInfo, InterpResult, LocalState, LocalValue, Machine, MiriConfig, + MiriMachine, OpTy, Operand, ReportErrorExt, UndefinedBehaviorInfo, + }, + mvalue::{MMemorySegment, MPathSegment, MValue}, +}; #[derive(Serialize, Debug, TS)] #[ts(export)] @@ -287,7 +288,11 @@ impl<'mir, 'tcx> VisEvaluator<'mir, 'tcx> { pub(super) fn mem_is_initialized( &self, layout: TyAndLayout<'tcx>, - allocation: &miri::Allocation, + allocation: &miri::Allocation< + miri::Provenance, + miri::AllocExtra, + miri::MiriAllocBytes, + >, ) -> bool { // TODO: this should be recursive over the type. Only handles one-step right now. let ranges = match &layout.fields { @@ -318,7 +323,8 @@ impl<'mir, 'tcx> VisEvaluator<'mir, 'tcx> { fn test_local( &self, frame: &MiriFrame<'mir, 'tcx>, - frame_index: usize, + local_index: usize, + global_index: usize, local: Local, state: &LocalState<'tcx, miri::Provenance>, ) -> InterpResult<'tcx, Option<(String, OpTy<'tcx, miri::Provenance>)>> { @@ -401,12 +407,16 @@ impl<'mir, 'tcx> VisEvaluator<'mir, 'tcx> { memory_map .stack_slots - .insert(alloc_id, (frame_index, name.clone(), layout.unwrap())); + .insert(alloc_id, (local_index, name.clone(), layout.unwrap())); } _ => {} }; - let op_ty = self.ecx.local_to_op(frame, local, layout)?; + let ty_and_layout = frame.locals.get(local).and_then(|ls| ls.layout.get()); + let op_ty = + self + .ecx + .local_to_op_at_frame(local, global_index, ty_and_layout)?; Ok(Some((name, op_ty))) } @@ -415,14 +425,17 @@ impl<'mir, 'tcx> VisEvaluator<'mir, 'tcx> { .local_frames() .map( |LocalFrame { - local_index, frame, .. + local_index, + frame, + global_index, + .. }| { frame .locals .iter_enumerated() .filter_map(|(local, state)| { let local_data_res = self - .test_local(frame, local_index, local, state) + .test_local(frame, local_index, global_index, local, state) .transpose()?; Some(local_data_res.map(|(name, op)| (local, name, op))) }) @@ -518,12 +531,12 @@ impl<'mir, 'tcx> VisEvaluator<'mir, 'tcx> { fn handle_moves( &mut self, - n_frames: usize, + n_frames_before: usize, moves: Vec>, ) -> InterpResult<'tcx, ()> { let n_frames_after = Machine::stack(&self.ecx).len(); let mut moved_places = self.moved_places.borrow_mut(); - match n_frames_after.cmp(&n_frames) { + match n_frames_after.cmp(&n_frames_before) { Ordering::Greater => moved_places.push_frame(), Ordering::Less => moved_places.pop_frame(), Ordering::Equal => { @@ -533,9 +546,14 @@ impl<'mir, 'tcx> VisEvaluator<'mir, 'tcx> { Either::Left(_mplace) => { // todo!() } - Either::Right((frame, local, _)) => { - moved_places - .add_place(frame, Place::from_local(local, self.ecx.tcx())); + // FIXME(gavinleroy) is the `frame` now the third slot? + Either::Right((local, _, _)) => { + if n_frames_after > 0 { + moved_places.add_place( + self.ecx.frame_idx(), + Place::from_local(local, self.ecx.tcx()), + ); + } } } } @@ -567,9 +585,10 @@ impl<'mir, 'tcx> VisEvaluator<'mir, 'tcx> { .map(|LocalFrame { frame, .. }| frame.current_loc()); let moves = self.collect_moves()?; - let n_all_frames: usize = Machine::stack(&self.ecx).len(); + let n_frames_before: usize = Machine::stack(&self.ecx).len(); let more_work: bool = self.ecx.step()?; - self.handle_moves(n_all_frames, moves)?; + + self.handle_moves(n_frames_before, moves)?; let local_frames_after = self.local_frames().collect::>(); let current_loc_opt = match local_frames_after.len().cmp(&n_local_frames) @@ -620,9 +639,12 @@ impl<'mir, 'tcx> VisEvaluator<'mir, 'tcx> { alloc_id: self.remap_alloc_id(alloc_id), } } - ub => MUndefinedBehavior::Other( - ub.diagnostic_message().as_str().unwrap().to_string(), - ), + ub => { + MUndefinedBehavior::Other(match ub.diagnostic_message().as_str() { + Some(s) => s.to_string(), + None => format!("{ub:?}"), + }) + } }, err => bail!("{}", err.diagnostic_message().as_str().unwrap()), }) @@ -642,8 +664,9 @@ impl<'mir, 'tcx> VisEvaluator<'mir, 'tcx> { } } Err(e) => { - // e.print_backtrace(); - break MResult::Error(self.beautify_error(e)?); + let (info, backtrace) = e.into_parts(); + backtrace.print_backtrace(); + break MResult::Error(self.beautify_error(info.into())?); } } }; diff --git a/crates/aquascope/src/lib.rs b/crates/aquascope/src/lib.rs index 5b7d61cb5..404e27e6f 100644 --- a/crates/aquascope/src/lib.rs +++ b/crates/aquascope/src/lib.rs @@ -64,6 +64,7 @@ extern crate rustc_data_structures; extern crate rustc_driver; extern crate rustc_error_messages; extern crate rustc_errors; +extern crate rustc_graphviz; extern crate rustc_hir; extern crate rustc_hir_pretty; extern crate rustc_index; diff --git a/crates/aquascope/src/test_utils.rs b/crates/aquascope/src/test_utils.rs index 7727dc0d0..eedcdf085 100644 --- a/crates/aquascope/src/test_utils.rs +++ b/crates/aquascope/src/test_utils.rs @@ -1,12 +1,12 @@ use std::{ collections::HashMap, env, fs, io, panic, path::Path, process::Command, + sync::Arc, }; use anyhow::{bail, Context, Result}; use fluid_let::fluid_set; use itertools::Itertools; use rustc_borrowck::consumers::BodyWithBorrowckFacts; -use rustc_errors::Handler; use rustc_hir::BodyId; use rustc_middle::{ mir::{Rvalue, StatementKind}, @@ -34,7 +34,7 @@ use crate::{ }, AquascopeAnalysis, }, - errors::{self, silent_emitter::SilentEmitter}, + errors, interpreter::{self, MTrace}, }; @@ -48,8 +48,8 @@ impl FileLoader for StringLoader { Ok(self.0.clone()) } - fn read_binary_file(&self, path: &Path) -> io::Result> { - fs::read(path) + fn read_binary_file(&self, path: &Path) -> io::Result> { + fs::read(path).map(Into::into) } } @@ -523,12 +523,12 @@ where Cb: FnOnce(TyCtxt<'_>), { fn config(&mut self, config: &mut rustc_interface::Config) { - config.parse_sess_created = Some(Box::new(|sess| { - // Create a new emitter writer which consumes *silently* all - // errors. There most certainly is a *better* way to do this, - // if you, the reader, know what that is, please open an issue :) - let handler = Handler::with_emitter(Box::new(SilentEmitter)); - sess.span_diagnostic = handler; + config.psess_created = Some(Box::new(|sess| { + let fallback_bundle = rustc_errors::fallback_fluent_bundle( + rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec(), + false, + ); + sess.dcx.make_silent(fallback_bundle, None, false); })); config.override_queries = Some(if self.is_interpreter { diff --git a/crates/aquascope_front/Cargo.lock b/crates/aquascope_front/Cargo.lock deleted file mode 100644 index 6551e9df9..000000000 --- a/crates/aquascope_front/Cargo.lock +++ /dev/null @@ -1,520 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" - -[[package]] -name = "aho-corasick" -version = "0.7.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" -dependencies = [ - "memchr", -] - -[[package]] -name = "anyhow" -version = "1.0.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9a8f622bcf6ff3df478e9deba3e03e4e04b300f8e6a139e192c05fa3490afc7" - -[[package]] -name = "aquascope" -version = "0.1.0" -dependencies = [ - "datafrog", - "env_logger", - "flowistry", - "log", - "rustc_plugin", - "serde", - "ts-rs", -] - -[[package]] -name = "aquascope_front" -version = "0.1.0" -dependencies = [ - "anyhow", - "aquascope", - "clap", - "env_logger", - "flowistry", - "log", - "rustc_plugin", - "serde", - "serde_json", - "ts-rs", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "camino" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ad0e1e3e88dd237a156ab9f571021b8a158caa0ae44b1968a241efb5144c1e" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "clap" -version = "3.2.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750" -dependencies = [ - "bitflags", - "clap_derive", - "clap_lex", - "indexmap", - "once_cell", - "textwrap", -] - -[[package]] -name = "clap_derive" -version = "3.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" -dependencies = [ - "heck", - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "clap_lex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] - -[[package]] -name = "datafrog" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0afaad2b26fa326569eb264b1363e8ae3357618c43982b3f285f0774ce76b69" - -[[package]] -name = "env_logger" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" -dependencies = [ - "atty", - "humantime", - "log", - "regex", - "termcolor", -] - -[[package]] -name = "flowistry" -version = "0.5.30" -dependencies = [ - "anyhow", - "cfg-if", - "fluid-let", - "intervaltree", - "log", - "serde", - "unicode-segmentation", -] - -[[package]] -name = "fluid-let" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "749cff877dc1af878a0b31a41dd221a753634401ea0ef2f87b62d3171522485a" - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "heck" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - -[[package]] -name = "indexmap" -version = "1.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" -dependencies = [ - "autocfg", - "hashbrown", -] - -[[package]] -name = "intervaltree" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "270bc34e57047cab801a8c871c124d9dc7132f6473c6401f645524f4e6edd111" -dependencies = [ - "smallvec", -] - -[[package]] -name = "itoa" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" - -[[package]] -name = "libc" -version = "0.2.132" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" - -[[package]] -name = "log" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "once_cell" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" - -[[package]] -name = "os_str_bytes" -version = "6.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro2" -version = "1.0.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "regex" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.6.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" - -[[package]] -name = "rustc_plugin" -version = "0.5.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a99f322d92a8eac7ba2025470880c6899447eeea4a704ee43bcea6ca2ed1ac13" -dependencies = [ - "cargo_metadata", - "log", - "rustc_tools_util", - "serde", - "serde_json", -] - -[[package]] -name = "rustc_tools_util" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3c5a95edfa0c893236ae4778bb7c4752760e4c0d245e19b5eff33c5aa5eb9dc" - -[[package]] -name = "ryu" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" - -[[package]] -name = "semver" -version = "1.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f6841e709003d68bb2deee8c343572bf446003ec20a583e76f7b15cebf3711" -dependencies = [ - "serde", -] - -[[package]] -name = "serde" -version = "1.0.144" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.144" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "smallvec" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" - -[[package]] -name = "syn" -version = "1.0.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "termcolor" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "textwrap" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16" - -[[package]] -name = "thiserror" -version = "1.0.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1b05ca9d106ba7d2e31a9dab4a64e7be2cce415321966ea3132c49a656e252" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8f2591983642de85c921015f3f070c665a197ed69e417af436115e3a1407487" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "ts-rs" -version = "6.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc59f479df54269b400dd95bc3b7e81623b3e4b9c70c8ca7125ab8341eafa64e" -dependencies = [ - "thiserror", - "ts-rs-macros", -] - -[[package]] -name = "ts-rs-macros" -version = "6.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f807fdb3151fee75df7485b901a89624358cd07a67a8fb1a5831bf5a07681ff" -dependencies = [ - "Inflector", - "proc-macro2", - "quote", - "syn", - "termcolor", -] - -[[package]] -name = "unicode-ident" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" - -[[package]] -name = "unicode-segmentation" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/crates/aquascope_front/Cargo.toml b/crates/aquascope_front/Cargo.toml index 3254349a2..48f3c7472 100644 --- a/crates/aquascope_front/Cargo.toml +++ b/crates/aquascope_front/Cargo.toml @@ -23,9 +23,16 @@ serde_json = "1" ts-rs = "6.2" itertools = "0.10.5" fluid-let = "1.0" -rustc_plugin = "0.7.0-nightly-2023-08-25" -rustc_utils = "0.7.0-nightly-2023-08-25" +rustc_plugin = "0.10.0-nightly-2024-05-20" +rustc_utils = "0.10.0-nightly-2024-05-20" # For binaries -env_logger = {version = "0.9", default-features = false} +env_logger = {version = "0.9", default-features = false, features = ["humantime"]} clap = {version = "3.1", default-features = false, features = ["std", "derive"]} + +[target.'wasm32-wasi'] +wasi-root = "wasi-sdk-20.0/share/wasi-sysroot" +linker = "wasi-sdk-20.0/bin/clang" + +[profile.release] +strip = true diff --git a/crates/aquascope_front/src/plugin.rs b/crates/aquascope_front/src/plugin.rs index f3dd3ed7f..6e2bad4f0 100644 --- a/crates/aquascope_front/src/plugin.rs +++ b/crates/aquascope_front/src/plugin.rs @@ -133,12 +133,11 @@ impl RustcPlugin for AquascopePlugin { plugin_args.should_fail, ); let _ = run_with_callbacks(&compiler_args, &mut callbacks); - postprocess( - callbacks - .result - .unwrap() - .map_err(|_| AquascopeError::BuildError { range: None }), - ) + postprocess(callbacks.result.unwrap().map_err(|e| { + AquascopeError::AnalysisError { + msg: format!("{e:?}"), + } + })) } _ => unreachable!(), } diff --git a/crates/aquascope_serve/Cargo.lock b/crates/aquascope_serve/Cargo.lock deleted file mode 100644 index 88e0e5e44..000000000 --- a/crates/aquascope_serve/Cargo.lock +++ /dev/null @@ -1,1527 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" - -[[package]] -name = "aho-corasick" -version = "0.7.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" -dependencies = [ - "memchr", -] - -[[package]] -name = "anyhow" -version = "1.0.65" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98161a4e3e2184da77bb14f02184cdd111e83bbbcc9979dfee3c44b9a85f5602" - -[[package]] -name = "aquascope" -version = "0.1.0" -dependencies = [ - "datafrog", - "env_logger", - "flowistry", - "log", - "rustc_plugin", - "serde", - "ts-rs", -] - -[[package]] -name = "aquascope_front" -version = "0.1.0" -dependencies = [ - "anyhow", - "aquascope", - "clap", - "env_logger", - "flowistry", - "log", - "rustc_plugin", - "serde", - "serde_json", - "ts-rs", -] - -[[package]] -name = "aquascope_serve" -version = "0.1.0" -dependencies = [ - "anyhow", - "aquascope_front", - "async-trait", - "axum", - "axum-macros", - "bollard", - "env_logger", - "futures", - "log", - "serde", - "serde_json", - "snafu", - "tar", - "tokio", - "tower-http", - "ts-rs", -] - -[[package]] -name = "async-trait" -version = "0.1.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "axum" -version = "0.5.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e3356844c4d6a6d6467b8da2cffb4a2820be256f50a3a386c9d152bab31043" -dependencies = [ - "async-trait", - "axum-core", - "bitflags", - "bytes", - "futures-util", - "headers", - "http", - "http-body", - "hyper", - "itoa", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper", - "tokio", - "tower", - "tower-http", - "tower-layer", - "tower-service", -] - -[[package]] -name = "axum-core" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9f0c0a60006f2a293d82d571f635042a72edf927539b7685bd62d361963839b" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http", - "http-body", - "mime", - "tower-layer", - "tower-service", -] - -[[package]] -name = "axum-macros" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6293dae2ec708e679da6736e857cf8532886ef258e92930f38279c12641628b8" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "base64" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "block-buffer" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bollard" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82e7850583ead5f8bbef247e2a3c37a19bd576e8420cd262a6711921827e1e5" -dependencies = [ - "base64", - "bollard-stubs", - "bytes", - "futures-core", - "futures-util", - "hex", - "http", - "hyper", - "hyperlocal", - "log", - "pin-project-lite", - "serde", - "serde_derive", - "serde_json", - "serde_urlencoded", - "thiserror", - "tokio", - "tokio-util", - "url", - "winapi", -] - -[[package]] -name = "bollard-stubs" -version = "1.42.0-rc.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed59b5c00048f48d7af971b71f800fdf23e858844a6f9e4d32ca72e9399e7864" -dependencies = [ - "serde", - "serde_with", -] - -[[package]] -name = "bytes" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" - -[[package]] -name = "camino" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ad0e1e3e88dd237a156ab9f571021b8a158caa0ae44b1968a241efb5144c1e" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", -] - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "clap" -version = "3.2.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750" -dependencies = [ - "bitflags", - "clap_derive", - "clap_lex", - "indexmap", - "once_cell", - "textwrap", -] - -[[package]] -name = "clap_derive" -version = "3.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" -dependencies = [ - "heck", - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "clap_lex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] - -[[package]] -name = "cpufeatures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" -dependencies = [ - "libc", -] - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "darling" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" -dependencies = [ - "darling_core", - "quote", - "syn", -] - -[[package]] -name = "datafrog" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0afaad2b26fa326569eb264b1363e8ae3357618c43982b3f285f0774ce76b69" - -[[package]] -name = "digest" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" -dependencies = [ - "block-buffer", - "crypto-common", -] - -[[package]] -name = "doc-comment" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" - -[[package]] -name = "env_logger" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c90bf5f19754d10198ccb95b70664fc925bd1fc090a0fd9a6ebc54acc8cd6272" -dependencies = [ - "atty", - "humantime", - "log", - "regex", - "termcolor", -] - -[[package]] -name = "filetime" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b9663d381d07ae25dc88dbdf27df458faa83a9b25336bcac83d5e452b5fc9d3" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "windows-sys 0.42.0", -] - -[[package]] -name = "flowistry" -version = "0.5.30" -dependencies = [ - "anyhow", - "cfg-if", - "fluid-let", - "intervaltree", - "log", - "serde", - "unicode-segmentation", -] - -[[package]] -name = "fluid-let" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "749cff877dc1af878a0b31a41dd221a753634401ea0ef2f87b62d3171522485a" - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "form_urlencoded" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "futures" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f21eda599937fba36daeb58a22e8f5cee2d14c4a17b5b7739c7c8e5e3b8230c" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bdd20c28fadd505d0fd6712cdfcb0d4b5648baf45faef7f852afb2399bb050" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" - -[[package]] -name = "futures-executor" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff63c23854bee61b6e9cd331d523909f238fc7636290b96826e9cfa5faa00ab" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" - -[[package]] -name = "futures-macro" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "futures-sink" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" - -[[package]] -name = "futures-task" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" - -[[package]] -name = "futures-util" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "generic-array" -version = "0.14.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "h2" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "headers" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" -dependencies = [ - "base64", - "bitflags", - "bytes", - "headers-core", - "http", - "httpdate", - "mime", - "sha1", -] - -[[package]] -name = "headers-core" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" -dependencies = [ - "http", -] - -[[package]] -name = "heck" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "http" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" -dependencies = [ - "bytes", - "http", - "pin-project-lite", -] - -[[package]] -name = "http-range-header" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" - -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - -[[package]] -name = "hyper" -version = "0.14.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyperlocal" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fafdf7b2b2de7c9784f76e02c0935e65a8117ec3b768644379983ab333ac98c" -dependencies = [ - "futures-util", - "hex", - "hyper", - "pin-project", - "tokio", -] - -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - -[[package]] -name = "idna" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "indexmap" -version = "1.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" -dependencies = [ - "autocfg", - "hashbrown", -] - -[[package]] -name = "intervaltree" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "270bc34e57047cab801a8c871c124d9dc7132f6473c6401f645524f4e6edd111" -dependencies = [ - "smallvec", -] - -[[package]] -name = "itoa" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" - -[[package]] -name = "libc" -version = "0.2.132" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" - -[[package]] -name = "log" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "matchit" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73cbba799671b762df5a175adf59ce145165747bb891505c43d09aefbbf38beb" - -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "mime" -version = "0.3.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" - -[[package]] -name = "mime_guess" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" -dependencies = [ - "mime", - "unicase", -] - -[[package]] -name = "mio" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" -dependencies = [ - "libc", - "log", - "wasi", - "windows-sys 0.36.1", -] - -[[package]] -name = "num_cpus" -version = "1.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "once_cell" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" - -[[package]] -name = "os_str_bytes" -version = "6.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" - -[[package]] -name = "percent-encoding" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" - -[[package]] -name = "pin-project" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro2" -version = "1.0.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags", -] - -[[package]] -name = "regex" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.6.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" - -[[package]] -name = "rustc_plugin" -version = "0.5.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a99f322d92a8eac7ba2025470880c6899447eeea4a704ee43bcea6ca2ed1ac13" -dependencies = [ - "cargo_metadata", - "log", - "rustc_tools_util", - "serde", - "serde_json", -] - -[[package]] -name = "rustc_tools_util" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3c5a95edfa0c893236ae4778bb7c4752760e4c0d245e19b5eff33c5aa5eb9dc" - -[[package]] -name = "ryu" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" - -[[package]] -name = "semver" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" -dependencies = [ - "serde", -] - -[[package]] -name = "serde" -version = "1.0.144" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.144" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.85" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_with" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" -dependencies = [ - "serde", - "serde_with_macros", -] - -[[package]] -name = "serde_with_macros" -version = "1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" -dependencies = [ - "darling", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sha1" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "signal-hook-registry" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" -dependencies = [ - "libc", -] - -[[package]] -name = "slab" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" - -[[package]] -name = "snafu" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5177903bf45656592d9eb5c0e22f408fc023aae51dbe2088889b71633ba451f2" -dependencies = [ - "doc-comment", - "snafu-derive", -] - -[[package]] -name = "snafu-derive" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "410b26ed97440d90ced3e2488c868d56a86e2064f5d7d6f417909b286afe25e5" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "socket2" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "syn" -version = "1.0.99" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "sync_wrapper" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8" - -[[package]] -name = "tar" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6" -dependencies = [ - "filetime", - "libc", - "xattr", -] - -[[package]] -name = "termcolor" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "textwrap" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16" - -[[package]] -name = "thiserror" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c53f98874615aea268107765aa1ed8f6116782501d18e53d08b471733bea6c85" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8b463991b4eab2d801e724172285ec4195c650e8ec79b149e6c2a8e6dd3f783" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" - -[[package]] -name = "tokio" -version = "1.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0020c875007ad96677dcc890298f4b942882c5d4eb7cc8f439fc3bf813dc9c95" -dependencies = [ - "autocfg", - "bytes", - "libc", - "memchr", - "mio", - "num_cpus", - "once_cell", - "pin-project-lite", - "signal-hook-registry", - "socket2", - "tokio-macros", - "winapi", -] - -[[package]] -name = "tokio-macros" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tokio-util" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", - "tracing", -] - -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-http" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c530c8675c1dbf98facee631536fa116b5fb6382d7dd6dc1b118d970eafe3ba" -dependencies = [ - "bitflags", - "bytes", - "futures-core", - "futures-util", - "http", - "http-body", - "http-range-header", - "httpdate", - "mime", - "mime_guess", - "percent-encoding", - "pin-project-lite", - "tokio", - "tokio-util", - "tower", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-layer" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "343bc9466d3fe6b0f960ef45960509f84480bf4fd96f92901afe7ff3df9d3a62" - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" -dependencies = [ - "cfg-if", - "log", - "pin-project-lite", - "tracing-core", -] - -[[package]] -name = "tracing-core" -version = "0.1.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7" -dependencies = [ - "once_cell", -] - -[[package]] -name = "try-lock" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" - -[[package]] -name = "ts-rs" -version = "6.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc59f479df54269b400dd95bc3b7e81623b3e4b9c70c8ca7125ab8341eafa64e" -dependencies = [ - "thiserror", - "ts-rs-macros", -] - -[[package]] -name = "ts-rs-macros" -version = "6.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f807fdb3151fee75df7485b901a89624358cd07a67a8fb1a5831bf5a07681ff" -dependencies = [ - "Inflector", - "proc-macro2", - "quote", - "syn", - "termcolor", -] - -[[package]] -name = "typenum" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" - -[[package]] -name = "unicase" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" -dependencies = [ - "version_check", -] - -[[package]] -name = "unicode-bidi" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" - -[[package]] -name = "unicode-ident" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcc811dc4066ac62f84f11307873c4850cb653bfa9b1719cee2bd2204a4bc5dd" - -[[package]] -name = "unicode-normalization" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" -dependencies = [ - "tinyvec", -] - -[[package]] -name = "unicode-segmentation" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fdbf052a0783de01e944a6ce7a8cb939e295b1e7be835a1112c3b9a7f047a5a" - -[[package]] -name = "url" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "want" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" -dependencies = [ - "log", - "try-lock", -] - -[[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" -dependencies = [ - "windows_aarch64_msvc 0.36.1", - "windows_i686_gnu 0.36.1", - "windows_i686_msvc 0.36.1", - "windows_x86_64_gnu 0.36.1", - "windows_x86_64_msvc 0.36.1", -] - -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.0", - "windows_i686_gnu 0.42.0", - "windows_i686_msvc 0.42.0", - "windows_x86_64_gnu 0.42.0", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.0", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" - -[[package]] -name = "windows_i686_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" - -[[package]] -name = "windows_i686_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" - -[[package]] -name = "xattr" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" -dependencies = [ - "libc", -] diff --git a/crates/aquascope_workspace_utils/Cargo.toml b/crates/aquascope_workspace_utils/Cargo.toml index 352ca6f62..e9ef90afd 100644 --- a/crates/aquascope_workspace_utils/Cargo.toml +++ b/crates/aquascope_workspace_utils/Cargo.toml @@ -18,5 +18,5 @@ include = [ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -toml = "0.5" +toml = "0.8" anyhow = "1" diff --git a/crates/aquascope_workspace_utils/src/lib.rs b/crates/aquascope_workspace_utils/src/lib.rs index 2c421bf32..c92f98b45 100644 --- a/crates/aquascope_workspace_utils/src/lib.rs +++ b/crates/aquascope_workspace_utils/src/lib.rs @@ -19,17 +19,21 @@ pub fn toolchain() -> Result { } pub fn miri_sysroot() -> Result { - let output = Command::new("cargo") - .args([ - &format!("+{}", toolchain()?), - "miri", - "setup", - "--print-sysroot", - ]) - .output()?; + if let Ok(sysroot) = std::env::var("MIRI_SYSROOT") { + return Ok(sysroot.into()); + } + + let mut cmd = Command::new("cargo"); + if let Ok(toolchain) = toolchain() { + cmd.arg(format!("+{}", toolchain)); + } + + let output = cmd.args(["miri", "setup", "--print-sysroot"]).output()?; + if !output.status.success() { bail!("Command failed"); } + let stdout = String::from_utf8(output.stdout)?; Ok(PathBuf::from(stdout.trim_end())) } diff --git a/crates/mdbook-aquascope/build.rs b/crates/mdbook-aquascope/build.rs index d992a957d..4ce3551c8 100644 --- a/crates/mdbook-aquascope/build.rs +++ b/crates/mdbook-aquascope/build.rs @@ -2,7 +2,7 @@ use std::{fs, io::ErrorKind, path::Path}; use anyhow::{Error, Result}; -const SRC_DIR: &str = "../../frontend/packages/aquascope-embed/dist/"; +const SRC_DIR: &str = "../../frontend/packages/embed/dist/"; const DST_DIR: &str = "./js"; fn main() -> Result<()> { diff --git a/crates/mdbook-aquascope/src/main.rs b/crates/mdbook-aquascope/src/main.rs index c665916e9..9c9c70981 100644 --- a/crates/mdbook-aquascope/src/main.rs +++ b/crates/mdbook-aquascope/src/main.rs @@ -10,10 +10,8 @@ use mdbook_preprocessor_utils::{ mdbook_preprocessor_utils::asset_generator!("../js/"); -const FRONTEND_ASSETS: [Asset; 2] = [ - make_asset!("aquascope-embed.iife.js"), - make_asset!("style.css"), -]; +const FRONTEND_ASSETS: [Asset; 2] = + [make_asset!("embed.iife.js"), make_asset!("style.css")]; struct AquascopePreprocessorWrapper(AquascopePreprocessor); @@ -78,7 +76,7 @@ fn main() {{ let chapter_path = harness.root().join("src/chapter_1.md"); fs::write(&chapter_path, mk_contents("0"))?; - let _book = + let mut _book = harness.compile::(serde_json::json!({}))?; // After running the first compile, a cache should exist diff --git a/crates/mdbook-aquascope/src/preprocessor.rs b/crates/mdbook-aquascope/src/preprocessor.rs index 98d46f96d..c20d875f6 100644 --- a/crates/mdbook-aquascope/src/preprocessor.rs +++ b/crates/mdbook-aquascope/src/preprocessor.rs @@ -2,6 +2,7 @@ use std::{ collections::HashMap, + env, fmt::Write, fs, path::PathBuf, @@ -28,21 +29,31 @@ impl AquascopePreprocessor { let run_and_get_output = |cmd: &mut Command| -> Result { let output = cmd.output()?; if !output.status.success() { - bail!("Command failed"); + bail!( + "Command failed with stderr:\n{}", + String::from_utf8(output.stderr).unwrap() + ); } let stdout = String::from_utf8(output.stdout)?; Ok(stdout.trim_end().to_string()) }; let miri_sysroot = aquascope_workspace_utils::miri_sysroot()?; - - let output = run_and_get_output(Command::new("rustup").args([ - "which", - "--toolchain", - &aquascope_workspace_utils::toolchain()?, - "rustc", - ]))?; - let rustc = PathBuf::from(output); + let rustc; + + if let Ok(toolchain) = aquascope_workspace_utils::toolchain() { + let output = run_and_get_output(Command::new("rustup").args([ + "which", + "--toolchain", + &toolchain, + "rustc", + ]))?; + rustc = PathBuf::from(output); + } else { + let output = run_and_get_output(Command::new("which") + .arg("rustc"))?; + rustc = PathBuf::from(output); + } let output = run_and_get_output( Command::new(rustc).args(["--print", "target-libdir"]), @@ -81,6 +92,7 @@ impl AquascopePreprocessor { cmd .arg("aquascope") .env("SYSROOT", &self.miri_sysroot) + .env("MIRI_SYSROOT", &self.miri_sysroot) .env("DYLD_LIBRARY_PATH", &self.target_libdir) .env("LD_LIBRARY_PATH", &self.target_libdir) .env("RUST_BACKTRACE", "1") diff --git a/flake.lock b/flake.lock new file mode 100644 index 000000000..c3957aca7 --- /dev/null +++ b/flake.lock @@ -0,0 +1,235 @@ +{ + "nodes": { + "depot-js": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1732146390, + "narHash": "sha256-z4X/Muj/swIBTZ1+U11Ofhb99NBgp+v7V1diQLpzXhU=", + "owner": "cognitive-engineering-lab", + "repo": "depot", + "rev": "120f9d4ce037b69122d75809f35a1528fc909ae6", + "type": "github" + }, + "original": { + "owner": "cognitive-engineering-lab", + "repo": "depot", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1726560853, + "narHash": "sha256-X6rJYSESBVr3hBoH0WbKE5KvhPU5bloyZ2L4K60/fPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "c1dfcf08411b08f6b8615f7d8971a2bfa81d5e8a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "inputs": { + "systems": "systems_2" + }, + "locked": { + "lastModified": 1731533236, + "narHash": "sha256-l0KFg5HjrsfsO/JpG+r7fRrqm12kzFHyUHqHCVpMMbI=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "11707dc2f618dd54ca8739b309ec4fc024de578b", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_3": { + "inputs": { + "systems": "systems_3" + }, + "locked": { + "lastModified": 1710146030, + "narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1730531603, + "narHash": "sha256-Dqg6si5CqIzm87sp57j5nTaeBbWhHFaVyG7V6L8k3lY=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "7ffd9ae656aec493492b44d0ddfb28e79a1ea25d", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1732014248, + "narHash": "sha256-y/MEyuJ5oBWrWAic/14LaIr/u5E0wRVzyYsouYY3W6w=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "23e89b7da85c3640bbc2173fe04f4bd114342367", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1720768451, + "narHash": "sha256-EYekUHJE2gxeo2pM/zM9Wlqw1Uw2XTJXOSAO79ksc4Y=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "7e7c39ea35c5cdd002cd4588b03a3fb9ece6fad9", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1718428119, + "narHash": "sha256-WdWDpNaq6u1IPtxtYHHWpl5BmabtpmLnMAx0RdJ/vo8=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "e6cea36f83499eb4e9cd184c8a8e823296b50ad5", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "depot-js": "depot-js", + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_2", + "wasm-rust": "wasm-rust" + } + }, + "rust-overlay": { + "inputs": { + "nixpkgs": "nixpkgs_4" + }, + "locked": { + "lastModified": 1720923816, + "narHash": "sha256-GrDL1nFYZrB/+Ah1hNoaNFfduB1agpfqL9QyEl12UOU=", + "owner": "oxalica", + "repo": "rust-overlay", + "rev": "fb8c8be0313f0e6385b3d70151a04ea1d71e4b68", + "type": "github" + }, + "original": { + "owner": "oxalica", + "repo": "rust-overlay", + "type": "github" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_2": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "systems_3": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + }, + "wasm-rust": { + "inputs": { + "flake-utils": "flake-utils_3", + "nixpkgs": "nixpkgs_3", + "rust-overlay": "rust-overlay" + }, + "locked": { + "lastModified": 1732217763, + "narHash": "sha256-88vFA3/1FD6+7zXN/zQOzAoyJV8gVXNVKaxWxiM5Af4=", + "owner": "gavinleroy", + "repo": "rust", + "rev": "761bcb0ddab3ad08826bf33bc43fb50ea1652285", + "type": "github" + }, + "original": { + "owner": "gavinleroy", + "ref": "761bcb0ddab3ad08826bf33bc43fb50ea1652285", + "repo": "rust", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 000000000..6dfc8bc76 --- /dev/null +++ b/flake.nix @@ -0,0 +1,108 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + depot-js.url = "github:cognitive-engineering-lab/depot"; + wasm-rust = { + type = "github"; + owner = "gavinleroy"; + repo = "rust"; + ref = "761bcb0ddab3ad08826bf33bc43fb50ea1652285"; + }; + }; + + outputs = { self, nixpkgs, flake-utils, depot-js, wasm-rust }: + flake-utils.lib.eachDefaultSystem (system: + let + pkgs = import nixpkgs { + inherit system; + }; + + # NOTE: won't it be an amazing day when we can use normal toolchains again? + toolchain = wasm-rust.packages.${system}.default; + depotjs = depot-js.packages.${system}.default; + + ci-check = pkgs.writeScriptBin "ci-check" '' + cargo insta test + cd crates/mdbook-aquascope/test-book && mdbook build + cd frontend && depot test && cd .. + ''; + + ci-install = pkgs.writeScriptBin "ci-install" '' + cargo install --path crates/aquascope_front --debug --locked + cargo install --path crates/mdbook-aquascope --debug --locked + ''; + + ci-publish-crates = pkgs.writeScriptBin "ci-publish-crates" '' + cargo build + cargo ws publish --from-git --allow-dirty --yes --token "$1" + ''; + + ci-build-standalone = pkgs.writeScriptBin "ci-build-standalone" '' + cd frontend + depot build + ''; + + ci-publish-full-pages = pkgs.writeScriptBin "ci-update-frontend" '' + cargo doc --lib + mv ./target/doc ./frontend/packages/aquascope-standalone/dist/doc + cd frontend && depot build + ''; + + minimalFrontendDeps = [ + depotjs + pkgs.nodejs_22 + pkgs.nodePackages.pnpm + ci-build-standalone + ]; + + in { + devShells = { + # Used only for building the frontend with + # depot and publishing the standalone site + minimal = pkgs.mkShell { + buildInputs = minimalFrontendDeps; + }; + + fullstack = with pkgs; mkShell { + buildInputs = minimalFrontendDeps ++ [ + ci-check + ci-install + ci-publish-crates + ci-publish-full-pages + + llvmPackages_latest.llvm + llvmPackages_latest.lld + libiconv + + cargo-insta + cargo-make + cargo-watch + rust-analyzer + + mdbook + + toolchain + ] ++ lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.SystemConfiguration + ]; + + shellHook = '' + export SYSROOT=$(rustc --print sysroot) + export MIRI_SYSROOT=$(rustc --print sysroot) + export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:$(rustc --print target-libdir)" + ''; + + RUSTC_LINKER = "${llvmPackages.clangUseLLVM}/bin/clang"; + + # NOTE: currently playwright-driver uses version 1.40.0, when something inevitably fails, + # check that the version of playwright-driver and that of the NPM playwright + # `packages/evaluation/package.json` match. + PLAYWRIGHT_BROWSERS_PATH="${playwright-driver.browsers}"; + }; + + default = self.devShells.${system}.fullstack; + }; + + }); +} diff --git a/frontend/package.json b/frontend/package.json index cf1961bbf..3b064d08e 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "private": true, "depot": { - "depot-version": "0.2.16" + "depot-version": "0.2.17" }, "devDependencies": { "@biomejs/biome": "^1.8.3", @@ -18,4 +18,4 @@ "vite": "^4.4.4", "vitest": "^0.33.0" } -} \ No newline at end of file +} diff --git a/frontend/packages/aquascope-standalone/vite.config.ts b/frontend/packages/aquascope-standalone/vite.config.ts deleted file mode 100644 index 589674746..000000000 --- a/frontend/packages/aquascope-standalone/vite.config.ts +++ /dev/null @@ -1,13 +0,0 @@ -import react from "@vitejs/plugin-react"; -import { defineConfig } from "vite"; - -let serverUrl = process.env["AQUASCOPE_SERVER"] ?? "http://127.0.0.1:8008"; - -export default defineConfig(({mode}) => ({ - base: "./", - define: { - SERVER_URL: JSON.stringify(serverUrl), - "process.env.NODE_ENV": JSON.stringify(mode), - }, - plugins: [react()] -})); diff --git a/frontend/packages/aquascope-editor/.gitignore b/frontend/packages/editor/.gitignore similarity index 100% rename from frontend/packages/aquascope-editor/.gitignore rename to frontend/packages/editor/.gitignore diff --git a/frontend/packages/aquascope-editor/package.json b/frontend/packages/editor/package.json similarity index 88% rename from frontend/packages/aquascope-editor/package.json rename to frontend/packages/editor/package.json index b1cfd39a2..944e0f4e2 100644 --- a/frontend/packages/aquascope-editor/package.json +++ b/frontend/packages/editor/package.json @@ -1,5 +1,5 @@ { - "name": "aquascope-editor", + "name": "@aquascope/editor", "version": "0.1.0", "files": [ "dist" @@ -33,6 +33,8 @@ "@types/react": "^18.0.26", "@types/react-dom": "^18.0.9", "@vitejs/plugin-react": "^4.0.3", + "@aquascope/system": "workspace:*", + "@aquascope/types": "workspace:*", "classnames": "^2.3.2", "react": "^18.2.0", "react-dom": "^18.2.0" diff --git a/frontend/packages/aquascope-editor/src/editor-utils/boundaries.tsx b/frontend/packages/editor/src/editor-utils/boundaries.tsx similarity index 99% rename from frontend/packages/aquascope-editor/src/editor-utils/boundaries.tsx rename to frontend/packages/editor/src/editor-utils/boundaries.tsx index 76247b255..9833d7fd3 100644 --- a/frontend/packages/aquascope-editor/src/editor-utils/boundaries.tsx +++ b/frontend/packages/editor/src/editor-utils/boundaries.tsx @@ -8,7 +8,7 @@ import type { AnalysisFacts, BoundariesAnnotations, PermissionsBoundary -} from "../types"; +} from "@aquascope/types"; import { type PermLetter, flowChar, diff --git a/frontend/packages/aquascope-editor/src/editor-utils/interpreter.tsx b/frontend/packages/editor/src/editor-utils/interpreter.tsx similarity index 99% rename from frontend/packages/aquascope-editor/src/editor-utils/interpreter.tsx rename to frontend/packages/editor/src/editor-utils/interpreter.tsx index 2144355f9..786c62d5f 100644 --- a/frontend/packages/aquascope-editor/src/editor-utils/interpreter.tsx +++ b/frontend/packages/editor/src/editor-utils/interpreter.tsx @@ -23,7 +23,7 @@ import type { MTrace, MUndefinedBehavior, MValue -} from "../types"; +} from "@aquascope/types"; import { evenlySpaceAround, linecolToPosition, diff --git a/frontend/packages/aquascope-editor/src/editor-utils/misc.tsx b/frontend/packages/editor/src/editor-utils/misc.tsx similarity index 99% rename from frontend/packages/aquascope-editor/src/editor-utils/misc.tsx rename to frontend/packages/editor/src/editor-utils/misc.tsx index 415833f63..a0b60fd9d 100644 --- a/frontend/packages/aquascope-editor/src/editor-utils/misc.tsx +++ b/frontend/packages/editor/src/editor-utils/misc.tsx @@ -9,15 +9,15 @@ import { import { Decoration, type DecorationSet, EditorView } from "@codemirror/view"; import _ from "lodash"; -import type { CharPos } from "../bindings/CharPos"; import type { AnalysisFacts, AnalysisOutput, + CharPos, CharRange, LoanKey, MoveKey, RefinementRegion -} from "../types"; +} from "@aquascope/types"; // --------- // Constants diff --git a/frontend/packages/aquascope-editor/src/editor-utils/permissions.tsx b/frontend/packages/editor/src/editor-utils/permissions.tsx similarity index 93% rename from frontend/packages/aquascope-editor/src/editor-utils/permissions.tsx rename to frontend/packages/editor/src/editor-utils/permissions.tsx index a00f4dee2..32f37204c 100644 --- a/frontend/packages/aquascope-editor/src/editor-utils/permissions.tsx +++ b/frontend/packages/editor/src/editor-utils/permissions.tsx @@ -2,7 +2,7 @@ import type { Range } from "@codemirror/state"; import type { Decoration, EditorView } from "@codemirror/view"; import _ from "lodash"; -import type { AnalysisOutput, AquascopeAnnotations } from "../types"; +import type { AnalysisOutput, AquascopeAnnotations } from "@aquascope/types"; import { boundariesField, makeBoundaryDecorations } from "./boundaries"; import { type ActionFacts, @@ -11,7 +11,7 @@ import { } from "./misc"; import { makeStepDecorations, stepField } from "./stepper"; -export interface PermissionsCfg { +export interface PermissionsConfig { stepper?: any; boundaries?: any; } @@ -56,7 +56,7 @@ export function makePermissionsDecorations( export function renderPermissions( view: EditorView, decorations?: PermissionsDecorations, - cfg?: PermissionsCfg + cfg?: PermissionsConfig ) { console.debug("rendering permissions with", cfg); if (decorations !== undefined) { diff --git a/frontend/packages/aquascope-editor/src/editor-utils/stepper.tsx b/frontend/packages/editor/src/editor-utils/stepper.tsx similarity index 99% rename from frontend/packages/aquascope-editor/src/editor-utils/stepper.tsx rename to frontend/packages/editor/src/editor-utils/stepper.tsx index 067f3aeb9..f58377ef6 100644 --- a/frontend/packages/aquascope-editor/src/editor-utils/stepper.tsx +++ b/frontend/packages/editor/src/editor-utils/stepper.tsx @@ -5,9 +5,9 @@ import _ from "lodash"; import React, { useState } from "react"; import ReactDOM from "react-dom/client"; -import type { CharPos } from "../bindings/CharPos"; import type { AnalysisFacts, + CharPos, LoanKey, MoveKey, PermissionsDataDiff, @@ -15,7 +15,7 @@ import type { PermissionsStepTable, StepperAnnotations, ValueStep -} from "../types"; +} from "@aquascope/types"; import { hideLoanRegion, hideMoveRegion, diff --git a/frontend/packages/aquascope-editor/src/lib.tsx b/frontend/packages/editor/src/lib.tsx similarity index 74% rename from frontend/packages/aquascope-editor/src/lib.tsx rename to frontend/packages/editor/src/lib.tsx index bc6e3c25e..db157620b 100644 --- a/frontend/packages/aquascope-editor/src/lib.tsx +++ b/frontend/packages/editor/src/lib.tsx @@ -1,3 +1,4 @@ +import type { AquascopeBackend } from "@aquascope/system"; import { rust } from "@codemirror/lang-rust"; import { indentUnit } from "@codemirror/language"; import { Compartment, EditorState, type Extension } from "@codemirror/state"; @@ -18,38 +19,28 @@ import { loanFactsField } from "./editor-utils/misc"; import { - type PermissionsCfg, + type PermissionsConfig, type PermissionsDecorations, makePermissionsDecorations, renderPermissions } from "./editor-utils/permissions"; import { stepField } from "./editor-utils/stepper"; import "./styles.scss"; -import type { - AnalysisFacts, - AnalysisOutput, - AquascopeAnnotations, - BackendError, - CharRange, - InterpAnnotations, - MTrace -} from "./types"; - -export * as types from "./types"; - -const DEFAULT_SERVER_URL = new URL("http://127.0.0.1:8008"); - -export type Result = { Ok: T } | { Err: BackendError }; - -// XXX this extra server response type is really -// annoying and I'd like to get rid of it. This change would -// require modifying how command output is read from the spawned -// docker container on the backend. -type ServerResponse = { - success: boolean; - stdout: string; - stderr: string; -}; +import { + type AnalysisFacts, + type AnalysisOutput, + type AquascopeAnnotations, + type BackendError, + type CharRange, + type Command, + type CommandResult, + type InterpAnnotations, + type MTrace, + isInterp, + isPerm +} from "@aquascope/types"; + +export * as types from "@aquascope/types"; export const defaultCodeExample: string = ` fn main() { @@ -60,12 +51,12 @@ fn main() { } `.trim(); -let readOnly = new Compartment(); -let mainKeybinding = new Compartment(); +const readOnly = new Compartment(); +const mainKeybinding = new Compartment(); type ButtonName = "copy" | "eye"; -let CopyButton = ({ view }: { view: EditorView }) => ( +const CopyButton = ({ view }: { view: EditorView }) => ( ); -let HideButton = ({ container }: { container: HTMLDivElement }) => { - let [hidden, setHidden] = useState(true); +const HideButton = ({ container }: { container: HTMLDivElement }) => { + const [hidden, setHidden] = useState(true); useEffect(() => { if (!hidden) container.classList.add("show-hidden"); else container.classList.remove("show-hidden"); @@ -92,7 +83,7 @@ let HideButton = ({ container }: { container: HTMLDivElement }) => { ); }; -let resetMarkedRangesOnEdit = EditorView.updateListener.of( +const resetMarkedRangesOnEdit = EditorView.updateListener.of( (upd: ViewUpdate) => { if (upd.docChanged) { upd.view.dispatch({ @@ -121,22 +112,22 @@ export class Editor { private buttons: Set; private shouldFail = false; - public constructor( + constructor( dom: HTMLDivElement, readonly setup: Extension, + readonly backend: AquascopeBackend | undefined, readonly reportStdErr: (err: BackendError) => void = err => { console.error("An error occurred: "); console.error(err); }, code: string = defaultCodeExample, - readonly serverUrl: URL = DEFAULT_SERVER_URL, readonly noInteract: boolean = false, readonly shouldFailHtml: string = "This code does not compile!", readonly buttonList: ButtonName[] = [] ) { this.buttons = new Set(buttonList); - let initialState = EditorState.create({ + const initialState = EditorState.create({ doc: code, extensions: [ mainKeybinding.of(setup), @@ -221,39 +212,16 @@ export class Editor { }); } - public async renderPermissions(cfg?: PermissionsCfg) { + public async renderPermissions(cfg?: PermissionsConfig) { // TODO: the permissions Decos are no longer removed on update // so we have to recompute every time. - // if (this.permissionsDecos === undefined) { await this.renderOperation("permissions", { config: cfg }); - // } renderPermissions(this.view, this.permissionsDecos, cfg); } - // Actions to communicate with the aquascope server - async callBackendWithCode( - endpoint: string, - config?: any - ): Promise { - let inEditor = this.getCurrentCode(); - let endpointUrl = new URL(endpoint, this.serverUrl); - let serverResponseRaw = await fetch(endpointUrl, { - method: "POST", - headers: { - "Content-Type": "application/json" - }, - body: JSON.stringify({ - code: inEditor, - config - }) - }); - let serverResponse: ServerResponse = await serverResponseRaw.json(); - return serverResponse; - } - renderInterpreter( trace: MTrace, config?: InterpreterConfig, @@ -273,33 +241,38 @@ export class Editor { ); } - async renderOperation( - operation: string, + async renderOperation( + operation: C, { response, config, annotations }: { - response?: Result; + response?: CommandResult; config?: CommonConfig & object; annotations?: AquascopeAnnotations; } = {} ) { console.debug(`Rendering operation: ${operation}`); + const inEditor = this.getCurrentCode(); + + if (config?.shouldFail) { + this.shouldFail = true; + } if (!response) { - let serverResponse = await this.callBackendWithCode(operation, config); - if (serverResponse.success) { - response = JSON.parse(serverResponse.stdout); + if (!this.backend) throw new Error("Cannot generate without backend"); + + response = await this.backend.call(operation, inEditor, { + shouldFail: this.shouldFail + }); + + if (!response) { this.reportStdErr({ - type: "ServerStderr", - error: serverResponse.stderr - }); - } else { - return this.reportStdErr({ - type: "ServerStderr", - error: serverResponse.stderr + type: "AnalysisError", + msg: `render operation ${operation} failed` }); + return; } } @@ -310,19 +283,19 @@ export class Editor { this.buttons.add("eye"); } - if (config?.shouldFail) { - this.shouldFail = true; - } - this.renderMeta(); - if (operation === "interpreter") { - if ("Ok" in response!) { + if (isInterp(operation)) { + // TODO: I don't like that we need this to narrow the type of response + response = response as CommandResult; + if ("Ok" in response) { this.renderInterpreter(response.Ok, config as any, annotations?.interp); } else { - this.reportStdErr(response!.Err); + this.reportStdErr(response.Err); } - } else if (operation === "permissions") { + } else if (isPerm(operation)) { + // TODO: I don't like that we need this to narrow the type of response + const resp: CommandResult = response; // The permissions analysis results are sent as an array of // body analyses. Each body could have analyzed successfully, // or had a @@ -336,10 +309,9 @@ export class Editor { // internally, usually means a feature was used that we don't support // or something actually went terribly wrong. These should be logged // somewhere, but the user should also be prompted to open a GitHub issue. - let cast = response as any as Result[]; - let results: AnalysisOutput[] = []; - - for (const res of cast) { + console.warn("Permissions response: ", resp); + const results: AnalysisOutput[] = []; + for (const res of resp) { if ("Ok" in res) { results.push(res.Ok); } else { diff --git a/frontend/packages/aquascope-editor/src/styles.scss b/frontend/packages/editor/src/styles.scss similarity index 100% rename from frontend/packages/aquascope-editor/src/styles.scss rename to frontend/packages/editor/src/styles.scss diff --git a/frontend/packages/editor/src/types.ts b/frontend/packages/editor/src/types.ts new file mode 100644 index 000000000..e69de29bb diff --git a/frontend/packages/aquascope-editor/tsconfig.json b/frontend/packages/editor/tsconfig.json similarity index 100% rename from frontend/packages/aquascope-editor/tsconfig.json rename to frontend/packages/editor/tsconfig.json diff --git a/frontend/packages/aquascope-editor/vitest.config.ts b/frontend/packages/editor/vitest.config.ts similarity index 100% rename from frontend/packages/aquascope-editor/vitest.config.ts rename to frontend/packages/editor/vitest.config.ts diff --git a/frontend/packages/aquascope-embed/package.json b/frontend/packages/embed/package.json similarity index 77% rename from frontend/packages/aquascope-embed/package.json rename to frontend/packages/embed/package.json index e4417bce6..0ddb1465f 100644 --- a/frontend/packages/aquascope-embed/package.json +++ b/frontend/packages/embed/package.json @@ -1,5 +1,5 @@ { - "name": "aquascope-embed", + "name": "@aquascope/embed", "version": "0.1.0", "depot": { "platform": "browser" @@ -14,9 +14,10 @@ "@types/react": "^18.0.26", "@types/react-dom": "^18.2.0", "@vitejs/plugin-react": "^4.0.3", - "aquascope-editor": "workspace:*", - "puppeteer": "^19.6.0", + "@aquascope/editor": "workspace:*", + "@aquascope/types": "workspace:*", + "playwright": "1.40.0", "react": "^18.2.0", "react-dom": "^18.2.0" } -} \ No newline at end of file +} diff --git a/frontend/packages/aquascope-embed/src/main.tsx b/frontend/packages/embed/src/main.tsx similarity index 56% rename from frontend/packages/aquascope-embed/src/main.tsx rename to frontend/packages/embed/src/main.tsx index c5cc1c34e..c84f06bed 100644 --- a/frontend/packages/aquascope-embed/src/main.tsx +++ b/frontend/packages/embed/src/main.tsx @@ -1,5 +1,6 @@ +import { Editor } from "@aquascope/editor"; +import type * as types from "@aquascope/types"; import { useFloating } from "@floating-ui/react-dom"; -import { Editor, type Result, type types } from "aquascope-editor"; import React, { useContext, useLayoutEffect, useState } from "react"; import ReactDOM from "react-dom/client"; @@ -16,7 +17,7 @@ const EMBED_NAME = "aquascope-embed"; // moving some of this functionality into aquascope-editor and distributing that // package on npm. declare global { - function initAquascopeBlocks(root: HTMLElement): void; + function initAquascopeBlocks(root: HTMLElement): Promise; var telemetry: | { @@ -25,13 +26,13 @@ declare global { | undefined; } -let CodeContext = React.createContext(""); +const CodeContext = React.createContext(""); // TODO: this is duplicated with mdbook-quiz. Should factor out into a mdbook-js-utils maybe? -let useCaptureMdbookShortcuts = (capture: boolean) => { +const useCaptureMdbookShortcuts = (capture: boolean) => { useLayoutEffect(() => { if (capture) { - let captureKeyboard = (e: KeyboardEvent) => e.stopPropagation(); + const captureKeyboard = (e: KeyboardEvent) => e.stopPropagation(); // This gets added specifically to document.documentElement rather than document // so bubbling events will hit this listener before ones added via document.addEventListener(...). @@ -57,7 +58,7 @@ let useCaptureMdbookShortcuts = (capture: boolean) => { }, [capture]); }; -let ContextProvider = ({ +const ContextProvider = ({ title, buttonText, children @@ -66,8 +67,8 @@ let ContextProvider = ({ buttonText: string; children: (close: () => void) => JSX.Element; }) => { - let [open, setOpen] = useState(false); - let { x, y, strategy, refs } = useFloating({ + const [open, setOpen] = useState(false); + const { x, y, strategy, refs } = useFloating({ placement: "bottom-end", open }); @@ -76,7 +77,7 @@ let ContextProvider = ({ // fullscreen useCaptureMdbookShortcuts(open); - let childEl = children(() => setOpen(false)); + const childEl = children(() => setOpen(false)); return (
@@ -112,13 +113,15 @@ let ContextProvider = ({ ); }; -let BugReporter = () => ( +const BugReporter = () => ( {close => { - let code = useContext(CodeContext); - let onSubmit: React.FormEventHandler = (event: any) => { - let data = new FormData(event.target as any); - let feedback = data.get("feedback")!.toString(); + const code = useContext(CodeContext); + const onSubmit: React.FormEventHandler = ( + event: any + ) => { + const data = new FormData(event.target as any); + const feedback = data.get("feedback")!.toString(); window.telemetry!.log("aquascopeBug", { code, feedback }); event.preventDefault(); close(); @@ -144,7 +147,7 @@ let BugReporter = () => ( ); -let QuestionMark = () => ( +const QuestionMark = () => ( {() => ( <> @@ -166,55 +169,55 @@ let QuestionMark = () => ( ); -let ExtraInfo = () => ( +const ExtraInfo = () => (
); -window.initAquascopeBlocks = (root: HTMLElement) => { - root.querySelectorAll(`.${EMBED_NAME}`).forEach(elem => { - elem.classList.remove(EMBED_NAME); - elem.classList.add(AQUASCOPE_NAME); +window.initAquascopeBlocks = async (root: HTMLElement) => { + const elements: HTMLDivElement[] = Array.from( + root.querySelectorAll(`.${EMBED_NAME}`) + ); + await Promise.all( + elements.map(async elem => { + elem.classList.remove(EMBED_NAME); + elem.classList.add(AQUASCOPE_NAME); - let readOnly = elem.dataset.noInteract! === "true"; + const readOnly = elem.dataset.noInteract! === "true"; - let computePermBtn: HTMLButtonElement | undefined; - if (!readOnly) { - // container for the button - let btnWrap = document.createElement("div"); - btnWrap.classList.add("top-right"); + let computePermBtn: HTMLButtonElement | undefined; + if (!readOnly) { + // container for the button + const btnWrap = document.createElement("div"); + btnWrap.classList.add("top-right"); - // button for computing the receiver permissions - computePermBtn = document.createElement("button"); - computePermBtn.className = "fa fa-refresh cm-button"; + // button for computing the receiver permissions + computePermBtn = document.createElement("button"); + computePermBtn.className = "fa fa-refresh cm-button"; - btnWrap.appendChild(computePermBtn); - elem.appendChild(btnWrap); - } + btnWrap.appendChild(computePermBtn); + elem.appendChild(btnWrap); + } - let maybeParseJson = (s: string | undefined): T | undefined => - s ? JSON.parse(s) : undefined; + const maybeParseJson = (s: string | undefined): T | undefined => + s ? JSON.parse(s) : undefined; - let initialCode = maybeParseJson(elem.dataset.code); - if (!initialCode) throw new Error("Missing data-code attribute"); + const initialCode = maybeParseJson(elem.dataset.code); + if (!initialCode) throw new Error("Missing data-code attribute"); - if (window.telemetry) { - let extraInfo = document.createElement("div"); - elem.appendChild(extraInfo); - ReactDOM.createRoot(extraInfo).render( - - - - ); - } - - let serverUrl = elem.dataset.serverUrl - ? new URL(elem.dataset.serverUrl) - : undefined; + if (window.telemetry) { + const extraInfo = document.createElement("div"); + elem.appendChild(extraInfo); + ReactDOM.createRoot(extraInfo).render( + + + + ); + } - let shouldFailHtml = ` + const shouldFailHtml = `
`; - let ed = new Editor( - elem, - setup, - err => { - console.error(err); - }, - initialCode, - serverUrl, - readOnly, - shouldFailHtml, - ["copy"] - ); + const ed = new Editor( + elem, + setup, + undefined, + err => { + console.error(err); + }, + initialCode, + readOnly, + shouldFailHtml, + ["copy"] + ); - let operations = maybeParseJson(elem.dataset.operations); - if (!operations) throw new Error("Missing data-operations attribute"); + const operations = maybeParseJson(elem.dataset.operations); + if (!operations) throw new Error("Missing data-operations attribute"); - let responses = maybeParseJson<{ [op: string]: Result }>( - elem.dataset.responses - ); - let config = maybeParseJson(elem.dataset.config); - let annotations = maybeParseJson( - elem.dataset.annotations - ); + // TODO: how can we specify `op` to be `Command`?? then use that type here VVVVV + const responses = maybeParseJson<{ + [op: string]: types.CommandResult; + }>(elem.dataset.responses); + const config = maybeParseJson(elem.dataset.config); + const annotations = maybeParseJson( + elem.dataset.annotations + ); - if (responses) { - operations.forEach(operation => { - ed.renderOperation(operation, { - response: responses![operation], - config, - annotations + if (responses) { + operations.forEach(operation => { + // TODO get rid of this cast VVVVVVVVVVVVVVVV + ed.renderOperation(operation as types.Command, { + response: responses![operation], + config, + annotations + }); }); - }); - } + } - computePermBtn?.addEventListener("click", _ => { - operations!.forEach(operation => ed.renderOperation(operation!, {})); - }); - }); + computePermBtn?.addEventListener("click", _ => { + operations!.forEach(operation => + // TODO: -------------------VVVVVVVV + ed.renderOperation(operation! as types.Command, {}) + ); + }); + }) + ); }; window.addEventListener( diff --git a/frontend/packages/aquascope-embed/src/setup.ts b/frontend/packages/embed/src/setup.ts similarity index 100% rename from frontend/packages/aquascope-embed/src/setup.ts rename to frontend/packages/embed/src/setup.ts diff --git a/frontend/packages/aquascope-embed/src/styles.scss b/frontend/packages/embed/src/styles.scss similarity index 98% rename from frontend/packages/aquascope-embed/src/styles.scss rename to frontend/packages/embed/src/styles.scss index cb5561264..d03f4e260 100644 --- a/frontend/packages/aquascope-embed/src/styles.scss +++ b/frontend/packages/embed/src/styles.scss @@ -1,4 +1,4 @@ -@use "aquascope-editor/dist/styles.scss"; +@use "@aquascope/editor/dist/styles.scss"; .light, .rust { --code-bg: #f6f7f6; diff --git a/frontend/packages/aquascope-embed/tests/embed.test.ts b/frontend/packages/embed/tests/embed.test.ts similarity index 86% rename from frontend/packages/aquascope-embed/tests/embed.test.ts rename to frontend/packages/embed/tests/embed.test.ts index d6ee9e656..894fed78e 100644 --- a/frontend/packages/aquascope-embed/tests/embed.test.ts +++ b/frontend/packages/embed/tests/embed.test.ts @@ -1,4 +1,4 @@ -import puppeteer, { type Browser, type Page } from "puppeteer"; +import { type Browser, type Page, chromium } from "playwright"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; describe("Aquascope Embed", () => { @@ -6,7 +6,7 @@ describe("Aquascope Embed", () => { let page: Page; beforeAll(async () => { - browser = await puppeteer.launch(); + browser = await chromium.launch(); page = await browser.newPage(); }); @@ -22,7 +22,9 @@ describe("Aquascope Embed", () => { } ); - await page.waitForSelector(".aquascope"); + await page.waitForSelector(".aquascope", { + timeout: 60_000 + }); // The embedded editors don't have to call out to aquascope, // they just need to render their contents. After the first editor has been // rendered they should all follow shortly. @@ -41,5 +43,5 @@ describe("Aquascope Embed", () => { // There must have been an editor on the screen. expect(editors).not.toBeNull(); expect(editors.length).toBeGreaterThan(0); - }, 30_000); + }, 60_000); }); diff --git a/frontend/packages/aquascope-embed/tsconfig.json b/frontend/packages/embed/tsconfig.json similarity index 100% rename from frontend/packages/aquascope-embed/tsconfig.json rename to frontend/packages/embed/tsconfig.json diff --git a/frontend/packages/aquascope-embed/vite.config.ts b/frontend/packages/embed/vite.config.ts similarity index 52% rename from frontend/packages/aquascope-embed/vite.config.ts rename to frontend/packages/embed/vite.config.ts index c5b41a009..2df726b3b 100644 --- a/frontend/packages/aquascope-embed/vite.config.ts +++ b/frontend/packages/embed/vite.config.ts @@ -1,22 +1,22 @@ -import fs from "fs"; +import fs from "node:fs"; +import { resolve } from "node:path"; import react from "@vitejs/plugin-react"; import { defineConfig } from "vite"; -import { resolve } from "path"; -let manifest = JSON.parse(fs.readFileSync("package.json", "utf-8")); -export default defineConfig(({mode}) => ({ +const manifest = JSON.parse(fs.readFileSync("package.json", "utf-8")); +export default defineConfig(({ mode }) => ({ build: { lib: { entry: resolve(__dirname, "src/main.tsx"), name: "AquascopeEmbed", - formats: ["iife"], + formats: ["iife"] }, rollupOptions: { external: Object.keys(manifest.dependencies || {}) } }, define: { - "process.env.NODE_ENV": JSON.stringify(mode), + "process.env.NODE_ENV": JSON.stringify(mode) }, - plugins: [react()], + plugins: [react()] })); diff --git a/frontend/packages/aquascope-standalone/aquascope-favicon.png b/frontend/packages/standalone/aquascope-favicon.png similarity index 100% rename from frontend/packages/aquascope-standalone/aquascope-favicon.png rename to frontend/packages/standalone/aquascope-favicon.png diff --git a/frontend/packages/aquascope-standalone/index.html b/frontend/packages/standalone/index.html similarity index 88% rename from frontend/packages/aquascope-standalone/index.html rename to frontend/packages/standalone/index.html index 883d547dd..d9084ac4c 100644 --- a/frontend/packages/aquascope-standalone/index.html +++ b/frontend/packages/standalone/index.html @@ -16,6 +16,14 @@ + + Aquascope: Look Beneath the Surface of Rust @@ -38,18 +46,11 @@

Aquascope Playground

- Aquascope is a research tool under active development, so it doesn't work for some Rust programs. + Aquascope is a research tool under active development, so it doesn't work for some Rust programs (but do file an issue). If you want to see Aquascope diagrams in action, check out the new chapter on ownership in the Rust Book Experiment.

-

- You can easily install and run the Aquascope playground locally. Simply follow the - installation instructions. - Running the playground locally is faster, which can improve demos in front of a live audience. It's also an option if our server is down, and please - file an issue if it is. -

-