Skip to content

Fix and clarify description of self.folders.subproject #4159

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

Open
wants to merge 1 commit into
base: develop2
Choose a base branch
from

Conversation

aagor
Copy link
Contributor

@aagor aagor commented Jul 8, 2025

The old documentation was wrong, as the subproject is not required to be the folder, where the conanfile.py is located.
An example, where this is not the case, can be found here: https://docs.conan.io/2/examples/conanfile/layout/conanfile_in_subfolder.html

The old documentation was wrong, as the subproject is not required to be
the folder, where the `conanfile.py` is located.
An example, where this is not the case, can be found here:
https://docs.conan.io/2/examples/conanfile/layout/conanfile_in_subfolder.html
@CLAassistant
Copy link

CLAassistant commented Jul 8, 2025

CLA assistant check
All committers have signed the CLA.

@aagor
Copy link
Contributor Author

aagor commented Jul 8, 2025

I'm open for suggestions (or direct edits), if you have better wording or want to clarify further.

@aagor aagor force-pushed the fix/subproject branch 2 times, most recently from ee74881 to 674f9cd Compare July 9, 2025 06:37
@memsharded memsharded added this to the 2.19 milestone Jul 9, 2025
Copy link
Member

@memsharded memsharded left a comment

Choose a reason for hiding this comment

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

While this is technically correct, I am not sure this was the original intention and design of the feature. The self.folders.subproject intends to have the conanfile.py in that location, and then the rest of the relative things of the subproject relative to it.
That is, the idea is that the conanfile.py is found at the root of the subproject. Maybe it doesn't work exactly like that for all cases, but for example, the docs in https://docs.conan.io/2/examples/conanfile/layout/multiple_subprojects.html show this usage.

It looks like we probably want to investigate the implications of this, if there could be some problems of explicitly documenting and encouraging this layout.

@aagor
Copy link
Contributor Author

aagor commented Jul 14, 2025

Well, I don't say or recommend this practice here of putting the conanfile.py inside a subfolder.

Where I can imagine this is used, is for open-source dependencies that ship upstream Conan/vcpkg/Debian/etc. support and don't want to clutter the main directory with files specific to one package manager.

But the point is, when the conanfile.py is in a subfolder, it`s usually wrong and problematic to set the subproject to this folder.

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.

3 participants