From a0c959be2877d36ba188ef5eb05329446061bbdb Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Thu, 20 Apr 2023 19:34:15 +0300 Subject: [PATCH] Improved support for projects located on Windows network drives // Issue #3417 --- platformio/builder/tools/piolib.py | 4 ++-- platformio/package/manager/_symlink.py | 2 +- platformio/package/meta.py | 4 ++-- platformio/project/integration/generator.py | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/platformio/builder/tools/piolib.py b/platformio/builder/tools/piolib.py index f95f6735..02d47ea6 100644 --- a/platformio/builder/tools/piolib.py +++ b/platformio/builder/tools/piolib.py @@ -170,8 +170,8 @@ class LibBuilderBase: ): return True # try to resolve paths - root_path = os.path.realpath(root_path) - child_path = os.path.realpath(child_path) + root_path = os.path.abspath(root_path) + child_path = os.path.abspath(child_path) return ( os.path.commonprefix([root_path + os.path.sep, child_path]) == root_path + os.path.sep diff --git a/platformio/package/manager/_symlink.py b/platformio/package/manager/_symlink.py index 33ff03f1..f0337869 100644 --- a/platformio/package/manager/_symlink.py +++ b/platformio/package/manager/_symlink.py @@ -40,7 +40,7 @@ class PackageManagerSymlinkMixin: pkg_dir, spec = self.resolve_symlink(path) if not pkg_dir: return None - pkg = PackageItem(os.path.realpath(pkg_dir)) + pkg = PackageItem(os.path.abspath(pkg_dir)) if not pkg.metadata: pkg.metadata = self.build_metadata(pkg.path, spec) return pkg diff --git a/platformio/package/meta.py b/platformio/package/meta.py index 4db53106..5622e470 100644 --- a/platformio/package/meta.py +++ b/platformio/package/meta.py @@ -482,7 +482,7 @@ class PackageItem: def __eq__(self, other): conds = [ - os.path.realpath(self.path) == os.path.realpath(other.path) + os.path.abspath(self.path) == os.path.abspath(other.path) if self.path and other.path else self.path == other.path, self.metadata == other.metadata, @@ -490,7 +490,7 @@ class PackageItem: return all(conds) def __hash__(self): - return hash(os.path.realpath(self.path)) + return hash(os.path.abspath(self.path)) def exists(self): return os.path.isdir(self.path) diff --git a/platformio/project/integration/generator.py b/platformio/project/integration/generator.py index 12f53ef0..40b8e87a 100644 --- a/platformio/project/integration/generator.py +++ b/platformio/project/integration/generator.py @@ -134,7 +134,7 @@ class ProjectGenerator: for root, _, files in os.walk(self.config.get("platformio", "src_dir")): for f in files: result.append( - os.path.relpath(os.path.join(os.path.realpath(root), f)) + os.path.relpath(os.path.join(os.path.abspath(root), f)) ) return result