-
Notifications
You must be signed in to change notification settings - Fork 949
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
Support multiline blocks and inline commets on profiles #16329
Support multiline blocks and inline commets on profiles #16329
Conversation
a5a5f92
to
f4b793d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Case broken by this PR, profile with
[replace_requires]
zlib/1.3: zlib/1.3#rrev1
We can try to be smart and think about all the other potential corner cases that would be breaking, and keep increasing the regex complexity to cover those, but there will always be more that we cannot simply foresee. Take into account that profiles also support jinja syntax, that in turn can contain practically any python code, so regex based replacer there will always be risky.
Yes, you are totally right! We may see if there is any other possible case where we could be breaking something. In terms of breaking changes in the jinja python injected code... I think there can't be any issue.
there can't be any Also, and fortunately, jinja supports natively multiline blocks without needing to add |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{# # my useless comment #}
include(default)
Will break your regex replacer again.
I didn't have to provide a very complex profile, just one line to break your code.
See for reference #15544 (comment) what some users are doing with profiles.
I think this is not worth the risk.
Note, that if you want to have a beautiful formatted dict, you can probably define such a dict in jinja, then render it as text in the |
Closing as risk is too high for little value. |
Changelog: Feature: Support multiline blocks and inline commets on profiles
Docs: https://github.com/conan-io/docs/pull/XXXX
Closes: #16328
develop
branch, documenting this one.