unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / Atom feed
* bug#25752: go incremental builds broken
@ 2017-02-16 15:05 Hank Donnay
       [not found] ` <handler.25752.B.14872575426869.ack@debbugs.gnu.org>
  2017-03-07 21:50 ` bug#25752: go incremental builds broken Ludovic Courtès
  0 siblings, 2 replies; 9+ messages in thread
From: Hank Donnay @ 2017-02-16 15:05 UTC (permalink / raw)
  To: 25752

Hello,

It seems the guix's go package is broken when the go tool is used for
incremental builds. Any attempt to use 'install' or 'build -i' results
in an attempt to write to the store. A one-liner:

    guix environment --ad-hoc go -- bash -c 'export t=$(mktemp -d); cd
$t && export GOPATH=$(pwd) GOBIN=$(pwd)/bin && go install cmd/go; cd
&& rm -rf $t'

Another command reports that (seemingly) the entire stdlib is marked as stale:

    guix environment --ad-hoc go -- bash -c 'export t=$(mktemp -d); cd
$t && export GOPATH=$(pwd) GOBIN=$(pwd)/bin && go list -f '\''{{join
.Deps "\n"}}'\'' cmd/go | xargs -n1 go list -f '\''{{if
.Stale}}{{.ImportPath}}: {{.StaleReason}}{{end}}'\''; cd && rm -rf $t'

The function for determining staleness is here (after the giant
comment explaining the reasoning):
https://golang.org/src/cmd/go/pkg.go#L1111

I don't see anything wrong with the package definition, but could be
missing something. My only hunch at this point is that something might
be modifying src/runtime/internal/sys/zversion.go, as that entire file
is included in the build ID computation.

Thanks,

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

* bug#25752: Acknowledgement (go incremental builds broken)
       [not found] ` <handler.25752.B.14872575426869.ack@debbugs.gnu.org>
@ 2017-02-24 19:50   ` Hank Donnay
  2017-02-25 15:58     ` Leo Famulari
  0 siblings, 1 reply; 9+ messages in thread
From: Hank Donnay @ 2017-02-24 19:50 UTC (permalink / raw)
  To: 25752

After talking on IRC, it seems like grafts are the problem. Adding
`--no-grafts` to the above commands has them succeed.

The GOROOT (store location, in this case) gets encoded in the
generated source by the 'dist' tool, so changing that is going to
cause issues.

Is there a way to disable grafts on a per-package basis, in the definition?

On Thu, Feb 16, 2017 at 10:06 AM, GNU bug Tracking System
<help-debbugs@gnu.org> wrote:
> Thank you for filing a new bug report with debbugs.gnu.org.
>
> This is an automatically generated reply to let you know your message
> has been received.
>
> Your message is being forwarded to the package maintainers and other
> interested parties for their attention; they will reply in due course.
>
> Your message has been sent to the package maintainer(s):
>  bug-guix@gnu.org
>
> If you wish to submit further information on this problem, please
> send it to 25752@debbugs.gnu.org.
>
> Please do not send mail to help-debbugs@gnu.org unless you wish
> to report a problem with the Bug-tracking system.
>
> --
> 25752: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25752
> GNU Bug Tracking System
> Contact help-debbugs@gnu.org with problems

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

* bug#25752: Acknowledgement (go incremental builds broken)
  2017-02-24 19:50   ` bug#25752: Acknowledgement (go incremental builds broken) Hank Donnay
@ 2017-02-25 15:58     ` Leo Famulari
  2020-12-18 20:00       ` zimoun
  0 siblings, 1 reply; 9+ messages in thread
From: Leo Famulari @ 2017-02-25 15:58 UTC (permalink / raw)
  To: Hank Donnay; +Cc: 25752

On Fri, Feb 24, 2017 at 02:50:10PM -0500, Hank Donnay wrote:
> After talking on IRC, it seems like grafts are the problem. Adding
> `--no-grafts` to the above commands has them succeed.
> 
> The GOROOT (store location, in this case) gets encoded in the
> generated source by the 'dist' tool, so changing that is going to
> cause issues.
> 
> Is there a way to disable grafts on a per-package basis, in the definition?

You can disable them on the command-line for any tool that builds
things, using the '--no-grafts' option, which is a "Common build option"
[0]. For example, `guix environment --ad-hoc go --no-grafts`.

If you do this, you should understand that the ungrafted Go package will
contain some serious security vulnerabilities, since we only use grafts
to fix vulnerabilities in core packages. [1]

We should figure out why this issue manifests when go is grafted, and
fix the root cause.

[0]
https://www.gnu.org/software/guix/manual/html_node/Common-Build-Options.html

[1]
https://www.gnu.org/software/guix/manual/html_node/Security-Updates.html

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

* bug#25752: go incremental builds broken
  2017-02-16 15:05 bug#25752: go incremental builds broken Hank Donnay
       [not found] ` <handler.25752.B.14872575426869.ack@debbugs.gnu.org>
@ 2017-03-07 21:50 ` Ludovic Courtès
  1 sibling, 0 replies; 9+ messages in thread
