flatpak / flatpak-builder

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

[Bug]: flatpak-builder --extra-sources not working ? #499

Open TTimo opened 1 year ago

TTimo commented 1 year ago

Checklist

Flatpak version

1.15.0

What Linux distribution are you using?

Manjaro Linux

Linux distribution version

Linux phoenix 5.19.17-2-MANJARO flatpak/flatpak#1 SMP PREEMPT_DYNAMIC Sun Nov 6 00:08:27 UTC 2022 x86_64 GNU/Linux

What architecture are you using?

x86_64

How to reproduce

I have the following module:

            {
                "type": "archive",
                "url": "https://netix.dl.sourceforge.net/project/scons/scons/3.0.1/scons-3.0.1.tar.gz",
                "sha256": "24475e38d39c19683bc88054524df018fe6949d70fbd4c69e298d39a0269f173"
            },

I run this command:

flatpak-builder --extra-sources=/home/timo/GtkRadiant/extra-sources --force-clean --disable-updates --repo=gtkradiant-repo gtkradiant io.github.TTimo.GtkRadiant.json

A directory with a local copy of the tarball is setup, the checksum matches:

timo@phoenix ~/G/extra-sources> pwd
/home/timo/GtkRadiant/extra-sources
timo@phoenix ~/G/extra-sources> ls -1al
total 632
drwxr-xr-x  3 timo timo   4096 Nov 24 20:01 ./
drwxr-xr-x  4 timo timo   4096 Nov 24 20:01 ../
drwxr-xr-x 15 timo timo   4096 Nov 24 19:51 gtkradiant/
-rw-r--r--  1 timo timo 634815 Nov 14  2017 scons-3.0.1.tar.gz
timo@phoenix ~/G/extra-sources> sha256sum scons-3.0.1.tar.gz
24475e38d39c19683bc88054524df018fe6949d70fbd4c69e298d39a0269f173  scons-3.0.1.tar.gz

Expected Behavior

flatpak-builder should be using my local tarball

Actual Behavior

flatpak-builder always downloads from the URL instead

Additional Information

It's possible I misunderstand the documentation, I haven't found any working examples online of using --extra-sources

smcv commented 1 year ago

Flatpak isn't responsible for reading manifests, issue moved to flatpak-builder.

retiredfeline commented 1 year ago

Doesn't work for me too:

openSUSE 15.4 Flatpak 1.12.8

Command: flatpak-builder --extra-sources=/home/data/software/uC/8088 build-dir io.github.gcc_ia16.Gcc_ia16_2204.yaml

Relevant manifest lines:

    sources:
      - type: archive
        url: https://launchpad.net/~tkchia/+archive/ubuntu/build-ia16/+sourcefiles/gcc-ia16-elf/6.3.0-20230219.07-ppa230219074~jammy/gcc-ia16-elf_6.3.0-20230219.07.orig.tar.xz
        sha256: "a8db1ea5603ed7d1c832ee452f3d7fa1093e00aa194146b6b15db55b830d3d15"

Doesn't use the local tarball, starts fetching from the remote site with curl.

TiZ-HugLife commented 1 month ago

Yeah, this is broken for me, too. I'm trying to do a local build for an application that wants Lua, and Lua's site is currently down for maintenance. I already downloaded the tarball, but it won't use it.

❯ org.flatpak.Builder --extra-sources=$(pwd) --force-clean --ccache --user --install build org.geany.Geany.yml
Downloading sources
Fetching git repo https://gitlab.gnome.org/GNOME/vte.git, ref refs/tags/0.72.4
remote: Enumerating objects: 1, done.
remote: Counting objects: 100% (1/1), done.
remote: Total 1 (delta 0), reused 1 (delta 0), pack-reused 0 (from 0)
Receiving objects: 100% (1/1), 269 bytes | 269.00 KiB/s, done.
Fetching LFS assets
fetch: Fetching all references...
Downloading https://www.lua.org/ftp/lua-5.1.5.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0^C

Fortunately, Lua is a shared module, and you can work around the site outage by switching https://www.lua.org with https://www.tecgraf.puc-rio.br/lua/mirror in your local copy of the shared module. Mirror sourced from this comment on /r/lua.