From f3cd975878d039fd3426a2e96c3df5f932577d2b Mon Sep 17 00:00:00 2001 From: Adam McKee Date: Thu, 9 Jan 2025 16:04:19 -0600 Subject: [PATCH] wasi component of l3_fn_build --- .github/workflows/gh_release.yml | 22 +- .github/workflows/gh_release_upload.yml | 49 +- .../workflows/gh_release_upload_windows.yml | 49 -- .github/workflows/verify.yml | 77 +- .github/workflows/windows_upload_asset.mjs | 32 - Cargo.lock | 678 ++++++++---------- Cargo.toml | 3 +- ci_verify.sh | 3 +- fn_build/Cargo.toml | 5 +- fn_build_wasm/Cargo.toml | 18 + fn_build_wasm/src/lib.rs | 133 ++++ fn_build_wasm/wit/fn-building.wit | 111 +++ fn_build_wasm/wit/fn-parsing.wit | 101 +++ l3_cli/Cargo.toml | 2 +- 14 files changed, 756 insertions(+), 527 deletions(-) delete mode 100644 .github/workflows/gh_release_upload_windows.yml delete mode 100644 .github/workflows/windows_upload_asset.mjs create mode 100644 fn_build_wasm/Cargo.toml create mode 100644 fn_build_wasm/src/lib.rs create mode 100644 fn_build_wasm/wit/fn-building.wit create mode 100644 fn_build_wasm/wit/fn-parsing.wit diff --git a/.github/workflows/gh_release.yml b/.github/workflows/gh_release.yml index 2553965..1816ab9 100644 --- a/.github/workflows/gh_release.yml +++ b/.github/workflows/gh_release.yml @@ -68,19 +68,21 @@ jobs: tag_name: ${{ needs.publish-cargo-crates.outputs.tag_name }} upload_hostname: ${{ steps.create.outputs.upload_hostname }} - publish-linux-and-macos-assets: + upload: needs: create-gh-release uses: ./.github/workflows/gh_release_upload.yml + strategy: + matrix: + include: + - filename: l3-linux-x86_64 + - filename: l3-linux-aarch64 + - filename: l3-macos-x86_64 + - filename: l3-macos-aarch64 + - filename: l3-windows-aarch64.exe + - filename: l3-windows-x86_64.exe + - filename: l3-fn-build.wasm with: - release_id: ${{ needs.create-gh-release.outputs.release_id }} - tag_name: ${{ needs.create-gh-release.outputs.tag_name }} - upload_hostname: ${{ needs.create-gh-release.outputs.upload_hostname }} - secrets: inherit - - publish-windows-assets: - needs: create-gh-release - uses: ./.github/workflows/gh_release_upload_windows.yml - with: + filename: ${{ matrix.filename }} release_id: ${{ needs.create-gh-release.outputs.release_id }} tag_name: ${{ needs.create-gh-release.outputs.tag_name }} upload_hostname: ${{ needs.create-gh-release.outputs.upload_hostname }} diff --git a/.github/workflows/gh_release_upload.yml b/.github/workflows/gh_release_upload.yml index 9d66085..eef0664 100644 --- a/.github/workflows/gh_release_upload.yml +++ b/.github/workflows/gh_release_upload.yml @@ -1,9 +1,12 @@ -name: Upload Linux/MacOS -run-name: Upload ${{ inputs.tag_name }} bins for Linux/MacOS +name: Release upload +run-name: Upload ${{ inputs.filename }} to release ${{ inputs.tag_name }} on: workflow_call: inputs: + filename: + required: true + type: string release_id: required: true type: string @@ -17,51 +20,25 @@ on: jobs: publish-asset: - name: "publish ${{ matrix.filename}}" - runs-on: ${{ matrix.runner }} - strategy: - matrix: - include: - - filename: l3-linux-x86_64 - runner: ubuntu-24.04 - target: x86_64-unknown-linux-gnu - - filename: l3-linux-aarch64 - runner: ubuntu-24.04 - target: aarch64-unknown-linux-gnu - apt_package_linker: gcc-aarch64-linux-gnu - - filename: l3-macos-x86_64 - runner: macos-latest - target: x86_64-apple-darwin - - filename: l3-macos-aarch64 - runner: macos-latest - target: aarch64-apple-darwin + name: "publish ${{ inputs.filename}}" + runs-on: ubuntu-latest env: - FILENAME: ${{ matrix.filename }} - TARGET: ${{ matrix.target }} + FILENAME: ${{ inputs.filename }} RELEASE_ID: ${{ inputs.release_id }} UPLOAD_HOSTNAME: ${{ inputs.upload_hostname }} steps: - - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 with: - ref: ${{ inputs.tag_name }} - - if: ${{ matrix.apt_package_linker }} - run: | - sudo apt update && sudo apt install ${{ matrix.apt_package_linker }} - mkdir -p $HOME/.cargo - mv ./.github/workflows/linkers.toml $HOME/.cargo/config.toml - - run: rustup install stable - - uses: swatinem/rust-cache@v2 - - run: rustup target add $TARGET - - name: build - run: cargo build --release --target $TARGET + name: ${{ inputs.filename }} + path: ${{ inputs.filename }} - name: upload run: | curl --fail --silent -L -X POST \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer $GH_TOKEN" \ -H "X-GitHub-Api-Version: 2022-11-28" \ - -H "Content-Type: $(file target/$TARGET/release/l3 -b --mime-type)" \ + -H "Content-Type: $(file $FILENAME -b --mime-type)" \ https://$UPLOAD_HOSTNAME/repos/eighty4/l3/releases/$RELEASE_ID/assets?name=$FILENAME \ - --data-binary "@target/$TARGET/release/l3" + --data-binary "@$FILENAME" env: GH_TOKEN: ${{ secrets.GH_TOKEN }} diff --git a/.github/workflows/gh_release_upload_windows.yml b/.github/workflows/gh_release_upload_windows.yml deleted file mode 100644 index c051fa8..0000000 --- a/.github/workflows/gh_release_upload_windows.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Upload Windows -run-name: Upload ${{ inputs.tag_name }} bins for Windows - -on: - workflow_call: - inputs: - release_id: - required: true - type: string - tag_name: - required: true - type: string - upload_hostname: - required: true - type: string - -jobs: - - publish-asset: - name: "publish ${{ matrix.filename}}" - runs-on: windows-2022 - strategy: - matrix: - include: - - filename: l3-windows-aarch64.exe - target: aarch64-pc-windows-msvc - - filename: l3-windows-x86_64.exe - target: x86_64-pc-windows-msvc - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ inputs.tag_name }} - - run: rustup install stable - - uses: swatinem/rust-cache@v2 - - run: rustup target add ${{ matrix.target }} - - name: build - shell: powershell - run: cargo build -p l3_cli --release --target ${{ matrix.target }} - - name: upload - shell: powershell - env: - GH_TOKEN: ${{ secrets.GH_TOKEN }} - RELEASE_ID: ${{ inputs.release_id }} - UPLOAD_HOSTNAME: ${{ inputs.upload_hostname }} - run: | - Move-Item -Path target\${{ matrix.target }}\release\l3.exe -Destination ${{ matrix.filename }} - Move-Item -Path .github/workflows/windows_upload_asset.mjs -Destination upload_asset.mjs - npm i @octokit/core - node upload_asset.mjs eighty4 l3 $env:RELEASE_ID ${{ matrix.filename }} application/x-dosexec $env:UPLOAD_HOSTNAME diff --git a/.github/workflows/verify.yml b/.github/workflows/verify.yml index a7f3b9f..35848a4 100644 --- a/.github/workflows/verify.yml +++ b/.github/workflows/verify.yml @@ -18,7 +18,9 @@ jobs: verify: runs-on: ubuntu-latest needs: - - build + - build-l3-cli-linux-and-macos + - build-l3-cli-windows + - build-l3-fn-build-wasm - examples - fmt - lint @@ -27,17 +29,82 @@ jobs: steps: - run: echo "We're gonna face it" - build: - runs-on: ${{ matrix.runs-on }} + build-l3-cli-linux-and-macos: + name: "build ${{ matrix.filename}}" + runs-on: ${{ matrix.runner }} strategy: matrix: - runs-on: [macos-latest, ubuntu-latest, windows-latest] + include: + - filename: l3-linux-x86_64 + runner: ubuntu-24.04 + target: x86_64-unknown-linux-gnu + - filename: l3-linux-aarch64 + runner: ubuntu-24.04 + target: aarch64-unknown-linux-gnu + apt_package_linker: gcc-aarch64-linux-gnu + - filename: l3-macos-x86_64 + runner: macos-latest + target: x86_64-apple-darwin + - filename: l3-macos-aarch64 + runner: macos-latest + target: aarch64-apple-darwin steps: - uses: actions/checkout@v4 + with: + ref: ${{ inputs.tag_name }} + - if: ${{ matrix.apt_package_linker }} + run: | + sudo apt update && sudo apt install ${{ matrix.apt_package_linker }} + mkdir -p $HOME/.cargo + mv ./.github/workflows/linkers.toml $HOME/.cargo/config.toml - run: rustup install stable - uses: swatinem/rust-cache@v2 + - run: rustup target add ${{ matrix.target }} + - name: build + run: cargo build --release --target ${{ matrix.target }} + - uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.filename }} + path: target/${{ matrix.target }}/release/l3 + + build-l3-cli-windows: + name: "build ${{ matrix.filename}}" + runs-on: windows-2022 + strategy: + matrix: + include: + - filename: l3-windows-aarch64.exe + target: aarch64-pc-windows-msvc + - filename: l3-windows-x86_64.exe + target: x86_64-pc-windows-msvc + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.tag_name }} + - run: rustup install stable + - uses: swatinem/rust-cache@v2 + - run: rustup target add ${{ matrix.target }} + - name: build + shell: powershell + run: cargo build -p l3_cli --release --target ${{ matrix.target }} + - uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.filename }} + path: target/${{ matrix.target }}/release/l3 + + build-l3-fn-build-wasm: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - run: rustup install stable + - uses: swatinem/rust-cache@v2 + - run: rustup target add wasm32-wasip2 - name: cargo build - run: cargo build --all-features --release --workspace + run: cargo build --all-features --release -p l3_fn_build_wasm --target wasm32-wasip2 + - uses: actions/upload-artifact@v4 + with: + name: l3-fn-build.wasm + path: target/wasm32-wasip2/release/l3_fn_build.wasm examples: runs-on: ${{ matrix.runs-on }} diff --git a/.github/workflows/windows_upload_asset.mjs b/.github/workflows/windows_upload_asset.mjs deleted file mode 100644 index b242094..0000000 --- a/.github/workflows/windows_upload_asset.mjs +++ /dev/null @@ -1,32 +0,0 @@ -const owner = process.argv[2] -const repo = process.argv[3] -const releaseId = process.argv[4] -const filename = process.argv[5] -const contentType = process.argv[6] -const baseUrl = 'https://' + process.argv[7] - -import {Octokit} from '@octokit/core' - -const auth = process.env.GH_TOKEN - -const url = `POST /repos/${owner}/${repo}/releases/${releaseId}/assets?name=${filename}` - -const options = { - baseUrl, - owner, - repo, - release_id: releaseId, - data: '@' + filename, - headers: { - 'Accept': 'application/vnd.github+json', - 'Content-Type': contentType, - 'X-GitHub-Api-Version': '2022-11-28', - }, -} - -new Octokit({auth}).request(url, options) - .then(() => console.log('finished')) - .catch((e) => { - console.error(e) - process.exit(1) - }) diff --git a/Cargo.lock b/Cargo.lock index 3be19d2..f10ab0f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -27,17 +27,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" -[[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 = "ahash" version = "0.8.11" @@ -63,9 +52,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "android-tzdata" @@ -118,7 +107,7 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.59.0", + "windows-sys", ] [[package]] @@ -128,14 +117,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.59.0", + "windows-sys", ] [[package]] name = "anyhow" -version = "1.0.92" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f37166d7d48a0284b99dd824694c26119c700b53bf0d1540cdb147dbdaaf13" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" [[package]] name = "arbitrary" @@ -268,7 +257,7 @@ dependencies = [ "once_cell", "serde", "serde_json", - "thiserror 1.0.67", + "thiserror 1.0.69", ] [[package]] @@ -286,41 +275,12 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" -[[package]] -name = "bytes" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" - -[[package]] -name = "bzip2" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" -dependencies = [ - "bzip2-sys", - "libc", -] - -[[package]] -name = "bzip2-sys" -version = "0.1.11+1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" -dependencies = [ - "cc", - "libc", - "pkg-config", -] - [[package]] name = "cc" -version = "1.1.31" +version = "1.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" +checksum = "a012a0df96dd6d06ba9a1b29d6402d1a5d77c6befd2566afdc26e10603dc93d7" dependencies = [ - "jobserver", - "libc", "shlex", ] @@ -332,9 +292,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.38" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" dependencies = [ "android-tzdata", "iana-time-zone", @@ -342,16 +302,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", -] - [[package]] name = "clap" version = "4.5.26" @@ -398,12 +348,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" -[[package]] -name = "constant_time_eq" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" - [[package]] name = "convert_case" version = "0.4.0" @@ -418,28 +362,13 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] -[[package]] -name = "crc" -version = "3.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" -dependencies = [ - "crc-catalog", -] - -[[package]] -name = "crc-catalog" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" - [[package]] name = "crc32fast" version = "1.4.2" @@ -451,9 +380,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" @@ -500,21 +429,6 @@ dependencies = [ "uuid", ] -[[package]] -name = "deflate64" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da692b8d1080ea3045efaab14434d40468c3d8657e42abddfffca87b428f4c1b" - -[[package]] -name = "deranged" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" -dependencies = [ - "powerfmt", -] - [[package]] name = "derive_arbitrary" version = "1.4.1" @@ -547,7 +461,6 @@ checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", - "subtle", ] [[package]] @@ -581,9 +494,9 @@ checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" [[package]] name = "flate2" -version = "1.0.34" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "miniz_oxide", @@ -672,9 +585,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heck" @@ -688,15 +601,6 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest", -] - [[package]] name = "hstr" version = "0.2.15" @@ -852,6 +756,12 @@ dependencies = [ "syn", ] +[[package]] +name = "id-arena" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" + [[package]] name = "idna" version = "1.0.3" @@ -881,31 +791,22 @@ checksum = "cb56e1aa765b4b4f3aadfab769793b7087bb03a4ea4920644a6d238e2df5b9ed" [[package]] name = "indexmap" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", - "hashbrown 0.15.0", + "hashbrown 0.15.2", "serde", ] -[[package]] -name = "inout" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" -dependencies = [ - "generic-array", -] - [[package]] name = "is-macro" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2069faacbe981460232f880d26bf3c7634e322d49053aa48c27e3ae642f728f1" +checksum = "1d57a3e447e24c22647738e4607f1df1e0ec6f72e16182c4cd199f647cdfb0e4" dependencies = [ - "Inflector", + "heck", "proc-macro2", "quote", "syn", @@ -937,25 +838,17 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" - -[[package]] -name = "jobserver" -version = "0.1.32" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" -dependencies = [ - "libc", -] +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "js-sys" -version = "0.3.72" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" dependencies = [ + "once_cell", "wasm-bindgen", ] @@ -1006,6 +899,15 @@ dependencies = [ "zip", ] +[[package]] +name = "l3_fn_build_wasm" +version = "0.0.1" +dependencies = [ + "l3_fn_build", + "tokio", + "wit-bindgen", +] + [[package]] name = "lalrpop-util" version = "0.20.2" @@ -1018,6 +920,12 @@ version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + [[package]] name = "libc" version = "0.2.169" @@ -1067,16 +975,6 @@ dependencies = [ "hashbrown 0.13.2", ] -[[package]] -name = "lzma-rs" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "297e814c836ae64db86b36cf2a557ba54368d03f6afcd7d947c266692f71115e" -dependencies = [ - "byteorder", - "crc", -] - [[package]] name = "malachite" version = "0.4.16" @@ -1143,23 +1041,23 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "miette" -version = "7.2.0" +version = "7.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4edc8853320c2a0dab800fbda86253c8938f6ea88510dc92c5f1ed20e794afc1" +checksum = "317f146e2eb7021892722af37cf1b971f0a70c8406f487e24952667616192c64" dependencies = [ "cfg-if", "miette-derive", "owo-colors", "textwrap", - "thiserror 1.0.67", + "thiserror 1.0.69", "unicode-width", ] [[package]] name = "miette-derive" -version = "7.2.0" +version = "7.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" +checksum = "23c9b935fbe1d6cbd1dac857b54a688145e2d93f48db36010514d0f612d0ad67" dependencies = [ "proc-macro2", "quote", @@ -1174,25 +1072,13 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" dependencies = [ "adler2", ] -[[package]] -name = "mio" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" -dependencies = [ - "hermit-abi", - "libc", - "wasi", - "windows-sys 0.52.0", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -1229,12 +1115,6 @@ dependencies = [ "serde", ] -[[package]] -name = "num-conv" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" - [[package]] name = "num-integer" version = "0.1.46" @@ -1265,9 +1145,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.5" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] @@ -1333,19 +1213,9 @@ checksum = "17359afc20d7ab31fdb42bb844c8b3bb1dabd7dcf7e68428492da7f16966fcef" [[package]] name = "pathdiff" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d61c5ce1153ab5b689d0c074c4e7fc613e942dfb7dd9eea5ab202d2ad91fe361" - -[[package]] -name = "pbkdf2" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" -dependencies = [ - "digest", - "hmac", -] +checksum = "df94ce210e5bc13cb6651479fa48d14f601d9858cfe0467f43ae157023b938d3" [[package]] name = "percent-encoding" @@ -1365,9 +1235,9 @@ dependencies = [ [[package]] name = "phf" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" dependencies = [ "phf_macros", "phf_shared", @@ -1375,9 +1245,9 @@ dependencies = [ [[package]] name = "phf_codegen" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" +checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" dependencies = [ "phf_generator", "phf_shared", @@ -1385,9 +1255,9 @@ dependencies = [ [[package]] name = "phf_generator" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ "phf_shared", "rand", @@ -1395,9 +1265,9 @@ dependencies = [ [[package]] name = "phf_macros" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" +checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" dependencies = [ "phf_generator", "phf_shared", @@ -1408,30 +1278,18 @@ dependencies = [ [[package]] name = "phf_shared" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" dependencies = [ - "siphasher", + "siphasher 1.0.1", ] [[package]] name = "pin-project-lite" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" - -[[package]] -name = "pkg-config" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" - -[[package]] -name = "powerfmt" -version = "0.2.0" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "ppv-lite86" @@ -1454,26 +1312,36 @@ dependencies = [ "dashmap", "from_variant", "once_cell", - "semver 1.0.23", + "semver 1.0.24", "serde", "st-map", "tracing", ] +[[package]] +name = "prettyplease" +version = "0.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "483f8c21f64f3ea09fe0f30f5d48c3e8eefe5dac9129f0075f76593b4c1da705" +dependencies = [ + "proc-macro2", + "syn", +] + [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] [[package]] name = "psm" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa37f80ca58604976033fae9515a8a2989fc13797d953f7c04fb8fa36a11f205" +checksum = "200b9ff220857e53e184257720a14553b2f4aa02577d2ed9842d45d4b9654810" dependencies = [ "cc", ] @@ -1500,9 +1368,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -1551,9 +1419,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ "bitflags", ] @@ -1572,9 +1440,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -1614,7 +1482,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.23", + "semver 1.0.24", ] [[package]] @@ -1709,9 +1577,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" dependencies = [ "serde", ] @@ -1783,15 +1651,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" -[[package]] -name = "signal-hook-registry" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" -dependencies = [ - "libc", -] - [[package]] name = "simd-abstraction" version = "0.7.1" @@ -1813,6 +1672,12 @@ version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + [[package]] name = "smallvec" version = "1.13.2" @@ -1830,27 +1695,11 @@ dependencies = [ "version_check", ] -[[package]] -name = "smawk" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" - -[[package]] -name = "socket2" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - [[package]] name = "sourcemap" -version = "9.0.0" +version = "9.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dab08a862c70980b8e23698b507e272317ae52a608a164a844111f5372374f1f" +checksum = "27c4ea7042fd1a155ad95335b5d505ab00d5124ea0332a06c8390d200bb1a76a" dependencies = [ "base64-simd", "bitvec", @@ -1865,6 +1714,15 @@ dependencies = [ "url", ] +[[package]] +name = "spdx" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58b69356da67e2fc1f542c71ea7e654a361a79c938e4424392ecf4fa065d2193" +dependencies = [ + "smallvec", +] + [[package]] name = "st-map" version = "0.2.4" @@ -1891,7 +1749,7 @@ dependencies = [ "cfg-if", "libc", "psm", - "windows-sys 0.59.0", + "windows-sys", ] [[package]] @@ -1929,12 +1787,6 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" -[[package]] -name = "subtle" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" - [[package]] name = "swc" version = "10.0.0" @@ -2042,7 +1894,7 @@ dependencies = [ "parking_lot", "rustc-hash", "serde", - "siphasher", + "siphasher 0.3.11", "sourcemap", "swc_allocator", "swc_atoms", @@ -2478,7 +2330,7 @@ dependencies = [ "once_cell", "preset_env_base", "rustc-hash", - "semver 1.0.23", + "semver 1.0.24", "serde", "serde_json", "st-map", @@ -2875,7 +2727,7 @@ dependencies = [ "swc_ecma_ast", "swc_ecma_utils", "swc_ecma_visit", - "thiserror 1.0.67", + "thiserror 1.0.69", ] [[package]] @@ -2890,9 +2742,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.87" +version = "2.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +checksum = "46f71c0377baf4ef1cc3e3402ded576dccc315800fbc62dfc7fe04b009773b4a" dependencies = [ "proc-macro2", "quote", @@ -2928,18 +2780,17 @@ version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" dependencies = [ - "smawk", "unicode-linebreak", "unicode-width", ] [[package]] name = "thiserror" -version = "1.0.67" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3c6efbfc763e64eb85c11c25320f0737cb7364c4b6336db90aa9ebe27a0bbd" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl 1.0.67", + "thiserror-impl 1.0.69", ] [[package]] @@ -2953,9 +2804,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "1.0.67" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b607164372e89797d78b8e23a6d67d5d1038c1c65efd52e1389ef8b77caba2a6" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", @@ -2973,25 +2824,6 @@ dependencies = [ "syn", ] -[[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" -dependencies = [ - "deranged", - "num-conv", - "powerfmt", - "serde", - "time-core", -] - -[[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" - [[package]] name = "tiny-keccak" version = "2.0.2" @@ -3018,15 +2850,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" dependencies = [ "backtrace", - "bytes", - "libc", - "mio", - "parking_lot", "pin-project-lite", - "signal-hook-registry", - "socket2", "tokio-macros", - "windows-sys 0.52.0", ] [[package]] @@ -3042,9 +2867,9 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "pin-project-lite", "tracing-attributes", @@ -3053,9 +2878,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", @@ -3064,9 +2889,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", ] @@ -3159,9 +2984,9 @@ checksum = "2f322b60f6b9736017344fa0635d64be2f458fbc04eef65f6be22976dd1ffd5b" [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-linebreak" @@ -3175,6 +3000,12 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + [[package]] name = "unicode_names2" version = "1.3.0" @@ -3246,9 +3077,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" dependencies = [ "cfg-if", "once_cell", @@ -3257,13 +3088,12 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", "syn", @@ -3272,9 +3102,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3282,9 +3112,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", @@ -3295,9 +3125,48 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.95" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" + +[[package]] +name = "wasm-encoder" +version = "0.220.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebf48234b389415b226a4daef6562933d38c7b28a8b8f64c5c4130dad1561ab7" +dependencies = [ + "leb128", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.220.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f3e5f5920c5abfc45573c89b07b38efdaae1515ef86f83dad12d60e50ecd62b" +dependencies = [ + "anyhow", + "indexmap", + "serde", + "serde_derive", + "serde_json", + "spdx", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasmparser" +version = "0.220.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e246c2772ce3ebc83f89a2d4487ac5794cad6c309b2071818a88c7db7c36d87b" +dependencies = [ + "ahash", + "bitflags", + "hashbrown 0.14.5", + "indexmap", + "semver 1.0.24", +] [[package]] name = "winapi" @@ -3330,15 +3199,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-sys" version = "0.59.0" @@ -3412,6 +3272,104 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "wit-bindgen" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a2b3e15cd6068f233926e7d8c7c588b2ec4fb7cc7bf3824115e7c7e2a8485a3" +dependencies = [ + "wit-bindgen-rt", + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen-core" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b632a5a0fa2409489bd49c9e6d99fcc61bb3d4ce9d1907d44662e75a28c71172" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rt" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7947d0131c7c9da3f01dfde0ab8bd4c4cf3c5bd49b6dba0ae640f1fa752572ea" +dependencies = [ + "bitflags", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4329de4186ee30e2ef30a0533f9b3c123c019a237a7c82d692807bf1b3ee2697" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "prettyplease", + "syn", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "177fb7ee1484d113b4792cc480b1ba57664bbc951b42a4beebe573502135b1fc" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.220.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ccedf54cc65f287da268d64d2bf4f7530d2cfb2296ffbe3ad5f65567e4cf53" +dependencies = [ + "anyhow", + "bitflags", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.220.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b7117ce3adc0b4354b46dc1cf3190b00b333e65243d244c613ffcc58bdec84d" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "semver 1.0.24", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + [[package]] name = "write16" version = "1.0.0" @@ -3499,26 +3457,6 @@ dependencies = [ "synstructure", ] -[[package]] -name = "zeroize" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" -dependencies = [ - "zeroize_derive", -] - -[[package]] -name = "zeroize_derive" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "zerovec" version = "0.10.4" @@ -3547,27 +3485,15 @@ version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae9c1ea7b3a5e1f4b922ff856a129881167511563dc219869afe3787fc0c1a45" dependencies = [ - "aes", "arbitrary", - "bzip2", - "constant_time_eq", "crc32fast", "crossbeam-utils", - "deflate64", "displaydoc", "flate2", - "hmac", "indexmap", - "lzma-rs", "memchr", - "pbkdf2", - "rand", - "sha1", "thiserror 2.0.10", - "time", - "zeroize", "zopfli", - "zstd", ] [[package]] @@ -3583,31 +3509,3 @@ dependencies = [ "once_cell", "simd-adler32", ] - -[[package]] -name = "zstd" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9" -dependencies = [ - "zstd-safe", -] - -[[package]] -name = "zstd-safe" -version = "7.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059" -dependencies = [ - "zstd-sys", -] - -[[package]] -name = "zstd-sys" -version = "2.0.13+zstd.1.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" -dependencies = [ - "cc", - "pkg-config", -] diff --git a/Cargo.toml b/Cargo.toml index c290fe7..babe82f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,7 @@ [workspace] members = [ "fn_build", + "fn_build_wasm", "l3_base", "l3_cli", ] @@ -12,7 +13,7 @@ serde = { version = "1.0.217", features = ["derive"] } serde_json = { version = "1.0.135", features = ["preserve_order"] } thiserror = "2.0.10" temp-dir = "0.1.14" -tokio = { version = "1.43.0", features = ["full"] } +tokio = { version = "1.43.0", default-features = false } [workspace.package] authors = ["Adam McKee "] diff --git a/ci_verify.sh b/ci_verify.sh index 16622d7..cdc7c0c 100755 --- a/ci_verify.sh +++ b/ci_verify.sh @@ -6,7 +6,8 @@ set -e _git_status_output=$(git status --porcelain) echo '\n*** cargo build ***' -cargo build --workspace +cargo build --workspace --exclude l3_fn_build_wasm +cargo build -p l3_fn_build_wasm --target wasm32-wasip2 echo '\n*** cargo fmt -v ***' cargo fmt --all -v diff --git a/fn_build/Cargo.toml b/fn_build/Cargo.toml index 1a09321..ad25690 100644 --- a/fn_build/Cargo.toml +++ b/fn_build/Cargo.toml @@ -25,8 +25,9 @@ swc_ecma_ast = "5.0.1" swc_ecma_parser = { version = "6.0.2", features = ["typescript"] } swc_ecma_visit = { version = "5.0.0" } thiserror = { workspace = true } -tokio = { workspace = true } -zip = "2.2.2" +tokio = { workspace = true, features = ["macros", "rt", "sync"] } +zip = { version = "2.2.2", default-features = false, features = ["deflate"] } [dev-dependencies] temp-dir = { workspace = true } +tokio = { workspace = true, features = ["macros", "rt", "rt-multi-thread", "sync", "test-util"] } diff --git a/fn_build_wasm/Cargo.toml b/fn_build_wasm/Cargo.toml new file mode 100644 index 0000000..eb89c1c --- /dev/null +++ b/fn_build_wasm/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "l3_fn_build_wasm" +version = "0.0.1" +description = "WASI component of the l3_fn_build crate" +publish = false +authors.workspace = true +edition.workspace = true +license.workspace = true +repository.workspace = true + +[lib] +name = "l3_fn_build" +crate-type = ["cdylib"] + +[dependencies] +l3_fn_build = { path = "../fn_build" } +tokio = { workspace = true, features = ["rt"] } +wit-bindgen = "0.36.0" diff --git a/fn_build_wasm/src/lib.rs b/fn_build_wasm/src/lib.rs new file mode 100644 index 0000000..81db498 --- /dev/null +++ b/fn_build_wasm/src/lib.rs @@ -0,0 +1,133 @@ +wit_bindgen::generate!({ + world: "fn-parsing" +}); + +use std::path::PathBuf; +use std::sync::Arc; + +struct FnParsingWasm; + +impl Guest for FnParsingWasm { + fn parse_entrypoint(spec: FnParseSpec) -> Result { + Self::debug_print_spec(&spec); + let result = tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .expect("current thread runtime for l3_fn_build::parse_entrypoint") + .block_on(l3_fn_build::parse_entrypoint(Self::map_in_fn_parse_spec( + spec, + ))); + match result { + Ok(val) => Ok(Self::map_out_fn_entrypoint(val)), + Err(err) => Err(err.to_string()), + } + } + + fn parse_fn(spec: FnParseSpec) -> Result { + Self::debug_print_spec(&spec); + let result = tokio::runtime::Builder::new_current_thread() + .enable_all() + .build() + .expect("current thread runtime for l3_fn_build::parse_fn") + .block_on(l3_fn_build::parse_fn(Self::map_in_fn_parse_spec(spec))); + match result { + Ok(val) => Ok(Self::map_out_fn_parse_manifest(val)), + Err(err) => Err(err.to_string()), + } + } +} + +impl FnParsingWasm { + fn debug_print_spec(spec: &FnParseSpec) { + println!( + "l3_fn_build::FnParseSpec project_dir={} entrypoint={} runtime={}", + spec.project_dir, + spec.entrypoint, + match spec.runtime { + Runtime::Node => "node", + Runtime::Python => "python", + } + ); + } + + fn map_in_fn_parse_spec(parse_spec: FnParseSpec) -> l3_fn_build::FnParseSpec { + l3_fn_build::FnParseSpec { + entrypoint: PathBuf::from(parse_spec.entrypoint), + project_dir: Arc::new(PathBuf::from(parse_spec.project_dir)), + runtime: match parse_spec.runtime { + Runtime::Node => l3_fn_build::runtime::Runtime::Node(Arc::new( + l3_fn_build::runtime::node::NodeConfig::default(), + )), + Runtime::Python => l3_fn_build::runtime::Runtime::Python, + }, + } + } + + fn map_out_fn_parse_manifest(parse_manifest: l3_fn_build::FnParseManifest) -> FnParseManifest { + FnParseManifest { + dependencies: match parse_manifest.dependencies { + l3_fn_build::FnDependencies::Required => FnDependencies::Required, + l3_fn_build::FnDependencies::Unused => FnDependencies::Unused, + }, + entrypoint: Self::map_out_fn_entrypoint(parse_manifest.entrypoint), + sources: parse_manifest + .sources + .into_iter() + .map(Self::map_out_fn_source) + .collect(), + } + } + + fn map_out_fn_source(source: l3_fn_build::FnSource) -> FnSource { + FnSource { + imports: source + .imports + .into_iter() + .map(|import| match import { + l3_fn_build::ModuleImport::PackageDependency { package, subpath } => { + ModuleImport::PackageDependency(DependencyImport { package, subpath }) + } + l3_fn_build::ModuleImport::RelativeSource(path) => { + ModuleImport::RelativeSource(path.to_string_lossy().to_string()) + } + l3_fn_build::ModuleImport::Unknown(specifier) => { + ModuleImport::Unknown(specifier) + } + }) + .collect(), + path: source.path.to_string_lossy().to_string(), + } + } + + fn map_out_fn_entrypoint(entrypoint: l3_fn_build::FnEntrypoint) -> FnEntrypoint { + FnEntrypoint { + handlers: entrypoint + .handlers + .into_iter() + .map(Self::map_out_fn_handler) + .collect(), + path: entrypoint.path.to_string_lossy().to_string(), + } + } + + fn map_out_fn_handler(handler: l3_fn_build::FnHandler) -> FnHandler { + FnHandler { + fn_name: handler.fn_name, + routing: match handler.routing { + l3_fn_build::FnRouting::HttpRoute(http_route) => FnRouting::HttpRoute(HttpRoute { + method: match http_route.method { + l3_fn_build::HttpMethod::Get => HttpMethod::Get, + l3_fn_build::HttpMethod::Delete => HttpMethod::Delete, + l3_fn_build::HttpMethod::Patch => HttpMethod::Patch, + l3_fn_build::HttpMethod::Post => HttpMethod::Post, + l3_fn_build::HttpMethod::Put => HttpMethod::Put, + }, + path: http_route.path, + }), + l3_fn_build::FnRouting::Unsupported => FnRouting::Unsupported, + }, + } + } +} + +export!(FnParsingWasm); diff --git a/fn_build_wasm/wit/fn-building.wit b/fn_build_wasm/wit/fn-building.wit new file mode 100644 index 0000000..a8ea9e9 --- /dev/null +++ b/fn_build_wasm/wit/fn-building.wit @@ -0,0 +1,111 @@ +package l3:fn-build; + +world fn-building { + record fn-build-spec { + entrypoint: string, + handler-fn-name: string, + mode: build-mode, + output: fn-output-config, + project-dir: string, + runtime: runtime, + } + + enum build-mode { + debug, + release, + } + + record fn-output-config { + build-root: string, + create-archive: bool, + } + + // todo remove fn-parsing duplicate + enum runtime { + node, + python, + } + + record fn-build-manifest { + checksums: list, + dependencies: fn-dependencies, + entrypoint: string, + handler: fn-handler, + output: fn-build-output, + sources: list, + } + + record source-checksum { + checksum: string, + path: string, + } + + // todo remove fn-parsing duplicate + // todo explicitly announce package dependencies in manifest + // todo achieve with variant fn-dependencies::packages(list) + enum fn-dependencies { + // function build will require project's production dependencies + required, + // function build does not require dependencies + unused, + } + + // todo remove fn-parsing duplicate + record fn-handler { + fn-name: string, + routing: fn-routing, + } + + // todo remove fn-parsing duplicate + variant fn-routing { + http-route(http-route), + unsupported, + } + + // todo remove fn-parsing duplicate + record http-route { + method: http-method, + path: string, + } + + // todo remove fn-parsing duplicate + enum http-method { + get, + delete, + patch, + post, + put, + } + + record fn-build-output { + archive-file: option, + build-dir: string, + } + + // todo remove fn-parsing duplicate + // a project source file + record fn-source { + // resolved and unresolved imports from a source file + imports: list, + // relative source path from project-dir + path: string, + } + + // todo remove fn-parsing duplicate + variant module-import { + // import of a package's production dependency + package-dependency(dependency-import), + // path to a project source relative to project-dir + relative-source(string), + // an unresolved import and error condition for function builds + unknown(string), + } + + // todo remove fn-parsing duplicate + record dependency-import { + %package: string, + subpath: option, + } + + export build-fn: func(spec: fn-build-spec) -> fn-build-manifest; +} diff --git a/fn_build_wasm/wit/fn-parsing.wit b/fn_build_wasm/wit/fn-parsing.wit new file mode 100644 index 0000000..17b86b3 --- /dev/null +++ b/fn_build_wasm/wit/fn-parsing.wit @@ -0,0 +1,101 @@ +package l3:fn-build; + +// todo parse result and parse error +world fn-parsing { + record fn-parse-spec { + // relative source path from project-dir + entrypoint: string, + // absolute directory path to project root + project-dir: string, + runtime: runtime, + } + + // todo variant and binding for runtime::node::node_config::NodeConfig + enum runtime { + node, + python, + } + +// record node-config { +// // Configured dependencies from package.json, excluding devDependencies +// dependencies: list, +// // Whether package.json declares the package type as ES module +// module-type: bool, +// subpath-imports: +// } + + record fn-parse-manifest { + // package dependency requirements for + dependencies: fn-dependencies, + // the entrypoint source file containing the function's handler function + entrypoint: fn-entrypoint, + // source files included in a function manifest and build + sources: list, + } + + // todo explicitly announce package dependencies in manifest + // todo achieve with variant fn-dependencies::packages(list) + enum fn-dependencies { + // function build will require project's production dependencies + required, + // function build does not require dependencies + unused, + } + + // metadata of function entrypoint + record fn-entrypoint { + // exported handler functions + handlers: list, + // relative path to entrypoint source file from project-dir + path: string, + } + + record fn-handler { + fn-name: string, + routing: fn-routing, + } + + variant fn-routing { + http-route(http-route), + unsupported, + } + + record http-route { + method: http-method, + path: string, + } + + enum http-method { + get, + delete, + patch, + post, + put, + } + + // a project source file + record fn-source { + // resolved and unresolved imports from a source file + imports: list, + // relative source path from project-dir + path: string, + } + + variant module-import { + // import of a package's production dependency + package-dependency(dependency-import), + // path to a project source relative to project-dir + relative-source(string), + // an unresolved import and error condition for function builds + unknown(string), + } + + record dependency-import { + %package: string, + subpath: option, + } + + export parse-entrypoint: func(spec: fn-parse-spec) -> result; + + export parse-fn: func(spec: fn-parse-spec) -> result; +} diff --git a/l3_cli/Cargo.toml b/l3_cli/Cargo.toml index 2d46542..8d14853 100644 --- a/l3_cli/Cargo.toml +++ b/l3_cli/Cargo.toml @@ -17,6 +17,6 @@ l3_api_base = { path = "../l3_base", version = "0.0.4" } l3_fn_build = { path = "../fn_build", version = "0.0.4" } serde_json = { workspace = true } thiserror = { workspace = true } -tokio = { workspace = true } +tokio = { workspace = true, features = ["macros", "rt", "rt-multi-thread", "sync", "test-util"] } [dev-dependencies]