Skip to content

Conversation

perseoGI
Copy link
Contributor

While reviewing docs for the conan training, I found some things that can be improved.

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.

Looks good overall, just a detail about per-package env

# Unset the variable "MyPath1"
MyPath1=!
mypkg/*:MyPath1=!
Copy link
Member

Choose a reason for hiding this comment

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

This would be introducing here the concept of per-package environment, but this section is to introduce the core syntax (add, append, remove).

It would be better to leave it as-is, and then add the per-package examples with mypkg/* separately

Copy link
Contributor Author

@perseoGI perseoGI Sep 26, 2025

Choose a reason for hiding this comment

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

I agree with you. There were two options, modifying this line or the below line.
See this screen capture from https://docs.conan.io/2/reference/config_files/profiles.html#profiles

I was confused about reading MyPath=! and then the explanation below.

Image

That is why I added that pattern, because if not, the Unix/Windows explanation below will be invalidated, as after parsing all the profile, MyPath1 will be empty.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, that is wrong, indeed.
Lets try to improve it:

  • Use MyPath2=! in the text
  • Explain in the explanation that if the system had defined MyPath2, it will be unset by Conan
  • After this example explanation, add a small example with per-package environment, a simple MyVar1=value1 followed by mypkg/*:MyVar1=value2 and explaining the final values would be enough

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated:
image

@memsharded memsharded added this to the 2.22 milestone Sep 30, 2025
@memsharded memsharded merged commit 3478a1c into conan-io:develop2 Sep 30, 2025
2 checks passed
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