all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* package updater: operate on package structs, not names?
@ 2015-12-01 10:41 Ricardo Wurmus
  2015-12-01 12:43 ` Ricardo Wurmus
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Ricardo Wurmus @ 2015-12-01 10:41 UTC (permalink / raw)
  To: guix-devel@gnu.org

Hi Guix,

I noticed a flaw in the CRAN updater.  The ‘latest-release’ procedure is
called with the result of ‘(package-name package)’.  The problem here is
that Guix package names follow much stricter naming rules than the
upstream packages.

Here are a couple of examples of R package names and their related Guix
package names:

    GenomicRanges —> r-genomic-ranges
    data.table    —> r-data-table
    formatR       –> r-formatr
    DBI           —> r-dbi

When we only pass the Guix name to ‘latest-release’, the updater won’t
know how to find the package and its upstream version because the names
don’t match.

There are two ways to approach this: we change the Guix package names to
closely match those of the upstream packages, or we pass the complete
package structure to ‘latest-release’.  The latter approach would allow
the CRAN updater to extract the appropriate name from the tarball URI.

We have the same problem for Ruby gems, I think, so I think that it
generally would be a good idea to pass the whole package object to
‘latest-release’.  Those updaters that only need the package name can
just reduce it by calling ‘(package-name package)’ themselves.

What do you think?

~~ Ricardo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: package updater: operate on package structs, not names?
  2015-12-01 10:41 package updater: operate on package structs, not names? Ricardo Wurmus
@ 2015-12-01 12:43 ` Ricardo Wurmus
  2015-12-01 17:36 ` Andreas Enge
  2015-12-02  8:00 ` Ludovic Courtès
  2 siblings, 0 replies; 4+ messages in thread
From: Ricardo Wurmus @ 2015-12-01 12:43 UTC (permalink / raw)
  To: guix-devel@gnu.org


Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> writes:

> Hi Guix,
>
> I noticed a flaw in the CRAN updater.  The ‘latest-release’ procedure is
> called with the result of ‘(package-name package)’.  The problem here is
> that Guix package names follow much stricter naming rules than the
> upstream packages.
>
> Here are a couple of examples of R package names and their related Guix
> package names:
>
>     GenomicRanges —> r-genomic-ranges
>     data.table    —> r-data-table
>     formatR       –> r-formatr
>     DBI           —> r-dbi
>
> When we only pass the Guix name to ‘latest-release’, the updater won’t
> know how to find the package and its upstream version because the names
> don’t match.
>
> There are two ways to approach this: we change the Guix package names to
> closely match those of the upstream packages, or we pass the complete
> package structure to ‘latest-release’.  The latter approach would allow
> the CRAN updater to extract the appropriate name from the tarball URI.
>
> We have the same problem for Ruby gems, I think, so I think that it
> generally would be a good idea to pass the whole package object to
> ‘latest-release’.  Those updaters that only need the package name can
> just reduce it by calling ‘(package-name package)’ themselves.
>
> What do you think?

It just occurred to me that I could do something like this:

   (specification->package the-package-name)

and then operate on the package.  Then I noticed that
‘guix/import/pypi.scm’ does this already.  Since we start out with a
package object wouldn’t it be better to just keep it rather than convert
back and forth between names and packages?

~~ Ricardo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: package updater: operate on package structs, not names?
  2015-12-01 10:41 package updater: operate on package structs, not names? Ricardo Wurmus
  2015-12-01 12:43 ` Ricardo Wurmus
@ 2015-12-01 17:36 ` Andreas Enge
  2015-12-02  8:00 ` Ludovic Courtès
  2 siblings, 0 replies; 4+ messages in thread
From: Andreas Enge @ 2015-12-01 17:36 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel@gnu.org

On Tue, Dec 01, 2015 at 11:41:25AM +0100, Ricardo Wurmus wrote:
> There are two ways to approach this: we change the Guix package names to
> closely match those of the upstream packages, or we pass the complete
> package structure to ‘latest-release’.  The latter approach would allow
> the CRAN updater to extract the appropriate name from the tarball URI.

I think we should work on the package, or more concretely, the uri and
the version. Then we should do some pattern matching to find occurrences
of major-minor-patchlevel, major-minor or major versions in the uri.
And then we should try +1 in each of them (with later components set to 0).

For instance with qt:
    (version "5.5.1")
             (uri
               (string-append
                 "http://download.qt.io/official_releases/qt/"
                 (version-major+minor version)
                 "/" version
                 "/single/qt-everywhere-opensource-src-"
                 version ".tar.xz"))
which expands to
http://download.qt.io/official_releases/qt/5.5/5.5.1/single/qt-everywhere-opensource-src-5.5.1.tar.xz

we should try
http://download.qt.io/official_releases/qt/5.5/5.5.2/single/qt-everywhere-opensource-src-5.5.2.tar.xz
http://download.qt.io/official_releases/qt/5.6/5.6.0/single/qt-everywhere-opensource-src-5.6.0.tar.xz
http://download.qt.io/official_releases/qt/6.0/6.0.0/single/qt-everywhere-opensource-src-6.6.0.tar.xz
(and maybe some recursion to find the latest version).

What do you think?

Andreas

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: package updater: operate on package structs, not names?
  2015-12-01 10:41 package updater: operate on package structs, not names? Ricardo Wurmus
  2015-12-01 12:43 ` Ricardo Wurmus
  2015-12-01 17:36 ` Andreas Enge
@ 2015-12-02  8:00 ` Ludovic Courtès
  2 siblings, 0 replies; 4+ messages in thread
From: Ludovic Courtès @ 2015-12-02  8:00 UTC (permalink / raw)
  To: Ricardo Wurmus; +Cc: guix-devel@gnu.org

Ricardo Wurmus <ricardo.wurmus@mdc-berlin.de> skribis:

> There are two ways to approach this: we change the Guix package names to
> closely match those of the upstream packages, or we pass the complete
> package structure to ‘latest-release’.  The latter approach would allow
> the CRAN updater to extract the appropriate name from the tarball URI.

This sounds like a good idea; I don’t think there are any good reasons
for just passing the package name.  Could you do that?

If need be, some of the CRAN packages could have a special property:

  (package
    (name "r-foo")
    ;; …
    (properties `((upstream-name . "Fo0"))))

Ludo’.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-12-02 10:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-01 10:41 package updater: operate on package structs, not names? Ricardo Wurmus
2015-12-01 12:43 ` Ricardo Wurmus
2015-12-01 17:36 ` Andreas Enge
2015-12-02  8:00 ` Ludovic Courtès

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.