-
Notifications
You must be signed in to change notification settings - Fork 1k
Report when manifests contain ineffectual constraints #302
Comments
Ahh, that was the issue. Constraints specified in I'll keep this open (but retitled) as a reminder that we need better feedback about this. |
@sdboyer Right on. I worked around this by having my desired version checked out into my go path before running |
I hand edited my |
I will take a look at this. |
@mikijov awesome! a quick pointer - there's already logic in gps that computes ineffectual constraints in more or less the way discussed here - we need to exclude such constraints from input hashing. That logic is in Line 82 in 18ebb09
We don't want to surface that whole struct, or that method directly, as it's deeply enmeshed in gps' internal systems. However, it may be worth surfacing a standalone func that does the work, moving the body of |
Hi @sdboyer. Thanks for the pointer. I do need a bit more guidance. a) gps package does not have a way to report warnings. Solution is sanitized from the internal details so I cannot call methonds on it for details of it's run. So I see few ways to do this:
b) From your problem definitio above b) dep ensure is still writing to the manifest. I don't see anywhere where ensure writes to manifest. I presume dep has changed since the issue was posted. Or...? |
@mikijov hi, sorry for delay - i'm just busy and getting busier these days :/ I think you're trying to reach further than is necessary with this 😄 I think the goal here is a func, with a signature something like this:
Where the returned map is all the projects that have constraints declared which will have no effect on solving. That function can then be called from anywhere, and the caller can decide what to do with logging. Let's start with the function, and we can worry about where to actually call it from next. |
Hi @sdboyer. No worries, it's not a simple codebase, so I understand we should keep it as clean/simple as possible. I did hear your directon the first time. Bit I thought I would have to expose too much of gps' internals if I went that way. You helped a bit by suggesting different signature. So I was able to come up with something (see below). However, second part of the getApplicableConstraints starts using internal gps data structs, rootdata, workingConstraints, maybe more. So I need bit more guidance.
func FindIneffectualConstraints(manifest Manifest, packageTree pkgtree.PackageTree) ProjectConstraints {
// Merge the normal and test constraints together
constraints := manifest.DependencyConstraints().merge(manifest.TestDependencyConstraints())
// if manifest is a RootManifest, then apply the overrides
if rootManifest := manifest.(RootManifest); rootManifest != nil {
// Include any overrides that are not already in the constraint list.
// Doing so makes input hashes equal in more useful cases.
for projectRoot, projectProperties := range rootManifest.Overrides() {
if _, exists := constraints[projectRoot]; !exists {
pp := ProjectProperties{
Constraint: projectProperties.Constraint,
Source: projectProperties.Source,
}
if pp.Constraint == nil {
pp.Constraint = anyConstraint{}
}
constraints[projectRoot] = pp
}
}
}
var ineffectuals ProjectConstraints
for packageRoot, packageProperties := range constraints {
if _, used := packageTree.Packages[string(packageRoot)]; !used {
ineffectuals[packageRoot] = packageProperties
}
}
return ineffectuals
} |
@mikijov thanks for sticking with it 😄
I think we can ignore all of that. The goal of this func isn't actually to do any of that complex overriding behavior - it's just to identify which
Because all we want is that list.
Hmm...good question. This really ends up being a question about what "ineffectual" means. Let's start with "no", and see how things go. |
Hi @sdboyer. I'm back. :-) So, first off, I have to say that I thought of you few times while trying to work out what various 1-2 letter variables mean. But I will persist. So, let's talk ineffectuals. Do you mind taking a quick look if the direction I am taking is close to what you had in mind. I think I am fairly close. However, I am stuck on one point. Constraints by definition point to root folder. However PackageTree points to actual packages. I see no reliable way of getting the project root from the package. Is this the good place to use Radix tree or create path aware .HasPrefix? Or do you have a better suggestion? |
@sdboyer Cool if I pick this up? Looks like no one is on it |
you're welcome to give it a go! though please note that if you don't end up getting to this in the next couple days, I may end up doing it. this is really quite pressing, and it was an error on my part to leave it open for so long, instead of just tackling it myself.
…On December 28, 2017 3:00:33 PM EST, Jacky Chiu ***@***.***> wrote:
@sdboyer Cool if I pick this up? Looks like no one is on it
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#302 (comment)
|
Update to the latest version of the Prometheus libraries and make necessary changes to satisfy API changes: - Use NewMergeSeriesSet() instead of DeduplicateSeriesSet(), which was removed in prometheus/prometheus@bb724f1bef6a. - Explicitly specify the options for the PromQL engine to ensure that PromQL metrics are registered following the change in prometheus/prometheus@f8fccc73d8705. The options used here are copied from the defaults. Prometheus vendors its own dependencies but also provides library packages, meaning that we have to manage its dependencies as transient dependencies. Using the `dep` tool, we cannot manage transient dependencies using regular constraints so I had to pin the versions in `Gopkg.toml` using overrides. See: https://github.com/golang/dep/blob/master/docs/FAQ.md#how-do-i-constrain-a-transitive-dependencys-version golang/dep#999 (comment) golang/dep#302
Update to the latest version of the Prometheus libraries and make necessary changes to satisfy API changes: - Use NewMergeSeriesSet() instead of DeduplicateSeriesSet(), which was removed in prometheus/prometheus@bb724f1bef6a. - Explicitly specify the options for the PromQL engine to ensure that PromQL metrics are registered following the change in prometheus/prometheus@f8fccc73d8705. The options used here are copied from the defaults. Prometheus vendors its own dependencies but also provides library packages, meaning that we have to manage its dependencies as transient dependencies. Using the `dep` tool, we cannot manage transient dependencies using regular constraints so I had to pin the versions in `Gopkg.toml` using overrides. See: https://github.com/golang/dep/blob/master/docs/FAQ.md#how-do-i-constrain-a-transitive-dependencys-version golang/dep#999 (comment) golang/dep#302
Update to the latest version of the Prometheus libraries and make necessary changes to satisfy API changes: - Use NewMergeSeriesSet() instead of DeduplicateSeriesSet(), which was removed in prometheus/prometheus@bb724f1bef6a. - Explicitly specify the options for the PromQL engine to ensure that PromQL metrics are registered following the change in prometheus/prometheus@f8fccc73d8705. The options used here are copied from the defaults. Prometheus vendors its own dependencies but also provides library packages, meaning that we have to manage its dependencies as transient dependencies. Using the `dep` tool, we cannot manage transient dependencies using regular constraints so I had to pin the versions in `Gopkg.toml` using overrides. See: https://github.com/golang/dep/blob/master/docs/FAQ.md#how-do-i-constrain-a-transitive-dependencys-version golang/dep#999 (comment) golang/dep#302
FINALLY! 🎉 🎉 |
Hey there... I may have found an issue regarding
ensure
at a revision using master.After running a
dep ensure
the manifest revision changes but the lock does not.Here is how to reproduce
manifest.json
is:and
lock.json
is:I was expecting the revision of
github.com/influxdata/influxdb
inlock.json
to change toe4628bb69266dbd624dc27d674b52705ce0dcbf2
.The text was updated successfully, but these errors were encountered: