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

Update fpm manifest to enforce module naming #121

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

Conversation

perazz
Copy link

@perazz perazz commented Feb 9, 2023

This commit adds a suitable module-naming convention to the fpm manifest for toml-f. Because toml-f already enforces a valid unique naming (module tomlf_*), there is no need to modify any of the source files. The current commit explicitly adds the naming convention in place to the manifest.

When module names become enforced by default in fpm, this flag will be necessary to build fpm from fpm.

@awvwgk
Copy link
Member

awvwgk commented Feb 9, 2023

Will merging this break all fpm builds with existing fpm versions? So we best have to wait for a new fpm release before applying this change.

@codecov
Copy link

codecov bot commented Feb 9, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (1c68ea9) 65.95% compared to head (2c42dd9) 65.95%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #121    /-   ##
=======================================
  Coverage   65.95%   65.95%           
=======================================
  Files          29       29           
  Lines        3169     3169           
  Branches     1350     1350           
=======================================
  Hits         2090     2090           
  Misses        393      393           
  Partials      686      686           

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@perazz
Copy link
Author

perazz commented Feb 9, 2023

As far as I can tell, having the [build] structure in fpm.toml have one more key-value pair should not break anything, because it is not even queried in any of the former fpm versions. So as long as it is properly read in by the toml parser, I think it should be safe to add

@awvwgk
Copy link
Member

awvwgk commented Feb 9, 2023

As far as I can tell, having the [build] structure in fpm.toml have one more key-value pair should not break anything, because it is not even queried in any of the former fpm versions. So as long as it is properly read in by the toml parser, I think it should be safe to add

That is not true for any version of fpm due to the allowed keyword checks in

https://github.com/fortran-lang/fpm/blob/main/src/fpm/manifest/build.f90#L119

@perazz
Copy link
Author

perazz commented Feb 9, 2023

Wow, this is a pretty severe limitation.

[dependencies]
[dependencies.toml-f]
git = "https://github.com/toml-f/toml-f"
rev = "aee54c5a480d623af99828c76df0447a15ce90dc"

But, the current fpm build points to a given commit. I guess we should look at how far backward this was prescribed.

@awvwgk
Copy link
Member

awvwgk commented Feb 9, 2023

Fpm would be fine with a pinned commit, but merging this patch would break TOML Fortran for everyone else using the latest version with fpm, so this is not acceptable at the moment.

@perazz
Copy link
Author

perazz commented Feb 9, 2023

Yes I agree the major improvements planned on fpm will break many things. Let's leave this PR here for when the time comes.

This commit adds a suitable `module-naming` convention to the fpm manifest for toml-f. 
Because toml-f already enforces a valid unique naming (`module tomlf_*`), there is no need to modify any of the source files. 
The current commit explicitly adds the naming convention in place to the manifest.

When module names become enforced by default in fpm, this flag will be necessary to build fpm from fpm.
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.

2 participants