Aloha Guix Help,
After a few years I decided to really want to sit down and learn Guix
deeply. In this email, I wish to understand the difference between using
Guile Scheme to interact with Guix and using Bash to interact with Guix.
QUESTION: Why does Guile Scheme not find some package symbols that the
command line can?
BACKGROUND:
Firstly, the output of =guix describe=
```
zjabbar@tao ~/code/leetcode$ guix describe
Generation 628 May 12 2024 14:46:41 (current)
guix 6ba29e0
repository URL: https://git.savannah.gnu.org/git/guix.git
branch: master
commit: 6ba29e02108ed144da1234b4b5512ee03865dcf6
```
When I use =guix search python-pytorch= or use the Emacs Guix interface and
=M-x guix p n python-pytorch= I get three different versions of
=python-pytorch=: 1.13.1, 2.0.1, and 2.2.1.
They are all defined in =gnu/packages/machine-learning.scm=
Using =guix build python-pytorch= will build the latest version 2.2.1.
However, in Scheme,
```
(use-modules (gnu packages))
(specification->package "python-pytorch")
```
Returns the package 2.0.1. To my knowledge, we should be able to import the
Scheme module and use the symbol if it is exported directly or defined
using define-public. Hence, I expect the following,
```
(use-modules (gnu packages)
(gnu packages machine-learning))
(specification->package "python-pytorch") ;; 2.2.1
python-pytorch ;; 1.13.1
python-pytorch2 ;; 2.2.1
python-pytorch-for-r-torch ;; 2.0.1
```
Instead I get,
```
(use-modules (gnu packages)
(gnu packages machine-learning))
(specification->package "python-pytorch") ;; 2.0.1
python-pytorch ;; 1.13.1
python-pytorch2 ;; Unbound variable: python-pytorch2
python-pytorch-for-r-torch ;; 2.0.1
```
This means that the following code does not work because Guile does not
find version 2.2.1,
```
(use-modules (gnu packages)
(guix transformations))
((options->transformation '((with-input . "[email protected]
[email protected]")))
(specification->package "python-torchvision"))
```
The following does also does not work,
```
(use-modules (gnu packages)
(guix packages))
((package-input-rewriting `((,python-pytorch . ,python-pytorch2)))
(specification->package "python-torchvision"))
```
--
Mahalo,
Zain Jabbar