sonic-pi-net / sonic-pi

Code. Music. Live.
https://sonic-pi.net
Other
10.8k stars 922 forks source link

Can't install the flatpak #3116

Open tallestlegacy opened 2 years ago

tallestlegacy commented 2 years ago

I've been getting this problem for months, shame on me for not reporting sooner

1. [✗] org.kde.Platform       5.15-21.08   i    flathub     44.7 MB / 306.3 MB
2. [ ] net.sonic_pi.SonicPi   stable       i    flathub  < 255.6 MB

Error: Error pulling from repo: GPG verification enabled, but no signatures found (use gpg-verify=false in remote config to disable)
error: Failed to install org.kde.Platform: Error pulling from repo: GPG verification enabled, but no signatures found (use gpg-verify=false in remote config to disable)

how do I fix this?

pashultz commented 2 years ago

Hi! Not a dev, just another Linux user. From the error message, it looks like the issue is with the KDE flatpak, not Sonic Pi per se. Unfortunately I can't reproduce this: the Sonic Pi flatpak installs and runs correctly on my machine, and oddly, it doesn't even give org.kde.Platform as a dependency. Which distribution and desktop environment do you use, and what command were you using to install Sonic Pi? (for comparison, I used flatpak install net.sonic_pi.SonicPi)

You might try using flatpak remote-delete org.kde.Platform to reset the cached stuff on your end, as suggested in this AskUbuntu question.

samaaron commented 2 years ago

Hi, unfortunately I can only echo @pashultz's comments. The flatpak build isn't something that we create or maintain - hopefully you can figure out who the maintainer is and contact them directly.

Otherwise, another route to installing on Linux is to build from source: https://github.com/sonic-pi-net/sonic-pi

lilyinstarlight commented 2 years ago

If I remember correctly, @hfiguiere is the person who maintains the flatpak

hfiguiere commented 2 years ago

This is a flatpak setup issue.

first: which distro are you on? Which architecture?

samaaron commented 2 years ago

@hfiguiere out of interest, are you considering updating the flatpack to v4? If so, do you need any help with it?

hfiguiere commented 2 years ago

Elixir is THE problem.

samaaron commented 2 years ago

@hfiguiere could you expand a little? What is it about Elixir that’s causing the issue(s)?

hfiguiere commented 2 years ago

Simply: there is no network access during the build phase, and Elixir require installing a ton of packages that way.

samaaron commented 2 years ago

Simply: there is no network access during the build phase, and Elixir require installing a ton of packages that way.

Where and when does the build phase happen? Does flatpak compile everything from source somewhere?

lilyinstarlight commented 2 years ago

Hi @hfiguiere! See #3022 - the guidance in that thread is a little dated, but I've worked on allowing building in offline sandboxes and I'm making a better write-up I'll contribute soon (the most notable differences from that thread are that esbuild is not required any longer and you have to separate the -n and -o options now)

Edit: you can also look at my Nix package, which might help too: https://github.com/NixOS/nixpkgs/blob/e939d920d5f430147b127d9f2e3e6b7dc926b9c3/pkgs/applications/audio/sonic-pi/default.nix

lilyinstarlight commented 2 years ago

Where and when does the build phase happen? Does flatpak compile everything from source somewhere?

Compiling in a sandbox is a pretty standard thing to do for ensuring reproducible builds (i.e. that any build from a different machine but compatible specs will produce a functionally identical program), so preventing any potentially unstable sources like file timestamps or internet access from creeping into the build is expected

hfiguiere commented 2 years ago

Yeah hex is part of the problem.

hfiguiere commented 2 years ago

Where and when does the build phase happen? Does flatpak compile everything from source somewhere?

The build phase happen after the download phase. It compile from source everything that's not in the runtime. Including erlang, elixir, Ruby (that one is only in the Sdk)

hfiguiere commented 2 years ago

The problem is all the elixir package needed.

