BobBuildTool/basement

autoconfReconfigure only available during checkout

Closed this issue · 7 comments

autoconfReconfigure from the autoconf class is only available during the checkout step. Most of the X libs (see #107) need a dependency during reconfigure called xorg-macros. Dependencies are not yet available during checkout, though, thus the reconfigure must take place in the build step. What would be the preferred method of solving this issue? Copying the autoconfReconfigure method to a to-be-added buildSetup?

there is a very good solution for that by using the yaml stuff:

checkoutDeterministic: True
checkoutTools: [autotools]
checkoutSetup: &rec |
    autoconfReconfigure()
    {
        if [[ ( ! -e configure ) || ( ! -e .autoreconf.stamp ) ||
              ( configure.ac -nt .autoreconf.stamp ) ]] ; then
            autoreconf -vfi
            rm -rf autom4te.cache *.h.in~
            touch .autoreconf.stamp
        fi
    }

buildSetup: *rec

But you have to test if it is necessary to add buildTools: [autotools]

refer: classes/python3/vars.yaml

Patching the sources in the buildStep requires to copy them. If possible in any way, I would avoid doing this. But if we need to go this route then the solution @daxcore proposed would be the right one. Note that you do not need to define buildTools: [autotools] because all checkoutTools are available in the build- and packageStep automatically.

A possible hack could be to define the xorg-macros as a tool and use it with some special "xorg-sources"-class. OTOH I'm pondering about the possibility of adding optional dependencies to checkout steps. Because the hack with the tool does exactly that...

A possible hack could be to define the xorg-macros as a tool and use it with some special "xorg-sources"-class.

That would create a copy of xorg-macros for every package that uses the tool (and thus the class), wouldn't it? While the macros are not exactly big, I'd like to mention that nearly every library in the X universe uses them. So, checkout dependencies sound more reasonable, IMHO.

Thanks, @daxcore, for the reminder regarding the yaml anchors. I didn't think of those indeed. Still, as @jkloetzke already mentioned, I needed to copy the sources into the build step and thus had to introduce an additional parameter to the function. So, simply referencing an anchor wouldn't have worked out...

I've created a sketch implementation in BobBuildTool/bob#453. Would be good to hear your thoughts about the approach. Of course it's still lacking tests and documentation... 😉

I'll give it a shot

The problem at hand is fixed by BobBuildTool/bob#453 so I'm closing this for now.