librelist archives

« back to archive

bentomaker reads bento.info on every command/--bundling=false does not work

bentomaker reads bento.info on every command/--bundling=false does not work

From:
Toshio Kuratomi
Date:
2011-07-22 @ 04:32
So I found a problem with the --bundling command line option to bentomaker
configure and that seems to have lead me down a rabbit hole :-)

First:

With a current git snapshot, if bento.info has::

  Flag: bundling
      Description: whether to install bundled modules or not
      Default: true

and then you run::
  bentomaker configure --bundling=false
  bentomaker build
  bentomaker install --list-files |grep yaku|wc -l
  44

So the private libraries are still being bundled.

Similarly, if you set the bento.info bundling default to false and run::
  bentomaker configure --bundling=true
  bentomaker build
  bentomaker install --list-files|grep yaku|wc -l
  2

So it seems that the default value given in the bento.info file is
overriding what's given on the commandline at configure time.

Second:

So, in looking at that, I found out that bentomaker is reading the
bento.info file at every step.  If I do this:

  # bento.info has Default: true
  bentomaker configure --bundling=true
  bentomaker build
  sed -i 's/Default: true/Default: false/' bento.info
  bentomaker install --list-files|grep yaku |wc -l
  2

it shows that the install step is reading bento.info instead of using what
is present at the configure step.

Is this expected behaviour?  It seems that this may be where the bug lies
but I'm not sure enough about the architecture to know for sure.

Thanks,
-Toshio

Re: [bento] bentomaker reads bento.info on every command/--bundling=false does not work

From:
David Cournapeau
Date:
2011-07-25 @ 04:56
Hi Toshio,

On Fri, Jul 22, 2011 at 1:32 PM, Toshio Kuratomi <a.badger@gmail.com> wrote:
> So I found a problem with the --bundling command line option to bentomaker
> configure and that seems to have lead me down a rabbit hole :-)
>
> First:
>
> With a current git snapshot, if bento.info has::
>
>  Flag: bundling
>      Description: whether to install bundled modules or not
>      Default: true
>
> and then you run::
>  bentomaker configure --bundling=false
>  bentomaker build
>  bentomaker install --list-files |grep yaku|wc -l
>  44
>
> So the private libraries are still being bundled.

Yes, I can confirm the bug. This is not how it is supposed to work, obviously.

> Second:
>
> So, in looking at that, I found out that bentomaker is reading the
> bento.info file at every step.  If I do this:
>
>  # bento.info has Default: true
>  bentomaker configure --bundling=true
>  bentomaker build
>  sed -i 's/Default: true/Default: false/' bento.info
>  bentomaker install --list-files|grep yaku |wc -l
>  2
>
> it shows that the install step is reading bento.info instead of using what
> is present at the configure step.

Without going into much details, while each command may cause to
re-read the bento.info, it should do so in the context of what was
passed to configure (exactly as is done for path information).

I will look into it, it must be a bug in the caching of bento.info
parsing, whose code is particularly ugly and fragile.

cheers,

David

Re: [bento] bentomaker reads bento.info on every command/--bundling=false does not work

From:
David Cournapeau
Date:
2011-07-25 @ 12:48
On Fri, Jul 22, 2011 at 1:32 PM, Toshio Kuratomi <a.badger@gmail.com> wrote:
> So I found a problem with the --bundling command line option to bentomaker
> configure and that seems to have lead me down a rabbit hole :-)
>
> First:
>
> With a current git snapshot, if bento.info has::
>
>  Flag: bundling
>      Description: whether to install bundled modules or not
>      Default: true
>
> and then you run::
>  bentomaker configure --bundling=false
>  bentomaker build
>  bentomaker install --list-files |grep yaku|wc -l
>  44
>
> So the private libraries are still being bundled.
>
> Similarly, if you set the bento.info bundling default to false and run::
>  bentomaker configure --bundling=true
>  bentomaker build
>  bentomaker install --list-files|grep yaku|wc -l
>  2
>
> So it seems that the default value given in the bento.info file is
> overriding what's given on the commandline at configure time.

Ok, this should be fixed in 38e2c9a. I have opened ticket #57 to track
the issue (I would prefer to track issues on the issue tracker
compared to the ML).

>
> Second:
>
> So, in looking at that, I found out that bentomaker is reading the
> bento.info file at every step.  If I do this:
>
>  # bento.info has Default: true
>  bentomaker configure --bundling=true
>  bentomaker build
>  sed -i 's/Default: true/Default: false/' bento.info
>  bentomaker install --list-files|grep yaku |wc -l
>  2
>
> it shows that the install step is reading bento.info instead of using what
> is present at the configure step.

To expand on this:
 * each command potentially has dependencies, which are automatically
run. Install depends on build, which itself depends on configure
 * when a command needs to run, it will do so using command arguments
passed previously if applicable (those are recorded somewhere in the
build directory)
 * a change in bento.info does not invalidate the arguments recording

While this is a bit complicated to explain, I believe this gives the
most intuitive behavior:
  * by default, you can run any command and all its dependencies are
automatically run
  * to reset bento state for a package, just remove the build directory
  * modifying a bento.info file (e.g. during packaging) does not by
itself invalid this cache. If this were not the case, you would have
to re-configure the package everytime you made a change.

There is an argument that this is too complicated and potentially
confusing. While I have already thought quite a bit about this issue,
I am open to alternatives.

cheers,

David