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

Fix component source dir vs component source mix-up #108

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading