Fpm: Bootstrapping: installation of the Fortran fpm version failed

Created on 1 Feb 2021  路  2Comments  路  Source: fortran-lang/fpm

Dear community, this is my first steps with fpm. I have followed the bootstrapping instructions in the README.md file. Everything works fine (fpm test says: "PASSED: all 109 tests passed") until the final step:

~/Fortran/fpm/fpm$ fpm run --runner cp -- ~/.local/bin
cp: cannot create regular file '/home/vmagnin/.local/bin/fpm': Text file busy

As it is the first time I read that error, I have inquired:
https://stackoverflow.com/questions/16764946/what-generates-the-text-file-busy-message-in-unix

Is it because the fpm file tries to modify itself? (which is the objective of the bootstrap if I have understood...)

I am working on Linux Kubuntu 20.10.

documentation

Most helpful comment

Is it because the fpm file tries to modify itself?

Thanks for trying it out and reporting this problem @vmagnin. Yes you're right this is because we're trying to replace the Haskell version while it is running; it looks like this is only possible by unlinking the old executable first which doesn't happen with cp(1).

A possible solution is to update the README to suggest mv(1) instead:

$ fpm run --runner mv -- ~/.local/bin

All 2 comments

Is it because the fpm file tries to modify itself?

Thanks for trying it out and reporting this problem @vmagnin. Yes you're right this is because we're trying to replace the Haskell version while it is running; it looks like this is only possible by unlinking the old executable first which doesn't happen with cp(1).

A possible solution is to update the README to suggest mv(1) instead:

$ fpm run --runner mv -- ~/.local/bin

Thanks @LKedward
your suggestion seems to have done the job, since there is no error message, and now when I launch fpm or fpm --help, the message seems longer with more options. I had not noted the previous version, but this is the version I have after bootstrapping:

~/Fortran/fpm/fpm$ fpm --version
Version:     0.1.3, alpha
Program:     fpm(1)
Description: A Fortran package manager and build system
Home Page:   https://github.com/fortran-lang/fpm
License:     MIT
OS Type:     Linux
Was this page helpful?
0 / 5 - 0 ratings

Related issues

scivision picture scivision  路  10Comments

everythingfunctional picture everythingfunctional  路  8Comments

certik picture certik  路  10Comments

smeskos picture smeskos  路  7Comments

awvwgk picture awvwgk  路  9Comments