[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Go build system - build from local directory fails
From: |
Marc |
Subject: |
Go build system - build from local directory fails |
Date: |
Wed, 18 Dec 2024 12:01:12 +0100 |
Hey,
I'm trying to build a go program that is located locally, and figured
I'd use to go-build-system to do so. I've created the following
(use-modules (guix gexp)
(guix packages)
(gnu packages gcc)
(gnu packages golang)
(guix build-system go)
(guix git-download)
(guix utils)
(guix download)
(guix build-system go)
(gnu packages bash))
(define (vcs-file? file stat)
"Return #t if file is a version-controlled file."
(case (stat:type stat)
((directory)
(member (basename file) '(".bzr" ".git" ".hg" ".svn" "CVS")))
((regular)
;; Git sub-modules have a '.git' file that is a regular text file.
(string=? (basename file) ".git"))
(else
#f)))
(define %script-name "my-project")
(package
(name %script-name)
(version "0.1")
(source (local-file "." %script-name
#:recursive? #t
#:select? vcs-file?))
(build-system go-build-system)
(home-page #f)
(synopsis "")
(description "")
(license #f))
Which I attempted to invoke with ~guix build -f myfile.scm~ but I get
errors. The program builds without issue otherwise, but here I get the error:
command "go" "install" "-v" "-x" "-ldflags=-s -w" "-trimpath" "" failed with
status 1
An initial suspicion is that I haven't set ‘#:import-path’ as expected
in the documentation. However, all examples I can find of this are
builds from a github repository rather than a local file, so I am not
sure what it needs to be set to.
Any clue what I could be missing?
Cheers,
--
Marc
- Go build system - build from local directory fails,
Marc <=