all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Packaging Proton Bridge: cryptic compilation failure
@ 2024-11-30 16:26 Marek Paśnikowski
  2024-11-30 17:29 ` Ian Eure
  2024-11-30 18:08 ` Cayetano Santos
  0 siblings, 2 replies; 5+ messages in thread
From: Marek Paśnikowski @ 2024-11-30 16:26 UTC (permalink / raw)
  To: Guix Help

[-- Attachment #1: Type: text/plain, Size: 2281 bytes --]

Hello Guix

I am towards the end of a first pass of packaging the Proton Bridge program to 
access my Proton Mail with KMail.

I have worked through and learned about many peculiarities of Golang build 
system.  As long as I had an error message, I was able to at least work around 
problems.  However, the latest build failure is completely cryptic to me, as 
its log contains zero error messages.  It works fine until I get a "build 
failed" summary:

[...]
/gnu/store/kw4dwavpd5638kxaxnyhchzbip2ihr7q-go-1.21.5/lib/go/pkg/tool/
linux_amd64/compile -o ./go-build882385907/b247/_pkg_.a -trimpath "/tmp/guix-
build-go-github-com-protonmail-go-proton-api-0.4.0.drv-0/src/golang.org/x/
text/encoding/ianaindex=>golang.org/x/text/encoding/ianaindex;$WORK/b247=>" -p 
golang.org/x/text/encoding/ianaindex -complete -buildid oeeEgL1OtT44tPEiSSgm/
oeeEgL1OtT44tPEiSSgm -goversion go1.21.5 -nolocalimports -importcfg ./go-
build882385907/b247/importcfg -pack ./src/golang.org/x/text/encoding/
ianaindex/ascii.go ./src/golang.org/x/text/encoding/ianaindex/ianaindex.go ./
src/golang.org/x/text/encoding/ianaindex/tables.go
/gnu/store/kw4dwavpd5638kxaxnyhchzbip2ihr7q-go-1.21.5/lib/go/pkg/tool/
linux_amd64/buildid -w $WORK/b247/_pkg_.a # internal
cp $WORK/b247/_pkg_.a /tmp/guix-build-go-github-com-protonmail-go-proton-
api-0.4.0.drv-0/go-build/
59/59c52b9f8132289a5cc9772aa1edea166f986e6eb6d79cd07cbaac8bcbf28c75-d # 
internal
Building 'github.com/ProtonMail/go-proton-api' failed.
[...]

The above is the result of this command:
$ guix build -v 3 -L ~/repositories/sovereign/ proton-bridge --cores=1

I have zero knowledge the Go language itself, which could explain why I have 
trouble understanding this failure.

I would very much appreciate any help from the resident Go packagers, as I am 
unable to make any further progress, and I desire to finally ditch the 
Proton’s web interface.

The entire package code is on my personal channel, in "proton-bridge" branch.  
There is one external dependency on the Efraim’s DFSG channel.

CGIT interface:
https://git.marekpasnikowski.pl/sovereign.git/tree/?h=proton-bridge

GIT clone URL:
https://git.marekpasnikowski.pl/sovereign.git

DFSG channel:
https://git.sr.ht/~efraim/my-guix

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Packaging Proton Bridge: cryptic compilation failure
  2024-11-30 16:26 Packaging Proton Bridge: cryptic compilation failure Marek Paśnikowski
@ 2024-11-30 17:29 ` Ian Eure
  2024-11-30 18:08 ` Cayetano Santos
  1 sibling, 0 replies; 5+ messages in thread
From: Ian Eure @ 2024-11-30 17:29 UTC (permalink / raw)
  To: help-guix

Hi Marek,

On Sat, Nov 30, 2024, at 4:26 PM, Marek Paśnikowski wrote:
> Hello Guix
>
> I am towards the end of a first pass of packaging the Proton Bridge program to 
> access my Proton Mail with KMail.
>
> I have worked through and learned about many peculiarities of Golang build 
> system.  As long as I had an error message, I was able to at least work around 
> problems.  However, the latest build failure is completely cryptic to me, as 
> its log contains zero error messages.  It works fine until I get a "build 
> failed" summary:
>
> [snip]
>
> The entire package code is on my personal channel, in "proton-bridge" branch.  
> There is one external dependency on the Efraim’s DFSG channel.
>

I'm not able to replicate your failure, because your channel has some other dependencies I'm missing:

	$ guix build -v 3 -KL /tmp/sovereign/ proton-bridge --cores=1
	guix build: warning: failed to load '(sovereign devices amd64)':
	no code for module (dfsg main golang)
	guix build: warning: failed to load '(sovereign packages bradenaw)':
	no code for module (dfsg main golang)
	guix build: warning: failed to load '(sovereign systems aisaka)':
	no code for module (suweren commons sudoers)
	guix build: warning: failed to load '(sovereign systems akashi)':
	no code for module (machines thinkpad-x200)
	guix build: warning: failed to load '(sovereign systems ayase)':
	no code for module (suweren commons sudoers)
	guix build: warning: failed to load '(sovereign systems mcdowell)':
	no code for module (users id1000)
	guix build: error: proton-bridge: unknown package
	$ 

The Guix manual has a Debugging Build Failures[1] section, which has some good general advice for these kinds of problems.  I also suggest opening the build log file (its path should be printed near the end of the build's stdout) and reading through there -- the build-system output makes things noisier in a way that can sometimes make it hard to see the true cause of the failure.  For whatever reason, it's usually easier for me to spot the problem when I'm paging through the log file, rather than looking at the same output on the terminal.

  -- Ian

[1]: https://guix.gnu.org/manual/devel/en/html_node/Debugging-Build-Failures.html


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Packaging Proton Bridge: cryptic compilation failure
  2024-11-30 16:26 Packaging Proton Bridge: cryptic compilation failure Marek Paśnikowski
  2024-11-30 17:29 ` Ian Eure
@ 2024-11-30 18:08 ` Cayetano Santos
  2024-11-30 18:56   ` Marek Paśnikowski
  1 sibling, 1 reply; 5+ messages in thread
From: Cayetano Santos @ 2024-11-30 18:08 UTC (permalink / raw)
  To: Marek Paśnikowski; +Cc: Guix Help


>sam. 30 nov. 2024 at 17:26, Marek Paśnikowski <marek@marekpasnikowski.pl> wrote:

> Hello Guix
>
> I am towards the end of a first pass of packaging the Proton Bridge program to
> access my Proton Mail with KMail.
>
> I have worked through and learned about many peculiarities of Golang build
> system.  As long as I had an error message, I was able to at least work around
> problems.  However, the latest build failure is completely cryptic to me, as
> its log contains zero error messages.  It works fine until I get a "build
> failed" summary:

The debug for dummies manual advices using the "--keep-failed" flag when
you build packages. Using a shell container helps to understand this kind
of cryptic messages too.

--
Cayetano Santos


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Packaging Proton Bridge: cryptic compilation failure
  2024-11-30 18:08 ` Cayetano Santos
@ 2024-11-30 18:56   ` Marek Paśnikowski
  2024-11-30 19:22     ` Ian Eure
  0 siblings, 1 reply; 5+ messages in thread
From: Marek Paśnikowski @ 2024-11-30 18:56 UTC (permalink / raw)
  To: Guix Help; +Cc: Cayetano Santos, Ian Eure

[-- Attachment #1: Type: text/plain, Size: 2615 bytes --]

On sobota, 30 listopada 2024 19:08:49 CET Cayetano Santos wrote:
> >sam. 30 nov. 2024 at 17:26, Marek Paśnikowski <marek@marekpasnikowski.pl> 
wrote:
> > Hello Guix
> > 
> > I am towards the end of a first pass of packaging the Proton Bridge
> > program to access my Proton Mail with KMail.
> > 
> > I have worked through and learned about many peculiarities of Golang build
> > system.  As long as I had an error message, I was able to at least work
> > around problems.  However, the latest build failure is completely cryptic
> > to me, as its log contains zero error messages.  It works fine until I
> > get a "build
> > failed" summary:
> The debug for dummies manual advices using the "--keep-failed" flag when
> you build packages. Using a shell container helps to understand this kind
> of cryptic messages too.
> 
> --
> Cayetano Santos


Thank you Ian, Cayetano for swiftly reminding me to Read The Manual.  I was so 
tired with constant tweaking of package after package, that I forgot to go to 
the basics.

I learned that I can source variables to emulate the build environment, in 
which I issued the same command that go build system uses to build the 
package.  Here is the result, much cleaner with the interesting stuff right at 
the end:

[...]
# github.com/ProtonMail/go-crypto/openpgp/packet
/tmp/guix-build-go-github-com-protonmail-go-proton-api-0.4.0.drv-0/src/
github.com/ProtonMail/go-crypto/openpgp/packet/packet_sequence.go:12:92: 
undefined: errors.ErrMalformedMessage
/tmp/guix-build-go-github-com-protonmail-go-proton-api-0.4.0.drv-0/src/
github.com/ProtonMail/go-crypto/openpgp/packet/packet_sequence.go:13:16: 
undefined: errors.ErrMalformedMessage
/tmp/guix-build-go-github-com-protonmail-go-proton-api-0.4.0.drv-0/src/
github.com/ProtonMail/go-crypto/openpgp/packet/packet_sequence.go:94:17: 
undefined: errors.ErrMalformedMessage
/tmp/guix-build-go-github-com-protonmail-go-proton-api-0.4.0.drv-0/src/
github.com/ProtonMail/go-crypto/openpgp/packet/config_v5.go:6:2: undefined: 
V5Disabled
/tmp/guix-build-go-github-com-protonmail-go-proton-api-0.4.0.drv-0/src/
github.com/ProtonMail/go-crypto/openpgp/packet/marker.go:27:33: undefined: 
packetTypeMarker
/tmp/guix-build-go-github-com-protonmail-go-proton-api-0.4.0.drv-0/src/
github.com/ProtonMail/go-crypto/openpgp/packet/padding.go:20:33: undefined: 
packetPadding

I remember faking a Proton’s fork with the upstream package because GitHub 
failed to find it.  It could be the one, or not.  At least I have a thread to 
follow now; and a new tool for deep inspection.

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Packaging Proton Bridge: cryptic compilation failure
  2024-11-30 18:56   ` Marek Paśnikowski
@ 2024-11-30 19:22     ` Ian Eure
  0 siblings, 0 replies; 5+ messages in thread
From: Ian Eure @ 2024-11-30 19:22 UTC (permalink / raw)
  To: Marek Paśnikowski, Guix Help; +Cc: Cayetano Santos

Hi Marek,

On Sat, Nov 30, 2024, at 6:56 PM, Marek Paśnikowski wrote:
> On sobota, 30 listopada 2024 19:08:49 CET Cayetano Santos wrote:
>> >sam. 30 nov. 2024 at 17:26, Marek Paśnikowski <marek@marekpasnikowski.pl> 
> wrote:
>> > Hello Guix
>> > 
>> > I am towards the end of a first pass of packaging the Proton Bridge
>> > program to access my Proton Mail with KMail.
>> > 
>> > I have worked through and learned about many peculiarities of Golang build
>> > system.  As long as I had an error message, I was able to at least work
>> > around problems.  However, the latest build failure is completely cryptic
>> > to me, as its log contains zero error messages.  It works fine until I
>> > get a "build
>> > failed" summary:
>> The debug for dummies manual advices using the "--keep-failed" flag when
>> you build packages. Using a shell container helps to understand this kind
>> of cryptic messages too.
>> 
>> --
>> Cayetano Santos
>
>
> Thank you Ian, Cayetano for swiftly reminding me to Read The Manual.  I was so 
> tired with constant tweaking of package after package, that I forgot to go to 
> the basics.
>
> I learned that I can source variables to emulate the build environment, in 
> which I issued the same command that go build system uses to build the 
> package.  Here is the result, much cleaner with the interesting stuff right at 
> the end:
>
> [...]
> # github.com/ProtonMail/go-crypto/openpgp/packet
> /tmp/guix-build-go-github-com-protonmail-go-proton-api-0.4.0.drv-0/src/
> github.com/ProtonMail/go-crypto/openpgp/packet/packet_sequence.go:12:92: 
> undefined: errors.ErrMalformedMessage
> /tmp/guix-build-go-github-com-protonmail-go-proton-api-0.4.0.drv-0/src/
> github.com/ProtonMail/go-crypto/openpgp/packet/packet_sequence.go:13:16: 
> undefined: errors.ErrMalformedMessage
> /tmp/guix-build-go-github-com-protonmail-go-proton-api-0.4.0.drv-0/src/
> github.com/ProtonMail/go-crypto/openpgp/packet/packet_sequence.go:94:17: 
> undefined: errors.ErrMalformedMessage
> /tmp/guix-build-go-github-com-protonmail-go-proton-api-0.4.0.drv-0/src/
> github.com/ProtonMail/go-crypto/openpgp/packet/config_v5.go:6:2: undefined: 
> V5Disabled
> /tmp/guix-build-go-github-com-protonmail-go-proton-api-0.4.0.drv-0/src/
> github.com/ProtonMail/go-crypto/openpgp/packet/marker.go:27:33: undefined: 
> packetTypeMarker
> /tmp/guix-build-go-github-com-protonmail-go-proton-api-0.4.0.drv-0/src/
> github.com/ProtonMail/go-crypto/openpgp/packet/padding.go:20:33: undefined: 
> packetPadding
>
> I remember faking a Proton’s fork with the upstream package because GitHub 
> failed to find it.  It could be the one, or not.  At least I have a thread to 
> follow now; and a new tool for deep inspection.
>

It's been a while since I've worked in Go, but based on: https://github.com/ProtonMail/go-crypto/blob/main/openpgp/packet/packet_sequence.go#L9

...I suspect the go-crypto repository houses multiple Go packages, which all need to be packaged individually in Guix.  It looks like your Guix packages aren't doing that, which may explain the error you're getting.    This is just a hunch, it's been a few years since I wrote Go, and I never dealt with packaging beyond stuffing static binaries into Docker containers -- but it feels at least close to the root of the issue to me.

  -- Ian


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-11-30 19:23 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-30 16:26 Packaging Proton Bridge: cryptic compilation failure Marek Paśnikowski
2024-11-30 17:29 ` Ian Eure
2024-11-30 18:08 ` Cayetano Santos
2024-11-30 18:56   ` Marek Paśnikowski
2024-11-30 19:22     ` Ian Eure

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.