Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign uppromql Go import problem: use of vendored package not allowed #1720
Comments
This comment has been minimized.
This comment has been minimized.
|
A local solution for me would be moving the Also here is a conversation I had with dave cheney https://twitter.com/fatih/status/740883554264096772 |
This comment has been minimized.
This comment has been minimized.
|
The problem here is that you are using the |
This comment has been minimized.
This comment has been minimized.
|
Yes it is intended to be used as a library. I fought hard to design it as one and it is in wide use by several companies. It is arguably a design flaw in the vendoring mechanism and as far as I know there are vendoring tools handling thise case by stripping vendoring from packages you vendor yourself. |
This comment has been minimized.
This comment has been minimized.
|
Wouldn't WRT to nested vendoring: Sometimes, nested vendoring is desired (for any identifiers that do not show up in the API of the library and are therefore completely contained). It would be hard for a vendoring tool to distinguish between the two cases. |
This comment has been minimized.
This comment has been minimized.
|
PromQL is pretty tightly bound to Prometheus, and we're not willing to offer any guarantees around API stability, so I think where it is is fine. |
This comment has been minimized.
This comment has been minimized.
|
I think the better solution would be move out promql into a separate repo and then vendor it. That way everyone can make use of it. I'm not sure though what the better solution would be, as @brian-brazil mentioned just looking at the code today, they indeed a very tightly bound. But just a side note, the way That's why I think the stability should be guaranteed |
This comment has been minimized.
This comment has been minimized.
That's a completely separate discussion. |
This comment has been minimized.
This comment has been minimized.
|
@brian-brazil well you said it's not guaranteed and I said it should. Not sure why you wrote this comment. Happy to discuss it in another issue. |
This comment has been minimized.
This comment has been minimized.
|
So yes, nothing is wrong with the vendoring in prometheus/prometheus. We could close this issue and open a new one titled "Move promql into a different repository?", or we could simply rename this issue and have the discussion here (as it has already happened anyway). |
This comment has been minimized.
This comment has been minimized.
|
There's no such thing as "meant as library" if we design each package in a manner that it exposes a well-designed API for the behavior it aims to implement. I'm not comfortable moving PromQL out at this point. It has an API that makes it useful for external use cases but is not there yet for a stable package. I think we have to count on vendor tooling here to work around the general issue. Especially since this is not PromQL specific and will come up again and again. Having 40 repos with distinct libraries for a project does not scale for any Go project out there. |
This comment has been minimized.
This comment has been minimized.
|
OK, vendoring declared as "still unsolved", and this issue declared closed. :) |
beorn7
closed this
Jun 9, 2016
This comment has been minimized.
This comment has been minimized.
|
Thanks for the clarification. I've created a custom script to extract the |
This comment has been minimized.
This comment has been minimized.
kardianos
commented
Jun 15, 2016
|
@beorn7
I'm working on having other options for the future, but that's about where we are right now. One of the "benefits" of option (1) is you could decouple your cmd release from your importable packages schedule. |
This comment has been minimized.
This comment has been minimized.
This is essentially "self-vendoring" and would require the constant re-vendoring @fabxc mentioned before. It's equivalent to moving the
That's what @fabxc meant by "I think we have to count on vendor tooling here to work around the general issue." |
tintoy
referenced this issue
Jan 13, 2017
Closed
How are external Packer plugins supposed to configure the communicator? #4342
noonat
added a commit
to upsight/franz
that referenced
this issue
Feb 17, 2017
noonat
added a commit
to upsight/franz
that referenced
this issue
Feb 17, 2017
noonat
added a commit
to upsight/franz
that referenced
this issue
Feb 17, 2017
noonat
added a commit
to upsight/stop
that referenced
this issue
Feb 17, 2017
This comment has been minimized.
This comment has been minimized.
tnachen
commented
Jan 15, 2018
|
@fatih is your script publically available? Having the exact same issue at the moment |
fromanirh
referenced this issue
Jul 31, 2018
Closed
Conflict between kubevirt and kubernetes types when used in third party projects #1395
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 23, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
fatih commentedJun 9, 2016
What did you do?
I've tried to import the
github.com/prometheus/common/modelpackage so I can construct apromql.AlertStmtfrom scratch. Here is the demo code that I'm using:Building this package is not possible because
promqluses a vendored package and thus I've got this error:This is ok, because they really are two different packages (one is vendored, and the other one is pulled by me and put into GOPATH), but if you go and use the vendored import path:
Now you get the error:
What did you expect to see?
I want to be able to create a custom
promql.AlertStmtwith theAnnotationsfieldWhat did you see instead? Under which circumstances?
As described above, it's not possible to create such a value
Environment
I'm using latest master with Git SHA
a08943e6d347119bfb1b50e738fca577e5733290