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

MakeDeps: Provide "require" information, and more styling tweaks #14605

Merged
merged 1 commit into from
Aug 31, 2023

Conversation

iskunk
Copy link
Contributor

@iskunk iskunk commented Aug 29, 2023

Changelog: Feature: MakeDeps: Provide "require" information, and more styling tweaks.
Docs: Omit

Minor follow-on to #14133

This includes the following:

  • Whitespace adjustments for better visual arrangement;
  • Include (indirect dependency) comment on applicable components (just an example of what can be done with the require info);
  • Pass the require info to DepContentGenerator and DepGenerator, as it provides useful context for a dependency;
  • Add a footer comment, to clearly indicate the end of the file.

@iskunk iskunk mentioned this pull request Aug 29, 2023
5 tasks
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.

Thanks for your contribution!

@@ -507,8 +512,9 @@ class DepGenerator:
Process a dependency cpp_info variables and generate its Makefile content
"""

def __init__(self, dependency):
def __init__(self, dependency, require=None):
Copy link
Member

Choose a reason for hiding this comment

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

If the require is always passed, better remove the None default

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoops, minor oversight there. Was thinking of making it optional at first.

@@ -597,6 +603,7 @@ class MakeDeps:
"""

_title = "# This Makefile has been generated by Conan. DO NOT EDIT!\n"
_footer = f"# end {CONAN_MAKEFILE_FILENAME}\n"
Copy link
Member

Choose a reason for hiding this comment

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

Not sure about the value of this footer. No other Conan generated file adds this end-of-file footer, so better remove it to align.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll remove it, but I would advise adopting this as a general convention. A clear footer indicates that you have the entire file, that it was not truncated for one reason or another.

Copy link
Member

Choose a reason for hiding this comment

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

We haven't been reported a truncated file ever in many years. Creation of generated files happen in memory, and written all at once in single operation, extremely unlikely to happen.

CONAN_NAME_{{ name }} = {{ dep.ref.name }}

Copy link
Member

Choose a reason for hiding this comment

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

I removed these lines, because I like visually more compact files, and group all similar things in blocks. For me, all the name, version, ref, are conceptually part of the same "block" of information, and I like to have some visual hints of these information groups.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I'm glad to see there is thought behind this. I'll leave the blank right before _ROOT, as that relates more to the other variables.

@iskunk iskunk force-pushed the feature/makedeps-tweak branch from 875c2b6 to 21fc098 Compare August 29, 2023 21:31
@iskunk
Copy link
Contributor Author

iskunk commented Aug 30, 2023

Let me know if you have any further concerns with this (updated) patch.

@memsharded memsharded merged commit e836696 into conan-io:release/2.0 Aug 31, 2023
@memsharded memsharded added this to the 2.0.11 milestone Aug 31, 2023
@iskunk
Copy link
Contributor Author

iskunk commented Sep 1, 2023

Thanks @memsharded and @uilianries. I'm happy to see this generator finished, merged, and polished off.

Looking forward to seeing what you have in mind for MakeToolchain.

@uilianries
Copy link
Member

Thank you for your words @iskunk !! About the MakeToolchain, your feedback will be very important too! Regards!

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