sonnyp / Junction

Application/browser chooser
https://flathub.org/apps/re.sonny.Junction
GNU General Public License v3.0
457 stars 28 forks source link

Build failure #127

Closed rudism closed 1 year ago

rudism commented 1 year ago

I'm trying to build this for a local user install, but running into an error at the ninja step. Here's a transcript of the build process with the error at the end. Am I doing something incorrectly, or is it a version/dependency problem, or something else?

~/src
❯ meson --version              
1.1.0

~/src
❯ ninja --version       
1.11.1

~/src
❯ git clone https://github.com/sonnyp/Junction.git
Cloning into 'Junction'...
remote: Enumerating objects: 1933, done.
remote: Counting objects: 100% (672/672), done.
remote: Compressing objects: 100% (199/199), done.
remote: Total 1933 (delta 485), reused 619 (delta 465), pack-reused 1261
Receiving objects: 100% (1933/1933), 3.10 MiB | 12.41 MiB/s, done.
Resolving deltas: 100% (1339/1339), done.

~/src
❯ cd Junction 

~/src/Junction main
❯ git submodule update --init --recursive         
Submodule 'troll' (https://github.com/sonnyp/troll.git) registered for path 'troll'
Cloning into '/home/rudism/src/Junction/troll'...
Submodule path 'troll': checked out '63392a57392fb8ed944e859269a3751f649f64ec'

~/src/Junction main
❯ meson setup --prefix ~/.local build
The Meson build system
Version: 1.1.0
Source dir: /home/rudism/src/Junction
Build dir: /home/rudism/src/Junction/build
Build type: native build
Project name: Junction
Project version: 1.7
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program msgfmt found: YES (/usr/bin/msgfmt)
Program desktop-file-validate found: YES (/usr/bin/desktop-file-validate)
Configuring re.sonny.Junction.service using configuration
Program appstream-util found: YES (/usr/bin/appstream-util)
Program glib-compile-schemas found: YES (/usr/bin/glib-compile-schemas)
Program gjs found: YES (/usr/bin/gjs)
Configuring re.sonny.Junction using configuration
Program blueprint-compiler found: YES (/usr/bin/blueprint-compiler)
Program ../troll/gjspack/bin/gjspack found: YES (/home/rudism/src/Junction/src/../troll/gjspack/bin/gjspack)
src/meson.build:31: WARNING: Project targets '>= 0.59.0' but uses feature deprecated since '0.56.0': meson.source_root. use meson.project_source_root() or meson.global_source_root() instead.
Program msginit found: YES (/usr/bin/msginit)
Program msgmerge found: YES (/usr/bin/msgmerge)
Program xgettext found: YES (/usr/bin/xgettext)
Found pkg-config: /usr/bin/pkg-config (0.29.2)
Build-time dependency gio-2.0 found: YES 2.76.1
Program glib-compile-schemas found: YES (/usr/bin/glib-compile-schemas)
Program gtk4-update-icon-cache found: NO
Program gtk-update-icon-cache found: YES (/usr/bin/gtk-update-icon-cache)
Program update-desktop-database found: YES (/usr/bin/update-desktop-database)
Build targets in project: 32
WARNING: Deprecated features used:
 * 0.56.0: {'meson.source_root'}

Junction 1.7

  User defined options
    prefix: /home/rudism/.local

Found ninja-1.11.1 at /usr/bin/ninja

~/src/Junction main
❯ ninja -C build install
ninja: Entering directory `build'
[29/30] Generating src/gjspack with a custom command
FAILED: src/re.sonny.Junction.src.gresource 
/home/rudism/src/Junction/src/../troll/gjspack/bin/gjspack --appid=re.sonny.Junction --prefix /re/sonny/Junction --project-root /home/rudism/src/Junction --resource-root /home/rudism/src/Junction/src --blueprint-compiler /usr/bin/blueprint-compiler --no-executable ../src/main.js --potfiles ../src/../po/POTFILES src
ninja: build stopped: subcommand failed.
rudism commented 1 year ago

Here's what happens when I manually run the command that it reports failed:

~/src/Junction main
❯ /home/rudism/src/Junction/src/../troll/gjspack/bin/gjspack --appid=re.sonny.Junction --prefix /re/sonny/Junction --project-root /home/rudism/src/Junction --resource-root /home/rudism/src/Junction/src --blueprint-compiler /usr/bin/blueprint-compiler --no-executable ../src/main.js --potfiles ../src/../po/POTFILES src

(gjspack:8112): Gjs-WARNING **: 13:05:50.833: JS ERROR: Gio.IOErrorEnum: Error opening file /home/rudism/src/src/main.js: No such file or directory
processSourceFile@resource:///gjspack/src/gjspack.js:135:36
build@resource:///gjspack/src/gjspack.js:365:40
@resource:///gjspack/src/cli.js:247:39

That path it's trying to open /home/rudism/src/src/main.js is definitely not right... Looks like it's missing a directory in there, I think it should be /home/rudism/src/Junction/src/main.js instead? I'm completely unfamiliar with meson/ninja so I'm not sure where to start looking.

eli-schwartz commented 1 year ago

When running ninja -C build install, it first does cd build/ and then, from that directory, runs the gjspack command in question.

Here's what happens when I manually run the command that it reports failed:

So, you must run this from inside the src/Junction/build/ directory -- not from src/Junction/.

rudism commented 1 year ago

Thanks for the hint... Trying that does not seem to produce any output, but the command is exiting with non-zero, so I'm still not sure what's up:

~/src/Junction/build main
❯ /home/rudism/src/Junction/src/../troll/gjspack/bin/gjspack --appid=re.sonny.Junction --prefix /re/sonny/Junction --project-root /home/rudism/src/Junction --resource-root /home/rudism/src/Junction/src --blueprint-compiler /usr/bin/blueprint-compiler --no-executable ../src/main.js --potfiles ../src/../po/POTFILES src

~/src/Junction/build main
❯ echo $?
1
sonnyp commented 1 year ago

The reason you're not getting an error message is probably an outdated blueprint-compiler or troll But even then you'll need libadwaita 1.4 (not released)

Do yourself a favor and use the Flatpak :)

This is what I get with your steps to reproduce:

sonny@porygon ~/t/Junction (main)> ninja -C build install
ninja: Entering directory `build'
[29/30] Generating src/gjspack with a custom command
FAILED: src/re.sonny.Junction.src.gresource 
/home/sonny/tmp/Junction/src/../troll/gjspack/bin/gjspack --appid=re.sonny.Junction --prefix /re/sonny/Junction --project-root /home/sonny/tmp/Junction --resource-root /home/sonny/tmp/Junction/src --blueprint-compiler /home/sonny/.local/bin/blueprint-compiler --no-executable ../src/main.js --potfiles ../src/../po/POTFILES src
error: Namespace Adw does not contain a type called Breakpoint
at /home/sonny/tmp/Junction/src/window.blp line 10 column 7:
  10 |  Adw.Breakpoint {
     |      ^
hint: Did you check your spelling?
hint: Are your dependencies up to date?

error: Namespace Adw does not contain a type called Breakpoint
at /home/sonny/tmp/Junction/src/window.blp line 19 column 7:
  19 |  Adw.Breakpoint {
     |      ^
hint: Did you check your spelling?
hint: Are your dependencies up to date?

ninja: build stopped: subcommand failed.
eli-schwartz commented 1 year ago

Well, it does look like troll was downloaded by running git submodule update (and the report includes a description of the commit that got checked out as a result).

I personally think it's a bit odd and perhaps a bug in the gjspack command if it exits nonzero without an error message, regardless of mismatched versions (unless a newer gjspack command actually has better logging) but I know nothing about either one, just about meson's command scheduling. :D

sonnyp commented 1 year ago

unless a newer gjspack command actually has better logging

Yes, I remember fixing that issue.

eli-schwartz commented 1 year ago

Excellent, then I guess this problem is solved by syncing the subproject in c54a749720a1adb1f5dc52899c6ec9e62c556d9a and @rudism should try to git pull today's changes and build the project again.