speedtables icon indicating copy to clipboard operation
speedtables copied to clipboard

More than one call to stapi::init can confuse existing speedtables

Open mutability opened this issue 10 years ago • 5 comments

(I hesitate to call this a bug, but it causes very non-obvious failures)

If you call stapi::init twice with different -dir values, then any ctables managed by stapi that were created between the two calls get confused because they can no longer find their working files (as [workname $ctable foo] starts returning a different value)

It might make sense to store the build dir used during init_ctable per ctable, so that later changes to build_root do not make things fail.

mutability avatar Mar 17 '16 12:03 mutability

What's the use case for calling stapi::init with different directories? I don't think that should be necessary.

resuna avatar Apr 03 '16 19:04 resuna

Packages that want to use stapi that are not aware of each other.

mutability avatar Apr 03 '16 20:04 mutability

There is an attempted fix for this in the stapi-fixes branch. It keeps track of the directory associated with each base filename, and keeps using it.

I'm also pondering whether ignoring subsequent calls to init would be better.

Can you see if this fix works for your use case?

resuna avatar Apr 06 '16 20:04 resuna

I have rebased the stapi-fixes branch up to master. Can you please verify that it fixes this problems so I can merge it back?

resuna avatar May 27 '16 13:05 resuna

Should be fixed with merge of stapi-fixes. @mutability - could you check?

resuna avatar Jul 11 '16 14:07 resuna