Generating docs for the Qt GUI...
Compiling Erlang/Elixir files...
Compiling 14 files (.erl)
src/osc/osc_tests.erl:16:2: Warning: export_all flag enabled - all functions will be exported
%   16| -compile(export_all).
%     |  ^

Compiling 14 files (.ex)
warning: outdented heredoc line. The contents inside the heredoc should be indented at the same level as the closing """. The following is forbidden:

    def text do
      """
    contents
      """
    end

Instead make sure the contents are indented as much as the heredoc closing:

    def text do
      """
      contents
      """
    end

The current heredoc line is indented too little
  lib/tau_web/live/log_live.ex:30

== Compilation error in file lib/tau_web/telemetry.ex ==
** (CompileError) lib/tau_web/telemetry.ex:3: module Telemetry.Metrics is not loaded and could not be found. This may be happening because the module you are trying to load directly or indirectly depends on the current module

Error: module sonicpi: Child process exited with code 1

(I have ZERO knowledge of elixir / erlang)

hfiguiere commented 2 years ago

That was with 4.0.1

Now it's 4.0.3:

Running: cd app && ./linux-config.sh --config RelWithDebInfo
Creating build directory...
Generating makefiles...
-- CMakeLists: Sonic Pi
CMake Error at /usr/share/cmake-3.23/Modules/CMakeDetermineSystem.cmake:130 (message):
  Could not find toolchain file:
  /run/build/sonicpi/app/vcpkg/scripts/buildsystems/vcpkg.cmake
Call Stack (most recent call first):
  CMakeLists.txt:39 (project)
hfiguiere commented 2 years ago

Ah yeah --offline-build everywhere. It seem the Elixir problem are gone on 4.0.3

hfiguiere commented 2 years ago

Still can't find QScintilla despite building it. Not sure what CMake expect to find but it doesn't come with a .pc file....

lilyinstarlight commented 2 years ago

Still can't find QScintilla despite building it. Not sure what CMake expect to find but it doesn't come with a .pc file....

It looks in defined library paths from environment (it didn't come with a CMake file or pkg-config file on my system...). Set QSCINTILLA_ROOT in the CMake vars to help it find it, if you know where it is

Edit: see stuff around https://github.com/sonic-pi-net/sonic-pi/blob/a63f5b6bf7c6013dcf7260aebd641c2be30540f4/app/gui/qt/cmake/FindQScintilla.cmake#L16

hfiguiere commented 2 years ago

Ah yeah the wrapper script mean the prefix isn't set. Works better now. Back to the elixir / erlang errors above.

lilyinstarlight commented 2 years ago

For the elixir stuff, you need to have a copy of the Mix deps folder copied into the build environment from downloading them manually (or if your build stuff has something analogous to fixed-output derivations from Nix, you can use that -- I wish I had more helpful info, but I haven't messed with flatpak before)

hfiguiere commented 2 years ago

So basically it's impossible, since:

  1. I have no clue how to build elixir stuff.
  2. I don't even have a URL to get the packages.

We have tools for python, go, dotnet, node (yarn or npm), rust (cargo), to generate manifest.

lilyinstarlight commented 2 years ago

Yeah I don't know what the direct URLs to the Hex package registry would be (Mix will build them for you when the package sources are put in the deps folder though -- it actually works fairly similar to Cargo from a user perspective)

I can zip up a deps sources folder from my machine for you if it would help. You would only have to get it into the build environment, unzip it, then run the build scripts the same as you otherwise would

hfiguiere commented 2 years ago

it wouldn't work. Upstream source are not allowed.

(Cargo has a Cargo.lock, so you can parse it, also Rust is far more popular)

hfiguiere commented 2 years ago

Building telemetry_metrics require telemetry. telemetry require rebar3, and rebar3 requires.... a lot. And that's not the only thing. (I already figured out mix)

Update rebar3 require bbmustache which requires... rebar3