Conversation
|
Nice! |
|
Isn't this going to be a problem for packages that have multiple subpackages? Since you are delegating the |
|
No, I did this exactly to avoid this issue that we had with our workaround for packages with many sub-packages so far. In this case the parent is only checked out and updated once. |
|
Could you please elaborate? How does this prevent a race condition during parallel imports? |
|
It uses the standard way from autoproj for updating packages. When a package is required by 2 other packages, it is also updated only once, even though all downstream dependencies get updated. Edit: Actually not so sure anymore that this is what happens. Gonna look into this some more... |
|
I'm not sure I understand what you are saying... Suppose a simple workspace with three packages A, B, C, all three are directly selected; B and C depend on A. The current behavior is: autoproj will call What you are implementing: autoproj will still call Or am I missing something? |
|
Ideally, what we want is that the parent package is just something like a dependency of the sub-packages. But that does not work directly, since dependencies are only checked out after the package itself is checked out. For reference, this is the current workaround used by |
|
@chhtz @g-arjones I changed it to set the dependency to the parent package during checkout, which interestingly seems to work in all tests I did. So especially calling global amake with a non-existing repository containing 9 subpackages worked well. It now says "my/package/subpackage updated", which is technically a lie because the update will happen only later when "my/package updated" is reached, dunno how much of an problem that might be. |
|
I looking into how to solve this: |
| raise "Subpackage must provide a parent package." | ||
| end | ||
|
|
||
| @parent = Autoproj.workspace.manifest.package_definition_by_name(parent_name) |
There was a problem hiding this comment.
Autobuild cannot depend on autoproj
| end | ||
|
|
||
| def checkout(package, options = Hash.new) # Does nothing, parent will be checked out | ||
| package.depends_on(@parent.autobuild) |
There was a problem hiding this comment.
I don't think this is going to behave as expected, especially with --no-deps...
|
I think what you guys are trying to implement is feasible, but not as trivial to get right as we would want. The delegate pattern you were going for is promising, but you have to synchronize access to the parent's importer and make sure you don't check out or update the same package multiple times... I would also suggest an API to create the importers so that the user doesn't have to define the importers manually.. Something like: stack_package 'some_metapackage' do
cmake_package 'package_a'
python_package 'package_b'
end |
|
Yes, with --no-deps it will definitely not work, but I don't really see a way to fix that. |
|
I don't know who could implement such a more involved solution to this. I think the current version should work in most situations. Only he type subpackage was added, so it should not affect any existing workspace. |
|
We already talked about this, But it is not included (yet), because the other (sigle line) api ideas made it impossible/complicated/impractical to set defines etc. for the subpackages. Your proposal actually was the latest result, as only this way we are able to add blocks to the subpackages.
For the Autoproj require: Do you think it woulf be better to place this in autoproj?: https://github.com/rock-core/autoproj/tree/master/lib/autoproj/autobuild_extensions |
This allows to define a package that is located in a sub-directory of another package. Use cases are common multi-packages commonly used in the ROS world (one repository with many packages inside), but also cases like cmake-packages that come with their ruby/python bindings in ruby/python subpackages.
@planthaber @chhtz @doudou