Commit 3fdc81ac authored by Jérome Perrin's avatar Jérome Perrin

fixup! component/default: system gcc can be used only if all gcc, g++ and...

fixup! component/default: system gcc can be used only if all gcc, g++ and gfortran exist and their versions are same.
parent ea28e0c2
Pipeline #34251 failed with stage
in 0 seconds
...@@ -40,7 +40,7 @@ part = gcc-10.5 ...@@ -40,7 +40,7 @@ part = gcc-10.5
# slapos.rebootstrap (see https://bugs.python.org/issue34112 about Python 3.7+). # slapos.rebootstrap (see https://bugs.python.org/issue34112 about Python 3.7+).
min_version = 5.4 min_version = 5.4
init = init =
import os, subprocess import errno, os, subprocess
parse_version = lambda ver: tuple(map(int, ver.strip().split('.'))) parse_version = lambda ver: tuple(map(int, ver.strip().split('.')))
version_set = set() version_set = set()
for command in ('gcc', 'g++', 'gfortran'): for command in ('gcc', 'g++', 'gfortran'):
...@@ -51,7 +51,9 @@ init = ...@@ -51,7 +51,9 @@ init =
except subprocess.CalledProcessError: # BBB: old GCC except subprocess.CalledProcessError: # BBB: old GCC
version = subprocess.check_output((command, '-dumpversion'), version = subprocess.check_output((command, '-dumpversion'),
universal_newlines=True).strip() universal_newlines=True).strip()
except FileNotFoundError: except OSError as e:
if e.errno != errno.ENOENT:
raise
version = None version = None
version_set.add(version) version_set.add(version)
if None in version_set or len(version_set) != 1: if None in version_set or len(version_set) != 1:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment