[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Removing a store reference from a file

From: Leo Famulari
Subject: Removing a store reference from a file
Date: Thu, 26 Oct 2017 11:04:43 -0400
User-agent: Mutt/1.9.1 (2017-09-22)

I noticed that Go executables built with the go-build-system keep an
unnecessary reference to Go itself:

$ guix gc --references $(realpath $(which syncthing))

The programs don't need or use this reference, so it would be nice to
get rid of it and save users some bandwidth when installing Go programs.

I'm still figuring out the best way to approach this issue (Go compiler
flags?), but here is some research.

In Nixpkgs, there is a switch to disallow this reference specifically:

# Do not enable this without good reason
# IE: programs coupled with the compiler
, allowGoReference ? false

... and it ends in a call to a general-purpose shell script,
remove-references-to, which uses sed to remove specific references:

I see that in Guix we have ((guix build utils) remove-store-references),
which removes *all* store references from a file, but using it here
leaves the Go executable unable to even start execution. I think it
needs libc's linker:

% strace -s1000 -f ./syncthing 
execve("./syncthing", ["./syncthing"], [/* 42 vars */]) = -1 ENOENT (No such 
file or directory)
fstat(2, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 3), ...}) = 0
write(2, "strace: exec: No such file or directory\n", 40strace: exec: No such 
file or directory
) = 40
getpid()                                = 5493
exit_group(1)                           = ?
+++ exited with 1 +++

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]