fortran-lang / fpm

Fortran Package Manager (fpm)
https://fpm.fortran-lang.org
MIT License
876 stars 99 forks source link

Install script always picks the latest release #1056

Closed marcelmbn closed 3 months ago

marcelmbn commented 3 months ago

Description

When installing fpm via either

  1. brew install fpm
  2. ./install.sh
  3. ... or via compiling the all-in-one Fortran script manually into a binary as follows

I receive the following errors (that are consistently the same between all three installation approaches). These errors do not happen when trying to install fpm-0.10.0 or lower via downloading fpm.F90, i.e, with the earlier versions, fpm is working on my infrastructure.

╭─marcelmueller at MBP in ~/source/fpm/build/bootstrap on main✘✘✘ 24-06-25 - 1:38:02
╰─(base) ⠠⠵ gfortran fpm-0.10.1.F90 -o fpm
fpm-0.10.1.F90:28554:101:

28554 |         call set_string(table, "descriptor", descriptor_name(self%descriptor), error, 'git_target_t')
      |                                                                                                     1
Error: There is no specific subroutine for the generic 'set_string' at (1)
fpm-0.10.1.F90:30325:93:

30325 |        call set_string(table,"os-type",os_type_name(self%os_type), error, 'profile_config_t')
      |                                                                                             1
Error: There is no specific subroutine for the generic 'set_string' at (1)
fpm-0.10.1.F90:31376:9:

31376 |     use fpm_git, only: git_target_t, git_target_tag, git_target_branch, &
      |         1
Fatal Error: Cannot open module file 'fpm_git.mod' for reading at (1): No such file or directory
compilation terminated.

Expected Behaviour

Compilation into a binary without errors/problems.

Version of fpm

0.10.1

Platform and Architecture

macOS-14.5/Apple silicon

Additional Information

gfortran was obtained via brew install gfortran. I've only tried using gfortran-14, not any older version.

perazz commented 3 months ago

Was fixed in #1013 already, and will appear in the next release. When you install fpm with Homebrew, you get a binary already, no need to build that again. Test that it is in the path with fpm --version

marcelmbn commented 3 months ago

Was fixed in #1013 already, and will appear in the next release. When you install fpm with Homebrew, you get a binary already, no need to build that again. Test that it is in the path with fpm --version

No, when being a non-x86 system like ARM, fpm is bootstrapped using gfortran. Otherwise, it wouldn't be an issue for me. But if it's already fixed in the code, I don't mind.

perazz commented 3 months ago

cc @henilp105 @arteevraina a new bugfix release 0.10.2 may be worthwhile

@marcelmbn the latest official brew bottle has 0.9.0, that works on my ARM system with brew upgrade fpm: https://github.com/fortran-lang/homebrew-fortran. I see from that repo that there's been a failed attempt at upgrading it to 0.10.0, may be related but it's not in homebrew yet

marcelmbn commented 3 months ago

Yes, but counterintuitively (and tbh, I don't understand the reasoning behind it; might be a question to the fpm developers in general), ./install.sh always downloads the latest release. That's why brew install fpm doesn't work:

https://github.com/fortran-lang/fpm/blob/83b4412fdb92e3238fd2f8ac5757b12386b8b51f/install.sh#L34-L41

brew install fpm also just executes the install script, and thus downloads the latest release (which suffers from the bug).

marcelmbn commented 3 months ago

@marcelmbn the latest official brew bottle has 0.9.0, that works on my ARM system with brew upgrade fpm:

This is probably because the brew formula didn't really change and thus, it's not downloaded from scratch with the latest version. This is IMHO an architectural problem. The ./installation.sh of a specific release should in my view point to the fpm.F90 of this version.

marcelmbn commented 3 months ago

@marcelmbn the latest official brew bottle has 0.9.0, that works on my ARM system with brew upgrade fpm:

This is probably because the brew formula didn't really change and thus, it's not downloaded from scratch with the latest version. This is IMHO an architectural problem. The ./installation.sh of a specific release should in my view point to the fpm.F90 of this version.

Maybe it makes sense to re-open the issue with a different context ("wrong" referencing of the install.sh script)?

perazz commented 3 months ago

Yes I think it's a good idea @marcelmbn, it would be useful to enhance the install script and let it pick any given release tag