rock-core / autoproj

Rock (Robot Construction Kit) package-oriented build system
http://rock-robotics.org/rock-and-syskit/workspace
23 stars 21 forks source link

Cycles detected in package set hierarchy (when apparantly there are none) on Ubuntu 18.04 with master? #359

Closed moooeeeep closed 2 years ago

moooeeeep commented 2 years ago

While trying to reproduce a build issue with another buildconf we have (which seems related to this issue), I set up this simple buildconf.

When I try to bootstrap this with the dev version of the bootstrap script on Ubuntu 18.04, I receive an error during aup:

root@1ef4237e6cd7:/ws# aup
  operating system: ubuntu,debian - 18.04,18.04.4,lts,bionic,beaver
  updating bundler
  updating autoproj
  bundler: connected to https://rubygems.org/
  already up-to-date autoproj main configuration
Traceback (most recent call last):
    20: from /ws/.autoproj/bin/aup:51:in `<main>'
    19: from /ws/.autoproj/bin/aup:51:in `load'
    18: from /root/.local/share/autoproj/gems/ruby/2.5.0/bundler/gems/autoproj-dba515f3387e/bin/aup:17:in `<top (required)>'
    17: from /root/.local/share/autoproj/gems/ruby/2.5.0/gems/thor-1.1.0/lib/thor/base.rb:485:in `start'
    16: from /root/.local/share/autoproj/gems/ruby/2.5.0/gems/thor-1.1.0/lib/thor.rb:392:in `dispatch'
    15: from /root/.local/share/autoproj/gems/ruby/2.5.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in `invoke_command'
    14: from /root/.local/share/autoproj/gems/ruby/2.5.0/gems/thor-1.1.0/lib/thor/command.rb:27:in `run'
    13: from /root/.local/share/autoproj/gems/ruby/2.5.0/bundler/gems/autoproj-dba515f3387e/lib/autoproj/cli/main.rb:240:in `update'
    12: from /root/.local/share/autoproj/gems/ruby/2.5.0/bundler/gems/autoproj-dba515f3387e/lib/autoproj/cli/main.rb:128:in `run_autoproj_cli'
    11: from /root/.local/share/autoproj/gems/ruby/2.5.0/bundler/gems/autoproj-dba515f3387e/lib/autoproj/reporter.rb:109:in `report'
    10: from /root/.local/share/autoproj/gems/ruby/2.5.0/bundler/gems/autobuild-5d0adc3ccfc4/lib/autobuild/reporting.rb:103:in `report'
     9: from /root/.local/share/autoproj/gems/ruby/2.5.0/bundler/gems/autoproj-dba515f3387e/lib/autoproj/reporter.rb:111:in `block in report'
     8: from /root/.local/share/autoproj/gems/ruby/2.5.0/bundler/gems/autoproj-dba515f3387e/lib/autoproj/cli/main.rb:139:in `block in run_autoproj_cli'
     7: from /root/.local/share/autoproj/gems/ruby/2.5.0/bundler/gems/autoproj-dba515f3387e/lib/autoproj/cli/update.rb:81:in `run'
     6: from /root/.local/share/autoproj/gems/ruby/2.5.0/bundler/gems/autoproj-dba515f3387e/lib/autoproj/workspace.rb:652:in `load_package_sets'
     5: from /root/.local/share/autoproj/gems/ruby/2.5.0/bundler/gems/autoproj-dba515f3387e/lib/autoproj/ops/configuration.rb:384:in `load_package_sets'
     4: from /root/.local/share/autoproj/gems/ruby/2.5.0/bundler/gems/autoproj-dba515f3387e/lib/autoproj/ops/configuration.rb:446:in `update_configuration'
     3: from /root/.local/share/autoproj/gems/ruby/2.5.0/bundler/gems/autoproj-dba515f3387e/lib/autoproj/ops/configuration.rb:629:in `update_package_sets'
     2: from /root/.local/share/autoproj/gems/ruby/2.5.0/bundler/gems/autoproj-dba515f3387e/lib/autoproj/ops/configuration.rb:365:in `sort_package_sets_by_import_order'
     1: from /root/.local/share/autoproj/gems/ruby/2.5.0/bundler/gems/autoproj-dba515f3387e/lib/autoproj/ops/configuration.rb:365:in `new'
/root/.local/share/autoproj/gems/ruby/2.5.0/bundler/gems/autoproj-dba515f3387e/lib/autoproj/ops/configuration.rb:37:in `initialize': The package set hierarchy contains cycles: [... it follows an incredibly long line of debug output (roughly 1.3MB long)

The release version and Ubuntu 20.04 (both versions) don't seem to be affected and check out just fine.

Any insights? Am I missing something?

doudou commented 2 years ago
moooeeeep commented 2 years ago

Do I understand correctly, that we need to pay more attention at which places we import each package set (and that situations in which package sets appear several times at various places in the dependency tree are practically not allowed / need to be handled with care)?

I've set up another similar buildconf (with one more layer of indirection) that exhibits the exact error, that we needed to debug in the first place. Is this the error we should have seen with the first buildconf too? (Update Actually this seems to be the exact same configuration, as provided in this comment, isn't it?)

failed to sort the package sets: the root package set should be last, but is not (Autoproj::InternalError)

Interestingly, this error message occurs only with the release bootstrap script. With the dev bootstrap the same error as above occurs (cycles detected in package set hierarchy). The results on Ubuntu 18.04 and 20.04 seem to be equal in this case.

I tried to find more info about the root package set is there any documentation about this, we could refer to?

doudou commented 2 years ago

Actually, I think I'm wrong. I'll have to check the code again.

doudou commented 2 years ago

This is probably fixed with the changes from @2maz (and the subsequent fix related to insane error messages that were being generated). All of that is released in 2.15.3

moooeeeep commented 2 years ago

The new error messages are very straight-forward. Thanks a lot!