0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-02-15 18:16:12 -05:00

chore: fix deno_resolver non-sync build

This commit is contained in:
David Sherret 2025-01-25 16:34:14 -05:00
parent 769f748dd9
commit 75ee39b1d4
3 changed files with 70 additions and 5 deletions

View file

@ -1097,6 +1097,25 @@ const ci = {
},
]),
},
wasm: {
name: "check wasm",
needs: ["pre_build"],
if: "${{ needs.pre_build.outputs.skip_build != 'true' }}",
"runs-on": ubuntuX86Runner,
"timeout-minutes": 30,
steps: skipJobsIfPrAndMarkedSkip([
...cloneRepoStep,
installRustStep,
{
name: "Install wasm target",
run: "rustup install wasm32-unknown-unknown",
},
{
name: "Cargo build",
run: "cargo build --target wasm32-unknown-unknown -p deno_resolver",
},
]),
},
"publish-canary": {
name: "publish canary",
"runs-on": ubuntuX86Runner,

View file

@ -688,6 +688,33 @@ jobs:
!./target/*/*.zip
!./target/*/*.tar.gz
key: '37-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}'
wasm:
name: check wasm
needs:
- pre_build
if: '${{ needs.pre_build.outputs.skip_build != ''true'' }}'
runs-on: ubuntu-24.04
timeout-minutes: 30
steps:
- name: Configure git
run: |-
git config --global core.symlinks true
git config --global fetch.parallel 32
if: '!(matrix.skip)'
- name: Clone repository
uses: actions/checkout@v4
with:
fetch-depth: 5
submodules: false
if: '!(matrix.skip)'
- uses: dsherret/rust-toolchain-file@v1
if: '!(matrix.skip)'
- name: Install wasm target
run: rustup install wasm32-unknown-unknown
if: '!(matrix.skip)'
- name: Cargo build
run: cargo build --target wasm32-unknown-unknown -p deno_resolver
if: '!(matrix.skip)'
publish-canary:
name: publish canary
runs-on: ubuntu-24.04

View file

@ -14,12 +14,31 @@ use url::Url;
use crate::errors::ClosestPkgJsonError;
use crate::errors::PackageJsonLoadError;
#[allow(clippy::disallowed_types)]
pub type PackageJsonCacheRc = crate::sync::MaybeArc<
dyn deno_package_json::PackageJsonCache
pub trait NodePackageJsonCache:
deno_package_json::PackageJsonCache
+ crate::sync::MaybeSend
+ crate::sync::MaybeSync
{
fn as_deno_package_json_cache(
&self,
) -> &dyn deno_package_json::PackageJsonCache;
}
impl<T> NodePackageJsonCache for T
where
T: deno_package_json::PackageJsonCache
+ crate::sync::MaybeSend
+ crate::sync::MaybeSync,
>;
{
fn as_deno_package_json_cache(
&self,
) -> &dyn deno_package_json::PackageJsonCache {
self
}
}
#[allow(clippy::disallowed_types)]
pub type PackageJsonCacheRc = crate::sync::MaybeArc<dyn NodePackageJsonCache>;
thread_local! {
static CACHE: RefCell<HashMap<PathBuf, PackageJsonRc>> = RefCell::new(HashMap::new());
@ -93,7 +112,7 @@ impl<TSys: FsRead> PackageJsonResolver<TSys> {
self
.loader_cache
.as_deref()
.map(|cache| cache as &dyn deno_package_json::PackageJsonCache),
.map(|cache| cache.as_deno_package_json_cache()),
path,
);
match result {