From: Ludovic Courtès @ 2017-03-07 21:50 UTC (permalink / raw)
  To: Hank Donnay; +Cc: 25752

Hello,

Hank Donnay <hdonnay@gmail.com> skribis:

> The function for determining staleness is here (after the giant
> comment explaining the reasoning):
> https://golang.org/src/cmd/go/pkg.go#L1111

This method relies on the build ID to, which is defined like this (info
"(ld) Options"):

  `--build-id'
  `--build-id=STYLE'
       Request the creation of a `.note.gnu.build-id' ELF note section or
       a `.buildid' COFF section.  The contents of the note are unique
       bits identifying this linked file.  STYLE can be `uuid' to use 128
       random bits, `sha1' to use a 160-bit SHA1 hash on the normative
       parts of the output contents, `md5' to use a 128-bit MD5 hash on
       the normative parts of the output contents, or `0xHEXSTRING' to
       use a chosen bit string specified as an even number of hexadecimal
       digits (`-' and `:' characters between digit pairs are ignored).
       If STYLE is omitted, `sha1' is used.

       The `md5' and `sha1' styles produces an identifier that is always
       the same in an identical output file, but will be unique among all
       nonidentical output files.  It is not intended to be compared as a
       checksum for the file's contents.  A linked file may be changed
       later by other tools, but the build ID bit string identifying the
       original linked file does not change.

       Passing `none' for STYLE disables the setting from any
       `--build-id' options earlier on the command line.

I suppose Go uses one of md5 or sha1, which is a good thing since it
allows for reproducible builds.

However, grafting breaks this, similarly to <https://bugs.gnu.org/19973>
since they change file contents without recomputing the build ID.

Having Go use --build-id=uuid would work around the problem, but it
would also prevent bit-reproducible builds.

Perhaps our grafting code will have to handle .note.gnu.build-id
specially.

Thoughts?

Thanks for reporting the issue,
Ludo’.

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

* bug#25752: Acknowledgement (go incremental builds broken)
  2017-02-25 15:58     ` Leo Famulari
@ 2020-12-18 20:00       ` zimoun
  2020-12-18 21:31         ` Leo Famulari
  0 siblings, 1 reply; 9+ messages in thread
From: zimoun @ 2020-12-18 20:00 UTC (permalink / raw)
  To: Leo Famulari; +Cc: 25752, Hank Donnay

Hi,

On Sat, 25 Feb 2017 at 10:58, Leo Famulari <leo@famulari.name> wrote:
> On Fri, Feb 24, 2017 at 02:50:10PM -0500, Hank Donnay wrote:
>> After talking on IRC, it seems like grafts are the problem. Adding
>> `--no-grafts` to the above commands has them succeed.
>> 
>> The GOROOT (store location, in this case) gets encoded in the
>> generated source by the 'dist' tool, so changing that is going to
>> cause issues.
>> 
>> Is there a way to disable grafts on a per-package basis, in the definition?
>
> You can disable them on the command-line for any tool that builds
> things, using the '--no-grafts' option, which is a "Common build option"
> [0]. For example, `guix environment --ad-hoc go --no-grafts`.
>
> If you do this, you should understand that the ungrafted Go package will
> contain some serious security vulnerabilities, since we only use grafts
> to fix vulnerabilities in core packages. [1]
>
> We should figure out why this issue manifests when go is grafted, and
> fix the root cause.

I suspect closing this bug had been forgotten.  If yes, feel free to
close it.  Otherwise, I do not understand what is the next actionable
step.

<http://issues.guix.gnu.org/issue/25752>

All the best,
simon




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

* bug#25752: Acknowledgement (go incremental builds broken)
  2020-12-18 20:00       ` zimoun
@ 2020-12-18 21:31         ` Leo Famulari
  2021-01-11 12:46           ` zimoun
  0 siblings, 1 reply; 9+ messages in thread
From: Leo Famulari @ 2020-12-18 21:31 UTC (permalink / raw)
  To: zimoun; +Cc: 25752, Hank Donnay

On Fri, Dec 18, 2020 at 09:00:14PM +0100, zimoun wrote:
> I suspect closing this bug had been forgotten.  If yes, feel free to
> close it.  Otherwise, I do not understand what is the next actionable
> step.

I don't think this bug has been fixed, although I have not checked.
Currently, Go incremental builds and library re-use is not functional in
Guix, unless I missed a new development.




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

* bug#25752: Acknowledgement (go incremental builds broken)
  2020-12-18 21:31         ` Leo Famulari
@ 2021-01-11 12:46           ` zimoun
  2021-01-11 20:01             ` Efraim Flashner
  0 siblings, 1 reply; 9+ messages in thread
From: zimoun @ 2021-01-11 12:46 UTC (permalink / raw)
  To: Leo Famulari; +Cc: 25752, Hank Donnay

Hi Leo,

On Fri, 18 Dec 2020 at 16:31, Leo Famulari <leo@famulari.name> wrote:

> I don't think this bug has been fixed, although I have not checked.
> Currently, Go incremental builds and library re-use is not functional in
> Guix, unless I missed a new development.

Thanks.  Could you provide a Go example for reproducing?  Well, a
reproducer to track what could be wrong on the grafting mechanism for
Go.  If I understand correctly.


All the best,
simon




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

* bug#25752: Acknowledgement (go incremental builds broken)
  2021-01-11 12:46           ` zimoun
@ 2021-01-11 20:01             ` Efraim Flashner
  2021-06-09 21:38               ` zimoun
  0 siblings, 1 reply; 9+ messages in thread
From: Efraim Flashner @ 2021-01-11 20:01 UTC (permalink / raw)
  To: zimoun; +Cc: 25752, Hank Donnay

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

On Mon, Jan 11, 2021 at 01:46:48PM +0100, zimoun wrote:
> Hi Leo,
> 
> On Fri, 18 Dec 2020 at 16:31, Leo Famulari <leo@famulari.name> wrote:
> 
> > I don't think this bug has been fixed, although I have not checked.
> > Currently, Go incremental builds and library re-use is not functional in
> > Guix, unless I missed a new development.
> 
> Thanks.  Could you provide a Go example for reproducing?  Well, a
> reproducer to track what could be wrong on the grafting mechanism for
> Go.  If I understand correctly.
> 

I actually spent a bit of time on this today/yesterday. I modified the
go-build-system to copy the pkg and src folders from build to build
(instead of just the src folders) and the pkg folders were ignored.
Upstream documentation isn't clear about when the pkg folder is used and
when it is ignored.

One thing I did try was to set the pkgdir to (string-append (getenv
"GOROOT") "/pkg"), but then it didn't find the pkg folder from go:out. I
didn't try copying go:out/pkg to GOROOT/pkg to see if that would fix it;
I assumed that even if it did work we wouldn't want to propagate all of
go with the go packages.

-- 
Efraim Flashner   <efraim@flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* bug#25752: Acknowledgement (go incremental builds broken)
  2021-01-11 20:01             ` Efraim Flashner
@ 2021-06-09 21:38               ` zimoun
  0 siblings, 0 replies; 9+ messages in thread
From: zimoun @ 2021-06-09 21:38 UTC (permalink / raw)
  To: Efraim Flashner; +Cc: 25752, Hank Donnay

Hi,

On Mon, 11 Jan 2021 at 22:01, Efraim Flashner <efraim@flashner.co.il> wrote:
> On Mon, Jan 11, 2021 at 01:46:48PM +0100, zimoun wrote:
>> On Fri, 18 Dec 2020 at 16:31, Leo Famulari <leo@famulari.name> wrote:
>> 
>> > I don't think this bug has been fixed, although I have not checked.
>> > Currently, Go incremental builds and library re-use is not functional in
>> > Guix, unless I missed a new development.
>> 
>> Thanks.  Could you provide a Go example for reproducing?  Well, a
>> reproducer to track what could be wrong on the grafting mechanism for
>> Go.  If I understand correctly.
>> 
>
> I actually spent a bit of time on this today/yesterday. I modified the
> go-build-system to copy the pkg and src folders from build to build
> (instead of just the src folders) and the pkg folders were ignored.
> Upstream documentation isn't clear about when the pkg folder is used and
> when it is ignored.
>
> One thing I did try was to set the pkgdir to (string-append (getenv
> "GOROOT") "/pkg"), but then it didn't find the pkg folder from go:out. I
> didn't try copying go:out/pkg to GOROOT/pkg to see if that would fix it;
> I assumed that even if it did work we wouldn't want to propagate all of
> go with the go packages.

What is the status of this bug?  Since I am not using Go at all, it is
hard for me to have a reproducer.  Is it possible to provide a
reproducer?  Thanks.

Cheers,
simon




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

end of thread, other threads:[~2021-06-09 21:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-16 15:05 bug#25752: go incremental builds broken Hank Donnay
     [not found] ` <handler.25752.B.14872575426869.ack@debbugs.gnu.org>
2017-02-24 19:50   ` bug#25752: Acknowledgement (go incremental builds broken) Hank Donnay
2017-02-25 15:58     ` Leo Famulari
2020-12-18 20:00       ` zimoun
2020-12-18 21:31         ` Leo Famulari
2021-01-11 12:46           ` zimoun
2021-01-11 20:01             ` Efraim Flashner
2021-06-09 21:38               ` zimoun
2017-03-07 21:50 ` bug#25752: go incremental builds broken Ludovic Courtès

unofficial mirror of bug-guix@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/guix-bugs/0 guix-bugs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guix-bugs guix-bugs/ https://yhetil.org/guix-bugs \
		bug-guix@gnu.org
	public-inbox-index guix-bugs

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.gnu.guix.bugs
	nntp://news.gmane.io/gmane.comp.gnu.guix.bugs


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git