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

Store size of package in the index #35

Open
aslozada opened this issue Mar 15, 2021 · 7 comments
Open

Store size of package in the index #35

aslozada opened this issue Mar 15, 2021 · 7 comments

Comments

@aslozada
Copy link
Member

Should the fpm.toml file contain information about the size of the package?

The subroutines new_package and check, in the module fpm_manifest_package, contain 18 keywords with information about a package, name, author, version, etc. However, no keyword provides information about the size of the package. 

An idea,

  1. Build the package
  2. Update the file fpm.toml with information about the size of the package

The command execute_command_line can get this information from shell.

@milancurcic
Copy link
Member

What is the size of a package? Many things come to mind: Number of modules, procedures, source files, dependencies? Number of lines of code? Number of bytes on disk of source files? Number of bytes of the binaries?

What is it useful for?

@LKedward
Copy link
Member

Thanks for opening @aslozada but I think there may be some misunderstanding about the role of the fpm.toml file.

fpm.toml is an input file written by the user to specify the necessary information to build and distribute the package; it is not a cache for metadata and properties of the package. Put another way, fpm.toml describes inputs (akin to independent variables) whereas the 'size' of a package is a property of the package and is hence an output (akin to a dependent variable).
It is for this reason that we do not in general want a workflow where fpm modifies fpm.toml since this implies a circular relationship of sorts.

@ghost
Copy link

ghost commented Mar 16, 2021

I think the information about the package size is useful in this scenario: a package contains many dependencies or a huge dependency (several GB of data) and we're in limited internet connection. I think fpm could display a message like this one: "I will download N GB of data. Do you want to continue?". This information could be stored in fpm-registry.

@LKedward
Copy link
Member

This information could be stored in fpm-registry.

Yes I agree, this type of information would be well-suited to the fpm-registry which is setup extract and cache such data.

@aslozada
Copy link
Member Author

Put another way, fpm.toml describes inputs (akin to independent variables) whereas the 'size' of a package is a property of the package and is hence an output (akin to a dependent variable).

Thanks, @LKedward.

The proposal is related to the scenario described by @brocolis. I thought that the file fpm.toml would be appropriate to contain this information. Of course, this file would be modified after building the package. Now I see that this procedure could be impractical.

@LKedward
Copy link
Member

Thanks @aslozada and @brocolis, the scenario makes sense for a central registry; providing more information about packages and their dependencies prior to downloading them is one of the motivations for developing a central fpm-registry. I'll move this issue to fpm-registry so that it can be tracked there.

@LKedward LKedward transferred this issue from fortran-lang/fpm Mar 16, 2021
@LKedward LKedward changed the title Size of package in the toml file Store size of package in the index Mar 16, 2021
@certik
Copy link
Member

certik commented Mar 16, 2021

Indeed, the fpm-registry should automatically extract this information and make it available.

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

No branches or pull requests

4 participants