From 07715526049054786ecd21d6d3566d56ae1f041e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 15:32:34 +0900 Subject: [PATCH 1/9] `ResolvedVc` --- turbopack/crates/turbopack-env/src/asset.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/turbopack/crates/turbopack-env/src/asset.rs b/turbopack/crates/turbopack-env/src/asset.rs index 95af2e2d6e9e0..e7423676593ad 100644 --- a/turbopack/crates/turbopack-env/src/asset.rs +++ b/turbopack/crates/turbopack-env/src/asset.rs @@ -1,7 +1,7 @@ use std::io::Write; use anyhow::Result; -use turbo_tasks::Vc; +use turbo_tasks::{ResolvedVc, Vc}; use turbo_tasks_env::ProcessEnv; use turbo_tasks_fs::{rope::RopeBuilder, File, FileSystemPath}; use turbopack_core::{ @@ -16,10 +16,10 @@ use turbopack_ecmascript::utils::StringifyJs; #[turbo_tasks::value] pub struct ProcessEnvAsset { /// The root path which we can construct our env asset path. - root: Vc, + root: ResolvedVc, /// A HashMap filled with the env key/values. - env: Vc>, + env: ResolvedVc>, } #[turbo_tasks::value_impl] From 4adcfcfd5a032bc8354e2c78873bd9291cc4f638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 15:32:42 +0900 Subject: [PATCH 2/9] `ResolvedVc` --- turbopack/crates/turbopack-env/src/embeddable.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/turbopack/crates/turbopack-env/src/embeddable.rs b/turbopack/crates/turbopack-env/src/embeddable.rs index b9d8494765c22..5ecd5d5082a4f 100644 --- a/turbopack/crates/turbopack-env/src/embeddable.rs +++ b/turbopack/crates/turbopack-env/src/embeddable.rs @@ -1,6 +1,6 @@ use anyhow::Result; use turbo_rcstr::RcStr; -use turbo_tasks::Vc; +use turbo_tasks::{ResolvedVc, Vc}; use turbo_tasks_env::{EnvMap, ProcessEnv}; use turbopack_ecmascript::utils::StringifyJs; @@ -8,7 +8,7 @@ use turbopack_ecmascript::utils::StringifyJs; /// output. #[turbo_tasks::value] pub struct EmbeddableProcessEnv { - prior: Vc>, + prior: ResolvedVc>, } #[turbo_tasks::value_impl] From ab099d03d9884fbdaf060dd6ab6b6c4592ba35bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 15:32:50 +0900 Subject: [PATCH 3/9] `ResolvedVc` --- turbopack/crates/turbopack-env/src/issue.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/turbopack/crates/turbopack-env/src/issue.rs b/turbopack/crates/turbopack-env/src/issue.rs index 076e17ace38a4..c4d0c78097666 100644 --- a/turbopack/crates/turbopack-env/src/issue.rs +++ b/turbopack/crates/turbopack-env/src/issue.rs @@ -1,12 +1,12 @@ -use turbo_tasks::Vc; +use turbo_tasks::{ResolvedVc, Vc}; use turbo_tasks_fs::FileSystemPath; use turbopack_core::issue::{Issue, IssueStage, OptionStyledString, StyledString}; /// An issue that occurred while resolving the parsing or evaluating the .env. #[turbo_tasks::value(shared)] pub struct ProcessEnvIssue { - pub path: Vc, - pub description: Vc, + pub path: ResolvedVc, + pub description: ResolvedVc, } #[turbo_tasks::value_impl] From dcd4fa160ed590335dfee73a0217ed25bf8dec8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 15:32:55 +0900 Subject: [PATCH 4/9] `ResolvedVc` --- turbopack/crates/turbopack-env/src/try_env.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/turbopack/crates/turbopack-env/src/try_env.rs b/turbopack/crates/turbopack-env/src/try_env.rs index 65d862d0c6dd5..2243ebdd4a61f 100644 --- a/turbopack/crates/turbopack-env/src/try_env.rs +++ b/turbopack/crates/turbopack-env/src/try_env.rs @@ -1,5 +1,5 @@ use anyhow::Result; -use turbo_tasks::Vc; +use turbo_tasks::{ResolvedVc, Vc}; use turbo_tasks_env::{DotenvProcessEnv, EnvMap, ProcessEnv}; use turbo_tasks_fs::FileSystemPath; use turbopack_core::issue::{IssueExt, StyledString}; @@ -8,9 +8,9 @@ use crate::ProcessEnvIssue; #[turbo_tasks::value] pub struct TryDotenvProcessEnv { - dotenv: Vc, - prior: Vc>, - path: Vc, + dotenv: ResolvedVc, + prior: ResolvedVc>, + path: ResolvedVc, } #[turbo_tasks::value_impl] From 1790dd633ea18b153ebc33640cfdf2fe7378095e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 15:33:07 +0900 Subject: [PATCH 5/9] Fix more --- turbopack/crates/turbopack-env/src/issue.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/turbopack/crates/turbopack-env/src/issue.rs b/turbopack/crates/turbopack-env/src/issue.rs index c4d0c78097666..b0f0c8d4ec669 100644 --- a/turbopack/crates/turbopack-env/src/issue.rs +++ b/turbopack/crates/turbopack-env/src/issue.rs @@ -23,11 +23,11 @@ impl Issue for ProcessEnvIssue { #[turbo_tasks::function] fn file_path(&self) -> Vc { - self.path + *self.path } #[turbo_tasks::function] fn description(&self) -> Vc { - Vc::cell(Some(self.description)) + Vc::cell(Some(*self.description)) } } From c0d9b7b2f01025b5e4e81c0760bc09ab637eca0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 15:33:29 +0900 Subject: [PATCH 6/9] Fix more --- turbopack/crates/turbopack-env/src/try_env.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/turbopack/crates/turbopack-env/src/try_env.rs b/turbopack/crates/turbopack-env/src/try_env.rs index 2243ebdd4a61f..61ef3f9d35b7a 100644 --- a/turbopack/crates/turbopack-env/src/try_env.rs +++ b/turbopack/crates/turbopack-env/src/try_env.rs @@ -16,14 +16,19 @@ pub struct TryDotenvProcessEnv { #[turbo_tasks::value_impl] impl TryDotenvProcessEnv { #[turbo_tasks::function] - pub fn new(prior: Vc>, path: Vc) -> Vc { - let dotenv = DotenvProcessEnv::new(Some(prior), path); - TryDotenvProcessEnv { + pub async fn new( + prior: ResolvedVc>, + path: ResolvedVc, + ) -> Result> { + let dotenv = DotenvProcessEnv::new(Some(prior), path) + .to_resolved() + .await?; + Ok(TryDotenvProcessEnv { dotenv, prior, path, } - .cell() + .cell()) } } From 9ae6cf587cff9603471a61bd9a92b4670db7a216 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 15:33:58 +0900 Subject: [PATCH 7/9] Fix more --- turbopack/crates/turbopack-env/src/asset.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/turbopack/crates/turbopack-env/src/asset.rs b/turbopack/crates/turbopack-env/src/asset.rs index e7423676593ad..e14bf36e27f1b 100644 --- a/turbopack/crates/turbopack-env/src/asset.rs +++ b/turbopack/crates/turbopack-env/src/asset.rs @@ -25,8 +25,11 @@ pub struct ProcessEnvAsset { #[turbo_tasks::value_impl] impl ProcessEnvAsset { #[turbo_tasks::function] - pub fn new(root: Vc, env: Vc>) -> Vc { - ProcessEnvAsset { root, env }.cell() + pub async fn new( + root: ResolvedVc, + env: ResolvedVc>, + ) -> Result> { + Ok(ProcessEnvAsset { root, env }.cell()) } } From 4d779104fd0e061657407e22898df4c4fbc8c237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 15:34:05 +0900 Subject: [PATCH 8/9] Fix more --- turbopack/crates/turbopack-env/src/try_env.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/turbopack/crates/turbopack-env/src/try_env.rs b/turbopack/crates/turbopack-env/src/try_env.rs index 61ef3f9d35b7a..7561d528ca813 100644 --- a/turbopack/crates/turbopack-env/src/try_env.rs +++ b/turbopack/crates/turbopack-env/src/try_env.rs @@ -20,7 +20,7 @@ impl TryDotenvProcessEnv { prior: ResolvedVc>, path: ResolvedVc, ) -> Result> { - let dotenv = DotenvProcessEnv::new(Some(prior), path) + let dotenv = DotenvProcessEnv::new(Some(*prior), *path) .to_resolved() .await?; Ok(TryDotenvProcessEnv { @@ -55,7 +55,8 @@ impl ProcessEnv for TryDotenvProcessEnv { // read_all_with_prior will wrap a current error with a context containing the // failing file, which we don't really care about (we report the filepath as the // Issue context, not the description). So extract the real error. - description: StyledString::Text(e.root_cause().to_string().into()).cell(), + description: StyledString::Text(e.root_cause().to_string().into()) + .resolved_cell(), } .cell() .emit(); From b0aa0135e10855a468d7ff61fd69e1150f6acdb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EB=8F=99=EC=9C=A4=20=28Donny=29?= Date: Tue, 26 Nov 2024 15:34:13 +0900 Subject: [PATCH 9/9] Fix more --- turbopack/crates/turbopack-env/src/embeddable.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/turbopack/crates/turbopack-env/src/embeddable.rs b/turbopack/crates/turbopack-env/src/embeddable.rs index 5ecd5d5082a4f..a7d7976af020e 100644 --- a/turbopack/crates/turbopack-env/src/embeddable.rs +++ b/turbopack/crates/turbopack-env/src/embeddable.rs @@ -14,8 +14,8 @@ pub struct EmbeddableProcessEnv { #[turbo_tasks::value_impl] impl EmbeddableProcessEnv { #[turbo_tasks::function] - pub fn new(prior: Vc>) -> Vc { - EmbeddableProcessEnv { prior }.cell() + pub fn new(prior: ResolvedVc>) -> Result> { + Ok(EmbeddableProcessEnv { prior }.cell()) } }