Skip to content

build failure since #360 #397

@klaernie

Description

@klaernie
          I tried to build this package with this PKGBUILD and this pr (since this pr to be precise)
pkgname=editorconfig-checker-git
_pkgname=editorconfig-checker
_commit=cf4ae1ccede331b2aa1b115f1de5257737de7eef
pkgver=next
pkgrel=1
pkgdesc='A tool to verify that your files are in harmony with your .editorconfig'
arch=(x86_64)
url="https://github.com/editorconfig-checker/$_pkgname"
license=(MIT)
depends=(glibc)
makedepends=(go)
provides=(ec)
conflicts=("$_pkgname")
source=(
        "git+${url}.git#commit=$_commit"
)
sha256sums=('SKIP')

build() {
        cd "$srcdir/$_pkgname"
        export CGO_CPPFLAGS="$CPPFLAGS"
        export CGO_CFLAGS="$CFLAGS"
        export CGO_CXXFLAGS="$CXXFLAGS"
        export CGO_LDFLAGS="$LDFLAGS"
        export GOFLAGS="-buildmode=pie -trimpath -ldflags=-linkmode=external -mod=readonly -modcacherw" # won't pass check
        # export GOFLAGS="-buildmode=pie -ldflags=-linkmode=external -mod=readonly -modcacherw" # will pass check
        go build -o "$_pkgname" ./cmd/...
}

check() {
        cd "$srcdir/$_pkgname"
        go test ./...
}

package() {
        cd "$srcdir/$_pkgname"
        install -Dm755 -t "$pkgdir/usr/bin/" "$_pkgname"
        ln -sf "$_pkgname" "$pkgdir/usr/bin/ec"
        install -Dm644 -t "$pkgdir/usr/share/licenses/$_pkgname" LICENSE
}

I got this error

==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Updating editorconfig-checker git repo...
==> Validating source files with sha256sums...
    editorconfig-checker ... Skipped
==> Extracting sources...
  -> Creating working copy of editorconfig-checker git repo...
Cloning into 'editorconfig-checker'...
done.
Switched to a new branch 'makepkg'
==> Starting build()...
==> Starting check()...
?       github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker        [no test files]
ok      github.com/editorconfig-checker/editorconfig-checker/v3/pkg/config      0.004s
ok      github.com/editorconfig-checker/editorconfig-checker/v3/pkg/encoding    0.034s
--- FAIL: TestFormatErrors (0.00s)
    error_test.go:320: mkdir github.com: permission denied
    error_test.go:323: mkdir github.com: permission denied
    error_test.go:326: mkdir github.com: permission denied
FAIL

Snapshot Summary

✕ 3 snapshots failed

FAIL    github.com/editorconfig-checker/editorconfig-checker/v3/pkg/error       0.003s
ok      github.com/editorconfig-checker/editorconfig-checker/v3/pkg/files       0.009s
ok      github.com/editorconfig-checker/editorconfig-checker/v3/pkg/logger      (cached)
ok      github.com/editorconfig-checker/editorconfig-checker/v3/pkg/utils       0.002s
ok      github.com/editorconfig-checker/editorconfig-checker/v3/pkg/validation  0.017s
ok      github.com/editorconfig-checker/editorconfig-checker/v3/pkg/validation/validators       (cached)
FAIL
==> ERROR: A failure occurred in check().
    Aborting...

If I remove -trimpath in GOFLAGS, it can build fine. Is it ok if I (or next archlinux official package) just remove this flag?

Originally posted by @xsy420 in #360 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions