#`bkref ToState ` is panicking

1 messages ยท Page 1 of 1 (latest)

young quest
#

Thanks! Yeah my next question would be wheter it's bkref that's nil (in which case our code just probably needs to check and handle it) or if it's within the .ToState() impl, which I think means we need a fix upstream (if it hasn't been made already)

past cloud
#

I'll try to suss that out. Is there a better way to test than simply building + running via mage engine:dev?

young quest
#

Probably not really... it's not the sort of thing that can be unit tested as far as I think, you kind need the whole system up and running more or less

past cloud
#

Cool. At least I'm not wasting cycles completely unnecessarily ๐Ÿ™‚

#

bkref is nil

#

If I change

    st, err := bkref.ToState()
    if err != nil {
        return nil, err
    }

to

    var st llb.State
    if bkref == nil {
        st = llb.Scratch()
    } else {

        st, err = bkref.ToState()
        if err != nil {
            return nil, err
        }
    }

It runs.

young quest