Skip to content
This repository has been archived by the owner on Dec 11, 2024. It is now read-only.

Commit

Permalink
fix component source dir vs component source mix-up
Browse files Browse the repository at this point in the history
  • Loading branch information
noise64 committed Dec 9, 2024
1 parent 8c24833 commit ae90320
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion wasm-rpc-stubgen/src/commands/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ async fn link_rpc<CPE: ComponentPropertiesExtensions>(
let _indent = LogIndent::new();

for component_name in ctx.application.component_names() {
let source = ctx.application.component_source_dir(component_name);
let source = ctx.application.component_source(component_name);
let dependencies = ctx
.application
.component_wasm_rpc_dependencies(component_name);
Expand Down
4 changes: 4 additions & 0 deletions wasm-rpc-stubgen/src/model/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,10 @@ impl<CPE: ComponentPropertiesExtensions> Application<CPE> {
.unwrap_or_else(|| panic!("Component not found: {}", component_name))
}

pub fn component_source(&self, component_name: &ComponentName) -> &Path {
&self.component(component_name).source
}

pub fn component_source_dir(&self, component_name: &ComponentName) -> &Path {
self.component(component_name).source_dir()
}
Expand Down
4 changes: 1 addition & 3 deletions wasm-rpc-stubgen/src/wit_resolve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,9 +422,7 @@ impl ResolvedWitApplication {
{
validation.push_context(
"source",
app.component_source_dir(component_name)
.to_string_lossy()
.to_string(),
app.component_source(component_name).display().to_string(),
);
}

Expand Down

0 comments on commit ae90320

Please sign in to comment.