-
Notifications
You must be signed in to change notification settings - Fork 97
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
Enable profiles in toml #653
Enable profiles in toml #653
Conversation
@kubajj and I are trying to take another run at the compiler profiles, submitting PRs in smaller increments. Could one or two people please perform a review of this one? |
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.
LGTM
Thanks @kubajj and @everythingfunctional - I'll put some time to review this this weekend. |
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.
Thanks Jakub @kubajj! I left a few minor comments, but my main feedback is that it would be good to have some more detailed description comments for some of the more complex subroutines to describe their logic for future developers.
Also, should the changes to the manifest reference be included in this PR?
Other than that this all looks good to me and I'm happy to move forward with the rest 👍
@@ -44,6 +46,7 @@ module fpm_manifest_package | |||
use fpm_toml, only : toml_table, toml_array, toml_key, toml_stat, get_value, & | |||
& len | |||
use fpm_versioning, only : version_t, new_version | |||
use fpm_filesystem, only: join_path |
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.
This import is not used
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.
It is on line 345.
src/fpm/manifest/profiles.f90
Outdated
if (.not.(present(profiles).and.present(profindex))) then | ||
call fatal_error(error, "Both profiles and profindex have to be present") | ||
return | ||
end if |
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.
Is this an internal error or can it be triggered by the user? In case this is user visible (let's assume it is), how helpful would that message be for fixing the manifest?
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.
It is an internal error. What should I do with it?
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.
So if the routine cannot be called with the optional arguments absent, can't we just always require them to be present?
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.
Oh, the thing is, the function operates in two modes, one is for just getting to know how many profiles there are if I am correct and the other actually writes to the profiles array.
That's where the line 403 and 431 comes in with if (present(profiles_size))
.
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.
I see. There are 3 optional arguments. The procedure should be called with either just profiles_size
present, or both profiles
and profindex
present. Would it make sense to split this into 2 procedures where neither has optional arguments?
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.
@everythingfunctional @awvwgk In the latest commit, I have split the function into two. One is traverse_oss_for_size
the other is just traverse_oss
. I tried to remove all unnecessary variables. Let me know what you think.
src/fpm/manifest/profiles.f90
Outdated
if (.not.(present(profiles).and.present(profindex))) then | ||
call fatal_error(error, "Both profiles and profindex have to be present") | ||
return | ||
end if |
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.
Same here, is this a user visible and does it provide the required information to help the user fix the manifest?
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.
Again, this is an internal error.
@LKedward about the changes to the manifest being included in the PR. I was thinking that since the profiles are not used yet, then we should not include it so that it does not confuse anybody. |
Of course, good point! |
This looks like it could be merged, no? |
Was there a reason this didn't get merged, or was it just forgotten about? I managed to resolve the merge conflict without much issue. Any chance we can go ahead and merge it now? |
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.
Looks good to me.
The original PR #653 was opened before C++ support was added. This PR brings the profiles manifest parsing up to date.
Enable compiler profiles to be loaded into the package. Profiles are not used in any way yet. Tests in the
test/fpm_test/test_manifest.f90
are making sure the functionality is behaving as expected. This is first part of #498 to be merged as it is difficult to merge such a big PR.This is still a huge PR as the file
src/fpm/manifest/profiles.f90
is a completely new file with a lot of functionality in it.