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

switch-config and pkg osdeps #318

Open
joaobrittoneto opened this issue Oct 6, 2020 · 10 comments
Open

switch-config and pkg osdeps #318

joaobrittoneto opened this issue Oct 6, 2020 · 10 comments

Comments

@joaobrittoneto
Copy link

I'm having a problem with autoproj switch-config using the manifest of a package that is no longer valid.

I have a branch (e.g stable) on the buildconf, with a snapshot.yml (the overrides) of packages in a stable version (including the package-set).
On master, a new osdeps was defined on the package-set and added on the manifet of one package (e.g. my_package).
Now I want to switch from master to stable.
When I do autoproj switch-config git git@git-repo/exemplo.git branch=stable, I got the follow error.

ERROR: manifest my_package/manifest.xml of my_package lists 'os-deps' as dependency, but it is neither a normal package nor an osdeps package. osdeps reports: cannot resolve os-deps: os-deps is not an osdep and it cannot be resolved as a source package

I believe autoproj is considering the manifest of my_package on the master branch, instead of the stable branch, (in stable branch the os-deps was not yet defined neither on package-set nor in my_package).

Am I doing something wrong or is it a bug in autoproj?

@doudou
Copy link
Member

doudou commented Oct 6, 2020

At what point during the "switch" did this error happen ? Did autoproj switch the configuration anyways, or did it fall back to the current config ?

@joaobrittoneto
Copy link
Author

The error happens right at the begging, while trying to update the packages.
It changed the config. The branch of the both buildconf and package-set are moved to stable, but the packages remain in master.

  autoproj main configuration: checking out branch stable
  updated autoproj main configuration

@doudou
Copy link
Member

doudou commented Oct 6, 2020

It stays that way after a run of autoproj update my_package ?

@planthaber
Copy link
Member

planthaber commented Oct 7, 2020

I think this is "normal" behavior of autoproj: update returns an error if osdeps are not found.

The config switch removed an osdep definition and changed the branch of a package requiring it (which removes the dependency from the package) but did not update the package.

So, after switch-config, the osdep definition is gone, the package is still on the old branch and aup returns an error because the osdep is not defined.

Workaround is what Sylvain said: autoproj update my_package, or a global autoproj update --no-osdeps (in case there could be more packahes with this issue)

I'm wondering if an autoproj update is what you would do all the time after a switch-config? In this case the autoproj update --no-osdeps could be automatically called as part of switch-config

@joaobrittoneto
Copy link
Author

It stays that way after a run of autoproj update my_package ?

After aup my_package it switch my_package to the defined branch and there is no more error.

So, after switch-config, the osdep definition is gone, the package is still on the old branch and aup returns an error because the osdep is not defined.

Would be: So, after switch-config, the osdep definition is gone, the package is still on the old branch and "switch-config" returns an error because the osdep is not defined.

Doing autoproj update manually is ok for a few cases, but may block automatic tools/CI.
Maybe it's worth to have a --update or --reset-update on switch-config to avoid it to crash on those cases.

@doudou
Copy link
Member

doudou commented Oct 7, 2020

Doing autoproj update manually is ok for a few cases, but may block automatic tools/CI.

I agree that the autoproj behavior is not great right now, but you really don't need switch-config in CI. Bootstrap instead with the right branch.

I would go for having switch-config not update at all (just checkout the main configuration) and let the user run it.

@g-arjones
Copy link
Contributor

Is there a reason for loading the manifests during a switch-config?

@g-arjones
Copy link
Contributor

g-arjones commented Oct 7, 2020

We could also use the same kind of workaround I used in the github plugin: just rescue and ignore PackageNotFound during switch-config

@doudou
Copy link
Member

doudou commented Oct 7, 2020

Is there a reason for loading the manifests during a switch-config?

I don't think there is. It just happens to be in the code path. As far as I remember, switch-config does update the configuration.

@g-arjones
Copy link
Contributor

Sounds like an easy fix then

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

4 participants