Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Erroneous build delay #140

Closed
lusis opened this issue Apr 15, 2014 · 11 comments
Closed

Erroneous build delay #140

lusis opened this issue Apr 15, 2014 · 11 comments

Comments

@lusis
Copy link
Contributor

lusis commented Apr 15, 2014

I think I've found a small bug that's causing dependencies to fail. I need to map out a proper test case but here's what I think is happening:

  • The docs state that deps explicitly named in a project file are built last
  • I'm sort of okay with this but previously I was explicitly ordering my builds in the project so small cognitive shift

So let's say I erroneously put openssl in my project file (let's says the first item). And I also have openssl as a dep in something else.

I think what's happening is that the dedupe is shifting explicit deps in a project to the end regardless of a software definition's deps.

So take a software def called nginx that says:

name "nginx"
default_version "1.4.3.6"

dependency "geoip"
dependency "zlib"
dependency "openssl"
dependency "libxml2"
dependency "libxslt"
dependency "pcre"
dependency "gd"
dependency "ngx_http_gunzip_filter_module"
dependency "ngx_http_filter_cache"
dependency "nginx_upstream_check_module"
dependency "nginx_http_jsonp_module"
dependency "ngx_cache_purge"
dependency "nginx-statsd"
dependency "nginx_requestid"
dependency "nginx_upstream_fair_module"
dependency "nginx-sticky-module"
dependency "nginx_tcp_proxy_module"

with a project like so:

dependency "preparation"
dependency "openssl"
dependency "mything" # mything has a dep on openssl and the above software def.

So I think the dedupe happens first (again I haven't validated) and THEN the explicit deps are shifted to the end. So that means openssl gets shifted to then end.

I'll try and validate this but I wanted to get this out there.

@johnbellone
Copy link

I am seeing dependencies not being executed. In particular preparation.

@schisamo
Copy link
Contributor

@hosh Does this look like the issue you stumbled across in omnibus-chef-server? /cc @adamhjk

@adamhjk
Copy link
Contributor

adamhjk commented Apr 23, 2014

That's totally it

@johnbellone
Copy link

Just confirmed this too. I had something being depended on twice and observed this.

@johnbellone
Copy link

Perhaps using solve for dependencies may be a good fix here?

@sethvargo
Copy link
Contributor

@johnbellone solve has a dependency on Gecode and some other stuff. I doubt you want it to solve the graph for you.

@johnbellone
Copy link

@sethvargo Gotcha, testing something out now :).

@adamhjk
Copy link
Contributor

adamhjk commented Apr 23, 2014

The fix is small - I can make it today if nobody else beats me to it.
On Apr 23, 2014 7:13 AM, "John Bellone" notifications@github.com wrote:

@sethvargo https://github.com/sethvargo Gotcha, testing something out
now :).


Reply to this email directly or view it on GitHubhttps://github.com//issues/140#issuecomment-41165459
.

adamhjk added a commit that referenced this issue Apr 24, 2014
This issue happens when a software is both a transitive
dependency at the software level, and a top level project
dependency. We were blindly shifting all the project deps
to the end of the build order as an optimization, and failed
to check for the case where we actually *needed* that software
in the right place.

This patch ensures that, if the software is a dependency of
any other software description, it does not get shifted to the
end.
@adamhjk
Copy link
Contributor

adamhjk commented Apr 24, 2014

Just opened a PR on this.

@johnbellone
Copy link

Woot!

adamhjk added a commit that referenced this issue Apr 25, 2014
@adamhjk
Copy link
Contributor

adamhjk commented Apr 25, 2014

This is fixed and merged.

Both Seth's are out on vacation, so a release is pending. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants