[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

how to handle upstream orig tarball with git-lfs reference files?



Upstreams are starting to use git lfs in their git repos. In some cases the git-lfs references files are retained in the source tarball, not replacing the reference with the actual files. This happens for instance with github repos (I gather it happens because the tarball is generated with 'git archive' [1]). An example is the mesh files [2] in pygalmesh 0.4.0 [3].

This means gbp import-orig, used in the normal way (or "old" way) with orig tarballs, will import lfs references, and dpkg-buildpackage will proceed to attempt the build with those references files, not with the actual files. So the build fails.

Actually 'gbp import-orig --pristine-tar' also fails, e.g.,

  pygalmesh$ gbp import-orig --uscan --pristine-tar
  gbp:info: Launching uscan...
  uupdate: debian/source/format is "3.0 (quilt)".
  uupdate: Auto-generating pygalmesh_0.3.6-2.debian.tar.xz
  uupdate: -> Copy to      pygalmesh_0.4.0-1.debian.tar.xz
gbp:info: Using uscan downloaded tarball ../pygalmesh_0.4.0.orig.tar.gz
  What is the upstream version? [0.4.0]
gbp:info: Importing '../pygalmesh_0.4.0.orig.tar.gz' to branch 'upstream'...
  gbp:info: Source package is pygalmesh
  gbp:info: Upstream version is 0.4.0
gbp:error: Import of ../pygalmesh_0.4.0.orig.tar.gz failed: Couldn't commit to 'pristine-tar' with upstream '536d07340054dd9bd56202ea58f4619650b3d05c': Downloading test/meshes/elephant.vtu (136 KB) Error downloading object: test/meshes/elephant.vtu (a11aa57): Smudge error: Error downloading test/meshes/elephant.vtu (a11aa572d612abfacace9a31c0e20c8a628bf4ffd50b1661e14790ae02c93b7b): [a11aa572d612abfacace9a31c0e20c8a628bf4ffd50b1661e14790ae02c93b7b] Object does not exist on the server or you don't have permissions to access it: [404] Object does not exist on the server or you don't have permissions to access it

Errors logged to /home/projects/pygalmesh/.git/lfs/logs/20190810T231824.577519072.log
  Use `git lfs logs last` to view the log.
  error: external filter 'git-lfs filter-process' failed
  fatal: test/meshes/elephant.vtu: smudge filter lfs failed
  tar: Unexpected EOF in archive
  tar: Unexpected EOF in archive
  tar: Error is not recoverable: exiting now
pristine-tar: command failed: git archive --format=tar 536d07340054dd9bd56202ea58f4619650b3d05c | (cd '/tmp/pristine-tar.B3MfD_oDaJ' && tar x)
  gbp:error: Error detected, Will roll back changes.
gbp:info: Rolling back branch upstream by resetting it to 72d0bcfaba44dea918042ba323c546b0d88b4905 gbp:info: Rolling back branch pristine-tar by resetting it to d832fde1c79f59611d31e4188a0388491914bde6
  gbp:error: Rolled back changes after import error.


So what is currently the best way to handle lfs files in upstream tarballs? Is gbp-buildpackage the only automated solution and those not using it just need to learn how? Or can debian/watch be written to include a git-lfs pull when repacking a source tarball? Any other solutions apart from manual repacking?

A related question, is it possible to configure a github repo so that the source tarball links are generated with actual files? If so then we could request upstream to configure their repo that way.

Drew

[1] https://github.com/git-lfs/git-lfs/issues/1322
[2] https://github.com/nschloe/pygalmesh/tree/master/test/meshes
[3] https://github.com/nschloe/pygalmesh/releases


Reply to: