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

Getting binaries for multibuild is broken? #1472

Open
isbm opened this issue Jan 23, 2024 · 3 comments
Open

Getting binaries for multibuild is broken? #1472

isbm opened this issue Jan 23, 2024 · 3 comments
Assignees
Labels

Comments

@isbm
Copy link
Contributor

isbm commented Jan 23, 2024

Describe the bug

Hi!
I am not sure if this is just me or osc is a bit broken? So I use osc Version 1.5.1 from here: https://build.opensuse.org/package/show/openSUSE:Tools/osc

And then I get this defined argparser's error: e37e144

...if I try this syntax:
https://github.com/dmach/osc/blob/behave/behave/features/getbinaries-project-package-repo-arch.feature#L21

Example (actual names are mangled):

  1. Checkout my_stuff package
  2. cd there (.osc is there, current dir is not a project, OK)
  3. osc getbinaries some:my:project my_stuff some_repo aarch64 --multibuild-package=my_flavour

Then I get this:

usage: osc [global opts] getbinaries [-h] [-d DIR] [-M FLAVOR] [--sources] [--debuginfo] [--ccache]
osc [global opts] getbinaries: error: The -M/--multibuild-package option can be only used from a package checkout.

It is already a bug, or just me?

Versions

  • Operating system: Ubuntu 22.04.3 LTS
  • Packages: osc, 1.5.1-0

I am also not entirely sure how this code is conforming to the new syntax:

if opts.multibuild_package and ((len(args) > 2) or (len(args) <= 2 and is_project_dir(Path.cwd()))):           
            self.argparse_error("The -M/--multibuild-package option can be only used from a package checkout.")

So if current directory is not a project directory, then amount of args should be no more than two. But in this case osc cries that I need to specify a) repo and b) arch. Further experimentations, if I comment-out this error entirely in the code, then osc cannot even find a package. But if I omit the package name from the above command, then it downloading me all possible binaries, including the package I am looking for. 😉

So I am not sure... If this is just me, then a bit better CLI doc would help. Thanks!

@isbm isbm added the Bug label Jan 23, 2024
@dmach
Copy link
Contributor

dmach commented Jan 24, 2024

I think the root cause is my attempt to make working with multibuild packages consistent.
The -M/--multibuild-package needs to be used when you're using a working copy that maps to a source package name and needs a hint about the flavor.

When working with a remote packages, you can specify name:flavor explicitly.
It is similar

Example commands using the testing container that osc uses for running behave tests:

$ osc -A https://localhost:1443 getbinaries test:factory multibuild-pkg standard x86_64 --multibuild-package=flavor1
usage: osc [global opts] getbinaries [-h] [-d DIR] [-M FLAVOR] [--sources] [--debuginfo] [--ccache]
osc [global opts] getbinaries: error: The -M/--multibuild-package option can be only used from a package checkout.
$ osc -A https://localhost:1443 getbinaries test:factory multibuild-pkg:flavor1 standard x86_64
Creating directory "binaries"
_buildenv: | Elapsed Time: 0:00:00                                                                                                                                                           
_statistics: | Elapsed Time: 0:00:00                                                                                                                                                         
multibuild-pkg-flavor1-1-1.x86_64.rpm: | Elapsed Time: 0:00:00                                                                                                                               
rpmlint.log: | Elapsed Time: 0:00:00

which is consistent with

$ osc -A https://localhost:1443 ls -b test:factory multibuild-pkg:flavor1
standard/x86_64
 _buildenv
 _statistics
 multibuild-pkg-1-1.src.rpm
 multibuild-pkg-flavor1-1-1.x86_64.rpm
 multibuild-pkg-flavor1-debuginfo-1-1.x86_64.rpm
 rpmlint.log
standard/i586
 _buildenv
 _statistics
 multibuild-pkg-1-1.src.rpm
 multibuild-pkg-flavor1-1-1.i586.rpm
 multibuild-pkg-flavor1-debuginfo-1-1.i586.rpm
 rpmlint.log

@dmach dmach self-assigned this Jan 24, 2024
@isbm
Copy link
Contributor Author

isbm commented Jan 24, 2024

@dmach well this makes sense. A bit. 😉 But I am still not sure why we then have that -M/--multibuild-package option? Whatever the syntax is, an "average Joe" (like myself) should just use it as --help says, or?

@dmach
Copy link
Contributor

dmach commented Jan 25, 2024

The -M/--multibuild-package is needed for this:

osc -A https://localhost:1443 co test:factory multibuild-pkg
cd test:factory/multibuild-pkg
osc getbinaries -M flavor1 standard x86_64

Whatever the syntax is, an "average Joe" (like myself) should just use it as --help says, or?

Let me check if I can improve the help message.

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

No branches or pull requests

2 participants