[PATCH] gnu: Fix current-guix.

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Christopher Baines
Owner
unassigned
Submitted by
Christopher Baines
Severity
normal

Debbugs page

Christopher Baines wrote 8 years ago
(address . guix-patches@gnu.org)
20170829064930.19849-1-mail@cbaines.net
Without this change, I get errors like:
ERROR: In procedure string-drop:
ERROR: Value out of range 0 to 35: 51

* gnu/packages/package-management.scm (current-guix): Pass exactly the same
path to git-predicate and local-file, to ensure that the select? function is
compatible.
---
gnu/packages/package-management.scm | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)

Toggle diff (31 lines)
diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index 67a956dea..a6c97e618 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -312,10 +312,11 @@ generated file."
#t)))
(define-public current-guix
- (let ((select? (delay (or (git-predicate
- (string-append (current-source-directory)
- "/../.."))
- source-file?))))
+ (let* ((repository-root (canonicalize-path
+ (string-append (current-source-directory)
+ "/../..")))
+ (select? (delay (or (git-predicate repository-root)
+ source-file?))))
(lambda ()
"Return a package representing Guix built from the current source tree.
This works by adding the current source tree to the store (after filtering it
@@ -323,7 +324,7 @@ out) and returning a package that uses that as its 'source'."
(package
(inherit guix)
(version (string-append (package-version guix) "+"))
- (source (local-file "../.." "guix-current"
+ (source (local-file repository-root "guix-current"
#:recursive? #t
#:select? (force select?)))))))
--
2.14.1
Christopher Baines wrote 8 years ago
Fix current-guix
(address . 28273@debbugs.gnu.org)
20170829080004.26bf784f@cbaines.net
You can check if this works for you by running:

guix build -e "((@ (gnu packages package-management) current-guix))"
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlmlEPRfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XdhYBAAjGA5ajdDaM0T9ei2b+gtIEjrHY3nACWPVPrNn7kOKkVa2NNxumg5tS9h
H/6mJMMYQDNbBf40xtdK1lz5NVYDKGsQHytgZcRU6x64pDTwzf1Zkf6jZg8a657L
dlR/Z3wov4vXGN7J5tVer+KH+P9L/QnfUneLFESc5Y+Ca2P60bI3f0Ue3LLxWfuq
ETHydr/7nX/A79/ntdEjDTZios7Pkr8IvGNK+AsD8M4/YccjwsVRSgLQ44tXL3gu
CYLPrEk9/CJh+cA1Lq2NXiYbnTorOG2hl/WfqhoaR58goPoUVs4CtSE1TGukQSRf
emRIXPI53Le6ZbagfRZ3hSg8fAuo59oDmcDrxAz4/O84TEvJNi429LX6jFC5S9KG
2y8xeBOp1n8opSYbHfYFjhPPp4SPZg/0aC4xyofNWWgf8iJrrEF9wnrNJr3yg9vm
zB1PecjPYpCuA7LrlI57Vp1ozj4qKQmWLQwKD5tlPgKsmbpPwwXVpozm+KDuqCLP
MuKlho5Ac7jGlOq7+8gD/72ZzXJDe8UCpjZBLatPrziEXA8iIWVC718cRNyrccRU
g1ZBBfZHtu2duxuPG0jOdrpusZwGWUwLi7KOFVCLW0+fxr88fgYtJJr3MxoArQYV
1B55qOgZ1D46no2+fFnBi1dQtt4wp/Y7DT87VW/zkwJv4VjE4hs=
=WFmB
-----END PGP SIGNATURE-----


Ludovic Courtès wrote 8 years ago
Re: [bug#28273] [PATCH] gnu: Fix current-guix.
(name . Christopher Baines)(address . mail@cbaines.net)(address . 28273@debbugs.gnu.org)
87val3ri36.fsf@gnu.org
Christopher Baines <mail@cbaines.net> skribis:

Toggle quote (8 lines)
> Without this change, I get errors like:
> ERROR: In procedure string-drop:
> ERROR: Value out of range 0 to 35: 51
>
> * gnu/packages/package-management.scm (current-guix): Pass exactly the same
> path to git-predicate and local-file, to ensure that the select? function is
> compatible.

Good catch, LGTM.

I think that fundamentally, we should arrange for ‘git-predicate’ to not
do any string prefix comparison. That’s bound to fail. If we could
somehow restrict it to comparing inode numbers, that’d be perfect.

Ludo’.
Christopher Baines wrote 8 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 28273-done@debbugs.gnu.org)
20170831220421.5ba1287c@cbaines.net
On Thu, 31 Aug 2017 15:18:37 +0200
ludo@gnu.org (Ludovic Courtès) wrote:

Toggle quote (12 lines)
> Christopher Baines <mail@cbaines.net> skribis:
>
> > Without this change, I get errors like:
> > ERROR: In procedure string-drop:
> > ERROR: Value out of range 0 to 35: 51
> >
> > * gnu/packages/package-management.scm (current-guix): Pass exactly
> > the same path to git-predicate and local-file, to ensure that the
> > select? function is compatible.
>
> Good catch, LGTM.

Great, I've merged this now.

Toggle quote (5 lines)
> I think that fundamentally, we should arrange for ‘git-predicate’ to
> not do any string prefix comparison. That’s bound to fail. If we
> could somehow restrict it to comparing inode numbers, that’d be
> perfect.

Hmm, yeah, that might work well... I think the structure would simplify
to:
- taking the list of files, creating a list of directories
(rather than a tree)
- combining these lists
- finding each inode for every file and directory

The predicate could then check if the provided inode is known, without
switching on the type as it does at the moment.

I'll put it on my list of things to look at :)
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlmoedVfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XfGCw//ej1ePV0FXY74v0kH6LbzRPXNTdMaNCeKthzV0GZEpb6D1F9liHJtsiQf
QOMpFlRvYxBuv9SfQXLWsW7gaPHA21oHiZMzzbD6Fxmbm0R62F7E13siFVqkBnis
K4PP2Nfcy1As4aX5Y+j+t/OPQxageowJzGmWOKpGdg6DvKeUjAj1D1wufRbh5Lpd
3aHZrwa/yylwTefor7GOyEhXPzKDbNCyppWts4FMccKtBedpPs7qF4AeYcTy1Bks
Mc9c4HB4TMDNrqon4IauI43VS7FNySItR92ObpdQBchoqb4C0241+KMmBCg6ng8A
2Sv5fGEvyD+Vz+1C4eShVTylRLe8kGJGI5pXnDIW07dLPQLGUT0XGZIxu5mLVV7j
2BYcVhbI9MJNDrN5J0HxCnkqsMOBAZMlx02xGVoap1WSpDvDA6RDi5y9noQm/237
Y8cyl631pHgIoBvIyb5i4gAxtuMnvnU7FBXEXAGPTXx2A1BTvIxTvgfrVeVqGnyY
fVWImAVme6LUNEpJg5Kg1WMXG3be5U5vrNG6Gw1NpSO/FZTv1Uy9C87NUinDTGX0
g1cPW7ZdEsFusPc8G6mjDj2/Qa6SJk/dvluPjGDaGGHd9U3yVUrvQ0uNYUuIkofZ
CjYDUwNMSqAkh6flV7XzOL+sXdeSk/ooxqljqQKZBs0/IWbCnyg=
=01KS
-----END PGP SIGNATURE-----


Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 28273@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 28273
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
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help