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

Support for dependency path relative to the fpm.toml it’s written in #719

Merged
merged 7 commits into from
Aug 30, 2022

Conversation

zoziha
Copy link
Contributor

@zoziha zoziha commented Jul 13, 2022

To close #605 .

Description

The previous dependency path was always quite the same as the top-level project, which made it difficult to make such an fpm package called by a higher-level project.
Rust-cargo seems to take a more reasonable approach: dependency paths are relative to the Cargo.toml it’s written in.

This PR attempts to support such improvements, which will allow us to publish fpm packages with component libraries.

---- pkg-1
      |---- fpm.toml
      |---- crate
              |---- pkg-2
              |---- pkg-3

# pkg-1 fpm.toml
[dependencies]
pkg-2 = { path = 'crate/pkg-2' }

# pkg-2 fpm.toml
[dependencies]
pkg-3 = { path = '../pkg-3' }

What this PR does

  • Update the interfaces of dependency.f90::new_dependecy and dependency.f90::new_dependecies, adding the root optional argument.
  • Add an example;
  • Update test and help manual;
  • Update README for MSYS2-fpm. (Not related to this PR, but a minor revision)
  • Update the handling of join_path("", "fpm.toml"):
print *, join_path("", "fpm.toml")  !! Original: `/fpm.toml`
print *, join_path("", "fpm.toml")  !! New:      `fpm.toml`
  • On Windows, adapt the path style of the Windows system to the dependency path.

1. The dependency path is no longer relative to the top-level project, but relative to the fpm.toml path that contains it;
2. Update `new_dependency`, `new_dependencies` interface and usage, add `root` argument.
1. Add a dependency path example;
2. Update `new_dependency` test;
3. Update help manual.
@zoziha zoziha marked this pull request as draft July 13, 2022 03:21
@zoziha zoziha changed the title Support for dependency paths relative to the fpm.toml it’s written in Support for dependency path relative to the fpm.toml it’s written in Jul 13, 2022
1. Add hell_fpm_path to run_tests.sh;
2. Rm unused `file_not_found_error` reference;
3. Update `fpm_filesystem::dirname`.
@zoziha zoziha marked this pull request as ready for review July 13, 2022 04:59
@zoziha zoziha requested a review from a team July 22, 2022 11:31
Copy link
Member

@LKedward LKedward left a comment

Choose a reason for hiding this comment

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

Hi @zoziha, apologies for the late review of this! This all looks good to me, thanks a lot! 👍

@zoziha
Copy link
Contributor Author

zoziha commented Aug 30, 2022

Thanks @awvwgk and @LKedward for reviewing.
With 2 approvals, maybe this can be merged next.

@awvwgk
Copy link
Member

awvwgk commented Aug 30, 2022

@zoziha Sure, feel free to go ahead and merge.

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.

Problems declearing local (path) dependencies
3 participants