appveyor: consider base build (BASE=SELF)
This commit is contained in:
@@ -45,13 +45,22 @@ ciscriptsdir = os.path.abspath(os.path.dirname(sys.argv[0]))
|
|||||||
if os.path.basename(ciscriptsdir) == 'appveyor':
|
if os.path.basename(ciscriptsdir) == 'appveyor':
|
||||||
ciscriptsdir = ciscriptsdir.rstrip(os.pathsep+'appveyor')
|
ciscriptsdir = ciscriptsdir.rstrip(os.pathsep+'appveyor')
|
||||||
|
|
||||||
|
if 'BASE' not in os.environ or os.environ['BASE'] == 'SELF':
|
||||||
|
building_base = True
|
||||||
|
places['EPICS_BASE'] = '.'
|
||||||
|
else:
|
||||||
|
building_base = False
|
||||||
|
|
||||||
def modlist():
|
def modlist():
|
||||||
for var in ['ADD_MODULES', 'MODULES']:
|
if building_base:
|
||||||
setup.setdefault(var, '')
|
ret = []
|
||||||
if var in os.environ:
|
else:
|
||||||
setup[var] = os.environ[var]
|
for var in ['ADD_MODULES', 'MODULES']:
|
||||||
logger.debug('ENV assignment: %s = %s', var, setup[var])
|
setup.setdefault(var, '')
|
||||||
ret = ['BASE'] + setup['ADD_MODULES'].upper().split() + setup['MODULES'].upper().split()
|
if var in os.environ:
|
||||||
|
setup[var] = os.environ[var]
|
||||||
|
logger.debug('ENV assignment: %s = %s', var, setup[var])
|
||||||
|
ret = ['BASE'] + setup['ADD_MODULES'].upper().split() + setup['MODULES'].upper().split()
|
||||||
logger.debug('Effective module list: %s', ret)
|
logger.debug('Effective module list: %s', ret)
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
@@ -377,18 +386,23 @@ def setup_for_build(args):
|
|||||||
|
|
||||||
make = os.path.join(toolsdir, 'make.exe')
|
make = os.path.join(toolsdir, 'make.exe')
|
||||||
|
|
||||||
with open(os.path.join(cachedir, 'RELEASE.local'), 'r') as f:
|
base_place = '.'
|
||||||
lines = f.readlines()
|
if not building_base:
|
||||||
for line in lines:
|
with open(os.path.join(cachedir, 'RELEASE.local'), 'r') as f:
|
||||||
(mod, place) = line.strip().split('=')
|
lines = f.readlines()
|
||||||
bindir = os.path.join(place, 'bin', os.environ['EPICS_HOST_ARCH'])
|
for line in lines:
|
||||||
if os.path.isdir(bindir):
|
(mod, place) = line.strip().split('=')
|
||||||
dllpaths.append(bindir)
|
bindir = os.path.join(place, 'bin', os.environ['EPICS_HOST_ARCH'])
|
||||||
if mod == 'EPICS_BASE':
|
if os.path.isdir(bindir):
|
||||||
base_place = place
|
dllpaths.append(bindir)
|
||||||
with open(os.path.join(base_place, 'configure', 'CONFIG_BASE_VERSION')) as myfile:
|
if mod == 'EPICS_BASE':
|
||||||
if 'BASE_3_14=YES' in myfile.read():
|
base_place = place
|
||||||
isbase314 = True
|
|
||||||
|
cfg_base_version = os.path.join(base_place, 'configure', 'CONFIG_BASE_VERSION')
|
||||||
|
if os.path.exists(cfg_base_version):
|
||||||
|
with open(cfg_base_version) as myfile:
|
||||||
|
if 'BASE_3_14=YES' in myfile.read():
|
||||||
|
isbase314 = True
|
||||||
|
|
||||||
bindir = os.path.join(os.getcwd(), 'bin', os.environ['EPICS_HOST_ARCH'])
|
bindir = os.path.join(os.getcwd(), 'bin', os.environ['EPICS_HOST_ARCH'])
|
||||||
if os.path.isdir(bindir):
|
if os.path.isdir(bindir):
|
||||||
@@ -433,9 +447,12 @@ def prepare(args):
|
|||||||
|
|
||||||
[add_dependency(mod) for mod in modlist()]
|
[add_dependency(mod) for mod in modlist()]
|
||||||
|
|
||||||
if os.path.isdir('configure'):
|
if not building_base:
|
||||||
release_local = os.path.join(cachedir, 'RELEASE.local')
|
if os.path.isdir('configure'):
|
||||||
shutil.copy(release_local, 'configure')
|
targetdir = 'configure'
|
||||||
|
else:
|
||||||
|
targetdir = '.'
|
||||||
|
shutil.copy(os.path.join(cachedir, 'RELEASE.local'), targetdir)
|
||||||
|
|
||||||
print('{0}Configuring EPICS build system{1}'.format(ANSI_YELLOW, ANSI_RESET))
|
print('{0}Configuring EPICS build system{1}'.format(ANSI_YELLOW, ANSI_RESET))
|
||||||
|
|
||||||
@@ -487,21 +504,22 @@ def prepare(args):
|
|||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
sp.check_call(['cl'])
|
sp.check_call(['cl'])
|
||||||
|
|
||||||
for mod in modlist():
|
if not building_base:
|
||||||
place = places[setup[mod+"_VARNAME"]]
|
for mod in modlist():
|
||||||
print('{0}Building dependency {1} in {2}{3}'.format(ANSI_YELLOW, mod, place, ANSI_RESET))
|
place = places[setup[mod+"_VARNAME"]]
|
||||||
call_make(cwd=place, silent=silent_dep_builds)
|
print('{0}Building dependency {1} in {2}{3}'.format(ANSI_YELLOW, mod, place, ANSI_RESET))
|
||||||
|
call_make(cwd=place, silent=silent_dep_builds)
|
||||||
|
|
||||||
print('{0}Dependency module information{1}'.format(ANSI_CYAN, ANSI_RESET))
|
print('{0}Dependency module information{1}'.format(ANSI_CYAN, ANSI_RESET))
|
||||||
print('Module Tag Binaries Commit')
|
print('Module Tag Binaries Commit')
|
||||||
print(100 * '-')
|
print(100 * '-')
|
||||||
for mod in modlist():
|
for mod in modlist():
|
||||||
commit = sp.check_output(['git', 'log', '-n1', '--oneline'], cwd=places[setup[mod+"_VARNAME"]]).strip()
|
commit = sp.check_output(['git', 'log', '-n1', '--oneline'], cwd=places[setup[mod+"_VARNAME"]]).strip()
|
||||||
print("%-10s %-12s %-11s %s" % (mod, setup[mod], 'rebuilt', commit))
|
print("%-10s %-12s %-11s %s" % (mod, setup[mod], 'rebuilt', commit))
|
||||||
|
|
||||||
print('{0}Contents of RELEASE.local{1}'.format(ANSI_CYAN, ANSI_RESET))
|
print('{0}Contents of RELEASE.local{1}'.format(ANSI_CYAN, ANSI_RESET))
|
||||||
with open(os.path.join(cachedir, 'RELEASE.local'), 'r') as f:
|
with open(os.path.join(cachedir, 'RELEASE.local'), 'r') as f:
|
||||||
print(f.read().strip())
|
print(f.read().strip())
|
||||||
|
|
||||||
def build(args):
|
def build(args):
|
||||||
setup_for_build(args)
|
setup_for_build(args)
|
||||||
|
|||||||
Reference in New Issue
Block a user