Fpm repeatedly tries to fetch stdlib dependency on every run – possible rate limiting issue?

I’m using the new meta-packages feature in fpm together with stdlib. However, every time I run a previously compiled command (with identical arguments), fpm appears to attempt re-downloading stdlib from GitHub. I suspect I may be hitting GitHub’s rate limits as a result.

Is there a known workaround to cache the dependency or prevent redundant fetches?

My fpm.toml includes:

[dependencies]
blas   = "*"
stdlib = "*"
openmp = "*"
hdf5   = "*"
# ... and others

When running fpm run, I see:

<WARNING> both openmp and stdlib requested: some functions may not be thread-safe!
 found blas package: blas
# Dependency change detected: stdlib
# Update: stdlib
Reinitialized existing Git repository in /home/pauli/cheesyham/build/dependencies/stdlib/.git/
fatal: não foi possível acessar 'https://github.com/fortran-lang/stdlib/': Could not resolve host: github.com
<ERROR> *cmd_run* Model error: Error while fetching git repository for remote dependency
STOP 1

Note that the final error shows a DNS resolution failure (Could not resolve host: github.com), which may be a side effect of repeated connection attempts or network throttling.

Any suggestions on how to make fpm respect a local cached copy of stdlib after the first fetch?

An easy workaround is to clone stdlib to a local folder yourself, checkout the stdlib-fpm branch and then point fpm there instead. i.e.

stdlib = { git=‘../deps/stdlib’, branch=‘stdlib-fpm’}

I don’t know how to do what you’re actually asking.

2 Likes

Nice, that’s a good workaround.

I wonder why dependency change detection always triggers with stdlib on my end.

I forgot to include details:

Version:     0.12.0, alpha
Program:     fpm(1)
OS Type:     Linux