unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: brettg@posteo.net
To: Bug guix <Bug-guix@gnu.org>, Ricardo Wurmus <rekado@elephly.net>
Cc: bug-Guix <bug-guix-bounces+brettg=posteo.net@gnu.org>
Subject: bug#38261: Recent changes to emacs build system
Date: Tue, 19 Nov 2019 02:58:33 +0100	[thread overview]
Message-ID: <57dee66c6531e9c8afbc5a22518d9917@posteo.net> (raw)
In-Reply-To: <26711cb3bba8555dea8ac4e9f8220726@posteo.net>



On 19.11.2019 01:32, brettg@posteo.net wrote:
> On 19.11.2019 01:27, brettg@posteo.net wrote:
>> On 18.11.2019 22:34, brettg@posteo.net wrote:
>>> On 18.11.2019 21:33, brettg@posteo.net wrote:
>>>> On 18.11.2019 21:28, brettg@posteo.net wrote:
>>>>> On 18.11.2019 20:01, brettg@posteo.net wrote:
>>>>>> Hey all, the recent changes to the emacs build system result in a 
>>>>>> few
>>>>>> broken packages like emacs-pdf-tools, or basically anything that 
>>>>>> uses
>>>>>> a phase for emacs-set-emacs-load-path.
>>>>>> 
>>>>>> For example, I borrowed the technique used by emacs-pdf-tools to
>>>>>> package emacs-telega, resulting in both packages failing to build:
>>>>>> 
>>>>>> Here is the code for emacs-telega:
>>>>>> 
>>>>>> https://git.sr.ht/~brettgilio/cfg/tree/master/channel/non-gnu/packages/emacs-xyz.scm#L99
>>>>>> 
>>>>>> The issue is in this phase for both emacs-pdf-tools and my channel 
>>>>>> package:
>>>>>> 
>>>>>>  (add-after 'compress-documentation 'emacs-set-emacs-load-path
>>>>>> 			  (assoc-ref emacs:%standard-phases 'set-emacs-load-path))
>>>>>> 
>>>>>> Resulting in:
>>>>>> 
>>>>>> starting phase `emacs-set-emacs-load-path'
>>>>>> Backtrace:
>>>>>>            5 (primitive-load 
>>>>>> "/gnu/store/5b1p1gsvfyi4fbx4s42rhab2dns…")
>>>>>> In ice-9/eval.scm:
>>>>>>    191:35  4 (_ _)
>>>>>> In ice-9/boot-9.scm:
>>>>>>     829:9  3 (catch _ _ #<procedure 7ffff3bbb518 at 
>>>>>> /gnu/store/zmkg…> …)
>>>>>> In srfi/srfi-1.scm:
>>>>>>    863:16  2 (every1 #<procedure 7ffff30ae160 at 
>>>>>> /gnu/store/zmkgrvv…> …)
>>>>>> In
>>>>>> /gnu/store/zmkgrvvhmrix2b1z7id6zrg9bb7qxzdl-module-import/guix/build/gnu-build-system.scm:
>>>>>>    839:30  1 (_ _)
>>>>>> In unknown file:
>>>>>>            0 (_ #:source 
>>>>>> "/gnu/store/qw8xbmk6ryl9a2jrp0gip3yffmsdix…" …)
>>>>>> 
>>>>>> ERROR: Wrong type to apply: #f
>>>>>> 
>>>>>> If we suspect that changes are going to be non-backwards 
>>>>>> compatible
>>>>>> could we use the news system to pass along that message? Much
>>>>>> appreciated. Thanks.
>>>>>> 
>>>>>> Brett Gilio
>>>>> 
>>>>> I applied a hotfix to the package by replacing 'set-emacs-load-path
>>>>> with 'add-source-to-load-path. I believe this fix would work for 
>>>>> all
>>>>> other affected packages.
>>>> 
>>>> https://git.sr.ht/~brettgilio/cfg/commit/c24a6db9d25151c487e9db675bd74e4bb3912173
>>> 
>>> Ricardo, just wanted to make you aware that this emacs-build-system
>>> change does break your guile-studio. I discovered this because I
>>> adopted some of your ideas of autoloading in the generated emacs lisp
>>> from guile-studio when creating my own emacs configuration dependent
>>> on guix, which resulted in
>>> 
>>> progn: Wrong number of arguments: (lambda nil "Autoload Emacs 
>>> packages
>>> found in EMACSLOADPATH.
>>> 
>>> 'Autoload' means to load the 'autoloads' files matching
>>> `guix-emacs-autoloads-regexp'." (interactive) (let* ((emacs-load-path
>>> (getenv "EMACSLOADPATH")) (emacs-non-core-load-path-directories
>>> (seq-filter (function (lambda (dir) (string-match-p
>>> "/share/emacs/site-lisp" dir))) (split-string emacs-load-path ":")))
>>> (autoloads (mapcan (function guix-emacs-find-autoloads)
>>> emacs-non-core-load-path-directories))) (mapc (function (lambda (f)
>>> (load f (quote noerror)))) autoloads))), 78
>>> 
>>> I'll let you know if I can find any fix for this when I get some 
>>> time.
>>> But just wanted to pass the message along.
>>> 
>>> Brett
>> 
>> I tried removing the arguments passed to
>> `guix-emacs-autoload-packages' as the updated version
>> (http://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/aux-files/emacs/guix-emacs.el?id=47b3b4c2aa49e21f4cc32c97ff7bbbd069bb849c)
>> does not carry arguments anymore, instead depending on a variable
>> EMACSLOADPATH. However, whenever that is done it returns
>> 
>> split-string: Wrong type argument: stringp, nil
>> 
>> possibly because my system is not finding EMACSLOADPATH.
>> 
>> I will keep investigating.
> 
> I can confirm, when running something analogous to `guix environment
> --ad-hoc emacs-dashboard` no changes are being made to the
> $GUIX_ENVIRONMENT/etc/profile to resemble EMACSLOADPATH.

So I have investigated the issue with EMACSLOADPATH: Similar to 
Ricardo's guile-studio,
my package enlign was using the autoload function from guix-emacs.el to 
propagate a list
of packages called from inputs to be loaded with the start of emacs.

I have since revised this to just call the autoload function directly, 
no longer passing any arguments, and had to modify my enlign package to 
respect the EMACSLOADPATH variable. This is only possible if all of the 
packages are passed as propagated-inputs though, which is less than 
desirable in my opinion (though I am willing to be convinced.)

This additionally leads to having to require emacs as a propagated input 
as well, as leading it native or regular input leads to an error with 
emacs not recognizing simple.el or mule-util.

Overall, I am not sure if I like the recent change to guix-emacs.el. I 
understand where the incentive is to do this, but ultimately it seems to 
lead to more headache when creating packages around emacs.

https://git.sr.ht/~brettgilio/cfg/commit/47bc9ae544ba10c0cacef1435625dcb0114e8cf5

Anyways,

If there is no other comment, this issue really just needs to fix 
emacs-pdf-tools and other affected packages from the recent string of 
changes.

Best,
Brett Gilio

  reply	other threads:[~2019-11-19  1:59 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-18 19:01 bug#38261: Recent changes to emacs build system brettg
2019-11-18 20:28 ` brettg
2019-11-18 20:33   ` brettg
2019-11-18 21:34     ` brettg
2019-11-19  0:27       ` brettg
2019-11-19  0:32         ` brettg
2019-11-19  1:58           ` brettg [this message]
2019-11-19 21:14             ` Maxim Cournoyer
2019-11-19 21:16               ` brettg
2019-11-19 21:29                 ` Maxim Cournoyer
2019-11-19 21:32                   ` brettg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57dee66c6531e9c8afbc5a22518d9917@posteo.net \
    --to=brettg@posteo.net \
    --cc=Bug-guix@gnu.org \
    --cc=bug-guix-bounces+brettg=posteo.net@gnu.org \
    --cc=rekado@elephly.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).