mirror of
https://github.com/denoland/deno.git
synced 2025-02-12 16:59:32 -05:00
chore: fix deno_resolver non-sync build (#27824)
This commit is contained in:
parent
6fe2341897
commit
0007b73552
6 changed files with 76 additions and 10 deletions
20
.github/workflows/ci.generate.ts
vendored
20
.github/workflows/ci.generate.ts
vendored
|
@ -1097,6 +1097,26 @@ const ci = {
|
||||||
},
|
},
|
||||||
]),
|
]),
|
||||||
},
|
},
|
||||||
|
wasm: {
|
||||||
|
name: "build wasm32",
|
||||||
|
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 target add wasm32-unknown-unknown",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Cargo build",
|
||||||
|
// we want this crate to be wasm compatible
|
||||||
|
run: "cargo build --target wasm32-unknown-unknown -p deno_resolver",
|
||||||
|
},
|
||||||
|
]),
|
||||||
|
},
|
||||||
"publish-canary": {
|
"publish-canary": {
|
||||||
name: "publish canary",
|
name: "publish canary",
|
||||||
"runs-on": ubuntuX86Runner,
|
"runs-on": ubuntuX86Runner,
|
||||||
|
|
27
.github/workflows/ci.yml
vendored
27
.github/workflows/ci.yml
vendored
|
@ -688,6 +688,33 @@ jobs:
|
||||||
!./target/*/*.zip
|
!./target/*/*.zip
|
||||||
!./target/*/*.tar.gz
|
!./target/*/*.tar.gz
|
||||||
key: '37-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}'
|
key: '37-cargo-target-${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.profile }}-${{ matrix.job }}-${{ github.sha }}'
|
||||||
|
wasm:
|
||||||
|
name: build wasm32
|
||||||
|
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 target add wasm32-unknown-unknown
|
||||||
|
if: '!(matrix.skip)'
|
||||||
|
- name: Cargo build
|
||||||
|
run: cargo build --target wasm32-unknown-unknown -p deno_resolver
|
||||||
|
if: '!(matrix.skip)'
|
||||||
publish-canary:
|
publish-canary:
|
||||||
name: publish canary
|
name: publish canary
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
|
|
5
Cargo.lock
generated
5
Cargo.lock
generated
|
@ -2215,9 +2215,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "deno_package_json"
|
name = "deno_package_json"
|
||||||
version = "0.4.1"
|
version = "0.4.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a850e68d99edecd4ff3426dd14a3d44a33a6b2175f54d85db7b42e4a3844ed0b"
|
checksum = "d07d26dbfcc01e636aef86f9baff7faf5338398e74d283d8fe01e39068f48049"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"boxed_error",
|
"boxed_error",
|
||||||
"deno_error",
|
"deno_error",
|
||||||
|
@ -5272,7 +5272,6 @@ dependencies = [
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"sys_traits",
|
"sys_traits",
|
||||||
"thiserror 2.0.3",
|
"thiserror 2.0.3",
|
||||||
"tokio",
|
|
||||||
"url",
|
"url",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -128,7 +128,7 @@ data-encoding = "2.3.3"
|
||||||
data-url = "=0.3.1"
|
data-url = "=0.3.1"
|
||||||
deno_cache_dir = "=0.17.0"
|
deno_cache_dir = "=0.17.0"
|
||||||
deno_error = "=0.5.5"
|
deno_error = "=0.5.5"
|
||||||
deno_package_json = { version = "=0.4.1", default-features = false }
|
deno_package_json = { version = "=0.4.2", default-features = false }
|
||||||
deno_unsync = "0.4.2"
|
deno_unsync = "0.4.2"
|
||||||
dlopen2 = "0.6.1"
|
dlopen2 = "0.6.1"
|
||||||
ecb = "=0.1.2"
|
ecb = "=0.1.2"
|
||||||
|
|
|
@ -32,5 +32,4 @@ serde.workspace = true
|
||||||
serde_json.workspace = true
|
serde_json.workspace = true
|
||||||
sys_traits.workspace = true
|
sys_traits.workspace = true
|
||||||
thiserror.workspace = true
|
thiserror.workspace = true
|
||||||
tokio.workspace = true
|
|
||||||
url.workspace = true
|
url.workspace = true
|
||||||
|
|
|
@ -14,12 +14,33 @@ use url::Url;
|
||||||
use crate::errors::ClosestPkgJsonError;
|
use crate::errors::ClosestPkgJsonError;
|
||||||
use crate::errors::PackageJsonLoadError;
|
use crate::errors::PackageJsonLoadError;
|
||||||
|
|
||||||
#[allow(clippy::disallowed_types)]
|
pub trait NodePackageJsonCache:
|
||||||
pub type PackageJsonCacheRc = crate::sync::MaybeArc<
|
deno_package_json::PackageJsonCache
|
||||||
dyn deno_package_json::PackageJsonCache
|
+ std::fmt::Debug
|
||||||
|
+ 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
|
||||||
|
+ std::fmt::Debug
|
||||||
+ crate::sync::MaybeSend
|
+ crate::sync::MaybeSend
|
||||||
+ crate::sync::MaybeSync,
|
+ 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! {
|
thread_local! {
|
||||||
static CACHE: RefCell<HashMap<PathBuf, PackageJsonRc>> = RefCell::new(HashMap::new());
|
static CACHE: RefCell<HashMap<PathBuf, PackageJsonRc>> = RefCell::new(HashMap::new());
|
||||||
|
@ -93,7 +114,7 @@ impl<TSys: FsRead> PackageJsonResolver<TSys> {
|
||||||
self
|
self
|
||||||
.loader_cache
|
.loader_cache
|
||||||
.as_deref()
|
.as_deref()
|
||||||
.map(|cache| cache as &dyn deno_package_json::PackageJsonCache),
|
.map(|cache| cache.as_deno_package_json_cache()),
|
||||||
path,
|
path,
|
||||||
);
|
);
|
||||||
match result {
|
match result {
|
||||||
|
|
Loading…
Add table
Reference in a new issue