This is a followup to 13a9feb5b64fd819eaed38a17da0284bbe2b8d9.
* guix/build/gnu-build-system.scm (patch-source-shebangs): Remove call
to 'remove'. Pass a second argument to 'find-files' to filter out
symlinks; pass #:stat lstat.
(patch-generated-file-shebangs): Likewise, and also filter out
non-executable files.
* guix/build/utils.scm (wrap-program)[wrapper-file-name]
[next-wrapper-number, wrapper-target]: Remove.
[wrapped-file, already-wrapped?]: New variables.
[last-line]: New procedure.
Use it to append to PROG when a wrapper already exists.
* tests/build-utils.scm ("wrap-program, one input, multiple calls"):
Adjust the list of files to delete.
* guix/build/syscalls.scm (errno): Do not export.
(syscall->procedure): Change to return a procedure that returns both the
value and errno. Use #:return-errno? where available.
(mount, umount, swapon, swapoff, mkdtemp!, fdatasync, statfs)
(clone, setns, pivot-root, fcntl-flock, network-interface-names)
(network-interface-flags, set-network-interface-flags)
(set-network-interface-address, network-interface-address):
(network-interfaces, tcgetattr, tcsetattr, terminal-window-size): Adjust
accordingly using 'let-values'.
The former pattern included the "jar" binary.
* guix/build/ant-build-system.scm (generate-classpath): Change pattern.
Suggested by: Ricardo Wurmus <rekado@elephly.net>
This fixes a bug whereby the choice between stripping 'libfoo.so.0.1.2'
and stripping 'libfoo.so' (the symlink) would be non-deterministic.
* guix/build/gnu-build-system.scm (strip)[strip-dir]: Use 'find-files'
instead of 'file-system-fold' so that files are picked in deterministic
order.
* guix/build/ruby-build-system.scm (log-file-deletion): New procedure.
(install): Remove files containing non-reproducible elements. Print when each
file is deleted.
* guix/build/graft.scm (replace-store-references): Reimplement for
faster grafting. Use binary I/O instead of textual I/O. Replace
'mapping' argument (an alist) with 'replacement-table' (a vhash).
(rewrite-directory): Adapt to mapping argument change in
'replace-store-references'. Remove 'with-fluids' that previously set
'%default-port-encoding' to #f, since we now use binary I/O.
(define-inline, hash-length): New macros.
(nix-base32-char?): New variable.
Resolved conflicts:
* gnu/packages/scheme.scm: Conflict in import of (guix licenses). On master,
"#:hide (openssl)" was used. On core-updates, "#:select (some licenses)" was
used. The latter won the conflict.
* gnu/packages/version-control.scm (git)[arguments]: Whitespace conflict
in 'install-shell-completion.
* guix/download.scm (url-fetch): Include (guix base64) module on the
build-side.
* guix/build/download.scm (http-fetch): Add "Authorization" header when
userinfo is present in the URI.
* guix/build/emacs-build-system.scm (emacs-inputs-el-directories):
Add ".../share/emacs/site-lisp" directory to the returned result as
elisp files can also be placed there.
Suggested by Danny Milosavljevic <dannym@scratchpost.org>
at <https://lists.gnu.org/archive/html/guix-devel/2016-06/msg00456.html>.
* guix/build/syscalls.scm (fdatasync): New procedure.
* guix/utils.scm (with-atomic-file-output): Use it. Use 'close-port'
instead of 'close'.
* guix/build/bournish.scm (%bournish-language): Add a joiner to SCHEME.
Compile only to Scheme.
* tests/bournish.scm: New file.
* Makefile.am (SCM_TESTS): Add it.
* guix/build/emacs-build-system.scm (gnu:unpack)
(store-file->elisp-source-file, unpack): New procedures.
(%standard-phases): Use the new unpack procedure.
* guix/build/download.scm (ftp-fetch): Add #:timeout and pass it to
'ftp-open'.
(http-fetch): Add #:timeout and pass it to 'open-connection-for-uri' and
in recursive calls.
(url-fetch): Add #:timeout and pass it to 'http-fetch' and 'ftp-fetch'.
This fixes a bug whereby 'http-fetch' would be passed a string instead
of a URI object.
* guix/build/download.scm (url-fetch): Rename 'content-addressed-urls'
to 'content-addressed-uris', and call 'string->uri'.
* guix/build/ruby-build-system.scm (build): Move extraction from here ...
(extract-gemspec): ... to here. New variable.
(first-gemspec): New variable.
(%standard-phases): Add 'extract-gemspec' phase.
Fixes <http://bugs.gnu.org/23132>.
Reported by Mark H Weaver <mhw@netris.org>.
* guix/build/graft.scm (rename-matching-files): New procedure.
(rewrite-directory): Use it.
* tests/grafts.scm ("graft-derivation, renaming"): New test.
* guix/download.scm (%content-addressed-mirrors)
(%content-addressed-mirror-file): New variables.
* guix/download.scm (url-fetch)[builder]: Define
'value-from-environment. Pass #:hashes and
#:content-addressed-mirrors to 'url-fetch'.
Define "guix download hashes" environment variable.
* guix/build/download.scm (url-fetch): Add #:content-addressed-mirrors
and #:hashes.
[content-addressed-urls]: New variable.
Use it.
* guix/build/syscalls.scm (bits->symbols-body, define-bits)
(local-flags): New macros.
(TCSANOW, TCSADRAIN, TCSAFLUSH): New variables.
(<termios>): New record type.
(%termios): New C structure.
(tcgetattr, tcsetattr): New procedures.
* tests/syscalls.scm ("tcgetattr ENOTTY", "tcgetattr")
("tcsetattr"): New tests.
* guix/build/syscalls.scm (define-c-struct)[read]: OFFSET defaults to 0.
(unfold-interface-list): Remove second argument to 'read-ifaddrs'.
(terminal-window-size): Remove second argument to 'read-winsize'.
Suggested by Danny Milosavljevic <dannym@scratchpost.org>.
* guix/build/download.scm (nar-uri-abbreviation): New procedure.
* guix/scripts/substitute.scm (process-substitution): Use it instead of
'store-path-abbreviation'.
* guix/build/syscalls.scm (syscall->procedure): New procedure.
(mount, umount, swapon, swapoff, clone, pivot-root): Use it.
(clone): Add case for nonexistent syscall id.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix/build/syscalls.scm (terminal-columns): Call
'terminal-window-size' only when PORT is a file port.
* tests/syscalls.scm ("terminal-columns non-file port"): New test.
* guix/build/syscalls.scm (TIOCGWINSZ): New macro.
(<window-size>): New record type.
(winsize): New C struct.
(winsize-struct): New variable.
(terminal-window-size, terminal-columns): New procedures.
Fixes <http://bugs.gnu.org/23275>.
Reported by Albin Söderqvist <albin@fripost.org>.
* guix/build/download.scm (http-fetch): Follow redirections upon 307.
This is what 'binaries.openttd.org' does.
Partially fixes <http://bugs.gnu.org/20145>.
* guix/build/download.scm (add-weak-reference): Remove.
(%tls-ports): New variable.
(register-tls-record-port): New procedure.
(tls-wrap): Use it instead of 'add-weak-reference'.
(close-connection): New procedure.
* guix/build/bournish.scm: New file.
* Makefile.am (MODULES): Add it.
* gnu/system/linux-initrd.scm (base-initrd): Add (guix build bournish)
and use it.
This fixes interfaces with a dash or other characters being ignored.
Suggested by Jookia <166291@gmail.com>.
* guix/build/syscalls.scm (%interface-line): Use [[:graph:]] instead
of [[:alnum:]].
Previously paths to the GEM_HOME of certain Ruby packages were
hard-coded, so packages failed to build when Ruby was updated to 2.3.0.
* guix/build/ruby-build-system.scm (gem-home): New procedure.
* gnu/packages/ruby.scm (ruby-metaclass, ruby-instantiator,
ruby-introspection, ruby-mocha, ruby-minitest-tu-shim): Use it.
The .gem file stored in GEM_HOME after install is both redundant and an
archive that stores timestamped files which makes builds
non-deterministic, so delete it after 'gem install'.
* guix/build/ruby-build-system.scm (install): Remove cached gem after
install.
This phase is inherited by other build systems, which ensures
'SOURCE_DATE_EPOCH' is always set in practice.
* guix/build/python-build-system.scm (set-SOURCE-DATE-EPOCH): Remove.
(%standard-phases): Don't add it.
* guix/build/gnu-build-system.scm (set-SOURCE-DATE-EPOCH): New
procedure.
(%standard-phases): Add it.
(gnu-build): Remove 'setenv' call for "SOURCE_DATE_EPOCH".
Previously, the 'git checkout' invocation would remove sub-modules that
had been initialized by 'git clone --recursive'.
* guix/build/git.scm (git-fetch): Never use "git clone --recursive".
Invoke "git submodule update --init --recursive" after "git checkout".
Remove '.git' directories as the last step.
This is a followup to 3eb34c6.
* guix/build-system/gnu.scm (gnu-build, gnu-cross-build): Use
"--enable-deterministic-archives" instead of "-D" to work around
Binutils bug <https://sourceware.org/bugzilla/show_bug.cgi?id=17671>.
* guix/build/gnu-build-system.scm (strip): Likewise.
* gnu/packages/python.scm (python-2)[arguments]: Set SOURCE_DATE_EPOCH
to 1 to match what the daemon does.
* guix/build/python-build-system.scm (set-SOURCE-DATE-EPOCH): Likewise.
* gnu/packages/patches/python-2.7-source-date-epoch.patch: New file.
* gnu/packages/python.scm (python-2)[source]: Use it.
[arguments]: Set SOURCE_DATE_EPOCH in 'patch-lib-shells' phase.
* guix/build/python-build-system.scm (set-SOURCE-DATE-EPOCH): New
procedure.
(%standard-phases): Add it.
* gnu-system.am (dist_patch_DATA): Add patch.
* guix/build/graft.scm (rewrite-directory)[rewrite-leaf]: Change to take
a single parameter. Add call to 'lstat'. Factorize result of
'destination'.
Use 'find-files' instead of 'file-system-fold'.
* guix/build/download.scm (open-socket-for-uri): Always pass
AI_ADDRCONFIG to 'getaddrinfo' as recommended in the fine Guile
manual.
* guix/ftp-client.scm (ftp-open): Ditto.
* guix/build/download.scm (ensure-uri): New procedure.
(current-http-proxy): New variable.
(open-socket-for-uri): Copy from Guile commit aaea5b2, but add #:timeout
parameter and use 'connect*' instead of 'connect'.
(open-connection-for-uri): Add #:timeout parameter and pass it to
'open-socket-for-uri'.
Benefits include: 'guix environment' more useful for ghc libraries, more
useful 'guix package --search-paths' for installed ghc libraries, cleaner
package recipes: no longer need to propagate runtime package dependencies.
* guix/build/haskell-build-system.scm (configure): Unset GHC_PACKAGE_PATH
around cabal configure.
(make-ghc-package-database): Use pattern directory search.
(register): Install complete package database for the current package.
* gnu/packages/haskell.scm (ghc): Add native-search-paths field.
For Cabal packages with "build-type: Configure", a configure shell
script is run to set up build parameters. These scripts need the
CONFIG_SHELL environment variable to be set to function properly.
* guix/build/haskell-build-system.scm (configure): Set CONFIG_SHELL if
necessary.
Fixes <http://bugs.gnu.org/21694>.
* guix/build/syscalls.scm (clone): Change 'syscall' parameter types to
LONG, UNSIGNED-LONG, or '*; make sure it has 6 parameters. Adjust
caller accordingly.
Fixes a regression introduced in a8be7b9a.
* guix/build/download.scm (store-path-abbreviation): Return STORE-PATH
if it's not an actual store path. Fixes an out-of-range exception
when running tests/substitute.scm and tests/store.scm.
* guix/build/download.scm
(string-pad-middle): Allow resulting padded string to overflow.
(store-url-abbreviation): Remove unnecessary procedure.
(progress-proc): Use BASENAME as default for parameter 'abbreviation'.
(url-fetch): Display extra newlines for readability.
Fixes a regression introduced in b7c7c03eb5.
* guix/build/emacs-build-system.scm (package-name-version->elpa-name-version):
Remove unused 'name' binding. Do not abuse 'strip-store-file-name' to
remove the "emacs-" prefix, which worked before b7c7c03eb5 but not after.
* guix/build/download.scm
(string-pad-middle, store-url-abbreviation, store-path-abbreviation):
New procedures.
(progress-proc): Add #:abbreviation parameter and use it. Generate a
better indeterminate progress string.
* guix/scripts/substitute.scm (assert-valid-narinfo): Add newlines to output.
(process-substitution): Use byte-count->string and store-path-abbreviation.
Co-authored-by: Ludovic Courtès <ludo@gnu.org>
Previously, the Ruby build system only knew how to work with gem archives,
which made it difficult to build unreleased gems from a Git repository or
released gems in tarball form.
* gnu/build/ruby-build-system.scm (gnu:unpack, gem-archive?): New procedures.
(unpack): Use GNU build system unpack phase for non-gem sources.
(build): Rebuild the gemspec iff the source is a gem archive.
* guix.texi ("ruby-build-system"): Mention that tarballs and directories are
acceptable.
* guix/build/download.scm (seconds->string): New function.
(byte-count->string): New function.
(progress-bar): New function.
(throughput->string): Remove function.
(progress-proc): Display base file name, elapsed time, and progress bar.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
The intent is to make 'clone' behave a lot more like 'primitive-fork', which
calls clone(2) with SIGCHLD, CLONE_CHILD_CLEARTID, and CLONE_CHILD_SETTID
flags. Notably, running 'clone' at the REPL without these flags would break
the REPL beyond repair.
* guix/build/syscalls.scm (CLONE_CHILD_CLEARTID, CLONE_CHILD_SETTID): New
variables.
* gnu/build/linux-container.scm (namespaces->bit-mask): Add
CLONE_CHILD_CLEARTID and CLONE_CHILD_SETTID to bit mask.
Having the hash of the source gem in the source directory file name proved to
be problematic when running the test suite for the 'pg' gem that creates
UNIX-domain sockets in the source directory and exceeded the 108 character
limit on GNU/Linux systems.
* guix/build/ruby-build-system.scm (unpack): Rename unpacked gem directory to
"gem".
* guix/build/utils.scm (strip-store-file-name): New procedure.
* guix/build/emacs-build-system.scm (store-directory->name-version):
Remove. Update callers to use 'strip-store-file-name'.
* gnu/packages/gcc.scm (make-libstdc++-doc)[arguments]: Use
'strip-store-file-name' instead of 'string-drop'.
* guix/build/gnu-build-system.scm (gnu-build)[elapsed-time]: New
procedure.
Use it, and use (current-time time-monotonic) instead
of (gettimeofday). Show one digit after the comma for the elapsed
time.
On systems with a glibc prior to 2.14, the 'setns' function is not available.
Thanks to Eric Bavier for reporting the issue.
* guix/build/syscalls.scm (setns): Wrap with 'false-if-exception'.
Based on discussions with Rohan Prinja <rohan.prinja@gmail.com>.
* guix/build/syscalls.scm (<interface>): New record type.
(write-interface, values->interface, unfold-interface-list,
network-interfaces, free-ifaddrs): New procedures.
(ifaddrs): New C struct.
(%struct-ifaddrs-type, %sizeof-ifaddrs): New macros.
* tests/syscalls.scm ("network-interfaces returns one or more interfaces",
"network-interfaces returns \"lo\""): New tests.
* guix/build/syscalls.scm (alignof*, align): New macros.
(write-types, read-types): Use 'align' to compute the actual offset to
read/write a value of TYPE0.
* guix/build/syscalls.scm (PF_PACKET, AF_PACKET): New variables.
(read-socket-address): Make 'index' optional. Return (vector FAMILY) when
FAMILY is neither AF_INET nor AF_INET6.
* guix/build/syscalls.scm (read-types): Add RETURN and VALUES parameters.
(define-c-struct): Add WRAP-FIELDS parameter and pass it to 'read-types'.
(sockaddr-in, sockaddr-in6): Add first argument that uses
'make-socket-address'.
(read-socket-address): Remove 'match' on the result of 'read-sockaddr-in'
and 'read-sockaddr-in6'.
* guix/build-system/gnu.scm (gnu-build, gnu-cross-build): Accept #:build
keyword argument. Pass it to 'gnu-build' on the build side.
* guix/build/gnu-build-system.scm (configure): Accept #:build keyword
argument. Unless it is false, pass --build to configure.