aboutsummaryrefslogtreecommitdiff
path: root/guix/build/union.scm
Commit message (Collapse)AuthorAge
* guix: build: Factor out default collision-resolver.Attila Lendvai2022-09-02
| | | | | | | | | | | | | | This prepares the stage for new collision resolvers without changing the underlying semantics too much. * guix/build/union.scm (resolve+warn-if-harmful): New variable. (warn-about-collision): Rename to... (resolve-collision/default): ... this. Implement in terms of resolve+warn-if-harmful. (union-build): Adjust accordingly. * guix/gexp.scm (directory-union): Likewise. Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
* union: Do not warn about "ld.so.cache" collisions.Ludovic Courtès2021-09-25
| | | | | | This is a followup to f85efa86e7690d9181946351631e02b1c20958c9. * guix/build/union.scm (%harmless-collisions): Add "ld.so.cache".
* Remove most uses of the _IO*F constants.Ludovic Courtès2019-01-09
| | | | | | | | | | | | | | | | | | | | | | | | These constants, for use with 'setvbuf', were deprecated in Guile 2.2 and disappeared in Guile 3.0. Here we keep these constants in build-side code where removing them is not feasible. * guix/build/download-nar.scm (download-nar): Adjust 'setvbuf' calls to the Guile 2.2+ API. * guix/build/download.scm (open-socket-for-uri): Likewise. (open-connection-for-uri, url-fetch): Likewise. * guix/build/make-bootstrap.scm (make-stripped-libc): Likewise. * guix/build/union.scm (setvbuf) [guile-2.0]: New conditional wrapper. (union-build): Adjust to new API. * guix/ftp-client.scm (ftp-open, ftp-list, ftp-retr): Likewise. * guix/http-client.scm (http-fetch): Likewise. * guix/inferior.scm (proxy): Likewise. * guix/scripts/substitute.scm (fetch, http-multiple-get): Likewise. * guix/self.scm (compiled-modules): Likewise. * guix/ssh.scm (remote-daemon-channel, store-import-channel) (store-export-channel): Likewise. * guix/ui.scm (initialize-guix): Likewise. * tests/publish.scm (http-get-port): Likewise. * guix/store.scm (%newlines): Adjust comment.
* union: Do not warn about harmless collisions.Ludovic Courtès2018-05-17
| | | | | | | | | | | | Until now we'd get pointless messages like: warning: collision encountered: /gnu/store/…-gtk-icon-themes/share/icons/hicolor/icon-theme.cache /gnu/store/…-inkscape-0.92.3/share/icons/hicolor/icon-theme.cache warning: choosing /gnu/store/…-gtk-icon-themes/share/icons/hicolor/icon-theme.cache * guix/build/union.scm (%harmless-collisions): New variable. (warn-about-collision): Honor it.
* profiles: Optionally use relative file names for symlink targets.Ludovic Courtès2018-05-10
| | | | | | | | | | * guix/build/union.scm (symlink-relative): New procedure. * guix/build/profiles.scm: Re-export it. (build-profile): Add #:symlink and pass it to 'union-build'. * guix/profiles.scm (profile-derivation): Add #:relative-symlinks?. Pass #:symlink to 'build-profile'. * tests/profiles.scm ("profile-derivation relative symlinks, one entry") ("profile-derivation relative symlinks, two entries"): New tests.
* union: Add 'relative-file-name'.Ludovic Courtès2018-05-10
| | | | | | * guix/build/union.scm (%not-slash): New variable. (relative-file-name): New procedure. * tests/union.scm (test-relative-file-name): New macro and tests.
* union: Allow callers to choose the collision resolution policy.Ludovic Courtès2018-04-08
| | | | | | | * guix/build/union.scm (warn-about-collision): New procedure. (union-build): Add #:resolve-collision. [resolve-collisions]: Call it. * tests/union.scm ("union-build collision first & last"): New test.
* union: Slightly improve messages for file collisions.Ludovic Courtès2018-03-31
| | | | | * guix/build/union.scm (union-build): Indent file names upon collision. Remove "arbitrarily" from the message.
* union: Wrap collisions with newlines.Oleg Pykhalov2018-02-15
| | | | * guix/build/union.scm (union-build): Wrap collisions with newlines.
* union: Parametrize the symlink procedure .Ludovic Courtès2017-11-21
| | | | | * guix/gexp.scm (directory-union): Add #:hard-links and honor it. * guix/build/union.scm (union-build): Add #:symlink parameter.
* union: Gracefully handle dangling symlinks in the input.Ludovic Courtès2017-05-18
| | | | | | | | | | | | Fixes <http://bugs.gnu.org/26949>. Reported by Pjotr Prins <pjotr.public12@thebird.nl>. * guix/build/union.scm (file-is-directory?): Return #f when FILE does not exist or is a dangling symlink. (file=?): Pass #f as a second argument to 'stat'; return #f when both ST1 or ST2 is #f. * tests/profiles.scm (test-equalm): New macro. ("union vs. dangling symlink"): New test.
* union: Add create-all-directories? parameter to 'union-build'.Huang Ying2017-03-26
| | | | | | | | * guix/build/union.scm (union-build): Add create-all-directories? keyword parameter. * tests/union.scm ("union-build #:create-all-directories? #t"): New test. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* union: Compare inode numbers in 'file=?'.Ludovic Courtès2016-05-23
| | | | * guix/build/union.scm (file=?): Compare the inode of ST1 and ST2.
* union: Ensure that the output is always a directory.Mark H Weaver2014-04-03
| | | | | | | | | Fixes the creation of single-package profiles, reported by Ludovic Courtès. * guix/build/union.scm (union-build): Add new internal procedure 'union-of-directories' that always creates a directory, containing the code previously used only to merge multiple directories. Call it from the multiple-directory case in 'union' and from the top-level 'union-build'.
* union: Rewrite to be faster; handle symlink/directory conflicts.Mark H Weaver2014-04-02
| | | | | | | | | * guix/build/union.scm: Rewrite; only 'file=?' remains unchanged. Remove 'tree-union' and 'delete-duplicate-leaves' exports. Merge inputs in a breadth-first fashion. Follow symlinks for purposes of making decisions about the merge. * tests/union.scm: Remove tests of 'tree-union' and 'delete-duplicate-leaves'.
* union: Do not compare directories upon collision.Ludovic Courtès2014-02-10
| | | | | | | * guix/build/union.scm (file=?): Return #f if FILE1 and FILE2 are not regular files. Fixes a bug whereby collisions among directories would lead to the invocation of 'file=?' and thus 'call-with-input-file' on directories. Reported by Mark H. Weaver <mhw@netris.org>.
* union: Do not warn when identical files collide.Ludovic Courtès2013-10-31
| | | | | | * guix/build/union.scm (file=?): New procedure. (union-build)[resolve-collision]: Do not warn when identical files collide.
* union: Make the log port a parameter.Ludovic Courtès2013-10-30
| | | | | * guix/build/union.scm (union-build): Add 'log-port' keyword parameter; use it.
* union: Don't traverse sub-directories only found in one element of the union.Ludovic Courtès2013-09-02
| | | | | | | | | | | | This significantly reduces I/O when building profiles, especially with lots of package-specific sub-directories (such as 'share/emacs/24.3', 'texmf', etc.) * guix/build/union.scm (union-build)[file-tree](others-have-it?): New procedure. Use it in the 'enter?' parameter of 'file-system-fold'; change 'skip' parameter accordingly. * tests/union.scm ("union-build"): Ensure that 'include' is a symlink and 'bin' is a directory.
* union: Don't warn when colliding leaves point to the same file.Ludovic Courtès2013-02-06
| | | | | | * guix/build/union.scm (union-build)[resolve-collision]: Pass LEAVES through `delete-duplicates'; warn iff the result contains more than one item.
* union: Delete duplicates when passed the same input several times.Ludovic Courtès2013-02-06
| | | | | | | * guix/build/union.scm (union-build): Prepend "." to the result of `union-tree', to match the expectations of `delete-duplicate-leaves'. Don't do mkdir when SUBDIR is ".". * tests/union.scm ("union-build"): Keep duplicates in %BOOTSTRAP-INPUTS.
* Merge branch 'core-updates'Ludovic Courtès2013-01-11
|\ | | | | | | | | Conflicts: guix/build/union.scm
| * Update license headers of builder-side code.Ludovic Courtès2013-01-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change license headers with this script: (use-modules (guix build utils)) (fluid-set! %default-port-encoding "UTF-8") (substitute* (cons "distro/packages/ld-wrapper.scm" (find-files "guix/build" "\\.scm$")) (("^([[:graph:]]+) This file is part of Guix." _ comment-start) (string-append comment-start " This file is part of GNU Guix.")) (("^([[:graph:]]+) Guix --- Nix package management.*" _ comment-start) (string-append comment-start " GNU Guix --- Functional package management for GNU\n")) (("^([[:graph:]]+) Guix is " _ comment-start) (string-append comment-start " GNU Guix is ")) (("^([[:graph:]]+) along with Guix." _ comment-start) (string-append comment-start " along with GNU Guix.")) (("^([[:graph:]]+) Copyright \\(C\\)" _ comment-start) (string-append comment-start " Copyright ©"))) * distro/packages/ld-wrapper.scm, guix/build/download.scm, guix/build/gnu-build-system.scm, guix/build/union.scm, guix/build/utils.scm: Update license headers.
* | union: Detect collisions, and delete duplicate leaves.Ludovic Courtès2013-01-09
|/ | | | | | | | * guix/build/union.scm (delete-duplicate-leaves): New procedure. (union-build)[leaf=?, resolve-collision]: New procedures. Use `delete-duplicate-leaves' on the result of `tree-union'. * tests/union.scm ("delete-duplicate-leaves, default", "delete-duplicate-leaves, file names"): New tests.
* Add (guix build union).Ludovic Courtès2012-10-29
* guix/build/union.scm, tests/union.scm: New files. * Makefile.am (MODULES): Add `guix/build/union.scm'. (TESTS): Add `tests/union.scm'.