frugal icon indicating copy to clipboard operation
frugal copied to clipboard

Go generation with `-r` and `use_vendor`...

Open natewoods-wf opened this issue 8 years ago • 1 comments

Go generation with -r and use_vendor causes duplicate generation of included assets.

Conversation from Messaging Platform Chat

[11:04 AM] Nate Woods: Quick nit: in wTranslate we had frugal generating recursively, but all of it's dependencies were using the (vendor) go flag, and we had use_vendor enabled.  So when we ran frugal -r --gen go:use_vendor wTranslate.frugal it actually generated all the vendored libraries too. Is that the desired behavior? [11:29 AM] Tyler Treat: @NateWoods go:use_vendor should do the same thing --use-vendor used to do [11:30 AM] Nate Woods: yep, and thats working, but when the -r is added, it generates all the vendored packages too [11:30 AM] Nate Woods: which is not something frugal 1.24.x did [11:31 AM] Tyler Treat: I don't think the behavior was supposed to change. if it did, that sounds like a bug [11:32 AM] Nate Woods: just putting it out there, not a huge problem for us, since all our libraries are vendored we can just remove the -r, but if somebody is trying to do a weird mix of both vendored and non-vendored things, it could cause problems [11:33 AM] Tyler Treat: feel free to create a github issue and we will follow up [11:33 AM] Nate Woods: (thumbsup)

Reproduction steps

$ git clone [email protected]:Workiva/wTranslate.git # clone wTranslate
$ frugal --version # observed bug with frugal 2.0.0 and frugal 2.0.1
$ frugal -r --out lib/go --gen go:use_vendor stage/wTranslate.frugal
$ ls lib/go/w* # notice wcontent and messaging repos are generated here along with wTranslate (wcontent and messaging are supposed to use_vendor)

natewoods-wf avatar Feb 07 '17 18:02 natewoods-wf

Arrived here by way of the Messaging Platform HipChat room:

[12:38 PM] Nathan Coleman: Question: I was reading through the docs on vendoring Frugal includes here: https://github.com/workiva/frugal#vendoring-includes [12:39 PM] Nathan Coleman: Given that information, I would expect these changes to prevent the commitlog stuff from being generated; however, that is not the case. https://github.com/joestrach-wf/snapshot/pull/2/files [12:40 PM] Nathan Coleman: Can someone tell me why that is still happening or if I just missed something? [12:41 PM] Brian Shannan: Is this the same issue as https://github.com/Workiva/frugal/issues/732 ? [12:42 PM] Nathan Coleman: Yes [12:45 PM] Nathan Coleman: Is there any planned work around that? [12:46 PM] Brian Shannan: Not right now, it's something we could look at doing though

nathancoleman-wf avatar Apr 19 '17 17:04 nathancoleman-wf