Commit Graph

22 Commits

Author SHA1 Message Date
Ekaitz Zarraga 2cc6e09a03
transformations: Add support for zig.
* guix/transformations.scm (tuning-compiler): Add support for zig.

Change-Id: I40bd28071c97c0dd0a907c704072b52b26d2de28
Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
2023-12-03 09:58:34 +02:00
Jean-Pierre De Jesus DIAZ 19b6173708
transformations: tuned-package: Use target on cross-compile.
* guix/transformations.scm (tuned-package): Use either bag-target if
  available or bag-system to select the CPU architecture of the package
  that is going to be tuned.  This enables the tuning of cross-compiled
  packages.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2023-09-17 15:31:03 +02:00
Efraim Flashner 1fd4f544b3
transformations: Wrap go binary.
* guix/transformations.scm (tuning-compiler): Adjust to wrap the go
binary with the appropriate environment variable.
(build-system-with-tuning-compiler): Remove custom 'set-microarchitecture
phase.
2023-07-25 16:07:02 +03:00
Efraim Flashner 691b97aed9
transformations: Allow tuning go packages.
* guix/transformations.scm (build-system-with-tuning-compiler): When
checking if a microarchitecture is supported by the compiler, also check
if it is a go compiler which supports that psabi.  Add a phase after
'setup-go-environment to set the go microarchitecture.
2023-07-12 16:48:28 +03:00
Ludovic Courtès d0be53d03e
transformations: Add "--tune" to "--help-transform".
* guix/transformations.scm (show-transformation-options-help/detailed):
Add '--tune'.
2023-05-31 23:24:33 +02:00
Sarthak Shah ae11fcb84a
transformations: Add '--with-configure-flag'.
* guix/transformations.scm (transform-package-configure-flag): New
procedure.
(%transformation-options, %transformation-options)
(show-transformation-options-help/detailed): Add it.
* tests/transformations.scm ("options->transformation,
with-configure-flag"): New test.
* doc/guix.texi (Package Transformation Options): Document it.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2023-05-04 17:06:44 +02:00
Ludovic Courtès 20c923c40d
transformations: Let users know when '--with-latest' has no effect.
* guix/transformations.scm (package-with-upstream-version): Print a
message when VERSION is false and SOURCE has the same version as P.
2023-01-16 13:41:27 +01:00
Ludovic Courtès 137b91f03b
transformations: Add '--with-version'.
This is a followup to 8aeccc6240.

* guix/transformations.scm (package-with-upstream-version): New procedure.
(transform-package-latest)[package-with-latest-upstream]: Remove.
Use 'package-with-upstream-version' instead.
(transform-package-version): New procedure.
(%transformations, %transformation-options)
(show-transformation-options-help/detailed): Add '-with-version'.
* tests/transformations.scm ("options->transformation, with-version"):
New test.
* doc/guix.texi (Package Transformation Options): Document '--with-version'.
(Defining Package Variants): Mention it.
2023-01-16 13:41:27 +01:00
Ludovic Courtès 6a04bc8a6d
transformations: Switch to SRFI-71.
* guix/transformations.scm (package-with-source)
(evaluate-source-replacement-specs): Use SRFI-71 'let' instead of
'let-values'.
2022-10-02 22:14:45 +02:00
Ludovic Courtès 28ade1bab2
transformations: '--with-source' now operates in depth.
The '--with-source' option is the first one that was implemented, and
it's the only one that would operate only on leaf packages rather than
traversing the dependency graph.  This change makes it consistent with
the rest of the transformation options.

* guix/transformations.scm (evaluate-source-replacement-specs): New
procedure.
(transform-package-source): Rewrite using it.
* tests/transformations.scm ("options->transformation, with-source, no
matches"): Rewrite since we no longer get a warning.
("options->transformation, with-source, in depth"): New test.
* doc/guix.texi (Package Transformation Options): Adjust examples.
2022-09-29 22:59:49 +02:00
Ludovic Courtès 0f024554e6
transformations: Preserve transformation order in package property.
Fixes <https://issues.guix.gnu.org/54942>.
Reported by SeerLite <seerlite@nixnet.email>.

* guix/transformations.scm (options->transformation)
[package-with-transformation-properties]: Add call to 'reverse'.
* tests/transformations.scm ("options->transformation, property order"):
New test.
2022-05-05 23:56:58 +02:00
Ludovic Courtès 3b80e79f21
transformations: '--tune' prints supported micro-architectures upon error.
* guix/transformations.scm (build-system-with-tuning-compiler): Add
&fix-hint condition when asked for an unsupported micro-architecture.
2022-03-14 23:32:30 +01:00
Ludovic Courtès 0552dcb294
shell: Cache profiles even when using package specs.
This enables profile caching not just when '-m' or '-f' is used, but
also when package specs are passed on the command line, as in:

  guix shell -D guix git

It also changes profile cache keys to include the system type, which was
previously ignored.

* guix/scripts/shell.scm (options-with-caching)[single-file-for-caching]:
Remove.
Call 'profile-cached-gc-root' instead; adjust to accept two values.
(profile-cache-primary-key): New procedure.
(profile-cache-key): Remove.
(profile-file-cache-key, profile-spec-cache-key): New procedures.
(profile-cached-gc-root): Rewrite to include functionality formally in
'single-file-for-caching', but extend to handle package specs.
* gnu/packages.scm (cache-is-authoritative?): Export.
* guix/transformations.scm (transformation-option-key?): New procedure.
* doc/guix.texi (Invoking guix shell): Move '--rebuild-cache'
documentation to the bottom, just above '--root'.  Explain caching and
how these two options relate to that.
2022-01-11 20:34:59 +01:00
Ludovic Courtès d090e9c37d
transformations: Add '--tune'.
* guix/transformations.scm (tuning-compiler)
(tuned-package, tunable-package?, package-tuning)
(transform-package-tuning)
(build-system-with-tuning-compiler): New procedures.
(%transformations): Add 'tune'.
(%transformation-options): Add "--tune".
* tests/transformations.scm ("options->transformation, tune")
("options->transformations, tune, wrong micro-architecture"): New
tests.
* doc/guix.texi (Package Transformation Options): Document '--tune'.
2022-01-01 15:23:24 +01:00
Marius Bakke 16ef7b4938
transformations: Git tags and 'git describe' style IDs are used as version.
* guix/transformations.scm (commit->version-string): New procedure.  Use git
tags and 'git describe' style identifiers directly.
(transform-package-source-commit): Adjust accordingly.
* tests/transformations.scm
("options->transformation, with-commit, version transformation"): New test.
* doc/guix.texi (Package Transformation Options): Mention the 'git describe'
style.
2021-09-08 18:03:50 +02:00
Ludovic Courtès 373e7ac4f9
transformations: 'with-patch' works on non-origin sources.
Fixes <https://issues.guix.gnu.org/49697>.
Reported by Philippe Swartvagher <philippe.swartvagher@inria.fr>.

* guix/transformations.scm (patched-source): New procedure.
(transform-package-patches)[package-with-extra-patches]: Use it
when (package-source p) is not an origin.
* tests/transformations.scm ("options->transformation, with-commit +
with-patch"): New test.
2021-08-11 16:35:28 +02:00
Ludovic Courtès 7ccf416dd0
transformations: '--with-latest' correctly handles already-latest case.
Previously, '--with-latest' would wrongfully print:

  warning: could not determine latest upstream release of 'xyz'

when 'xyz' is already the latest version.  This fixes that.

* guix/transformations.scm (transform-package-latest): Use
'package-latest-release' instead of 'package-latest-release*'.
2021-06-08 23:28:04 +02:00
Ludovic Courtès 9ab817b2a4
transformations: Add '--with-latest'.
* guix/upstream.scm (upstream-source-compiler): New procedure.
(%updaters): Set! it.
* guix/transformations.scm (transform-package-latest): New procedure.
(%transformations): Add 'with-latest'.
(%transformation-options, show-transformation-options-help/detailed):
Add '--with-latest'.
* tests/transformations.scm ("options->transformation, with-latest"):
New test.
* doc/guix.texi (Package Transformation Options): Document it.
2021-01-19 17:45:39 +01:00
Ludovic Courtès e38d90d497
transformations: Add '--with-patch'.
Suggested by Philippe Swartvagher <philippe.swartvagher@inria.fr>.

* guix/transformations.scm (transform-package-patches): New procedure.
(%transformations): Add it as 'with-patch'.
(%transformation-options, show-transformation-options-help/detailed):
Add '--with-patch'.
* tests/transformations.scm ("options->transformation, with-patch"): New
test.
* doc/guix.texi (Package Transformation Options): Document it.
2020-12-27 17:23:40 +01:00
Ludovic Courtès e79ecff045
transformations: Show '--help-transform' only where applicable.
Fixes <https://bugs.gnu.org/44773>.
Reported by Florian Pelz <pelzflorian@pelzflorian.de>.

This fixes a regression introduced in
6701f64f73.

* guix/transformations.scm (%transformation-options): Add
"--help-transform".
(show-transformation-options-help): Rename to...
(show-transformation-options-help/detailed): ... this.
(show-transformation-options-help): New public procedure.
* guix/scripts/build.scm (show-build-options-help): Remove
"--help-transform".
(%standard-build-options): Likewise.
(show-help): Call 'show-transformation-options-help'.
* guix/scripts/environment.scm (show-help): Likewise.
* guix/scripts/graph.scm (show-help): Likewise.
* guix/scripts/install.scm (show-help): Likewise.
* guix/scripts/pack.scm (show-help): Likewise.
* guix/scripts/package.scm (show-help): Likewise.
* guix/scripts/upgrade.scm (show-help): Likewise.
2020-11-21 12:39:14 +01:00
Ludovic Courtès 31726f32ac
transformations: Raise '&formatted-message' exceptions instead of 'leave'.
* guix/transformations.scm (evaluate-replacement-specs)
(package-git-url, evaluate-git-replacement-specs)
(transform-package-source-git-url)
(transform-package-toolchain): Use 'raise' and 'formatted-message'
instead of 'leave'.
2020-10-31 23:16:43 +01:00
Ludovic Courtès f68b3ba12d
guix build: Move transformation options to (guix transformations).
* guix/transformations.scm: New file.
* tests/scripts-build.scm: Rename to...
* tests/transformations.scm: ... this.
* Makefile.am (MODULES): Add 'guix/transformations.scm'.
(SCM_TESTS): Adjust to rename.
* guix/scripts/build.scm (numeric-extension?)
(tarball-base-name, <downloaded-file>, download-to-store*)
(compile-downloaded-file, package-with-source)
(transform-package-source, evaluate-replacement-specs)
(transform-package-inputs, transform-package-inputs/graft)
(%not-equal, package-git-url, evaluate-git-replacement-specs)
(transform-package-source-branch, transform-package-source-commit)
(transform-package-source-git-url, package-dependents/spec)
(package-toolchain-rewriting, transform-package-toolchain)
(transform-package-with-debug-info, transform-package-tests)
(%transformations, transformation-procedure, %transformation-options)
(show-transformation-options-help, options->transformation)
(package-transformations): Move to (guix transformations).
* guix/scripts/environment.scm: Adjust accordingly.
* guix/scripts/graph.scm: Likewise.
* guix/scripts/install.scm: Likewise.
* guix/scripts/pack.scm: Likewise.
* guix/scripts/package.scm: Likewise.
* guix/scripts/upgrade.scm: Likewise.
* po/guix/POTFILES.in: Add 'guix/transformations.scm'.
2020-10-31 23:16:43 +01:00