[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Attempt to build package golang-github-mvdan-sh for apptainer



Hi Andreas,

when a build-dep is missing, the "quick fix" is to embed it in the package.

For apptainer, as it uses go.mod, here's one approach:

    # create the vendor tree
    go mod vendor

    # copy the build-dep you need in debian/vendor
    mkdir -p debian/vendor
    cp -a vendor/mvdan.cc/ debian/vendor/

    # To use embedded copies from debian/vendor during build,
    # add this snippet to debian/rules:
    execute_after_dh_auto_configure:
        cp -av debian/vendor _build/src/github.com/apptainer/apptainer

    # git things
    git add debian/vendor debian/rules
    git commit -m "Vendor mvdan.cc/sh"
    git clean -dfx

That should unblock you for this build-dep. Keep doing it for other missing build deps. Then later on, after you have the view on all the missing build deps, you can start packaging it properly. Then submit to NEW, and with time, as they enter debian, replace the vendor copies with proper Debian build-deps.

Hope that helps.

Cheers,

 Arnaud


On 2/14/22 15:42, Andreas Tille wrote:
Hi,

I'm trying to package missing dependencies for apptainer[1].
Looking at the error messages in Salsa CI[2] which says:

...
/builds/hpc-team/apptainer/debian/output/source_dir/_build/src/mvdan.cc/sh/v3/interp (from $GOPATH)
../internal/pkg/util/shell/interpreter/interpreter.go:26:2: cannot find package "mvdan.cc/sh/v3/syntax" in any of:
	/usr/lib/go-1.17/src/mvdan.cc/sh/v3/syntax (from $GOROOT)
	/builds/hpc-team/apptainer/debian/output/source_dir/_build/src/mvdan.cc/sh/v3/syntax (from $GOPATH)
...

I assume I need to package golang-github-mvdan-sh[3] (please double
check whether my assumption is valid).  Unfortunately the build of this
package breaks as you can see in salsa-ci[4].  (BTW, the
debian/gitlab-ci.yaml file which is automatically created by
dh-make-golang is not really helpful to spot build time errors and thus
I replaced this.)

Any idea how to fix this build?

Kind regards

      Andreas.

[1] https://salsa.debian.org/hpc-team/apptainer
[2] https://salsa.debian.org/hpc-team/apptainer/-/jobs/2466108#2969
[3] https://salsa.debian.org/go-team/packages/golang-github-mvdan-sh
[4] https://salsa.debian.org/go-team/packages/golang-github-mvdan-sh/-/jobs/2465932

--
Arnaud Rebillout / Offensive Security / Kali Linux Developer


Reply to: