'autocrlf' in ~/.gitconfig can break "guix pull" checkouts

  • Open
  • quality assurance status badge
Details
3 participants
  • Ludovic Courtès
  • Maxime Devos
  • Grigory Shepelev
Owner
unassigned
Submitted by
Grigory Shepelev
Severity
important

Debbugs page

G
G
Grigory Shepelev wrote on 26 Dec 2021 02:14
Bug report
(address . bug-guix@gnu.org)
CAGJuR-5kOYCLNF6Qe6Omr+tH_AHfH30KKc8XDrpH3SKwTJH=mQ@mail.gmail.com
Today's guix pull gives the following bug.
Attachment: file
shegeley@zone51 ~$ guix pull
Updating channel 'nonguix' from Git repository at 'https://gitlab.com/nonguix/nonguix'...
Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
Building from these channels:
Computing Guix derivation for 'x86_64-linux'... -ice-9/read.scm:126:4: In procedure read-string:
gnu/packages/virtualization.scm:640:1: invalid character in escape sequence: #\return
guix pull: error: You found a bug: the program '/gnu/store/w1hd6ab7f92y0f2r1ah4yyvi205a71bc-compute-guix-derivation'
failed to compute the derivation for Guix (version: "2495582e08cf411163f0799d290fda5101141949"; system: "x86_64-linux";
host version: "1dfe8c372163d481ebebb97dd3b4cafa49906b28"; pull-version: 1).
Please report the COMPLETE output above by email to <bug-guix@gnu.org>.

shegeley@zone51 ~$ guix describe
Generation 1 Dec 25 2021 11:29:17 (current)
guix 1dfe8c3
branch: master
commit: 1dfe8c372163d481ebebb97dd3b4cafa49906b28
nonguix 39e4b41
branch: master
commit: 39e4b41e5f7277b8d58084cd7aff8edde71f6572

shegeley@zone51 ~$ guix home describe
Generation 7 Dec 26 2021 12:06:08 (current)
file name: /var/guix/profiles/per-user/shegeley/guix-home-7-link
canonical file name: /gnu/store/gs67wavx1yi8073j7ab89ld9fkkjqhc5-home
channels:
nonguix:
branch: master
commit: 39e4b41e5f7277b8d58084cd7aff8edde71f6572
guix:
branch: master
commit: 1dfe8c372163d481ebebb97dd3b4cafa49906b28
configuration file: /gnu/store/r7wlaf9pqmnrharqprvhwcsxbzylwqrl-configuration.scm

shegeley@zone51 ~$ guix system describe
Generation 12 Dec 25 2021 23:09:27 (current)
file name: /var/guix/profiles/system-12-link
canonical file name: /gnu/store/cyr8pjabz8gj9a99wydqwrs1igkmzxk8-system
label: GNU with Linux 5.15.11
bootloader: grub-efi
root device: UUID: b127a177-06dd-4c1d-8ddf-53a68170f1b6
kernel: /gnu/store/hs0vfgmvpywdzv7b7q2vpw38y73d6vls-linux-5.15.11/bzImage
channels:
nonguix:
branch: master
commit: 39e4b41e5f7277b8d58084cd7aff8edde71f6572
guix:
branch: master
commit: 1dfe8c372163d481ebebb97dd3b4cafa49906b28
configuration file: /gnu/store/ha2hn9i7yd7hds9hsx1bv5jf90ibja51-configuration.scm
M
M
Maxime Devos wrote on 26 Dec 2021 03:22
Re: bug#52801: Guile inconsistently misbehaves in case of escapes and carriage returns, breaking "guix pull"
a20a798c001e83689f103a81965298b81bf94a92.camel@telenet.be
retitle 52801 Guile inconsistently misbehaves in case of escapes and carriage returns, breaking "guix pull"
severity 52801 important
thanks

Grigory Shepelev schreef op zo 26-12-2021 om 13:14 [+0300]:
Today's guix pull gives the following bug.

Seems like an instance of https://issues.guix.gnu.org/52559#15.
I took the liberty of renaming the bug report appropriately.

Anyway, here's the minimal reproducer:

Run the following in a REPL:
(call-with-input-string "\"Hello\\\rcarriage return!\"" read)
;; --> invalid character in escape sequence: #\return

Greetings,
Maxime.
M
M
Maxime Devos wrote on 26 Dec 2021 07:20
(address . control@debbugs.gnu.org)
bacc21423898e97b4b694b4d71a4fba541c7c1da.camel@telenet.be
retitle 52801 Guil misbehaves in case of escapes and carriage returns, sometimes breaking "guix pull"
severity 52801 important
thanks
M
M
Maxime Devos wrote on 26 Dec 2021 07:22
(address . control@debbugs.gnu.org)
89849eb47d0d2393a272f977e402318fa1da3371.camel@telenet.be
retitle 52801 Guile misbehaves in case of escapes and carriage returns, sometimes breaking "guix pull"
severity 52801 important
thanks
L
L
Ludovic Courtès wrote on 30 Jan 2022 09:52
(address . 52801@debbugs.gnu.org)
87h79l9kml.fsf@gnu.org
Hi,

Grigory Shepelev <shegeley@gmail.com> skribis:

Toggle quote (12 lines)
> shegeley@zone51 ~$ guix pull
> Updating channel 'nonguix' from Git repository at 'https://gitlab.com/nonguix/nonguix'...
> Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
> Building from these channels:
> guix https://git.savannah.gnu.org/git/guix.git 2495582
> nonguix https://gitlab.com/nonguix/nonguix 39e4b41
> Computing Guix derivation for 'x86_64-linux'... -ice-9/read.scm:126:4: In procedure read-string:
> gnu/packages/virtualization.scm:640:1: invalid character in escape sequence: #\return
> guix pull: error: You found a bug: the program '/gnu/store/w1hd6ab7f92y0f2r1ah4yyvi205a71bc-compute-guix-derivation'
> failed to compute the derivation for Guix (version: "2495582e08cf411163f0799d290fda5101141949"; system: "x86_64-linux";
> host version: "1dfe8c372163d481ebebb97dd3b4cafa49906b28"; pull-version: 1).

Maxime Devos <maximedevos@telenet.be> skribis:

Toggle quote (9 lines)
> Seems like an instance of https://issues.guix.gnu.org/52559#15.
> I took the liberty of renaming the bug report appropriately.
>
> Anyway, here's the minimal reproducer:
>
> Run the following in a REPL:
> (call-with-input-string "\"Hello\\\rcarriage return!\"" read)
> ;; --> invalid character in escape sequence: #\return

That’s expected. Conversely, this one works:

(call-with-input-string "\"Hello \\\nnewline!\"" read)

What was in gnu/packages/virtualization.scm:640:1 at that point?

Toggle snippet (17 lines)
$ git ls-tree 2495582e08cf411163f0799d290fda5101141949 -- gnu/packages
040000 tree 8070c9587f76797cf16800522688ded39c956d00 gnu/packages
$ git ls-tree 8070c9587f76797cf16800522688ded39c956d00 |grep virtuali
100644 blob 20ffb4a481239349078e2a2864d1bd873dfcd143 virtualization.scm
$ git show 20ffb4a481239349078e2a2864d1bd873dfcd143 |head -649 |tail -10
"/run/setuid-programs:/run/current-system/profile/sbin:\
/run/current-system/profile/bin"))))
(add-after 'bootstrap 'patch-sphinx-version-detection
(lambda _
;; The build system runs 'sphinx-build --version' to verify that
;; the Sphinx is recent enough, but does not expect the
;; .sphinx-build-real executable name created by the Sphinx wrapper.
(substitute* "configure"
(("\\$SPHINX --version 2>&1")
"$SPHINX --version 2>&1 \

AFAICS, this was a regular \n (not \r) following backslash.

Did the issue magically disappear?

Grigory, could it be that libgit2 somehow converted \n to \r\n on your
machine, or that you manually accesses files under
~/.cache/guix/checkouts?

Thanks,
Ludo’.
G
G
Grigory Shepelev wrote on 30 Jan 2022 11:45
(name . Ludovic Courtès)(address . ludo@gnu.org)
CAGJuR-74nJiEFeSMPG-V6ULXgdt__xmMKjLL_wTunhbBpLezvQ@mail.gmail.com
Seems like the problem was in my .gitconfig file where "autocrlf = true". I
set it to "false", and cleared the cache. Then the "guix pull" started to
work as expected.
I don't even remember why I had to get into "git's guts". Something like:
had some problem with some exact project where my colleague used macOS or
windows and some files that came from git had some problems with that.

вс, 30 янв. 2022 г. в 20:52, Ludovic Courtès <ludo@gnu.org>:

Toggle quote (71 lines)
> Hi,
>
> Grigory Shepelev <shegeley@gmail.com> skribis:
>
> > shegeley@zone51 ~$ guix pull
> > Updating channel 'nonguix' from Git repository at '
> https://gitlab.com/nonguix/nonguix'...
> > Updating channel 'guix' from Git repository at '
> https://git.savannah.gnu.org/git/guix.git'...
> > Building from these channels:
> > guix https://git.savannah.gnu.org/git/guix.git 2495582
> > nonguix https://gitlab.com/nonguix/nonguix 39e4b41
> > Computing Guix derivation for 'x86_64-linux'... -ice-9/read.scm:126:4:
> In procedure read-string:
> > gnu/packages/virtualization.scm:640:1: invalid character in escape
> sequence: #\return
> > guix pull: error: You found a bug: the program
> '/gnu/store/w1hd6ab7f92y0f2r1ah4yyvi205a71bc-compute-guix-derivation'
> > failed to compute the derivation for Guix (version:
> "2495582e08cf411163f0799d290fda5101141949"; system: "x86_64-linux";
> > host version: "1dfe8c372163d481ebebb97dd3b4cafa49906b28"; pull-version:
> 1).
>
> Maxime Devos <maximedevos@telenet.be> skribis:
>
> > Seems like an instance of <https://issues.guix.gnu.org/52559#15>.
> > I took the liberty of renaming the bug report appropriately.
> >
> > Anyway, here's the minimal reproducer:
> >
> > Run the following in a REPL:
> > (call-with-input-string "\"Hello\\\rcarriage return!\"" read)
> > ;; --> invalid character in escape sequence: #\return
>
> That’s expected. Conversely, this one works:
>
> (call-with-input-string "\"Hello \\\nnewline!\"" read)
>
> What was in gnu/packages/virtualization.scm:640:1 at that point?
>
> --8<---------------cut here---------------start------------->8---
> $ git ls-tree 2495582e08cf411163f0799d290fda5101141949 -- gnu/packages
> 040000 tree 8070c9587f76797cf16800522688ded39c956d00 gnu/packages
> $ git ls-tree 8070c9587f76797cf16800522688ded39c956d00 |grep virtuali
> 100644 blob 20ffb4a481239349078e2a2864d1bd873dfcd143 virtualization.scm
> $ git show 20ffb4a481239349078e2a2864d1bd873dfcd143 |head -649 |tail -10
> "/run/setuid-programs:/run/current-system/profile/sbin:\
> /run/current-system/profile/bin"))))
> (add-after 'bootstrap 'patch-sphinx-version-detection
> (lambda _
> ;; The build system runs 'sphinx-build --version' to verify
> that
> ;; the Sphinx is recent enough, but does not expect the
> ;; .sphinx-build-real executable name created by the Sphinx
> wrapper.
> (substitute* "configure"
> (("\\$SPHINX --version 2>&1")
> "$SPHINX --version 2>&1 \
> --8<---------------cut here---------------end--------------->8---
>
> AFAICS, this was a regular \n (not \r) following backslash.
>
> Did the issue magically disappear?
>
> Grigory, could it be that libgit2 somehow converted \n to \r\n on your
> machine, or that you manually accesses files under
> ~/.cache/guix/checkouts?
>
> Thanks,
> Ludo’.
>
Attachment: file
G
G
Grigory Shepelev wrote on 30 Jan 2022 11:47
(name . Ludovic Courtès)(address . ludo@gnu.org)
CAGJuR-5UYEVv0MMUGi0YrX_0b7HnLK2GecPdFLRi5cw6S4XiFw@mail.gmail.com
That explains why the problem was raised on my desktop PC as well. It uses
the same .gitconfig file.

вс, 30 янв. 2022 г. в 22:45, Grigory Shepelev <shegeley@gmail.com>:

Toggle quote (81 lines)
> Seems like the problem was in my .gitconfig file where "autocrlf = true".
> I set it to "false", and cleared the cache. Then the "guix pull" started to
> work as expected.
> I don't even remember why I had to get into "git's guts". Something like:
> had some problem with some exact project where my colleague used macOS or
> windows and some files that came from git had some problems with that.
>
> вс, 30 янв. 2022 г. в 20:52, Ludovic Courtès <ludo@gnu.org>:
>
>> Hi,
>>
>> Grigory Shepelev <shegeley@gmail.com> skribis:
>>
>> > shegeley@zone51 ~$ guix pull
>> > Updating channel 'nonguix' from Git repository at '
>> https://gitlab.com/nonguix/nonguix'...
>> > Updating channel 'guix' from Git repository at '
>> https://git.savannah.gnu.org/git/guix.git'...
>> > Building from these channels:
>> > guix https://git.savannah.gnu.org/git/guix.git 2495582
>> > nonguix https://gitlab.com/nonguix/nonguix 39e4b41
>> > Computing Guix derivation for 'x86_64-linux'... -ice-9/read.scm:126:4:
>> In procedure read-string:
>> > gnu/packages/virtualization.scm:640:1: invalid character in escape
>> sequence: #\return
>> > guix pull: error: You found a bug: the program
>> '/gnu/store/w1hd6ab7f92y0f2r1ah4yyvi205a71bc-compute-guix-derivation'
>> > failed to compute the derivation for Guix (version:
>> "2495582e08cf411163f0799d290fda5101141949"; system: "x86_64-linux";
>> > host version: "1dfe8c372163d481ebebb97dd3b4cafa49906b28"; pull-version:
>> 1).
>>
>> Maxime Devos <maximedevos@telenet.be> skribis:
>>
>> > Seems like an instance of <https://issues.guix.gnu.org/52559#15>.
>> > I took the liberty of renaming the bug report appropriately.
>> >
>> > Anyway, here's the minimal reproducer:
>> >
>> > Run the following in a REPL:
>> > (call-with-input-string "\"Hello\\\rcarriage return!\"" read)
>> > ;; --> invalid character in escape sequence: #\return
>>
>> That’s expected. Conversely, this one works:
>>
>> (call-with-input-string "\"Hello \\\nnewline!\"" read)
>>
>> What was in gnu/packages/virtualization.scm:640:1 at that point?
>>
>> --8<---------------cut here---------------start------------->8---
>> $ git ls-tree 2495582e08cf411163f0799d290fda5101141949 -- gnu/packages
>> 040000 tree 8070c9587f76797cf16800522688ded39c956d00 gnu/packages
>> $ git ls-tree 8070c9587f76797cf16800522688ded39c956d00 |grep virtuali
>> 100644 blob 20ffb4a481239349078e2a2864d1bd873dfcd143 virtualization.scm
>> $ git show 20ffb4a481239349078e2a2864d1bd873dfcd143 |head -649 |tail -10
>> "/run/setuid-programs:/run/current-system/profile/sbin:\
>> /run/current-system/profile/bin"))))
>> (add-after 'bootstrap 'patch-sphinx-version-detection
>> (lambda _
>> ;; The build system runs 'sphinx-build --version' to verify
>> that
>> ;; the Sphinx is recent enough, but does not expect the
>> ;; .sphinx-build-real executable name created by the Sphinx
>> wrapper.
>> (substitute* "configure"
>> (("\\$SPHINX --version 2>&1")
>> "$SPHINX --version 2>&1 \
>> --8<---------------cut here---------------end--------------->8---
>>
>> AFAICS, this was a regular \n (not \r) following backslash.
>>
>> Did the issue magically disappear?
>>
>> Grigory, could it be that libgit2 somehow converted \n to \r\n on your
>> machine, or that you manually accesses files under
>> ~/.cache/guix/checkouts?
>>
>> Thanks,
>> Ludo’.
>>
>
Attachment: file
M
M
Maxime Devos wrote on 30 Jan 2022 13:06
(address . 52801@debbugs.gnu.org)
982577c012cb2c3882821e9b8e19968b5b9f4936.camel@telenet.be
Grigory Shepelev schreef op zo 30-01-2022 om 22:45 [+0300]:
Toggle quote (4 lines)
> Seems like the problem was in my .gitconfig file where "autocrlf =
> true". I set it to "false", and cleared the cache. Then the "guix
> pull" started to work as expected.

According to
we can tell libgit to not do CRLF conversion, which would make (guix git)
more robust.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYfb91RccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7jDoAQCEfUYzUfGPJ99reavwpCyAU5fK
jHcctGQUXpZw3wrBfgD/d2jCJRwqjLgO0qE9Gl//pUjbmLJkrGlmTg9Hpt8tDQM=
=idz3
-----END PGP SIGNATURE-----


G
G
Grigory Shepelev wrote on 31 Jan 2022 04:48
(name . Maxime Devos)(address . maximedevos@telenet.be)
CAGJuR-6_9xZZUtxMpCws0wQ4e8mBwXQJiSwAnxBp-JDeBP4_jw@mail.gmail.com
The issue can be closed I guess. Thanks for your assistance.

пн, 31 янв. 2022 г. в 00:06, Maxime Devos <maximedevos@telenet.be>:

Toggle quote (14 lines)
> Grigory Shepelev schreef op zo 30-01-2022 om 22:45 [+0300]:
> > Seems like the problem was in my .gitconfig file where "autocrlf =
> > true". I set it to "false", and cleared the cache. Then the "guix
> > pull" started to work as expected.
>
> According to
> <https://github.com/libgit2/libgit2/blob/HEAD/include/git2/clone.h#L111>
> and <https://libgit2.org/libgit2/#HEAD/type/git_checkout_options>,
> we can tell libgit to not do CRLF conversion, which would make (guix git)
> more robust.
>
> Greetings,
> Maxime.
>
Attachment: file
M
M
Maxime Devos wrote on 31 Jan 2022 05:20
(name . Grigory Shepelev)(address . shegeley@gmail.com)
adf386420414603ecca717b6d497a2f68cc9c160.camel@telenet.be
Grigory Shepelev schreef op ma 31-01-2022 om 15:48 [+0300]:
Toggle quote (18 lines)
> The issue can be closed I guess. Thanks for your assistance.

> пн, 31 янв. 2022 г. в 00:06, Maxime Devos <maximedevos@telenet.be>:
> > Grigory Shepelev schreef op zo 30-01-2022 om 22:45 [+0300]:
> > > Seems like the problem was in my .gitconfig file where "autocrlf
> > =
> > > true". I set it to "false", and cleared the cache. Then the "guix
> > > pull" started to work as expected. 
> >
> > According to
> >
> <https://github.com/libgit2/libgit2/blob/HEAD/include/git2/clone.h#L111
> > >
> > and <https://libgit2.org/libgit2/#HEAD/type/git_checkout_options>,
> > we can tell libgit to not do CRLF conversion, which would make
> > (guix git)
> > more robust.

I don't think that modifying some git settings should break "guix
pull",
so I wouldn't close yet.

Greetings,
Maxime
Attachment: file
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYffiNxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7jQqAPwK8FEbytIUZBF/9I+AzEwWWA8P
NuoQnF0LfRBRsZCPXgD/Wu1GpZWiF45IYsIlcz1/YgtXDLrZxw6gHA7pEWEKAgU=
=gnk4
-----END PGP SIGNATURE-----


L
L
Ludovic Courtès wrote on 1 Feb 2022 00:45
control message for bug #52801
(address . control@debbugs.gnu.org)
87h79j6kli.fsf@gnu.org
retitle 52801 'autocrlf' in ~/.gitconfig can break "guix pull" checkouts
quit
L
L
Ludovic Courtès wrote on 1 Feb 2022 00:48
Re: bug#52801: Guile misbehaves in case of escapes and carriage returns, sometimes breaking "guix pull"
(name . Maxime Devos)(address . maximedevos@telenet.be)
87fsp36khr.fsf@gnu.org
Hi Maxime,

Maxime Devos <maximedevos@telenet.be> skribis:

Toggle quote (11 lines)
> Grigory Shepelev schreef op zo 30-01-2022 om 22:45 [+0300]:
>> Seems like the problem was in my .gitconfig file where "autocrlf =
>> true". I set it to "false", and cleared the cache. Then the "guix
>> pull" started to work as expected.
>
> According to
> <https://github.com/libgit2/libgit2/blob/HEAD/include/git2/clone.h#L111>
> and <https://libgit2.org/libgit2/#HEAD/type/git_checkout_options>,
> we can tell libgit to not do CRLF conversion, which would make (guix git)
> more robust.

Indeed. Looks like Guile-Git doesn’t expose checkout options yet, so
doing that would be the first step.

Maybe Guix should just ignore ~/.gitconfig altogether?

Thanks,
Ludo’.
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 52801@patchwise.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 52801
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch