Skip to content
Open
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
7 changes: 7 additions & 0 deletions crates/wasm-pkg-client/src/oci/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@ impl OciBackend {
Ok(auth)
})
.await
.map_err(|e| {
if let Error::RegistryError(anyhow_err) = e {
Error::RegistryError(anyhow_err.context(reference.repository().to_owned()))
} else {
e
}
})
.cloned()
}

Expand Down
5 changes: 5 additions & 0 deletions crates/wasm-pkg-core/src/resolver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -730,6 +730,11 @@ impl DependencyResolutionMap {
package,
} => {
source_files.extend(package.source_map.source_files().map(Path::to_path_buf));
// handle cases for a workspace level `wkg.toml` where overrides may reference
// the package being built
if package.main.name == root.main.name {
continue;
}
Comment on lines +733 to +737
Copy link
Copy Markdown
Member Author

@mkatychev mkatychev Apr 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this or perhaps resolve_dependencies is the best place to handle this case but this should apply to local or registry packages regardless if the dependency name+namespace+version match that of the root:

// add deps from config first in case they're local deps and then add deps from the directory
if let Some(overrides) = config.overrides.as_ref() {
for (pkg, ovr) in overrides.iter() {
let pkg: PackageRef = pkg.parse().context("Unable to parse as a package ref")?;
let dep = match (ovr.path.as_ref(), ovr.version.as_ref()) {
(Some(path), v) => {
if v.is_some() {
tracing::warn!("Ignoring version override for local package");
}
let path = tokio::fs::canonicalize(path)
.await
.with_context(|| format!("resolving local dependency {}", path.display()))?;
Dependency::Local(path)
}
(None, Some(version)) => Dependency::Package(RegistryPackage {
name: Some(pkg.clone()),
version: version.to_owned(),
registry: None,
}),
(None, None) => {
tracing::warn!("Found override without version or path, ignoring");
continue;
}
};
tracing::debug!(dependency = %dep);
resolver
.add_dependency(&pkg, &dep)
.await
.with_context(|| format!("unable to add dependency {dep}"))?;
}
}
let (_name, packages) = get_packages(path)?;

My one concern is the comment on L180 making the get_pacakges move from L212 tricky.

merged.push_group(package).with_context(|| {
format!(
"failed to merge dependency `{name}`",
Expand Down
Loading