Re: More on Actions, routes and builders in general

Bram Moolenaar <[email protected]> Thu, 17 Jun 2004 21:31:31 +0200
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
Lars Ivar Igesund wrote:

> > Looking at the d module I notice that the d_compile, d_build, d_builddll
> > and d_buildlib actions use ":do" to redirect the work to another action.
> > Those should be rewritten to use define_action().
> 
> I didn't get what "those" pointed to, but; The reason why it was done 
> this way, was mostly to don't need the full compile code in all three 
> actions. So I tried with three actions (one for each outtype) and no 
> redirection. As I understand it, all those three should be primary 
> actions, all with "d" as intype and differing outtypes.

Be careful to only make actions "primary" when they are always to be
used for turning its input filetypes into its output filetypes.  Thus one
would be "d" to "object,default", another "d" to "libobject" and the
third "d" to "dllobject".  These are in the d module, the actions in the
dmd tool can't be primary actions, they are invoked indirectly by the
module.

> This leads to trouble. Only the last defined action seems to be
> remembered. First, the last action was the one with libobject as
> outtype. In a recipe with a :lib and a :program, the lib built fine
> while the program crashed with the message:
> 
> Error in recipe "define_action(build) from libobject,object,default to 
> default" line 474: No commands defined for d_buildlib program from object
> 
> Then i moved the define_action calls, making the one with object as 
> outtype the last. Then I got the following message on the lib target:
> 
> Error in recipe "define_action(buildlib) from libobject,object,default 
> to default" line 474: No commands defined for d_build lib from libobject

Strange.  I would think you did something wrong in the way you defined
the actions.  They are all added in a list, they don't overwrite each
other.

I guess you are using BUILDLIB_ACTION or adding a {buildaction}
attribute to the object files.  Then the "buildlib" action invokes that
action.  Don't see how that can go wrong.

I can't guess what is wrong.  Can you show me the code?

-- 
hundred-and-one symptoms of being an internet addict:
170. You introduce your wife as "my_lady-/[email protected]" and refer to your
     children as "forked processes."

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
 \\\  Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///


-------------------------------------------------------
This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference
Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer
Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA
REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND