flatpak / flatpak-builder

Tool to build flatpaks from source
GNU Lesser General Public License v2.1
139 stars 92 forks source link

[Feature request]: Support git-lfs #463

Open bilelmoussaoui opened 2 years ago

bilelmoussaoui commented 2 years ago

Checklist

Suggestion

Currently there is no way to tell flatpak-builder to run git-lfs pull on a git repository which requires for now having to use a simple buildsystem and running it yourself

hhyyrylainen commented 1 year ago

Could you share an example of how to do this? When I tried adding a git lfs pull or just a git lfs get my builds fail. It seems like those commands trigger a checkout that tries to pull from a "file" remote which fails like this:

Filtering content: 100% (33/33), 10.45 MiB | 10.24 MiB/s, done.
Note: switching to '9effbdd957ac78f9c4932d0614277124c01af943'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 9effbdd Added option to specify nuget source to use and writing directly to output folder
Cloning into '/home/hhyyrylainen/Projects/com.revolutionarygamesstudio.ThriveLauncher/.flatpak-builder/build/thrive-launcher-5/RevolutionaryGamesCommon'...
fatal: transport 'file' not allowed
fatal: clone of 'file:///home/hhyyrylainen/Projects/com.revolutionarygamesstudio.ThriveLauncher/.flatpak-builder/git/https_github.com_Revolutionary-Games_RevolutionaryGamesCommon.git' into submodule path '/home/hhyyrylainen/Projects/com.revolutionarygamesstudio.ThriveLauncher/.flatpak-builder/build/thrive-launcher-5/RevolutionaryGamesCommon' failed

Edit: seems like my problem was actually when flatpak-builder was trying to still setup my repo (which seems to cause a LFS content filter anyway, which confused me) it failed to copy over the submodules. So the solution was for me to run the following on my host system:

git config --global --add protocol.file.allow always

And turns out that, that was a bug in flatpak-builder that's not yet fixed in the Fedora repo version (or it might but it's been a couple of days since I last installed updates): https://github.com/flatpak/flatpak-builder/issues/495

wiiznokes commented 6 months ago

Can i ask where to put the git lfs pull command ?