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

Automated dependency tree update #843

Merged
merged 8 commits into from
Mar 15, 2023

Conversation

perazz
Copy link
Contributor

@perazz perazz commented Feb 20, 2023

Fixes #837 #799 (also targeting #838).

tl;dr fpm does never update a project's cached dependencies unless forced to do so via fpm update.
This is wrong as dependencies may change in the manifest and the user should not have to manually do it every time.

With the current PR:

  1. The ability to update dependencies is propagated to fpm build:
    https://github.com/perazz/fpm/blob/063148259fc4745f60c8e3d253c803b3e09ace38/src/fpm.f90#L63-L70

  2. When cache.toml is present, the old dependency tree was only loaded from it. New dependencies would be added from scratch (id==0), but cached dependencies (id>0) would be left as-is. Now, instead of just finding the ID of a cached dependency, fpm will check if it has changed, and request an update if so
    https://github.com/perazz/fpm/blob/063148259fc4745f60c8e3d253c803b3e09ace38/src/fpm/dependency.f90#L373-L389

This resolves changes in fpm.toml automatically and should be easily integrated with the local registry cache (#817 @minhqdao). @certik please let me know about the module contents problems (#838), I'm happy to help.

@perazz perazz marked this pull request as draft February 20, 2023 10:07
@perazz perazz changed the title Automated dependency tree updated Automated dependency tree update Feb 20, 2023
@perazz perazz marked this pull request as ready for review March 1, 2023 15:27
Copy link
Member

@henilp105 henilp105 left a comment

Choose a reason for hiding this comment

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

Thanks @perazz , look good to me.

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.

When upgrading dependency hash, fpm does not rebuild
2 participants