Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Install script always picks the latest release #1056

Closed
marcelmbn opened this issue Jun 24, 2024 · 7 comments · Fixed by #1057
Closed

Install script always picks the latest release #1056

marcelmbn opened this issue Jun 24, 2024 · 7 comments · Fixed by #1057
Labels
bug Something isn't working enhancement New feature or request

Comments

@marcelmbn
Copy link

marcelmbn commented Jun 24, 2024

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.

@marcelmbn marcelmbn added the bug Something isn't working label Jun 24, 2024
@perazz
Copy link
Member

perazz commented Jun 25, 2024

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

@perazz perazz closed this as completed Jun 25, 2024
@marcelmbn
Copy link
Author

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
Copy link
Member

perazz commented Jun 25, 2024

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
Copy link
Author

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:

fpm/install.sh

Lines 34 to 41 in 83b4412

# Return value of the latest published release on GitHub, with no heading "v" (e.g., "0.7.0")
get_latest_release()
{
$2 "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' | # Pluck JSON value
sed -E 's/^v//' # Remove heading "v" if present
}

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

@marcelmbn
Copy link
Author

@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
Copy link
Author

@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
Copy link
Member

perazz commented Jun 25, 2024

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

@perazz perazz reopened this Jun 25, 2024
@perazz perazz changed the title Installation error using gfortran-14 on macOS-14.5 @ ARM Install script always picks the latest release Jun 25, 2024
@perazz perazz added the enhancement New feature or request label Jun 25, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants