forked from rosa/hakurei
internal/rosa: extra inputs in alternative path
This works around particularly unwieldy build systems. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -926,7 +926,7 @@ func (ctx *evalContext) pf(
|
||||
sourceA any
|
||||
helper Helper
|
||||
|
||||
inputs, runtimes azalea.Array
|
||||
inputs, runtimes, extra azalea.Array
|
||||
)
|
||||
if err = args.Apply(map[unique.Handle[azalea.Ident]]any{
|
||||
k("description"): &meta.Description,
|
||||
@@ -952,14 +952,17 @@ func (ctx *evalContext) pf(
|
||||
k("exec"): &helper,
|
||||
k("inputs"): &inputs,
|
||||
k("runtime"): &runtimes,
|
||||
k("extra"): &extra,
|
||||
}); err != nil {
|
||||
return
|
||||
}
|
||||
var inputsH P
|
||||
var inputsH, extraH P
|
||||
if inputsH, err = toHandles(inputs); err != nil {
|
||||
return
|
||||
} else if meta.Dependencies, err = toHandles(runtimes); err != nil {
|
||||
return
|
||||
} else if extraH, err = toHandles(extra); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
meta.ID = int(anitya)
|
||||
@@ -981,6 +984,15 @@ func (ctx *evalContext) pf(
|
||||
})
|
||||
}
|
||||
|
||||
for _, h := range extraH {
|
||||
_, a := ctx.t.MustLoad(h)
|
||||
attr.Paths = append(attr.Paths, pkg.Path(
|
||||
AbsUsrSrc.Append("extra", h.String()),
|
||||
attr.Writable,
|
||||
a,
|
||||
))
|
||||
}
|
||||
|
||||
for _, pair := range files {
|
||||
var pathname *check.Absolute
|
||||
if pathname, err = check.NewAbs(pair[0]); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user