openSUSE / obs-service-tar_scm

An OBS source service: fetches code from any SCM and archives it
GNU General Public License v2.0
31 stars 105 forks source link

tar_scm: Generated tarball may contain outdated git sources if cached repository exists #237

Open afaerber opened 6 years ago

afaerber commented 6 years ago

In multiple of my packages I've recently experienced osc service disabledrun detecting a cached git repo from a previous run and updating the branch I'm using as expected, but afterwards detecting an identical tarball.

Detected cached repository...
From https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell
   237f07b..83b53fc  A3700_utils-armada-17.06 -> origin/A3700_utils-armada-17.06
   34ce216..177ba47  A3700_utils-armada-17.10 -> origin/A3700_utils-armada-17.10
34ce2160a1521dda9c7c68e06fcde83242dee94a
34ce2160a1521dda9c7c68e06fcde83242dee94a
Identical target file A3700-utils-marvell-17.10.tar.xz already exists, skipping..

Removing the tarball does not remedy this. Deleting the cached git repo does. So it must be the generation of the tarball that is at fault. Possibly this is related to the branch in question (A3700_utils-armada-17.10) not being the checked out default branch (A3700_utils-armada-17.06) in the cached git repo?

$ git branch -a
* A3700_utils-armada-17.06
  A3700_utils-armada-17.10
  remotes/origin/A3700_utils-armada-17.06
  remotes/origin/A3700_utils-armada-17.08
  remotes/origin/A3700_utils-armada-17.10
  remotes/origin/HEAD -> origin/A3700_utils-armada-17.06
  <service name="tar_scm" mode="disabled">
    <param name="url">https://github.com/MarvellEmbeddedProcessors/A3700-utils-marvell.git</param>
    <param name="scm">git</param>
    <param name="filename">A3700-utils-marvell</param>
    <param name="versionformat">17.10</param>
    <param name="revision">refs/heads/A3700_utils-armada-17.10</param>
  </service>

Will check if obs_scm works better.

afaerber commented 6 years ago

Converting to obs_scm fails:

$ osc service localrun
Cloning into '/home/andreas/OBS/home:a_faerber:branches:devel:ARM:Factory:Contrib:MacchiatoBin/arm-trusted-firmware-marvell/atf-marvell'...
From https://github.com/MarvellEmbeddedProcessors/atf-marvell
 * [new branch]        atf-v1.3-armada-17.10 -> atf-v1.3-armada-17.10
34247e027e234634d65287d1cfdf0c3d6eb98cae
Traceback (most recent call last):
  File "/usr/lib/obs/service/obs_scm", line 30, in <module>
    main()
  File "/usr/lib/obs/service/obs_scm", line 26, in main
    TarSCM.run()
  File "/usr/lib/obs/service/TarSCM/__init__.py", line 35, in run
    task_list.process_list()
  File "/usr/lib/obs/service/TarSCM/tasks.py", line 109, in process_list
    self.process_single_task(task)
  File "/usr/lib/obs/service/TarSCM/tasks.py", line 192, in process_single_task
    cli       = args
  File "/usr/lib/obs/service/TarSCM/archive.py", line 93, in create_archive
    os.utime(name, (tstamp, tstamp))
OSError: [Errno 40] Too many levels of symbolic links: 'atf-marvell-1.3~17.10~20180423T103720~34247e02/plat/marvell/a3700/a3700/include'
Aborting: service call failed:  /usr/lib/obs/service/obs_scm --url https://github.com/MarvellEmbeddedProcessors/atf-marvell.git --scm git --filename atf-marvell --versionformat 1.3~17.10~%ci~%h --revision refs/heads/atf-v1.3-armada-17.10 --outdir /home/andreas/OBS/home:a_faerber:branches:devel:ARM:Factory:Contrib:MacchiatoBin/arm-trusted-firmware-marvell/tmpH2zkGR.obs_scm.service
aspiers commented 6 years ago

Possibly this is related to the branch in question (A3700_utils-armada-17.10) not being the checked out default branch (A3700_utils-armada-17.06) in the cached git repo?

I thought the cache only contained bare repos with no working tree checked out; are you seeing something which contradicts that?

afaerber commented 6 years ago

Yes, if I cd into the directory I see the folders like in a normal checkout, and as shown above git branch indicates with a star I'm on a local branch corresponding to upstream's default branch.

aspiers commented 6 years ago

@afaerber Is it possible that you have repos cached from before tar_scm switched to caching only bare repos?