pop-os / cosmic-epoch

Next generation Cosmic desktop environment
2.78k stars 78 forks source link

`cosmic-launcher_build` fails while trying to get `libcosmic` dependency #62

Closed virtualritz closed 1 year ago

virtualritz commented 1 year ago

Same/similar to #60.

Could you keep this open this time until I confirm the build is really fixed?

cosmic-launcher 0.1.0

  User defined options
    prefix: /usr
    vendor: false

Found ninja-1.10.1 at /usr/bin/ninja
/usr/bin/meson compile -C cosmic-launcher_build
ninja: Entering directory `/home/moritz/code/cosmic-epoch/cosmic-launcher_build'
[0/3] Generating src/cargo-build with a custom command
    Updating git repository `https://github.com/pop-os/libcosmic/`
error: failed to get `libcosmic` as a dependency of package `cosmic-launcher v0.1.0 (/home/moritz/code/cosmic-epoch/cosmic-launcher)`

Caused by:
  failed to load source for dependency `libcosmic`

Caused by:
  Unable to update https://github.com/pop-os/libcosmic/?branch=master#3bb193c3

Caused by:
  object not found - no match for id (3bb193c3d2f41f87359d80e3eebba365425c4018); class=Odb (9); code=NotFound (-3)
[2/3] Generating data/com.system76.CosmicLauncher.metainfo.xml with a custom command
FAILED: src/cosmic-launcher 
/usr/bin/env CARGO_HOME=/home/moritz/code/cosmic-epoch/cosmic-launcher_build/cargo-home /home/moritz/.cargo/bin/cargo build --manifest-path /home/moritz/code/cosmic-epoch/cosmic-launcher/Cargo.toml --target-dir /home/moritz/code/cosmic-epoch/cosmic-launcher_build/src --release && cp src/release/cosmic-launcher src/cosmic-launcher
ninja: build stopped: subcommand failed.
error: Recipe `_meson_build` failed on line 11 with exit code 1
error: Recipe `build` failed on line 22 with exit code 1
Elias-Graf commented 1 year ago

How I was able to resolve this

The libconsmic crate needs to be updated to something that exists, and is supported by the code. I found that commit e9766389c4da17d43aea7d24c871ef838a22a3d1 is working.

Note: My build, at least at the time of writing this, is still not able to complete compilation, but the following actions helped to continue it further

If your problem is in cosmic-applets/*:

cd cosmic-applets
cargo update --package=libcosmic --precise=e9766389c4da17d43aea7d24c871ef838a22a3d1

Error in If your problem is in cosmic-launcher:

cd cosmic-launcher
cargo update --package=libcosmic --precise=e9766389c4da17d43aea7d24c871ef838a22a3d1

Original Post for reference

For me, the error is slightly different. It is failing in the cosmic-applets/cusmic-applet-network. The issue there seems to be, that the Cargo.lock, in cosmic-applets, seems to specific a commit that doesn't exist? I have found that the issue can be partially resolved by updating that, using: cargo update -p libcosmic. As this updates to the latest version, there seems to be some new code, that is incompatible. I found, updating using cargo update --package=libcosmic --precise=e9766389c4da17d43aea7d24c871ef838a22a3d1, leads to cargo build finishing,~but I now get some error about something related to linking with `cc` failed - /usr/bin/ld: cannot find -lEGL: No such file or directory.~ Turns out I was missing libglvnd-dev and some other packages.

I will update this comment if I figure out anything else.

virtualritz commented 1 year ago

Thanks for taking the time. I tried various things but couldn't get it to build. cargo update fails for a lot of the crates because of specific dependencies that seem outdated.

For the maintainers: all I want is to build this desktop and see if I can contribute. If I have to jump through these hoops every time I pull an update from this repo then sorry, I don't have time for this.

And I mean that in a very caring way because the work you've done so far on this, at least visually, looks great.

ids1024 commented 1 year ago

Currently it's still considered a pre-alpha so breakage is somewhat expected. And testing is mainly done with .deb packaging or manually building individual components rather than with this repository.

We should be able to add some kind of CI here to verify it keeps building.

virtualritz commented 1 year ago

63 does not fix this, just brakes elsewhere (I did a new clone of the repo and built from scratch):

cosmic-launcher 0.1.0

  User defined options
    prefix: /usr
    vendor: false

Found ninja-1.10.1 at /usr/bin/ninja
/usr/bin/meson compile -C cosmic-launcher_build
ninja: Entering directory `/home/moritz/code/cosmic-epoch/cosmic-launcher_build'
[0/3] Generating src/cargo-build with a custom command
    Updating crates.io index
    Updating git repository `https://github.com/pop-os/libcosmic/`
    Updating git submodule `https://github.com/pop-os/iced.git`
    Updating git repository `https://github.com/wash2/launcher.git`
error: failed to get `pop-launcher` as a dependency of package `cosmic-launcher v0.1.0 (/home/moritz/code/cosmic-epoch/cosmic-launcher)`

Caused by:
  failed to load source for dependency `pop-launcher`

Caused by:
  Unable to update https://github.com/wash2/launcher.git?branch=cosmic-toplevel#8c331383

Caused by:
  object not found - no match for id (8c331383b669287fe63d945430e674906da990f1); class=Odb (9); code=NotFound (-3)
[2/3] Generating data/com.system76.CosmicLauncher.metainfo.xml with a custom command
jokeyrhyme commented 1 year ago

I've checked out 18469b8d724ef3575fb3e46729640b15fd03e2bf

I no longer get the build error relating to libcosmic: https://github.com/pop-os/cosmic-epoch/issues/62#issue-1537982367

I do get the build error relating to a missing commit for pop-launcher: https://github.com/pop-os/cosmic-epoch/issues/62#issuecomment-1407111966

I can fix that with:

$ cd cosmic-launcher
$ cargo update
$ cd ..
$ just sysext

However, now I get:

   Compiling pipewire v0.5.0 (https://github.com/pop-os/pipewire-rs#3179b912)
error[E0425]: cannot find value `PW_KEY_NODE_TARGET` in crate `pw_sys`
   --> /home/me/.cargo/git/checkouts/pipewire-rs-60faa9e340c48539/3179b91/pipewire/src/auto/keys.rs:164:28
    |
164 | key_constant!(NODE_TARGET, PW_KEY_NODE_TARGET,
    |                            ^^^^^^^^^^^^^^^^^^ help: a constant with a similar name exists: `PW_KEY_NODE_NAME`
    |
   ::: /home/me/GitHub/pop-os/cosmic-epoch/xdg-desktop-portal-cosmic/target/debug/build/pipewire-sys-8f9d0395f62ed735/out/bindings.rs:151:1
    |
151 | pub const PW_KEY_NODE_NAME: &[u8; 10usize] = b"node.name\0";
    | ------------------------------------------ similarly named constant `PW_KEY_NODE_NAME` defined here

   Compiling enumflags2 v0.7.5
For more information about this error, try `rustc --explain E0425`.
error: could not compile `pipewire` due to previous error

Doing a cargo update doesn't fix this, and I've had a look and I'm not actually sure where to get a compatible version of this dependency

virtualritz commented 1 year ago

The bottom line is that this repo needs some CI badly. If I was a maintainer I would make that an absolute priority.

I don't mind running alpha software and contributing to alpha software but since leaving 25+ years of C++ behind and working with Rust for three years now, any kind of hoops I have to jump through to get a build going is an instant red flag. :)

Elias-Graf commented 1 year ago

I'm not sure if that's what you guys did, but I've seen it now twice that you just wrote cargo update. Please note that this updated all packages. While what I did (and what lead to successful compilation on a fresh copy of the repo (at the time that was: 426c71ddc3049245e8dab9035e45b7e17cf437e6)), was updating using cargo update --package=libcosmic --precise=e9766389c4da17d43aea7d24c871ef838a22a3d1. That only updates references to the libcosmic crate, and put it's exactly to the e9766389c4da17d43aea7d24c871ef838a22a3d1 commit, which worked and existed when I tried it.

jokeyrhyme commented 1 year ago

@Elias-Graf good point, updating just the references that are broken is better than updating everything

That said, since https://github.com/pop-os/cosmic-epoch/pull/63 we don't have a broken libcosmic reference anyway, and the broken reference to pop-launcher can be fixed with another cargo update --package=pop-launcher

The current blocker is that there's now a reference to pipewire / pipewire-sys that is broken, and no amount of cargo update seems to help with that

ids1024 commented 1 year ago

The Pipewire issue is due to pipewire-rs being broken by a newer version of Pipewire: https://gitlab.freedesktop.org/pipewire/pipewire-rs/-/issues/55

Elias-Graf commented 1 year ago

If I currently do the following:

git reset --hard
git clean -fd
git pull
just sysext

I get:

error: failed to get `pop-launcher` as a dependency of package `cosmic-launcher v0.1.0 (/home/elias/Projects/cosmic-epoch/cosmic-launcher)`

Caused by:
  failed to load source for dependency `pop-launcher`

Caused by:
  Unable to update https://github.com/wash2/launcher.git?branch=cosmic-toplevel#8c331383

Caused by:
  object not found - no match for id (8c331383b669287fe63d945430e674906da990f1); class=Odb (9); code=NotFound (-3)
jokeyrhyme commented 1 year ago

@Elias-Graf I fixed that with

$ cd cosmic-launcher
$ cargo update --package=pop-launcher
$ cd ..
ryannathans commented 1 year ago

I got around the pipewire issue by commenting out the problematic line of code in pipewire's auto/keys.rs. This is probably not the right way, but it's one way that works..

wash2 commented 1 year ago

66 seems to fix the pipewire and launcher build issues for me. I hope it resolves this issue :)

jokeyrhyme commented 1 year ago

Definitely gets pretty far without needing any of the previous interventions

However, it now gets to cosmic-launcher and exits with a ninja error:

install -Dm0755 "target/release/cosmic-comp" ""/home/ron/GitHub/pop-os/cosmic-epoch/cosmic-sysext/usr/bin/cosmic-comp""
make: Leaving directory '/home/ron/GitHub/pop-os/cosmic-epoch/cosmic-comp'
/usr/bin/meson install -C cosmic-launcher_build --destdir=/home/ron/GitHub/pop-os/cosmic-epoch/cosmic-sysext
ninja: Entering directory `/home/ron/GitHub/pop-os/cosmic-epoch/cosmic-launcher_build'
[0/1] Regenerating build files.

ERROR: Neither directory contains a build file meson.build.
FAILED: build.ninja
/usr/bin/meson --internal regenerate /home/ron/GitHub/pop-os/cosmic-epoch/cosmic-launcher /home/ron/GitHub/pop-os/cosmic-epoch/cosmic-launcher_build
ninja: error: rebuilding 'build.ninja': subcommand failed
Could not rebuild /home/ron/GitHub/pop-os/cosmic-epoch/cosmic-launcher_build
error: Recipe `_meson_install` failed on line 14 with exit code 255

And, it doesn't seem like there are any build.ninja files at all, anywhere, at least according to fd build.ninja

wash2 commented 1 year ago

Definitely gets pretty far without needing any of the previous interventions

However, it now gets to cosmic-launcher and exits with a ninja error:

install -Dm0755 "target/release/cosmic-comp" ""/home/ron/GitHub/pop-os/cosmic-epoch/cosmic-sysext/usr/bin/cosmic-comp""
make: Leaving directory '/home/ron/GitHub/pop-os/cosmic-epoch/cosmic-comp'
/usr/bin/meson install -C cosmic-launcher_build --destdir=/home/ron/GitHub/pop-os/cosmic-epoch/cosmic-sysext
ninja: Entering directory `/home/ron/GitHub/pop-os/cosmic-epoch/cosmic-launcher_build'
[0/1] Regenerating build files.

ERROR: Neither directory contains a build file meson.build.
FAILED: build.ninja
/usr/bin/meson --internal regenerate /home/ron/GitHub/pop-os/cosmic-epoch/cosmic-launcher /home/ron/GitHub/pop-os/cosmic-epoch/cosmic-launcher_build
ninja: error: rebuilding 'build.ninja': subcommand failed
Could not rebuild /home/ron/GitHub/pop-os/cosmic-epoch/cosmic-launcher_build
error: Recipe `_meson_install` failed on line 14 with exit code 255

And, it doesn't seem like there are any build.ninja files at all, anywhere, at least according to fd build.ninja

have you pulled latest & updated the submodules? git submodule update –remote

jokeyrhyme commented 1 year ago

Yep

$ cd ~/GitHub/pop-os/cosmic-epoch
$ git restore .
$ git pull
$ git submodule update --init --recursive --force
$ just clean
$ just sysext

Results in

ERROR: Neither directory contains a build file meson.build. FAILED: build.ninja

I also tried with

$ cd ~/GitHub/pop-os/cosmic-epoch/cosmic-launcher
$ git fetch
$ git checkout master_jammy
$ cd ~/GitHub/pop-os/cosmic-epoch
$ just clean
$ just sysext

Still the same

I get that this is pre-alpha though, happy to try out commits without any expectations

Just sharing in case someone else had a quick fix :)

Vixea commented 1 year ago

with a clean pull of cosmic I receive this error:

/usr/bin/meson install -C cosmic-launcher_build --destdir=~/Documents/projects/cosmic-epoch/cosmic-sysext
Install data not found. Run this command in build directory root.
error: Recipe `_meson_install` failed on line 14 with exit code 1
mmstick commented 1 year ago

You'll have to edit the justfile in cosmic-epoch to use just instead of meson/ninja.

wash2 commented 1 year ago

Ok ya, I updated the build step to just just for cosmic launcher, but I missed the install step. I'll update that.

jokeyrhyme commented 1 year ago

Oh, that was pretty close, but I still get

error: Justfile does not contain recipes just, install, cosmic-launcher, or /home/ron/GitHub/pop-os/cosmic-epoch/cosmic-sysext.

But, now that I knew where to look, I changed that line to

{{ just }} rootdir={{dir}} cosmic-launcher/install

(taking inspiration from the other install steps that use just) and now it gets all the way to "Done" without any errors, yay

Thanks for taking a look!

wash2 commented 1 year ago

@jokeyrhyme yes, thank you for your patience! Hopefully similar mistakes will be caught by the newly added CI in the future :sweat_smile:

virtualritz commented 1 year ago

Yesterday morning I was able to do a successfull build but after today's git pull it's broken again:

    Finished release [optimized] target(s) in 2m 36s
[2/3] Generating data/com.system76.CosmicAppLibrary.metainfo.xml with a custom command
/home/moritz/.cargo/bin/just cosmic-bg/build-release
error: Justfile does not contain recipe `build-release`.
error: Recipe `build` failed on line 19 with exit code 1
wash2 commented 1 year ago

Yesterday morning I was able to do a successfull build but after today's git pull it's broken again:


    Finished release [optimized] target(s) in 2m 36s

[2/3] Generating data/com.system76.CosmicAppLibrary.metainfo.xml with a custom command

/home/moritz/.cargo/bin/just cosmic-bg/build-release

error: Justfile does not contain recipe `build-release`.

error: Recipe `build` failed on line 19 with exit code 1

That's weird, sorry I keep asking everyone this, but have you updated the submodules?

jokeyrhyme commented 1 year ago

I'd recommend that folks setup their git so that it always automatically grabs the correct submodule commits:

$ git config --global fetch.recurseSubmodules true
$ git config --global submodule.recurse true
virtualritz commented 1 year ago

That's weird, sorry I keep asking everyone this, but have you updated the submodules?

Ack! I hadnt'. Sorry about that. Build works fine now two days in a row.

Closing this for good.