Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Help with GOPATH #11085

Closed
vsoch opened this issue Apr 2, 2019 · 3 comments
Closed

Help with GOPATH #11085

vsoch opened this issue Apr 2, 2019 · 3 comments

Comments

@vsoch
Copy link
Member

vsoch commented Apr 2, 2019

Hey spack!

I have a recipe for updated Singularity almost working, and I don't understand what the (package provided) go is doing / setup enough to know how to interact with it. I'm trying to install dependencies first for singularity, but it always fails when I run make because it can't find a module on the GOPATH. I thought the GOPATH would be kept internal to the spack go install, but I don't see any src/github.com/ folders there, so I'm sort of confused. Here is what I have so far:

    def configure(self, spec, prefix):

        # Update the GOPATH, packages will be installed (and found) here
        env = os.environ
        env['GOPATH'] = self.stage.source_path + ':' + env['GOPATH']

        # Version 3.0 and up, build configure with mconfig
        version = str(self.version)
        if version.startswith('3') or version == 'develop':
            go('get', 'github.com/golang/dep/cmd/dep', env=env)
            configure = Executable('./mconfig -V %s --prefix=%s' % (version, prefix))
        configure()

    @when('@develop')
    def build(self, spec, prefix):

        env = os.environ
        env['GOPATH'] = self.stage.source_path + ':' + env['GOPATH']

        #install_tree('bin', prefix.bin)
        with working_dir('builddir'):
            make()

        #builddir = os.path.join(self.build_directory, 'builddir')
        os.chdir(builddir)
        #make('-C %s' % builddir, parallel=False) 
        make()

    def install(self, spec, prefix):
        builddir = os.path.join(self.build_directory, 'builddir')
        make('install', parallel=False)    

And the first error (of many) always looks like this:

==> Executing phase: 'build'
==> Error: ProcessError: Command exited with status 2:
    'make' '-j4'

15 errors found in build log:
     92        $ cd /tmp/vanessa/spack-stage/spack-stage-pyga95f8/singularity/builddir
     93        $ make
     94     ==> Executing phase: 'build'
     95     ==> [2019-04-02-14:05:55.300861] 'make' '-j4'
     96      GO clean -cache
     97      CNI PLUGIN bandwidth
  >> 98     can't load package: package github.com/sylabs/singularity/vendor/github.com/containernetworking/plugins/plugins/meta/bandwidth: cannot find package "github.com/syl
            abs/singularity/vendor/github.com/containernetworking/plugins/plugins/meta/bandwidth" in any of:
     99     	/home/vanessa/Documents/Dropbox/Code/Python/spack/opt/spack/linux-ubuntu16.04-x86_64/gcc-5.4.0/go-1.11.5-73pcics3bti7rafvlgjzmcgtaeogebxg/src/github.com/sylabs/si
            ngularity/vendor/github.com/containernetworking/plugins/plugins/meta/bandwidth (from $GOROOT)
     100    	/home/vanessa/Documents/Dropbox/Code/Python/spack/var/spack/stage/singularity-develop-a6ao2vpujcqc2xzb2euvmci3mfta75uj/singularity/src/github.com/sylabs/singulari
            ty/vendor/github.com/containernetworking/plugins/plugins/meta/bandwidth (from $GOPATH)
     101    	/home/vanessa/Documents/Dropbox/Code/Python/spack/var/spack/stage/singularity-develop-a6ao2vpujcqc2xzb2euvmci3mfta75uj/singularity/src/github.com/sylabs/singulari
            ty/vendor/github.com/containernetworking/plugins/plugins/meta/bandwidth
     102     CNI PLUGIN bridge

Thanks!

@vsoch
Copy link
Member Author

vsoch commented Apr 2, 2019

Whew, okay, I think I got something working. I can open a PR to discuss challenges and changes.

@vsoch vsoch closed this as completed Apr 2, 2019
@hartzell
Copy link
Contributor

hartzell commented Apr 2, 2019

I'll look forward to the PR. Reading this issue, I was curious whether you were running into problems with the changes that Go modules have introduced (in particular w.r.t. vendoring), and their status in various recent versions of Go (experimental, opt-in, default)

@vsoch
Copy link
Member Author

vsoch commented Apr 2, 2019

See #11094. Right - I think these were some of the issues! At least I think the vendor change, I'm not sure about the opt-in / default versions. There are different kinds of versions now? This sure is getting messy. 💥

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants