diff --git a/lib/src/package.dart b/lib/src/package.dart index 3e4a8dc6b..11c346e4e 100644 --- a/lib/src/package.dart +++ b/lib/src/package.dart @@ -308,17 +308,17 @@ See $workspacesDocUrl for more information. verifyLink(resolvedDir); { - final symlinkResolvedDir = symlinkResolvedDirs[resolvedDir] ??= - Directory(resolvedDir).resolveSymbolicLinksSync(); - - for (final parent in parentDirs(p.dirname(resolvedDir))) { + final canonicalized = p.canonicalize(resolvedDir); + final symlinkResolvedDir = symlinkResolvedDirs[canonicalized] ??= + Directory(canonicalized).resolveSymbolicLinksSync(); + for (final parent in parentDirs(p.dirname(canonicalized))) { final symlinkResolvedParent = symlinkResolvedDirs[parent] ??= Directory(parent).resolveSymbolicLinksSync(); if (p.equals(symlinkResolvedDir, symlinkResolvedParent)) { dataError(''' Pub does not support symlink cycles. -$resolvedDir => ${p.canonicalize(parent)} +$symlinkResolvedDir => ${p.canonicalize(symlinkResolvedParent)} '''); } }