Subject: Fwd: Help with packaging go-github-com-charmbracelet-x-exp-teatest on Guix?

From: Sharlatan Hellseher <[email-masked]>
Date: Fri, 7 Mar 2025 20:42:08 +0000

---------- Forwarded message ---------
From: Sharlatan Hellseher <[email-masked]>
Date: Fri, 7 Mar 2025 at 20:36
Subject: Re: Help with packaging
go-github-com-charmbracelet-x-exp-teatest on Guix?
To: <[email-masked]>, <[email-masked]>

Hi Ashvith,

The issue you experience is due to fact that Golang projects started
practiced Workspaces or monorepor e.g. source code for verity of
modules distributed from the single repository but tagged individually.
It make live for go-build-system harder as it symlinks inputs from the
store by the #:import-path and if any path is intersecting it rise
"Permission Denied" issue.

Do you really need this package (that is a working variant)? It stands as
a testing library for already packaged go-github-com-charmbracelet-bubbletea :

--8<---------------cut here---------------start------------->8---
(define-public go-github-com-charmbracelet-x-exp-teatest
  ;; No version tag, use commit from Golang pseudo version:
  ;; 0.0.0-20250303111204-ce812b082f54
  (let ((commit "ce812b082f548a1a39b1a2bab82d931514ee89d8")
        (revision "0"))
    (package
      (name "go-github-com-charmbracelet-x-exp-teatest")
      (version (git-version "0.0.0" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/charmbracelet/x")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "0l748wpw689k79hnwh905hslqdg31nlh80xabs72b3yjqvxxpr1x"))
         (modules '((guix build utils)))
         (snippet
          #~(begin
              ;; Submodules with their own go.mod files and packed as separated
              ;; packages:
              ;;
              ;; - github.com/charmbracelet/x/ansi
              ;; - github.com/charmbracelet/x/cellbuf
              ;; - github.com/charmbracelet/x/colors
              ;; - github.com/charmbracelet/x/conpty
              ;; - github.com/charmbracelet/x/editor
              ;; - github.com/charmbracelet/x/errors
              ;; - github.com/charmbracelet/x/examples
              ;; - github.com/charmbracelet/x/exp/golden
              ;; - github.com/charmbracelet/x/exp/higherorder
              ;; - github.com/charmbracelet/x/exp/maps
              ;; - github.com/charmbracelet/x/exp/open
              ;; - github.com/charmbracelet/x/exp/ordered
              ;; - github.com/charmbracelet/x/exp/slice
              ;; - github.com/charmbracelet/x/exp/strings
              ;; - github.com/charmbracelet/x/exp/teatest/v2
              ;; - github.com/charmbracelet/x/input
              ;; - github.com/charmbracelet/x/json
              ;; - github.com/charmbracelet/x/sshkey
              ;; - github.com/charmbracelet/x/term
              ;; - github.com/charmbracelet/x/termios
              ;; - github.com/charmbracelet/x/vt
              ;; - github.com/charmbracelet/x/wcwidth
              ;; - github.com/charmbracelet/x/windows
              ;; - github.com/charmbracelet/x/xpty
              (for-each delete-file-recursively
                        (list "ansi"
                              "cellbuf"
                              "colors"
                              "conpty"
                              "editor"
                              "errors"
                              "examples"
                              "exp/golden"
                              "exp/higherorder"
                              "exp/maps"
                              "exp/open"
                              "exp/ordered"
                              "exp/slice"
                              "exp/strings"
                              "exp/teatest/v2"
                              "input"
                              "json"
                              "sshkey"
                              "term"
                              "termios"
                              "vt"
                              "wcwidth"
                              "windows"
                              "xpty"))))))
      (build-system go-build-system)
      (arguments
       (list
        #:import-path "github.com/charmbracelet/x/exp/teatest"
        #:unpack-path "github.com/charmbracelet/x"
        #:test-flags
        ;; XXX: Two tests with not matching escape character, check
with upstream.
        #~(list "-skip" "TestApp|TestAppSendToOtherProgram")))
      (propagated-inputs
       (list go-github-com-charmbracelet-bubbletea
             go-github-com-charmbracelet-x-exp-golden))
      (home-page "https://github.com/charmbracelet/x")
      (synopsis "Golang library for testing Bubble Tea programs")
      (description
       "Package teatest provides helper functions to test
@code{https://github.com/charmbracelet/bubbletea, Bubble Tea}'s
@code{tea.Model}.")
      (license license:expat))))
--8<---------------cut here---------------end--------------->8---

Let me know if you might need more help and take a look at go-team branch
which is in a queue to master it contains 100+ new packages and some updates.

---
Oleg

-- 
VCS: https://github.incerto.xyz/; https://git.sr.ht/~hellseher/
GPG: 9847 81DE 689C 21C2 6418 0867 76D7 27BF F62C D2B5

… наш разум - превосходная объяснительная машина которая способна
найти смысл почти в чем угодно, истолковать любой феномен, но
совершенно не в состоянии принять мысль о непредсказуемости.