Skip to content

fix: error if explicit canister path is bad - #276

Merged
raymondk merged 4 commits into
mainfrom
SDK-2508-canister-manifest-location-doesnt-throw-an-error-if-canister-yaml-is-not-found
Jan 16, 2026
Merged

fix: error if explicit canister path is bad#276
raymondk merged 4 commits into
mainfrom
SDK-2508-canister-manifest-location-doesnt-throw-an-error-if-canister-yaml-is-not-found

Conversation

@viviveevee

@viviveevee viviveevee commented Jan 16, 2026

Copy link
Copy Markdown
Contributor

When explicit (non-glob) canister paths in icp.yaml didn't exist or lacked a canister.yaml file, they were silently ignored instead of throwing an error.

Now glob patterns get treated differently from explicit paths and if an explicit path does not exist, icp project show throws an error

@viviveevee
viviveevee marked this pull request as ready for review January 16, 2026 10:18
@viviveevee
viviveevee requested a review from a team as a code owner January 16, 2026 10:18
Comment thread crates/icp/src/project.rs Outdated
// For explicit paths, validate that they exist and contain canister.yaml
let mut validated_paths = vec![];
for p in paths {
if !p.is_dir() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Can we just use p.is_file() ?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Otherwise the errors should be fixed, p.is_dir to say the directory doesn't exist and the path joined with canister.yaml to say the canister definition doesn't exist.

@raymondk
raymondk merged commit 5391e11 into main Jan 16, 2026
47 checks passed
@raymondk
raymondk deleted the SDK-2508-canister-manifest-location-doesnt-throw-an-error-if-canister-yaml-is-not-found branch January 16, 2026 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants