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

[editables] Store full path to 'conanfile.py' #7079

Merged
merged 6 commits into from May 27, 2020

Conversation

jgsogo
Copy link
Contributor

@jgsogo jgsogo commented May 25, 2020

Changelog: Fix: Adding a package as editable stores full path to conanfile.py.
Docs: omit

On the local folder, the name of the conanfile is not always conanfile.py|txt

Closes #6905

@jgsogo jgsogo added this to the 1.26 milestone May 25, 2020
@jgsogo jgsogo marked this pull request as ready for review May 25, 2020
conans/client/cache/cache.py Outdated Show resolved Hide resolved
@@ -11,11 +11,12 @@

class PackageEditableLayout(object):

def __init__(self, base_folder, layout_file, ref):
def __init__(self, base_folder, layout_file, ref, conanfile_path):
Copy link
Contributor Author

@jgsogo jgsogo May 25, 2020

Choose a reason for hiding this comment

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

Why I want to open this door, having a different path for the conanfile and the base_folder? when we have an out-of-sources recipe the source folder, build folder,... cannot be computed relative to the conanfile.py itself. Paths in the layout file should be absolute or we need to provide an additional path as base folder (as it is requested here: #6896).

@SSE4
Copy link
Contributor

SSE4 commented May 25, 2020

isn't it breaking? previously, editable didn't store full paths, so I could easily relocate my package by copying/moving it to the different place within the file system. but right now it stores full paths, making editables no longer truly relocatable.

@jgsogo
Copy link
Contributor Author

jgsogo commented May 25, 2020

Paths stored in the editable_packages.json were absolute paths to the directory where the conanfile was located. Conan, when using them, was adding unconditionally a conanfile.py to them so it was not possible to make editable a package with a different filename for the conanfile.

Now I'm storing the full path to the conanfile, not just the directory, but the full path to the .py file (absolute path as it was before).

This shouldn't break anything


What do you mean by a relocatable editable package? Conan has always looked for the sources in a hardcoded path, if you move them you need to remove and add again the package as editable.

@jgsogo jgsogo requested a review from memsharded May 25, 2020
@SSE4
Copy link
Contributor

SSE4 commented May 25, 2020

@jgsogo okay then, it wasn't obvious that conan always stored absolute paths. I had an impression conan stored relative paths to the conanfile, therefore you were able to move conanfile outside.

@jgsogo
Copy link
Contributor Author

jgsogo commented May 25, 2020

Paths in the layout file (if not absolute) are relative to the location conanfile.py

czoido
czoido approved these changes May 27, 2020
@jgsogo jgsogo merged commit aa11aa8 into conan-io:develop May 27, 2020
2 checks passed
@jgsogo jgsogo deleted the fix/editables branch May 27, 2020
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.

[bug] Store full path to the conanfile for editable packages
4 participants