aboutsummaryrefslogtreecommitdiff
path: root/guix/discovery.scm
Commit message (Collapse)AuthorAge
* Autoload (guix build syscalls).Ludovic Courtès2024-04-15
| | | | | | | | * guix/discovery.scm, guix/git.scm, guix/nar.scm, guix/scripts.scm, guix/scripts/build.scm: Autoload (guix build syscalls). * guix/packages.scm: Autoload (guix build utils). Change-Id: Ia7703b5f46e55fbfadff63b13c35bfe097ce2220
* guix: Strip #:use-module lists.Ludovic Courtès2023-03-13
| | | | | | | | | | | | This was obtained by setting up this environment: guix shell -D guix --with-input=guile@3.0.9=guile-next \ --with-commit=guile-next=e2ed33ef0445c867fe56c247054aa67e834861f2 -- make -j5 then adding 'unused-module' to (@@ (guix build compiler) %warnings), building, and checking all the "unused module" warnings and removing those that were definitely unused.
* discovery: Hide Guile warnings when loading modules.Ludovic Courtès2021-09-30
| | | | | | Fixes <https://issues.guix.gnu.org/43747>. * guix/discovery.scm (scheme-modules): Parameterize 'current-warning-port'.
* discovery: Fix typo.Arun Isaac2020-07-05
| | | | | | * guix/discovery.scm (fold-module-public-variables*): In the docstring, replace (PROC MODULE SYMBOL VARIABLE) with (PROC MODULE SYMBOL VARIABLE RESULT).
* discovery: 'scheme-files' ignores hidden files.Ludovic Courtès2019-07-26
| | | | | * guix/discovery.scm (scheme-files)[dot-prefixed?]: New procedure. Use it to exclude any file starting with ".".
* ui: 'warn-about-load-error' warns about file/module name mismatches.Ludovic Courtès2019-07-20
| | | | | | | | | | * guix/discovery.scm (scheme-modules): Rename the inner 'file' to 'relative'. Pass FILE as an addition argument to WARN. * guix/ui.scm (warn-about-load-error): Add 'module' argument (actually, what was called 'file' really contained a module name.) Call 'check-module-matches-file' in the catch-all error case. (check-module-matches-file): New procedure. * tests/guix-build.sh: Test it.
* discovery: Handle edge case in scheme-files when looking at symlinks.fix-crash-in-discovery-scheme-filesChristopher Baines2019-07-08
| | | | | | | | | | Previously, this code would cause crashes in Guix (running guix package -s for example) which could be experienced when Emacs creates temporary files in the gnu/packages/patches directory when a patch file has been edited, but not saved. * guix/discovery.scm (scheme-files): Add else clause to cond used when handling symlinks.
* discovery: 'all-modules' returns modules in path order.Robert Vollmert2019-05-26
| | | | | | | | | | | | | A particular effect of this is that if there are ambiguous packages in a directory specified with `-L module_dir` and the distribution, the version from `module_dir` will be loaded, which is usually what would be expected. (E.g. for `guix build` or `guix package -i`.) * guix/discovery.scm (all-modules): Return modules in path order. * tests/guix-package.sh: Test local definitions take precedence. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* discovery: Add 'fold-module-public-variables*'.Ludovic Courtès2019-01-15
| | | | * guix/discovery.scm (fold-module-public-variables*): New procedure.
* discovery: Add 'scheme-modules*'.Ludovic Courtès2018-09-02
| | | | | | * guix/self.scm (scheme-modules*): Move to... * guix/discovery.scm (scheme-modules*): ... here. New procedure. Make 'sub-directory' an optional parameter.
* discovery: Remove dependency on (guix ui).Ludovic Courtès2018-04-08
| | | | | | | | | | | | | | This reduces the closure of (guix discovery) from 28 to 8 modules. * guix/discovery.scm (scheme-files): Use 'format' instead of 'warning'. (scheme-modules): Add #:warn parameter. Use it instead of 'warn-about-load-error'. (fold-modules): Add #:warn and pass it to 'scheme-modules'. (all-modules): Likewise. * gnu/bootloader.scm (bootloader-modules): Pass #:warn to 'all-modules'. * gnu/packages.scm (fold-packages): Likewise. * gnu/services.scm (all-service-modules): Likewise. * guix/upstream.scm (importer-modules): Likewise.
* Add (guix self).Ludovic Courtès2018-04-08
| | | | | | | | * guix/self.scm: New file. * Makefile.am (MODULES): Add it. * gnu/packages.scm (%distro-root-directory): Rewrite to try different directories. * guix/discovery.scm (guix): Export 'scheme-files'.
* discovery: Move 'file-name->module-name' to (guix modules).Ludovic Courtès2017-10-22
| | | | | | * guix/discovery.scm (file-name->module-name): Move to... * guix/modules.scm (file-name->module-name): ... here. * guix/build/compile.scm: Use (guix modules) instead of (guix discovery).
* build: Factorize module compilation in (guix build compile).Ludovic Courtès2017-10-22
| | | | | | | | | | | | | | * guix/build/compile.scm: New file. * Makefile.am (MODULES): Add it. * build-aux/compile-all.scm: Use it. (warnings, file->module, load-module-file) (%default-optimizations, %lightweight-optimizations) (optimization-options, compile-file*): Remove. <top level>: Use 'compile-files'. * guix/build/pull.scm (%default-optimizations) (%lightweight-optimizations, optimization-options): Remove. (build-guix): Rewrite as a call to 'compile-files'. * guix/discovery.scm (file-name->module-name): Export.
* discovery: Recurse into directories pointed to by a symlink.Ludovic Courtès2017-07-03
| | | | | | | | | | | | Reported by Christopher Baines <mail@cbaines.net> and Alex Kost <alezost@gmail.com> at <https://lists.gnu.org/archive/html/guix-devel/2017-06/msg00290.html>. * guix/discovery.scm (scheme-files): When ENTRY is a symlink that doesn't end in '.scm', call 'stat' and recurse if it points to a directory. * tests/discovery.scm ("scheme-modules recurses in symlinks to directories"): New test.
* discovery: 'scheme-files' returns '() for a non-accessible directory.Ludovic Courtès2017-06-18
| | | | | | | | | | | | Fixes a regression introduced in d27cc3bfaafe6b5b0831e88afb1c46311d382a0b. Reported by Ricardo Wurmus <rekado@elephly.net>. * guix/discovery.scm (scheme-files): Catch 'scandir*' system errors. Return '() and optionally raise a warning upon 'system-error'. * tests/discovery.scm ("scheme-modules, non-existent directory"): New test.
* discovery: Rewrite 'scheme-files' using 'scandir*'.Ludovic Courtès2017-06-16
| | | | | | | | | | | | On a command like: guix environment --ad-hoc coreutils -- true this reduces the number of 'stat' calls from 14.1K to 9.7K on my setup (previously each getdents(2) call would be followed by one stat(2) call per entry). * guix/discovery.scm (scheme-files): Rewrite using 'scandir*'.
* Add (guix discovery).Ludovic Courtès2017-05-03
* guix/discovery.scm, tests/discovery.scm: New files. * gnu/packages.scm (scheme-files, file-name->module-name) (scheme-modules, all-package-modules): Remove. (fold-packages): Rewrite in terms of 'fold-module-public-variables'. * gnu/tests.scm: Use (guix discovery). * Makefile.am (MODULES): Add guix/discovery.scm. (SCM_TESTS): Add tests/discovery.scm.