From c4e31e994c7619c90792f0adac5f70d4f94451e5 Mon Sep 17 00:00:00 2001 From: darkless Date: Fri, 24 Apr 2020 10:19:58 +0200 Subject: [PATCH 1/9] initial GoPackage EasyBlock --- easybuild/easyblocks/generic/gopackage.py | 169 ++++++++++++++++++++++ 1 file changed, 169 insertions(+) create mode 100644 easybuild/easyblocks/generic/gopackage.py diff --git a/easybuild/easyblocks/generic/gopackage.py b/easybuild/easyblocks/generic/gopackage.py new file mode 100644 index 0000000000..c8057d3116 --- /dev/null +++ b/easybuild/easyblocks/generic/gopackage.py @@ -0,0 +1,169 @@ +## +# Copyright 2009-2020 Ghent University +# +# This file is part of EasyBuild, +# originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), +# with support of Ghent University (http://ugent.be/hpc), +# the Flemish Supercomputer Centre (VSC) (https://www.vscentrum.be), +# Flemish Research Foundation (FWO) (http://www.fwo.be/en) +# and the Department of Economy, Science and Innovation (EWI) (http://www.ewi-vlaanderen.be/en). +# +# https://github.com/easybuilders/easybuild +# +# EasyBuild is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation v2. +# +# EasyBuild is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with EasyBuild. If not, see . +## +""" +EasyBuild support for Go packages, implemented as an EasyBlock + +@author: Pavel Grochal (INUITS) +""" +import os +from distutils.version import LooseVersion + +import easybuild.tools.environment as env +from easybuild.framework.easyblock import EasyBlock +from easybuild.framework.easyconfig import CUSTOM +from easybuild.tools.build_log import EasyBuildError +from easybuild.tools.filetools import which +from easybuild.tools.modules import get_software_root, get_software_version +from easybuild.tools.run import run_cmd + + +class GoPackage(EasyBlock): + """Builds and installs a Go package, and provides a dedicated module file.""" + + @staticmethod + def extra_options(extra_vars=None): + """Easyconfig parameters specific to Go packages.""" + if extra_vars is None: + extra_vars = {} + extra_vars.update({ + 'modulename': [None, "Module name of the go package, when building non-native module", CUSTOM], + 'forced_deps': [None, "Force specific version of go package, when building non-native module", CUSTOM], + }) + return extra_vars + + def __init__(self, *args, **kwargs): + """Initialize custom class variables.""" + super(GoPackage, self).__init__(*args, **kwargs) + self.go_cmd = None + + def prepare_go(self): + """Go-specific preperations.""" + + go = None + go_root = get_software_root('Go') + if go_root: + bin_go = os.path.join(go_root, 'bin', 'go') + if os.path.exists(bin_go) and os.path.samefile(which('go'), bin_go): + # if Go is listed as a (build) dependency, use 'go' command provided that way + go = os.path.join(go_root, 'bin', 'go') + self.log.debug("Retaining 'go' command for Go dependency: %s", go) + if go: + self.go_cmd = go + else: + raise EasyBuildError("Failed to pick go command to use. Is it listed in dependencies?") + + go_version = get_software_version('Go') + if LooseVersion(go_version) < LooseVersion("1.11"): + raise EasyBuildError("Go version < 1.11 doesn't support installing modules from go.mod") + + # enforce use of go modules + env.setvar('GO111MODULE', 'on', verbose=False) + # set bin folder + env.setvar('GOBIN', os.path.join(self.installdir, 'bin'), verbose=False) + + def configure_step(self): + """Configure Go package build/install.""" + + if self.go_cmd is None: + self.prepare_go() + + # creates log entries for go being used, for debugging + run_cmd("%s version" % self.go_cmd, verbose=False, trace=False) + run_cmd("%s env" % self.go_cmd, verbose=False, trace=False) + + def build_step(self): + """If Go package is not native go module, lets try to make the module.""" + + go_mod_file = os.path.join('./', 'go.mod') + go_sum_file = os.path.join('./', 'go.sum') + + if not os.path.exists(go_mod_file) or not os.path.isfile(go_mod_file): + self.log.warn("go.mod not found! This is not natively supported go module. Trying to init module.") + + if self.cfg['modulename'] is None: + raise EasyBuildError("Installing non-native go module. You need to specify 'modulename' in easyconfig") + + # for more information about migrating to go modules + # see: https://blog.golang.org/migrating-to-go-modules + + # go mod init + cmd = ' '.join([self.go_cmd, 'mod init', self.cfg['modulename']]) + run_cmd(cmd, log_all=True, simple=True) + + if self.cfg['forced_deps']: + for dep in self.cfg['forced_deps']: + # go get specific dependencies which locks them in go.mod + cmd = ' '.join([self.go_cmd, 'get %s@%s' % dep]) + run_cmd(cmd, log_all=True, simple=True) + + # go build ./... + cmd = ' '.join([self.go_cmd, 'build ./...']) + run_cmd(cmd, log_all=True, simple=True) + + # go test ./... + cmd = ' '.join([self.go_cmd, 'test ./...']) + run_cmd(cmd, log_all=True, simple=True) + + # go mod tidy + cmd = ' '.join([self.go_cmd, 'mod tidy']) + run_cmd(cmd, log_all=True, simple=True) + + # go build ./... again + cmd = ' '.join([self.go_cmd, 'build ./...']) + run_cmd(cmd, log_all=True, simple=True) + + # go test ./... again + cmd = ' '.join([self.go_cmd, 'test ./...']) + run_cmd(cmd, log_all=True, simple=True) + + self.log.warn('Include generated go.mod and go.sum via patch to ensure locked dependencies ' + 'and run this easyconfig again.') + cmd = 'cat go.mod' + run_cmd(cmd, log_all=True, simple=True) + + cmd = 'cat go.sum' + run_cmd(cmd, log_all=True, simple=True) + + if not os.path.exists(go_sum_file) or not os.path.isfile(go_sum_file): + raise EasyBuildError("go.sum not found! This module has no locked dependency versions.") + + def install_step(self): + """Install Go package to a custom path""" + + # actually install Go package + cmd = ' '.join( + [self.cfg['preinstallopts'], self.go_cmd, 'install', self.cfg['installopts']]) + run_cmd(cmd, log_all=True, log_ok=True, simple=True) + + def sanity_check_step(self): + """Custom sanity check for Go package.""" + + # Go Package should produce something into bin directory + custom_paths = { + 'files': [], + 'dirs': ['bin'], + } + + super(GoPackage, self).sanity_check_step(custom_paths=custom_paths) From 28c8e785d5d991a80fa3e8e668cd5a9afaccf609 Mon Sep 17 00:00:00 2001 From: darkless Date: Fri, 24 Apr 2020 13:47:12 +0200 Subject: [PATCH 2/9] fixed remarks --- easybuild/easyblocks/generic/gopackage.py | 64 ++++++++++++----------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/easybuild/easyblocks/generic/gopackage.py b/easybuild/easyblocks/generic/gopackage.py index c8057d3116..df156858a4 100644 --- a/easybuild/easyblocks/generic/gopackage.py +++ b/easybuild/easyblocks/generic/gopackage.py @@ -48,8 +48,8 @@ def extra_options(extra_vars=None): if extra_vars is None: extra_vars = {} extra_vars.update({ - 'modulename': [None, "Module name of the go package, when building non-native module", CUSTOM], - 'forced_deps': [None, "Force specific version of go package, when building non-native module", CUSTOM], + 'modulename': [None, "Module name of the Go package, when building non-native module", CUSTOM], + 'forced_deps': [None, "Force specific version of Go package, when building non-native module", CUSTOM], }) return extra_vars @@ -58,8 +58,9 @@ def __init__(self, *args, **kwargs): super(GoPackage, self).__init__(*args, **kwargs) self.go_cmd = None - def prepare_go(self): - """Go-specific preperations.""" + def prepare_step(self, **kwargs): + """Go-specific preparations.""" + super(GoPackage, self).prepare_step(**kwargs) go = None go_root = get_software_root('Go') @@ -67,28 +68,24 @@ def prepare_go(self): bin_go = os.path.join(go_root, 'bin', 'go') if os.path.exists(bin_go) and os.path.samefile(which('go'), bin_go): # if Go is listed as a (build) dependency, use 'go' command provided that way - go = os.path.join(go_root, 'bin', 'go') + self.go_cmd = bin_go self.log.debug("Retaining 'go' command for Go dependency: %s", go) - if go: - self.go_cmd = go - else: + + if self.go_cmd is None: raise EasyBuildError("Failed to pick go command to use. Is it listed in dependencies?") go_version = get_software_version('Go') if LooseVersion(go_version) < LooseVersion("1.11"): raise EasyBuildError("Go version < 1.11 doesn't support installing modules from go.mod") + def configure_step(self): + """Configure Go package build/install.""" + # enforce use of go modules env.setvar('GO111MODULE', 'on', verbose=False) # set bin folder env.setvar('GOBIN', os.path.join(self.installdir, 'bin'), verbose=False) - def configure_step(self): - """Configure Go package build/install.""" - - if self.go_cmd is None: - self.prepare_go() - # creates log entries for go being used, for debugging run_cmd("%s version" % self.go_cmd, verbose=False, trace=False) run_cmd("%s env" % self.go_cmd, verbose=False, trace=False) @@ -96,8 +93,8 @@ def configure_step(self): def build_step(self): """If Go package is not native go module, lets try to make the module.""" - go_mod_file = os.path.join('./', 'go.mod') - go_sum_file = os.path.join('./', 'go.sum') + go_mod_file = 'go.mod' + go_sum_file = 'go.sum' if not os.path.exists(go_mod_file) or not os.path.isfile(go_mod_file): self.log.warn("go.mod not found! This is not natively supported go module. Trying to init module.") @@ -108,43 +105,46 @@ def build_step(self): # for more information about migrating to go modules # see: https://blog.golang.org/migrating-to-go-modules + # go mod init - cmd = ' '.join([self.go_cmd, 'mod init', self.cfg['modulename']]) + cmd = ' '.join([self.go_cmd, 'mod', 'init', self.cfg['modulename']]) run_cmd(cmd, log_all=True, simple=True) if self.cfg['forced_deps']: for dep in self.cfg['forced_deps']: # go get specific dependencies which locks them in go.mod - cmd = ' '.join([self.go_cmd, 'get %s@%s' % dep]) + cmd = ' '.join([self.go_cmd, 'get', '%s@%s' % dep]) run_cmd(cmd, log_all=True, simple=True) + # note: ... (tripledot) used below is not a typo, but go wildcard pattern + # which means: anything you can find in this directory, including all subdirectories + # see: 'go help packages' or https://golang.org/pkg/cmd/go/internal/help/ + # see: https://stackoverflow.com/a/28031651/2047157 + # go build ./... - cmd = ' '.join([self.go_cmd, 'build ./...']) + cmd = ' '.join([self.go_cmd, 'build', './...']) run_cmd(cmd, log_all=True, simple=True) # go test ./... - cmd = ' '.join([self.go_cmd, 'test ./...']) + cmd = ' '.join([self.go_cmd, 'test', './...']) run_cmd(cmd, log_all=True, simple=True) # go mod tidy - cmd = ' '.join([self.go_cmd, 'mod tidy']) + cmd = ' '.join([self.go_cmd, 'mod', 'tidy']) run_cmd(cmd, log_all=True, simple=True) # go build ./... again - cmd = ' '.join([self.go_cmd, 'build ./...']) + cmd = ' '.join([self.go_cmd, 'build', './...']) run_cmd(cmd, log_all=True, simple=True) # go test ./... again - cmd = ' '.join([self.go_cmd, 'test ./...']) + cmd = ' '.join([self.go_cmd, 'test', './...']) run_cmd(cmd, log_all=True, simple=True) self.log.warn('Include generated go.mod and go.sum via patch to ensure locked dependencies ' 'and run this easyconfig again.') - cmd = 'cat go.mod' - run_cmd(cmd, log_all=True, simple=True) - - cmd = 'cat go.sum' - run_cmd(cmd, log_all=True, simple=True) + run_cmd('cat go.mod', log_all=True, simple=True) + run_cmd('cat go.sum', log_all=True, simple=True) if not os.path.exists(go_sum_file) or not os.path.isfile(go_sum_file): raise EasyBuildError("go.sum not found! This module has no locked dependency versions.") @@ -153,8 +153,12 @@ def install_step(self): """Install Go package to a custom path""" # actually install Go package - cmd = ' '.join( - [self.cfg['preinstallopts'], self.go_cmd, 'install', self.cfg['installopts']]) + cmd = ' '.join([ + self.cfg['preinstallopts'], + self.go_cmd, + 'install', + self.cfg['installopts'], + ]) run_cmd(cmd, log_all=True, log_ok=True, simple=True) def sanity_check_step(self): From 00f11713d1c8d772097ac81b20cbd4d3be84fc6b Mon Sep 17 00:00:00 2001 From: darkless Date: Fri, 24 Apr 2020 14:30:28 +0200 Subject: [PATCH 3/9] removed whitespace --- easybuild/easyblocks/generic/gopackage.py | 1 - 1 file changed, 1 deletion(-) diff --git a/easybuild/easyblocks/generic/gopackage.py b/easybuild/easyblocks/generic/gopackage.py index df156858a4..5258b9ac39 100644 --- a/easybuild/easyblocks/generic/gopackage.py +++ b/easybuild/easyblocks/generic/gopackage.py @@ -105,7 +105,6 @@ def build_step(self): # for more information about migrating to go modules # see: https://blog.golang.org/migrating-to-go-modules - # go mod init cmd = ' '.join([self.go_cmd, 'mod', 'init', self.cfg['modulename']]) run_cmd(cmd, log_all=True, simple=True) From f8ddfb068064ff38c9290fa16b49d793ad136d80 Mon Sep 17 00:00:00 2001 From: darkless Date: Fri, 24 Apr 2020 16:30:29 +0200 Subject: [PATCH 4/9] simplified GoPackage prepare step --- easybuild/easyblocks/generic/gopackage.py | 14 ++------------ test/easyblocks/module.py | 5 +++++ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/easybuild/easyblocks/generic/gopackage.py b/easybuild/easyblocks/generic/gopackage.py index 5258b9ac39..69435fa30a 100644 --- a/easybuild/easyblocks/generic/gopackage.py +++ b/easybuild/easyblocks/generic/gopackage.py @@ -62,20 +62,10 @@ def prepare_step(self, **kwargs): """Go-specific preparations.""" super(GoPackage, self).prepare_step(**kwargs) - go = None - go_root = get_software_root('Go') - if go_root: - bin_go = os.path.join(go_root, 'bin', 'go') - if os.path.exists(bin_go) and os.path.samefile(which('go'), bin_go): - # if Go is listed as a (build) dependency, use 'go' command provided that way - self.go_cmd = bin_go - self.log.debug("Retaining 'go' command for Go dependency: %s", go) - - if self.go_cmd is None: + if get_software_root('Go') is None: raise EasyBuildError("Failed to pick go command to use. Is it listed in dependencies?") - go_version = get_software_version('Go') - if LooseVersion(go_version) < LooseVersion("1.11"): + if LooseVersion(get_software_version('Go')) < LooseVersion("1.11"): raise EasyBuildError("Go version < 1.11 doesn't support installing modules from go.mod") def configure_step(self): diff --git a/test/easyblocks/module.py b/test/easyblocks/module.py index 52e1a351d1..564dc8f61d 100644 --- a/test/easyblocks/module.py +++ b/test/easyblocks/module.py @@ -41,6 +41,7 @@ import easybuild.tools.toolchain.utilities as tc_utils from easybuild.base import fancylogger from easybuild.base.testing import TestCase +from easybuild.easyblocks.generic.gopackage import GoPackage from easybuild.easyblocks.generic.intelbase import IntelBase from easybuild.easyblocks.generic.pythonbundle import PythonBundle from easybuild.easyblocks.imod import EB_IMOD @@ -234,6 +235,10 @@ def template_module_only_test(self, easyblock, name='foo', version='1.3.2', extr # $EBROOTPYTHON must be set for PythonBundle easyblock os.environ['EBROOTPYTHON'] = '/fake/install/prefix/Python/2.7.14-foss-2018a' + elif app_class == GoPackage: + # $EBROOTGO must be set for GoPackage easyblock + os.environ['EBROOTGO'] = '/fake/install/prefix/Go/1.14' + elif app_class == EB_OpenFOAM: # proper toolchain must be used for OpenFOAM(-Extend), to determine value to set for $WM_COMPILER write_file(os.path.join(tmpdir, 'GCC', '4.9.3-2.25'), '\n'.join([ From bfe61bf155e1c280b1ed59b2f0ad10c272bcbd0a Mon Sep 17 00:00:00 2001 From: darkless Date: Fri, 24 Apr 2020 16:49:25 +0200 Subject: [PATCH 5/9] fixed GoPackage executable --- easybuild/easyblocks/generic/gopackage.py | 40 ++++++++--------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/easybuild/easyblocks/generic/gopackage.py b/easybuild/easyblocks/generic/gopackage.py index 69435fa30a..45d3798c48 100644 --- a/easybuild/easyblocks/generic/gopackage.py +++ b/easybuild/easyblocks/generic/gopackage.py @@ -53,11 +53,6 @@ def extra_options(extra_vars=None): }) return extra_vars - def __init__(self, *args, **kwargs): - """Initialize custom class variables.""" - super(GoPackage, self).__init__(*args, **kwargs) - self.go_cmd = None - def prepare_step(self, **kwargs): """Go-specific preparations.""" super(GoPackage, self).prepare_step(**kwargs) @@ -77,8 +72,8 @@ def configure_step(self): env.setvar('GOBIN', os.path.join(self.installdir, 'bin'), verbose=False) # creates log entries for go being used, for debugging - run_cmd("%s version" % self.go_cmd, verbose=False, trace=False) - run_cmd("%s env" % self.go_cmd, verbose=False, trace=False) + run_cmd("go version", verbose=False, trace=False) + run_cmd("go env", verbose=False, trace=False) def build_step(self): """If Go package is not native go module, lets try to make the module.""" @@ -96,13 +91,13 @@ def build_step(self): # see: https://blog.golang.org/migrating-to-go-modules # go mod init - cmd = ' '.join([self.go_cmd, 'mod', 'init', self.cfg['modulename']]) + cmd = ' '.join(['go', 'mod', 'init', self.cfg['modulename']]) run_cmd(cmd, log_all=True, simple=True) if self.cfg['forced_deps']: for dep in self.cfg['forced_deps']: # go get specific dependencies which locks them in go.mod - cmd = ' '.join([self.go_cmd, 'get', '%s@%s' % dep]) + cmd = ' '.join(['go', 'get', '%s@%s' % dep]) run_cmd(cmd, log_all=True, simple=True) # note: ... (tripledot) used below is not a typo, but go wildcard pattern @@ -110,25 +105,16 @@ def build_step(self): # see: 'go help packages' or https://golang.org/pkg/cmd/go/internal/help/ # see: https://stackoverflow.com/a/28031651/2047157 - # go build ./... - cmd = ' '.join([self.go_cmd, 'build', './...']) - run_cmd(cmd, log_all=True, simple=True) - - # go test ./... - cmd = ' '.join([self.go_cmd, 'test', './...']) - run_cmd(cmd, log_all=True, simple=True) - - # go mod tidy - cmd = ' '.join([self.go_cmd, 'mod', 'tidy']) - run_cmd(cmd, log_all=True, simple=True) + # building and testing will add packages to go.mod + run_cmd('go build ./...', log_all=True, simple=True) + run_cmd('go test ./...', log_all=True, simple=True) - # go build ./... again - cmd = ' '.join([self.go_cmd, 'build', './...']) - run_cmd(cmd, log_all=True, simple=True) + # tidy up go.mod + run_cmd('go mod tidy', log_all=True, simple=True) - # go test ./... again - cmd = ' '.join([self.go_cmd, 'test', './...']) - run_cmd(cmd, log_all=True, simple=True) + # build and test again, to ensure go mod tidy didn't removed anything needed + run_cmd('go build ./...', log_all=True, simple=True) + run_cmd('go test ./...', log_all=True, simple=True) self.log.warn('Include generated go.mod and go.sum via patch to ensure locked dependencies ' 'and run this easyconfig again.') @@ -144,7 +130,7 @@ def install_step(self): # actually install Go package cmd = ' '.join([ self.cfg['preinstallopts'], - self.go_cmd, + 'go', 'install', self.cfg['installopts'], ]) From d9647e33a5fa49fbb4f796766aa3fb96250f188b Mon Sep 17 00:00:00 2001 From: darkless Date: Fri, 24 Apr 2020 16:52:06 +0200 Subject: [PATCH 6/9] removed unused imports --- easybuild/easyblocks/generic/gopackage.py | 1 - 1 file changed, 1 deletion(-) diff --git a/easybuild/easyblocks/generic/gopackage.py b/easybuild/easyblocks/generic/gopackage.py index 45d3798c48..f2b7d41418 100644 --- a/easybuild/easyblocks/generic/gopackage.py +++ b/easybuild/easyblocks/generic/gopackage.py @@ -34,7 +34,6 @@ from easybuild.framework.easyblock import EasyBlock from easybuild.framework.easyconfig import CUSTOM from easybuild.tools.build_log import EasyBuildError -from easybuild.tools.filetools import which from easybuild.tools.modules import get_software_root, get_software_version from easybuild.tools.run import run_cmd From df1650f1a3710823256c4b878038f5e6d05cd483 Mon Sep 17 00:00:00 2001 From: darkless Date: Fri, 24 Apr 2020 20:37:12 +0200 Subject: [PATCH 7/9] added EBVERSIONGO to test --- test/easyblocks/module.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/easyblocks/module.py b/test/easyblocks/module.py index 564dc8f61d..b3a955a021 100644 --- a/test/easyblocks/module.py +++ b/test/easyblocks/module.py @@ -238,6 +238,7 @@ def template_module_only_test(self, easyblock, name='foo', version='1.3.2', extr elif app_class == GoPackage: # $EBROOTGO must be set for GoPackage easyblock os.environ['EBROOTGO'] = '/fake/install/prefix/Go/1.14' + os.environ['EBVERSIONGO'] = '1.14' elif app_class == EB_OpenFOAM: # proper toolchain must be used for OpenFOAM(-Extend), to determine value to set for $WM_COMPILER From 29b277454368f6ffe716dec6187a98f3cde4f45b Mon Sep 17 00:00:00 2001 From: darkless Date: Fri, 24 Apr 2020 20:54:32 +0200 Subject: [PATCH 8/9] correct prepare_step args --- easybuild/easyblocks/generic/gopackage.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/easybuild/easyblocks/generic/gopackage.py b/easybuild/easyblocks/generic/gopackage.py index f2b7d41418..1f5ad0fb1d 100644 --- a/easybuild/easyblocks/generic/gopackage.py +++ b/easybuild/easyblocks/generic/gopackage.py @@ -52,9 +52,9 @@ def extra_options(extra_vars=None): }) return extra_vars - def prepare_step(self, **kwargs): + def prepare_step(self, *args, **kwargs): """Go-specific preparations.""" - super(GoPackage, self).prepare_step(**kwargs) + super(GoPackage, self).prepare_step(*args, **kwargs) if get_software_root('Go') is None: raise EasyBuildError("Failed to pick go command to use. Is it listed in dependencies?") From e728aaee9cc957715ce91595f7433f06188d6415 Mon Sep 17 00:00:00 2001 From: darkless Date: Sat, 25 Apr 2020 08:56:24 +0200 Subject: [PATCH 9/9] correct prepare_step args --- easybuild/easyblocks/generic/gopackage.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/easybuild/easyblocks/generic/gopackage.py b/easybuild/easyblocks/generic/gopackage.py index 1f5ad0fb1d..f447922f2c 100644 --- a/easybuild/easyblocks/generic/gopackage.py +++ b/easybuild/easyblocks/generic/gopackage.py @@ -138,10 +138,11 @@ def install_step(self): def sanity_check_step(self): """Custom sanity check for Go package.""" - # Go Package should produce something into bin directory + # Check if GoPackage produced binary and can run help on it custom_paths = { - 'files': [], - 'dirs': ['bin'], + 'files': ['bin/%s' % self.name.lower()], + 'dirs': [], } + custom_commands = ['%s --help' % self.name.lower()] - super(GoPackage, self).sanity_check_step(custom_paths=custom_paths) + super(GoPackage, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands)