bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#27447: pelican-quickstart produces files with store path shebangs


From: zimoun
Subject: bug#27447: pelican-quickstart produces files with store path shebangs
Date: Tue, 14 Sep 2021 17:17:21 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Hi Mark,

On Thu, 14 Jan 2021 at 18:00, Mark H Weaver <mhw@netris.org> wrote:
> zimoun <zimon.toutoune@gmail.com> writes:

>> --8<---------------cut here---------------start------------->8---
>> $ guix environment -C --ad-hoc pelican coreutils grep
>> [env]$ mkdir foo && cd foo && ls -l
>> total 0
>>
>> [env]$ pelican-quickstart
>> Welcome to pelican-quickstart v4.2.0.
>>
>> This script will help you create a new Pelican-based website.
>>
>> Please answer the following questions so this script can generate the files
>> needed by Pelican.
>>
>>
>>> Where do you want to create your new web site? [.]
>>> What will be the title of this web site? Foo
>>> Who will be the author of this web site? zimoun
>>> What will be the default language of this web site? [en]
>>> Do you want to specify a URL prefix? e.g., https://example.com   (Y/n) n
>>> Do you want to enable article pagination? (Y/n) n
>>> What is your time zone? [Europe/Paris]
>>> Do you want to generate a tasks.py/Makefile to automate generation and 
>>> publishing? (Y/n) y
>>> Do you want to upload your website using FTP? (y/N) N
>>> Do you want to upload your website using SSH? (y/N) N
>>> Do you want to upload your website using Dropbox? (y/N) N
>>> Do you want to upload your website using S3? (y/N) N
>>> Do you want to upload your website using Rackspace Cloud Files? (y/N) N
>>> Do you want to upload your website using GitHub Pages? (y/N) N
>> Done. Your new project is available at /tmp/bar
>>
>> [env]$ ls
>> Makefile  content  output  pelicanconf.py  publishconf.py  tasks.py
>>
>> [env]$ egrep -nr "store"
>> pelicanconf.py:1:#!/gnu/store/h8jw9qhyfp6fm6nb3cgh4335qhr31wfz-python-wrapper-3.8.2/bin/python
>> publishconf.py:1:#!/gnu/store/h8jw9qhyfp6fm6nb3cgh4335qhr31wfz-python-wrapper-3.8.2/bin/python
>> --8<---------------cut here---------------end--------------->8---
>>
>> Why is it a bug?
>
> It's a bug because these absolute file names will cease to exist after
> the next 'core-updates' merge happens, and more precisely after the
> older system generations (or user profiles) are deleted and 'guix gc'
> subsequently deletes these obsolete store items.
>
> At that point, maybe things will break.  I think that would need to be
> investigated before dismissing this bug report.

I still miss why it is a bug.  The script ’pelican-quickstart’ is an
*helper* to generate this configuration file ’pelicancon.py’.
Therefore, the user should review it, IMHO.

Let consider this scenario:

    1. guix install pelican
    2. pelican-quickstart
    3. guix pull
    4. guix upgrade
    5. guix gc

At step #2, the generated configuration file is in agreement with the
Python interpreter.  Then, I agree that this Python could be gone after
the GC.

However, there is no guarantee that the generated configuration file at
step #2 still works with the potentially upgraded Pelican version (step
#4); independently of the shebang issue we are speaking.

Somehow, it is the responsibility of the user to maintain their
configuration file across the Pelican versions.

Well, considering my previous words [1],

        Why does embed store paths in configuration files is an issue?
        Pelican is a Python application which therefore requires a
        Python interpreter.  Running ’pelican’ against another Python VM
        than the one it was built seems a bad idea.

        And if the point is run “pelican-quickstart” with one Pelican
        version built against one Python VM, and then reuse these
        generated config files with another Pelican version built
        against another Python VM, in this use-case, the bug is upstream
        because it embeds absolute path which does not respect PEP 394
        [2].

I still think the bug is upstream.  Anyway.  The point is to resolve
and close this report. ;-)

First, I am not sure Pelican is a lot run by Guix users.  The version
4.2.0 seems from Oct. 2019 and the last upstream version is 4.6 from
March 2021.  Running,

  $ ./pre-inst-env guix refresh -u pelican
  $ ./pre-inst-env guix environment -C --ad-hoc pelican \
                        -- pelican-quickstart

does not fix the issue. (Maybe I will submit the resulting update,
separately.)


Second, do we patch Pelican to remove?  If yes, these absolute file
names in the generated configuration file should be replaced by what?


Cheers,
simon

1: <http://issues.guix.gnu.org/issue/27447#6>
2: <https://www.python.org/dev/peps/pep-0394/>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]