Skip to content
Snippets Groups Projects
Commit 675b000e authored by Eric Müller's avatar Eric Müller :mountain_bicyclist:
Browse files

feat(BSS-2): support spack fetch

parent b64c2519
No related branches found
No related tags found
1 merge request!500feat(BSS-2): support spack fetch
Pipeline #27992 passed with stage
in 13 hours, 34 minutes, and 47 seconds
......@@ -3,6 +3,7 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import unittest.mock
from spack import *
from spack.util.environment import EnvironmentModifications
......@@ -18,7 +19,7 @@ class Hxtorch(WafPackage):
maintainers = ['emuller']
version('7.0-rc1-fixup2', branch='waf')
version('7.0-rc1-fixup2', tag='hxtorch-7.0-rc1-fixup2')
version('7.0-rc1-fixup1', branch='waf')
# compiler for the BrainScaleS-2 embedded processor ("PPU"); needed for
......@@ -64,6 +65,33 @@ class Hxtorch(WafPackage):
depends_on('yaml-cpp+shared', type=('build', 'link', 'run'))
extends('python')
def do_fetch(self, mirror_only=False):
"""Setup the project."""
self.stage.create()
self.stage.fetch(mirror_only)
# if fetcher didn't do anything, it's cached already
if not os.path.exists(self.stage.source_path):
return
with working_dir(self.stage.source_path):
waf = which('./waf')
waf('setup', '--repo-db-url=https://github.com/electronicvisions/projects',
'--clone-depth=2',
'--without-munge',
'--without-hxcomm-hostarq',
'--without-hxcomm-extoll',
'--project=hxtorch',
'--release-branch=ebrains-' + str(self.spec.version)
)
# in the configure step, we need access to all archived .git folders
def custom_archive(self, destination):
super(spack.fetch_strategy.GitFetchStrategy, self).archive(destination)
with unittest.mock.patch('spack.fetch_strategy.GitFetchStrategy.archive', new=custom_archive):
self.stage.cache_local()
def _setup_common_env(self, env):
# grenade needs to find some libraries for the JIT-compilation of
# programs for BrainScaleS-2's embedded processor.
......@@ -116,15 +144,7 @@ class Hxtorch(WafPackage):
# override configure step as we perform a project setup first
def configure(self, spec, prefix):
"""Setup and configure the project."""
self.waf('setup', '--repo-db-url=https://github.com/electronicvisions/projects',
'--without-munge',
'--without-hxcomm-hostarq',
'--without-hxcomm-extoll',
'--project=hxtorch',
'--release-branch=ebrains-' + str(spec.version)
)
"""Configure the project."""
args = ['--prefix={0}'.format(self.prefix)]
args += self.configure_args()
......
......@@ -3,6 +3,7 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
import unittest.mock
from spack import *
from spack.util.environment import EnvironmentModifications
......@@ -18,7 +19,7 @@ class PynnBrainscales(WafPackage):
maintainers = ['emuller']
version('7.0-rc1-fixup2', branch='waf')
version('7.0-rc1-fixup2', tag='pynn-brainscales-7.0-rc1-fixup2')
version('7.0-rc1-fixup1', branch='waf')
# compiler for the BrainScaleS-2 embedded processor ("PPU"); needed for
......@@ -61,6 +62,33 @@ class PynnBrainscales(WafPackage):
depends_on('yaml-cpp+shared', type=('build', 'link', 'run'))
extends('python')
def do_fetch(self, mirror_only=False):
"""Setup the project."""
self.stage.create()
self.stage.fetch(mirror_only)
# if fetcher didn't do anything, it's cached already
if not os.path.exists(self.stage.source_path):
return
with working_dir(self.stage.source_path):
waf = which('./waf')
waf('setup', '--repo-db-url=https://github.com/electronicvisions/projects',
'--clone-depth=2',
'--without-munge',
'--without-hxcomm-hostarq',
'--without-hxcomm-extoll',
'--project=pynn-brainscales',
'--release-branch=ebrains-' + str(self.spec.version)
)
# in the configure step, we need access to all archived .git folders
def custom_archive(self, destination):
super(spack.fetch_strategy.GitFetchStrategy, self).archive(destination)
with unittest.mock.patch('spack.fetch_strategy.GitFetchStrategy.archive', new=custom_archive):
self.stage.cache_local()
def _setup_common_env(self, env):
# grenade needs to find some libraries for the JIT-compilation of
# programs for BrainScaleS-2's embedded processor.
......@@ -113,15 +141,7 @@ class PynnBrainscales(WafPackage):
# override configure step as we perform a project setup first
def configure(self, spec, prefix):
"""Setup and configure the project."""
self.waf('setup', '--repo-db-url=https://github.com/electronicvisions/projects',
'--without-munge',
'--without-hxcomm-hostarq',
'--without-hxcomm-extoll',
'--project=pynn-brainscales',
'--release-branch=ebrains-' + str(spec.version)
)
"""Configure the project."""
args = ['--prefix={0}'.format(self.prefix)]
args += self.configure_args()
......
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