Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make cache DB always use forward slash for paths #14940

Merged
merged 2 commits into from
Oct 16, 2023
Merged
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
4 changes: 3 additions & 1 deletion conan/internal/cache/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ def get_package_layout(self, pref: PkgReference):
assert pref.revision, "Package revision must be known to get the package layout"
pref_data = self._db.try_get_package(pref)
pref_path = pref_data.get("path")
return PackageLayout(pref, os.path.join(self._base_folder, pref_path))
# we use abspath to convert cache forward slash in Windows to backslash
return PackageLayout(pref, os.path.abspath(os.path.join(self._base_folder, pref_path)))

def get_or_create_ref_layout(self, ref: RecipeReference):
""" called by RemoteManager.get_recipe()
Expand Down Expand Up @@ -181,6 +182,7 @@ def assign_prev(self, layout: PackageLayout):
pref.timestamp = revision_timestamp_now()
# Wait until it finish to really update the DB
relpath = os.path.relpath(layout.base_folder, self._base_folder)
relpath = relpath.replace("\\", "/") # Uniform for Windows and Linux
try:
self._db.create_package(relpath, pref, build_id)
except ConanReferenceAlreadyExistsInDB:
Expand Down