You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Scaffolding a zome fails on Windows due to issues with path canonicalization. The extended-length path prefix \\?\ remains in the path, which prevents the scaffolding tool from executing correctly. This issue occurs in the following function:
src\scaffold\app\cargo.rs::exec_metadata
The error message that appears is:
failed to load manifest for workspace member `\\?\C:\rust\test-app\dnas\*\zomes\coordinator\*`
referenced by workspace at `\\?\C:\rust\test-app\Cargo.toml`
Caused by:
failed to read `\\?\C:\rust\test-app\dnas\*\zomes\coordinator\*\Cargo.toml`
Caused by:
Filnavnet, mappenavnet eller volumnavnesyntaksen er feil. (os error 123)
`cargo metadata` exited with an error:
Expected behavior
The canonicalized path should not retain the \\?\ extended-length path prefix, allowing the tool to execute successfully.
System information
OS: [Windows 10]
Scaffolding Version: 4.0.0 and any version above
Steps to reproduce
Ensure extended-length path support is enabled on Windows.
Use the scaffolding tool to create a new web app and add a DNA and zome:
hc scaffold web-app`
cd {web-app-name}
hc scaffold dna
hc scaffold zome
The following error will occur:
failed to load manifest for workspace member `\\?\C:\rust\test-app\dnas\*\zomes\coordinator\*`
referenced by workspace at `\\?\C:\rust\test-app\Cargo.toml`
Caused by:
failed to read `\\?\C:\rust\test-app\dnas\*\zomes\coordinator\*\Cargo.toml`
Caused by:
Filnavnet, mappenavnet eller volumnavnesyntaksen er feil. (os error 123)
`cargo metadata` exited with an error:
Possible fix
To resolve this issue, the dunce crate can be used for path canonicalization, which avoids the extended-length path prefix.
Current code
src\scaffold\app\cargo.rs:161
let path = current_dir
.join(workspace_cargo_toml_path(app_file_tree)).canonicalize()?;
Proposed fix:
let path = current_dir.join(workspace_cargo_toml_path(app_file_tree));let path = dunce::canonicalize(path)?;
The text was updated successfully, but these errors were encountered:
Description
Scaffolding a zome fails on Windows due to issues with path canonicalization. The extended-length path prefix
\\?\
remains in the path, which prevents the scaffolding tool from executing correctly. This issue occurs in the following function:The error message that appears is:
Expected behavior
The canonicalized path should not retain the
\\?\
extended-length path prefix, allowing the tool to execute successfully.System information
4.0.0
and any version aboveSteps to reproduce
Possible fix
To resolve this issue, the
dunce
crate can be used for path canonicalization, which avoids the extended-length path prefix.Current code
src\scaffold\app\cargo.rs:161
Proposed fix:
The text was updated successfully, but these errors were encountered: