Skip to content

418 pkg confg#497

Open
Joerg Henrichs (hiker) wants to merge 14 commits into
mainfrom
418_pkg_confg
Open

418 pkg confg#497
Joerg Henrichs (hiker) wants to merge 14 commits into
mainfrom
418_pkg_confg

Conversation

@hiker
Copy link
Copy Markdown
Collaborator

Adds a simple interface to pkg-config and nf-config.

@hiker
Copy link
Copy Markdown
Collaborator Author

Yaswant Pradhan (@yaswant) , ready for review. Not urgent for the release, it's just makes site-configs more convenient to write.

@hiker Joerg Henrichs (hiker) added this to the vn2.1 milestone Oct 6, 2025
@hiker Joerg Henrichs (hiker) added the Ready for review Indicating that a PR is ready to be reviewed. label Oct 23, 2025
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm not sure this is a problem which needs an object solution. In particular an object per library seems a bit odd since that obvious is immediately thrown away after the library has been interrogated.

It may be helpful to look at https://github.com/MetOffice/lfric_core/blob/main/lfric_build/pkg_config.py for an alternative approach. Although this is not necessarily the best solution either.

Also, the shell command seems like a different change. Can it be moved to its own pull request?

Comment thread tests/unit_tests/tools/test_pkg_config.py
@hiker
Copy link
Copy Markdown
Collaborator Author

I'm not sure this is a problem which needs an object solution. In particular an object per library seems a bit odd since that obvious is immediately thrown away after the library has been interrogated.

That is the first time that I got a comment to remove OO ;) The classes here inherit from the Tool class the handling of availability, version number, and code execution and error handling. Why would we want to remove this feature of OO, and potentially duplicate the code here?

It may be helpful to look at https://github.com/MetOffice/lfric_core/blob/main/lfric_build/pkg_config.py for an alternative approach. Although this is not necessarily the best solution either.

I had a quick look, and while it supports version handling and better shared/static support, it's otherwise pretty much the same - one class per package? I don't see the real difference to the way this implementation is handling this.

Also, after looking at the code, it appears that it combined -L, -I etc and the path into a single argument. I am not really familiar with pkg-config, why is that required?

But the support for version specification and better static/shared handling would actually be good to add imho.

Also, the shell command seems like a different change. Can it be moved to its own pull request?

I added a new section to the documentation to document the new tools, and then added a paragraph of explicit documentation for the existing shell tool to this new section to complete it. Should I really pull out one paragraph of documentation to a separate PR?

I wonder if perhaps the previous PR wasn't clean or so, and showed some other changes? I've just updated this PR to latest main version (and added the two new tools to fab.api), and it now does not show any changes to shell.py.

TBH, since your implementation has already support for version specifications and static/shared linking, I am also happy to close this PR, so you can add your version instead.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

One minor issue of location.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nfconfig is a very specific implementation detail which doesn't feel like it belongs in the build framework. This feels much more like an odd-ball quirk of a particular project. So lets move it to lfric_core where it seems like a better fit. You will probably want to delete the pkg_config library which is already there, since this replaces it.

By contrast, pkg_config is a standardised tool, much more appropriate across projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Low priority Ready for review Indicating that a PR is ready to be reviewed.

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

4 participants