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

obs_gbp: dpkg-scansources also finds any .dsc in the source clone #463

Open
nickbroon opened this issue Mar 23, 2023 · 0 comments
Open

obs_gbp: dpkg-scansources also finds any .dsc in the source clone #463

nickbroon opened this issue Mar 23, 2023 · 0 comments

Comments

@nickbroon
Copy link
Contributor

nickbroon commented Mar 23, 2023

Spotting while attempting to use obs_gbp to build https://github.com/fluent/fluent-bit/

2023-03-22 10:12:25,643 Files:
2023-03-22 10:12:25,643  fluent-bit_2.0.6-1.dsc
2023-03-22 10:12:25,644  fluent-bit_2.0.6.orig.tar.gz
2023-03-22 10:12:25,777  fluent-bit_2.0.6-1.debian.tar.xz
2023-03-22 10:12:25,778 Files:
2023-03-22 10:12:25,778  librdkafka.dsc
Traceback (most recent call last):
  File "/usr/lib/obs/service/obs_gbp", line 30, in <module>
    main()
  File "/usr/lib/obs/service/obs_gbp", line 26, in main
    TarSCM.run()
  File "/usr/lib/obs/service/TarSCM/__init__.py", line 39, in run
    task_list.process_list()
  File "/usr/lib/obs/service/TarSCM/tasks.py", line 131, in process_list
    self.process_single_task(task)
  File "/usr/lib/obs/service/TarSCM/tasks.py", line 257, in process_single_task
    cli       = args
  File "/usr/lib/obs/service/TarSCM/archive.py", line 370, in create_archive
    shutil.copy(input_file, output_file)
  File "/usr/lib64/python3.6/shutil.py", line 245, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib64/python3.6/shutil.py", line 120, in copyfile
    with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: '/user1/foobar/output/tmpjxhk2m4u/librdkafka.dsc'
2023-03-22 10:12:25,779 Skipping cleanup

This looks to be the relevant bit of code:

sources = self.helpers.safe_run(['dpkg-scansources', workdir],

As well as finding the generated fluent-bit source package .dsc, as the cloned source repo is also in the same directory it will find any .dsc files there too. (Arguably git repos should not contain .dsc files as they can be generated from control files, but it's not uncommon for some repo to do this for other CI system, and in case of fluent-bit its in a vendored dependency)

I think there might be two options to address this:

  • Make sure the clones source tree is not in the same directory and the generated source packages (I don't think gpb/dpkg-buildpackage allows control output location, so moving the files from obs_gbp might be needed, or deleting the clone directory before searching for the source packages)

  • As the source index generated by dpkg-scansources is not actually used, just the list of found .dsc files; perhaps instead of using dpkg-scansource something like find <workdir> -path <scm_object.clone_dir> -prune -o -name '*.dsc' -exec cat '{}' \; which ignores the clone directory.

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

1 participant