Skip Menu |

This queue is for tickets about the CPANPLUS CPAN distribution.

Report information
The Basics
Id: 46850
Status: open
Priority: 0/
Queue: CPANPLUS

People
Owner: Nobody in particular
Requestors: jquelin [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: cpan2dist --nobuildprereqs is of no use
cpan2dist always follows dependencies and tries to build them, which is not always wanted. one can think that "cpan2dist --nobuildprereqs" would prevent this, but nope, it's the default and really means: "don't rebuild prereqs if we're at latest version, but rebuild anyway if we're not at latest version". "cpan2dist --buildprereqs" indeed means "i really really want to loose my time, please rebuild a package for all the prereqs even if i already have them installed and working". i don't think --buildprereqs is really useful... i therefore propose to change the meaning to: - --buildprereqs (default): build the prereqs if they are not installed, or if the version installed is not recent enough to build the wanted package. however, if the prereq is installed and recent enough for the package to be built, don't rebuild it, even cpan holds a newer version than what is installed on system. - --nobuildprereqs: don't build the prereqs at all. if some of them are missing, fail cpan2dist - after all, the user requested it. i would really want that for app::cpan2pkg, and also because i really cannot see a valid use case for current behaviour.
On Thu Jun 11 04:01:45 2009, JQUELIN wrote: Show quoted text
> cpan2dist always follows dependencies and tries to build them, which is > not always wanted. > > > one can think that "cpan2dist --nobuildprereqs" would prevent this, but > nope, it's the default and really means: "don't rebuild prereqs if we're > at latest version, but rebuild anyway if we're not at latest version". > > "cpan2dist --buildprereqs" indeed means "i really really want to loose > my time, please rebuild a package for all the prereqs even if i already > have them installed and working". > > i don't think --buildprereqs is really useful... > > i therefore propose to change the meaning to: > > - --buildprereqs (default): build the prereqs if they are not installed, > or if the version installed is not recent enough to build the wanted > package. however, if the prereq is installed and recent enough for the > package to be built, don't rebuild it, even cpan holds a newer version > than what is installed on system. > > - --nobuildprereqs: don't build the prereqs at all. if some of them are > missing, fail cpan2dist - after all, the user requested it. > > i would really want that for app::cpan2pkg, and also because i really > cannot see a valid use case for current behaviour. >
Hi Jerome, I understand your point, but i'm a bit stuck at a good solution. The use case for 'buildprereqs' is to build a mirror of software. This is what debian.pkgs.cpan.org does/did. This means that irrespective of my own install base, I want to build packages I can put on an apt mirror for others to use. For that, I need to make sure I have all dependencies built as well. Your use case makes sense too, and we should incorporate that. Suggestions (or even better, patches) are most welcome. If I can help clarify things, just come find me on #perl or email here and I'll be happy to. Cheers,
ok, i understand now the interest of --build-requires i therefore propose to change the way --build--requires work. instead of being a boolean, i propose it takes a string, with the following meaning: - --buildrequires always (or 'all') ==> same meaning that --build-requires currently, always build package for prereqs - --buildrequires as_needed (or 'update' or 'newer') ==> same meaning that --nobuild-requires today, ie build package only if a newer version exists. this would be the default if --buildrequires is not specified. - --buildrequires never (or 'none') ==> whatever current state, never try to build a package for prereq, even if a newer version exist upstream, even if this means that one of the prereq is not installed or installed with a version not recent enough. fail and let the user deal with that. what do you think of this idea?
On Sun Jun 14 09:40:44 2009, JQUELIN wrote: Show quoted text
> ok, i understand now the interest of --build-requires > > i therefore propose to change the way --build--requires work. instead of > being a boolean, i propose it takes a string, with the following meaning: > > - --buildrequires always (or 'all') ==> same meaning that > --build-requires currently, always build package for prereqs > > - --buildrequires as_needed (or 'update' or 'newer') ==> same meaning > that --nobuild-requires today, ie build package only if a newer version > exists. this would be the default if --buildrequires is not specified. > > - --buildrequires never (or 'none') ==> whatever current state, never > try to build a package for prereq, even if a newer version exist > upstream, even if this means that one of the prereq is not installed or > installed with a version not recent enough. fail and let the user deal > with that. > > > what do you think of this idea?
I understand what you're trying to do, but it'd be a backwards incompatible change. Can you think of a way to do this change with, for example, another flag? Basically, the value of this flag is passed on straight to $obj->install, which then ends up at the C::Dist::* implementations, unchanged. Cheers,
hi jos, i understand your concern. however, cpanplus is 0.x software, so breaking its api is fair game *imo*. and i'm not sure cpan2dist is used that much. but that's your call as cpanplus author, so i'll try to find something else... :-) what about adding a new flag: --update-check (or --prereq-update or whatever the name) if yes (default): checks to find a more recent version of the installed prereqs package if no: no such checks which give us the matrix: --nobuild-prereq && --update-check (default) check for newer versions of installed prereqs, but don't rebuild them if we're up to date. --nobuild-prereq && --noupdate-check don't rebuild a prereq package if we have the prereq installed, even if a newer version is available on cpan --build-prereq && --update-check check for newer versions of installed prereqs, and rebuild them --build-prereq && --noupdate-check should be forbidden, since cpanplus use latest version when building a package
Hi Jerome, Show quoted text
> i understand your concern. however, cpanplus is 0.x software, so > breaking its api is fair game *imo*. and i'm not sure cpan2dist is used > that much. > > but that's your call as cpanplus author, so i'll try to find something > else... :-)
I've taken another look at the code, following the path it takes. It seems to me that that CPANPLUS::Dist->prereq_satisfied *SHOULD* have this behaviour already. Could you please verify (See CPANPLUS::Dist:472 for where it's invoked)? I'm actually inclined to think it's a bug now if: * Module::A requires Module::B 1 * You have version Module::B 1 * CPAN has Module::B 2 * cpan2dist goes and builds Module::B 2 without --build-prereq specified
indeed, you're right that it will not create a package for the prereqs if the installed version is recent enough to meet the module minimum prereq version. however, would it be possible to tell cpan2dist to never, ever create a package for prereqs, even if the minimum version is not met? in that case, cpan2dist would just fail...
note however that there is a bug with --force: cpan2dist --nobuildprereqs --force Foo::Bar ==> this *will* recreate the packages for prereqs that are already at a correct level. it recreate the packages even if the modules are at latest version that can be found on cpan... this is a bug. i expect --force to proceed even if the package for Foo::Bar already exists, but not for the prereqs...