fix(nix): use gomod2nix and build scard#1212
Conversation
floatpanebot
left a comment
There was a problem hiding this comment.
Hi @endoze! Please fix the following issues with your PR:
- Title: Is too long (64 characters). The PR title must be strictly under 40 characters.
- Body: Missing the
## What?or## Why?headings required by the PR template.
floatpanebot
left a comment
There was a problem hiding this comment.
Hi @endoze! Please fix the following issues with your PR:
- Title: Is too long (64 characters). The PR title must be strictly under 40 characters.
- Body: Missing the
## What?or## Why?headings required by the PR template.
floatpanebot
left a comment
There was a problem hiding this comment.
Hi @endoze! Please fix the following issues with your PR:
- Body: Missing the
## What?or## Why?headings required by the PR template.
floatpanebot
left a comment
There was a problem hiding this comment.
Hi @endoze! Please fix the following issues with your PR:
- Body: Missing the
## What?or## Why?headings required by the PR template.
Formatting issues have been resolved. Thank you!
92c5b18 to
d7ef388
Compare
|
Hey, @endoze , didn't know about the problem, will check out the fix later. p.s. drop the last commit removing snapcraft validation, it started failing yesterday, probably an issue with snapcraft's servers |
2f16bba to
d7ef388
Compare
|
@endoze we need some sort of an automatic workflow for the gomod2nix. There is no way anyone will actually update it manually. Please, use the same workflow, as in |
|
@andrinoff I've added a workflow to open a pull request when |
|
@endoze just got home, doesn't work on my machine (Arch Linux, I do not use nix, so I do not know what the problem is. I'll try to look for a fix though. |
|
@andrinoff Happy to help debug. I'll run it on my linux machine as well to verify it works as I was expecting. I think it might be the include paths for scard. Did you get a stack trace from nix when you tried building via nix? |
|
there is like a log: Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/czr6admaaam4zz29fwf2r0ca7b06z1ay-6h3fk6riq8qg4g17rav22d11g6781sfq-source
source root is 6h3fk6riq8qg4g17rav22d11g6781sfq-source
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "patchPhase" }
Executing goConfigHook
Setting up vendor directory from /nix/store/52i6v8i7pp7ca6hkxiwbqqh3vkrdw9h5-vendor-env
Restoring Go build cache from /nix/store/fwaa38xd6pipvns3dgz7qdc86jz7w1ki-go-cache-env/cache.tar.zst
Finished goConfigHook
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: configurePhase
@nix { "action": "setPhase", "phase": "configurePhase" }
no configure script, doing nothing
Running phase: buildPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
Executing goBuildHook
Building subPackage .
internal/goarch
internal/abi
internal/unsafeheader
internal/cpu
internal/bytealg
internal/byteorder
internal/chacha8rand
internal/coverage/rtcov
internal/godebugs
internal/goexperiment
internal/goos
internal/profilerecord
internal/runtime/atomic
internal/runtime/syscall/linux
math/bits
internal/strconv
internal/runtime/cgroup
internal/runtime/exithook
internal/runtime/gc
internal/runtime/sys
internal/runtime/gc/scan
internal/asan
internal/msan
internal/race
internal/runtime/math
internal/runtime/maps
internal/runtime/pprof/label
internal/stringslite
internal/trace/tracev2
runtime
internal/reflectlite
errors
sync/atomic
internal/sync
internal/synctest
sync
io
iter
unicode
unicode/utf8
bytes
cmp
....(truncated) just lists all dependencies 🤷♂ |
|
error itself: error: Cannot build '/nix/store/xd5nlinn04f6bqlkd3f5f5ihd51ic75i-matcha-dev.drv'.
Reason: builder failed with exit code 1.
Output paths:
/nix/store/y7pv1am4lx3pkwsi1zs9b52x9086s5m9-matcha-dev
Last 25 log lines:
> github.com/yuin/gopher-lua/parse
> github.com/yuin/gopher-lua/pm
> github.com/yuin/gopher-lua
> github.com/floatpane/matcha/plugin
> charm.land/lipgloss/v2
> github.com/floatpane/matcha/theme
> charm.land/bubbles/v2/key
> charm.land/bubbles/v2/help
> charm.land/bubbles/v2/paginator
> charm.land/bubbles/v2/spinner
> charm.land/bubbles/v2/cursor
> charm.land/bubbles/v2/internal/runeutil
> github.com/atotto/clipboard
> charm.land/bubbles/v2/textinput
> github.com/sahilm/fuzzy
> charm.land/bubbles/v2/list
> charm.land/bubbles/v2/internal/memoization
> charm.land/bubbles/v2/viewport
> charm.land/bubbles/v2/textarea
> github.com/floatpane/matcha/plugins
> github.com/hashicorp/golang-lru/v2/internal
> github.com/hashicorp/golang-lru/v2/simplelru
> github.com/hashicorp/golang-lru/v2
> github.com/floatpane/matcha/view
> github.com/floatpane/matcha/tui
For full logs, run:
nix log /nix/store/xd5nlinn04f6bqlkd3f5f5ihd51ic75i-matcha-dev.drv |
|
i run |
|
@andrinoff Nix is a complicated beast 😄 . Depending on how you installed/configured it on your machine, those flags would be necessary for a flake based build. Though I've recreated the issue locally on my own linux machine. I'll push up a fix shortly. |
buildGoModule with CGO_ENABLED=0 prevented the scard smart card package from linking against platform libraries. Switch to gomod2nix's buildGoApplication so CGO works and add the required platform-specific dependencies (apple-sdk on macOS, pcsclite on Linux). Add a CI job to keep gomod2nix.toml in sync.
The gomod2nix CI check required contributors to have a working Nix environment to regenerate gomod2nix.toml before their PR could pass. This created unnecessary friction for Go dependency updates since most contributors don't need Nix tooling. Replace the blocking check with a post-merge workflow that automatically opens a PR to sync gomod2nix.toml whenever go.mod or go.sum change on master, keeping the Nix build in sync without burdening contributors.
5c11028 to
fce4152
Compare
|
I rewrote my commits so you'll need to make sure you pull down the latest, but this should now build correctly on linux. The issue was missing |
weird, seems to still not work... i will try it tomorrow, its 1 am. ttys |
|
i'll trust you on this one |
|
/approve |
floatpanebot
left a comment
There was a problem hiding this comment.
Approved on behalf of @andrinoff via /approve command.
What?
Switch from buildGoModule to gomod2nix's buildGoApplication so CGO works, and add platform-specific dependencies (apple-sdk on macOS, pcsclite on Linux). Add a CI job to keep gomod2nix.toml in sync.
Why?
buildGoModule with CGO_ENABLED=0 prevented the scard smart card package from linking against platform libraries.
Closes #1211