Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use nix shell #16359

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
Draft

Use nix shell #16359

wants to merge 12 commits into from

Conversation

yakimant
Copy link
Member

@yakimant yakimant commented Sep 18, 2024

After making a nix shell to build a Linux binary:
#9350

It was running as a part of CI:
https://ci.status.im/job/status-desktop/job/systems/job/linux/job/x86_64/job/package-nix/

Now it's time to switch developers to use it and eventually cleanup non-Nix shell related code.

What does the PR do

  1. Swiches to Nix flakes to run Nix shell faster (nix develop)
  2. Adds direnv setup (`nix-direnv)
  3. Adds check-nix-shell Makefile target to block further run make

How to test

  • Setup local tools: nix, direnv
  • enter shell by (one of the ways):
    • direnv allow
    • nix develop
    • nix-shell
  • run the usual Linux targets

Useful Links

TODO

  • Issues running an app with export FLAG_DAPPS_ENABLED=1
  • Document to setup environment - nix/README.md
  • Script to setup environment - ubuntu_build_setup.sh (used in Ansible CI fleet)
  • nix develop issue: unsupported tarball input attribute 'lastModified'. Maybe wrong nix version
  • make sure nix.conf is loaded in each case (direnv, develop, shell)
  • make run fails to run in nix shell
  • Appimage takes QtWebEngineProccess from /nix/store if present, it is not patched, so breaks
  • Try run-storybook-tests and run-statusq-tests in Nix shell
  • Test running the app on Wayland
  • Opt-out of nix shell (using system libs/tools for both building and running)

@status-im-auto
Copy link
Member

status-im-auto commented Sep 18, 2024

Jenkins Builds

Click to see older builds (125)
Commit #️⃣ Finished (UTC) Duration Platform Result
f073852 #1 2024-09-18 14:54:30 ~2 min linux-nix/x86_64 📄log
f073852 #1 2024-09-18 14:58:38 ~6 min linux/x86_64 📄log
✔️ f073852 #1 2024-09-18 14:58:46 ~6 min tests/nim 📄log
✔️ f073852 #1 2024-09-18 15:00:16 ~8 min macos/aarch64 🍎dmg
✔️ f073852 #1 2024-09-18 15:02:43 ~10 min macos/x86_64 🍎dmg
f073852 #1 2024-09-18 15:03:40 ~11 min tests/ui 📄log
6c4a30c #2 2024-09-19 10:50:01 ~2 min linux-nix/x86_64 📄log
✔️ 6c4a30c #2 2024-09-19 10:52:00 ~4 min macos/aarch64 🍎dmg
✔️ 3a21cc3 #3 2024-09-19 10:57:32 ~3 min macos/aarch64 🍎dmg
3a21cc3 #3 2024-09-19 10:58:09 ~4 min linux/x86_64 📄log
3a21cc3 #3 2024-09-19 10:58:22 ~4 min linux-nix/x86_64 📄log
✔️ 3a21cc3 #3 2024-09-19 11:00:45 ~7 min tests/nim 📄log
✔️ 3a21cc3 #3 2024-09-19 11:01:06 ~7 min macos/x86_64 🍎dmg
✔️ 3a21cc3 #3 2024-09-19 11:05:28 ~11 min tests/ui 📄log
240b436 #4 2024-09-19 12:48:45 ~4 min linux/x86_64 📄log
✔️ 240b436 #4 2024-09-19 12:49:27 ~5 min macos/aarch64 🍎dmg
✔️ 240b436 #4 2024-09-19 12:50:55 ~6 min tests/nim 📄log
✔️ 240b436 #4 2024-09-19 12:56:00 ~11 min macos/x86_64 🍎dmg
✔️ 240b436 #4 2024-09-19 12:56:26 ~12 min tests/ui 📄log
✔️ 240b436 #4 2024-09-19 12:57:00 ~13 min linux-nix/x86_64 📦tgz
✔️ 630d599 #5 2024-09-25 08:40:18 ~5 min macos/aarch64 🍎dmg
✔️ 630d599 #5 2024-09-25 08:41:45 ~6 min tests/nim 📄log
✔️ 630d599 #5 2024-09-25 08:47:04 ~12 min tests/ui 📄log
✔️ 630d599 #5 2024-09-25 08:48:00 ~12 min macos/x86_64 🍎dmg
✔️ 630d599 #5 2024-09-25 08:49:48 ~14 min linux/x86_64 📦tgz
✔️ efb7ee4 #6 2024-09-25 10:44:28 ~4 min macos/aarch64 🍎dmg
✔️ efb7ee4 #6 2024-09-25 10:46:25 ~6 min tests/nim 📄log
✔️ efb7ee4 #6 2024-09-25 10:51:47 ~11 min tests/ui 📄log
✔️ efb7ee4 #6 2024-09-25 10:51:57 ~11 min macos/x86_64 🍎dmg
✔️ efb7ee4 #6 2024-09-25 10:52:39 ~12 min linux/x86_64 📦tgz
✔️ 56b0e91 #7 2024-09-25 13:19:59 ~4 min macos/aarch64 🍎dmg
✔️ 56b0e91 #7 2024-09-25 13:22:26 ~6 min tests/nim 📄log
56b0e91 #7 2024-09-25 13:23:51 ~8 min linux/x86_64 📄log
✔️ 56b0e91 #7 2024-09-25 13:26:11 ~10 min macos/x86_64 🍎dmg
✔️ 56b0e91 #7 2024-09-25 13:27:13 ~11 min tests/ui 📄log
✔️ 6e708fc #8 2024-09-25 13:36:47 ~5 min macos/aarch64 🍎dmg
✔️ 6e708fc #8 2024-09-25 13:37:58 ~6 min tests/nim 📄log
✔️ 6e708fc #8 2024-09-25 13:41:49 ~10 min macos/x86_64 🍎dmg
✔️ 6e708fc #8 2024-09-25 13:43:06 ~11 min tests/ui 📄log
✔️ 6e708fc #8 2024-09-25 13:47:43 ~16 min linux/x86_64 📦tgz
✔️ 2f95cd9 #9 2024-09-26 11:06:33 ~4 min macos/aarch64 🍎dmg
✔️ 2f95cd9 #9 2024-09-26 11:08:57 ~6 min tests/nim 📄log
✔️ 2f95cd9 #9 2024-09-26 11:13:41 ~11 min macos/x86_64 🍎dmg
✔️ 2f95cd9 #9 2024-09-26 11:14:10 ~12 min tests/ui 📄log
✔️ 2f95cd9 #9 2024-09-26 11:14:18 ~12 min linux/x86_64 📦tgz
✔️ 195a1cc #10 2024-09-26 11:28:35 ~4 min macos/aarch64 🍎dmg
✔️ 195a1cc #10 2024-09-26 11:30:57 ~6 min tests/nim 📄log
✔️ 195a1cc #10 2024-09-26 11:35:20 ~10 min macos/x86_64 🍎dmg
✔️ 195a1cc #10 2024-09-26 11:36:21 ~11 min linux/x86_64 📦tgz
✔️ 195a1cc #10 2024-09-26 11:37:13 ~12 min tests/ui 📄log
✔️ 87ef476 #11 2024-09-26 14:30:33 ~4 min macos/aarch64 🍎dmg
✔️ 87ef476 #11 2024-09-26 14:32:36 ~6 min tests/nim 📄log
87ef476 #11 2024-09-26 14:33:49 ~7 min linux/x86_64 📄log
✔️ 87ef476 #11 2024-09-26 14:37:40 ~11 min macos/x86_64 🍎dmg
✔️ 87ef476 #11 2024-09-26 14:38:22 ~12 min tests/ui 📄log
✔️ 945b2f4 #12 2024-09-26 14:43:11 ~4 min macos/aarch64 🍎dmg
✔️ 945b2f4 #12 2024-09-26 14:45:30 ~6 min tests/nim 📄log
✔️ 945b2f4 #12 2024-09-26 14:49:54 ~10 min macos/x86_64 🍎dmg
✔️ 945b2f4 #12 2024-09-26 14:50:54 ~11 min tests/ui 📄log
✔️ 945b2f4 #12 2024-09-26 14:54:55 ~15 min linux/x86_64 📦tgz
✔️ 6e973dd #13 2024-09-27 09:33:36 ~6 min tests/nim 📄log
✔️ 6e973dd #13 2024-09-27 09:35:06 ~8 min macos/aarch64 🍎dmg
6e973dd #13 2024-09-27 09:38:41 ~11 min tests/ui 📄log
✔️ 6e973dd #13 2024-09-27 09:39:07 ~12 min macos/x86_64 🍎dmg
✔️ 6e973dd #13 2024-09-27 09:40:53 ~14 min linux/x86_64 📦tgz
✔️ 158b11f #14 2024-09-27 12:45:21 ~3 min macos/aarch64 🍎dmg
✔️ 158b11f #14 2024-09-27 12:47:47 ~6 min tests/nim 📄log
✔️ 158b11f #14 2024-09-27 12:52:25 ~10 min macos/x86_64 🍎dmg
✔️ 158b11f #14 2024-09-27 12:53:15 ~11 min tests/ui 📄log
✔️ 158b11f #14 2024-09-27 12:54:52 ~13 min linux/x86_64 📦tgz
✔️ 4458bc2 #15 2024-09-27 13:02:46 ~4 min macos/aarch64 🍎dmg
✔️ 4458bc2 #15 2024-09-27 13:05:23 ~6 min tests/nim 📄log
✔️ 4458bc2 #15 2024-09-27 13:09:30 ~10 min macos/x86_64 🍎dmg
4458bc2 #15 2024-09-27 13:10:05 ~11 min tests/ui 📄log
✔️ 4458bc2 #15 2024-09-27 13:10:50 ~12 min linux/x86_64 📦tgz
✔️ 749feac #16 2024-10-02 10:10:17 ~4 min macos/aarch64 🍎dmg
✔️ 749feac #16 2024-10-02 10:12:23 ~6 min tests/nim 📄log
749feac #16 2024-10-02 10:17:08 ~11 min tests/ui 📄log
✔️ 749feac #16 2024-10-02 10:17:39 ~11 min macos/x86_64 🍎dmg
✔️ 749feac #16 2024-10-02 10:20:45 ~15 min linux/x86_64 📦tgz
✔️ 3ce5594 #17 2024-10-02 10:58:41 ~3 min macos/aarch64 🍎dmg
✔️ 3ce5594 #17 2024-10-02 11:01:02 ~6 min tests/nim 📄log
✔️ 3ce5594 #17 2024-10-02 11:05:49 ~11 min macos/x86_64 🍎dmg
3ce5594 #17 2024-10-02 11:06:07 ~11 min tests/ui 📄log
✔️ 3ce5594 #17 2024-10-02 11:07:01 ~12 min linux/x86_64 📦tgz
dc490e5 #18 2024-10-02 11:36:40 ~3 min macos/aarch64 📄log
✖️ dc490e5 #18 2024-10-02 11:39:39 ~6 min tests/nim 📄log
dc490e5 #18 2024-10-02 11:40:25 ~6 min linux/x86_64 📄log
dc490e5 #18 2024-10-02 11:40:56 ~7 min macos/x86_64 📄log
dc490e5 #18 2024-10-02 11:44:53 ~11 min tests/ui 📄log
✔️ 2f81475 #19 2024-10-02 13:18:33 ~5 min macos/aarch64 🍎dmg
✔️ 2f81475 #19 2024-10-02 13:19:41 ~6 min tests/nim 📄log
2f81475 #19 2024-10-02 13:24:26 ~11 min tests/ui 📄log
✔️ 2f81475 #19 2024-10-02 13:25:57 ~12 min linux/x86_64 📦tgz
✔️ 2f81475 #19 2024-10-02 13:27:02 ~13 min macos/x86_64 🍎dmg
✔️ 2f81475 #19 2024-10-02 13:33:42 ~20 min windows/x86_64 💿exe
✔️ c56b36c #20 2024-10-02 14:14:42 ~4 min macos/aarch64 🍎dmg
✔️ c56b36c #20 2024-10-02 14:16:43 ~6 min tests/nim 📄log
✔️ c56b36c #20 2024-10-02 14:19:56 ~9 min macos/x86_64 🍎dmg
✔️ c56b36c #20 2024-10-02 14:24:28 ~14 min tests/ui 📄log
✔️ c56b36c #20 2024-10-02 14:25:22 ~15 min linux/x86_64 📦tgz
✔️ 4469a6b #21 2024-10-09 14:58:12 ~6 min tests/nim 📄log
✔️ 4469a6b #21 2024-10-09 14:58:22 ~7 min macos/aarch64 🍎dmg
4469a6b #21 2024-10-09 15:03:59 ~12 min tests/ui 📄log
✔️ 4469a6b #21 2024-10-09 15:05:34 ~14 min linux/x86_64 📦tgz
✔️ 4469a6b #21 2024-10-09 15:06:59 ~15 min macos/x86_64 🍎dmg
✔️ 4469a6b #21 2024-10-09 15:17:21 ~25 min windows/x86_64 💿exe
✔️ 2c0f63e #22 2024-10-10 09:42:01 ~4 min macos/aarch64 🍎dmg
✔️ 2c0f63e #22 2024-10-10 09:44:04 ~6 min tests/nim 📄log
✔️ 2c0f63e #22 2024-10-10 09:49:02 ~11 min macos/x86_64 🍎dmg
✔️ 2c0f63e #22 2024-10-10 09:49:21 ~11 min tests/ui 📄log
✔️ 2c0f63e #22 2024-10-10 09:50:11 ~12 min linux/x86_64 📦tgz
✔️ 2c0f63e #22 2024-10-10 10:02:06 ~24 min windows/x86_64 💿exe
c35a8a8 #23 2024-10-10 10:43:11 ~4 min linux/x86_64 📄log
✔️ c35a8a8 #23 2024-10-10 10:43:19 ~4 min macos/aarch64 🍎dmg
✔️ c35a8a8 #23 2024-10-10 10:45:25 ~6 min tests/nim 📄log
c35a8a8 #23 2024-10-10 10:49:53 ~11 min tests/ui 📄log
✔️ c35a8a8 #23 2024-10-10 10:51:43 ~13 min macos/x86_64 🍎dmg
✔️ c35a8a8 #23 2024-10-10 11:04:30 ~25 min windows/x86_64 💿exe
✔️ 3166dc5 #24 2024-10-10 11:17:04 ~4 min macos/aarch64 🍎dmg
✔️ 3166dc5 #24 2024-10-10 11:19:15 ~6 min tests/nim 📄log
✔️ 3166dc5 #24 2024-10-10 11:24:23 ~11 min macos/x86_64 🍎dmg
✔️ 3166dc5 #24 2024-10-10 11:24:30 ~11 min tests/ui 📄log
✔️ 3166dc5 #24 2024-10-10 11:25:33 ~13 min linux/x86_64 📦tgz
✔️ 3166dc5 #24 2024-10-10 11:36:41 ~24 min windows/x86_64 💿exe
Commit #️⃣ Finished (UTC) Duration Platform Result
cb5e201 #25 2024-10-10 12:08:21 ~16 sec linux/x86_64 📄log
✔️ cb5e201 #25 2024-10-10 12:12:32 ~4 min macos/aarch64 🍎dmg
✔️ cb5e201 #25 2024-10-10 12:14:55 ~6 min tests/nim 📄log
cb5e201 #25 2024-10-10 12:19:24 ~11 min tests/ui 📄log
✔️ cb5e201 #25 2024-10-10 12:19:46 ~11 min macos/x86_64 🍎dmg
✔️ 298b92f #26 2024-10-10 12:29:19 ~4 min macos/aarch64 🍎dmg
✔️ 298b92f #26 2024-10-10 12:31:11 ~6 min tests/nim 📄log
✔️ 298b92f #26 2024-10-10 12:35:57 ~11 min macos/x86_64 🍎dmg
✔️ 298b92f #26 2024-10-10 12:36:03 ~11 min tests/ui 📄log
✔️ 298b92f #26 2024-10-10 12:37:21 ~12 min linux/x86_64 📦tgz
✔️ 298b92f #26 2024-10-10 12:49:24 ~24 min windows/x86_64 💿exe

@yakimant yakimant marked this pull request as draft September 18, 2024 14:56
@status-im-auto
Copy link
Member

@status-im-auto
Copy link
Member

@status-im-auto
Copy link
Member

@yakimant
Copy link
Member Author

yakimant commented Sep 19, 2024

@igor-sirotin, @alexjba, @caybro, @micieslak,
guys, I need feedback from developers about this approach.

This PR is enforcing Nix environment for Linux builds.
You will need to have Nix and direnv installed.

As a benefit you will have:

  • Fully reproducable and managed dev environment (no need to install system tools, no different versions)
  • Newer Qt version - 5.15.8 now, 5.15.15 easily achivable

FYI @anastasiyaig

Copy link
Member

@jakubgs jakubgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if I'm a fan of this flake-compat stuff, but other than that this looks good.

flake.nix Outdated Show resolved Hide resolved
Copy link
Contributor

@alexjba alexjba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Glad to see this change! 🍻

@anastasiyaig
Copy link
Contributor

@yakimant @siddarthkay we need to tell tests to use another artefact :)

@status-im-auto
Copy link
Member

@status-im-auto
Copy link
Member

@status-im-auto
Copy link
Member

@yakimant
Copy link
Member Author

yakimant commented Sep 25, 2024

Need to sort out the locations of:

  • QtWebEngineProcess
  • qtwebengine_locales
  • resources (eg qtwebengine_resources.pak)
  • icudtl.dat

Possible places:

  • bin
  • libexec
  • resources
  • translations

Links:

Env vars (5.15.8):

  • QT_WEBENGINE_ICU_DATA_DIR
  • QTWEBENGINE_DICTIONARIES_PATH
  • QTWEBENGINEPROCESS_PATH

Copy link
Member

@jakubgs jakubgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good.

ci/Jenkinsfile.linux Outdated Show resolved Hide resolved
ci/Jenkinsfile.linux Show resolved Hide resolved
@alexjba
Copy link
Contributor

alexjba commented Sep 26, 2024

@yakimant could you please give me some instructions on how to build and run the app using the nix shell? I have a new linux environment with just a bare minimum of packages installed: build-essential, git, nix, direnv.

If I understand it correctly it's all I should have to get me started, right?

@alexjba
Copy link
Contributor

alexjba commented Sep 26, 2024

One other note: would it be a good chance to update the ubuntu_build_setup.sh and add a function that configures the new dependencies?

@yakimant
Copy link
Member Author

yakimant commented Sep 26, 2024

@alexjba There are 2 options:

  1. Setup direnv: direnv allow. Nix shell will start automatically every time you enter the work dir.
  2. If you want to start the shell manualy: nix develop. If you forger make will fail with a notice to run a Nix shell.

In regards of ubuntu_build_setup.sh - yes, good idea. No so much will be left though (nix, direnv).

@status-im-auto
Copy link
Member

@alexjba
Copy link
Contributor

alexjba commented Sep 26, 2024

@alexjba There are 2 options:

  1. Setup direnv: direnv allow. Nix shell will start automatically every time you enter the work dir.
  2. If you want to start the shell manualy: nix develop. If you forger make will fail with a notice to run a Nix shell.

In regards of ubuntu_build_setup.sh - yes, good idea. No so much will be left though (nix, direnv).

Thank you! I've followed the steps and this is my result:

  1. Running nix develop results in experimental flags error for nix-command and flakes
  2. nix develop --extra-experimental-features "nix-command flakes" results in cannot connect to socket at '/nix/var/nix/daemon-socket/socket': Permission denied
  3. sudo nix develop --extra-experimental-features "nix-command flakes" results in
error: unsupported tarball input attribute 'lastModified'

       … while updating the lock file of flake 'git+file:///home/alex/repo/status-desktop?ref=use_nix_shell&rev=6e708fc8dade82f549a0124ef2aed8e43ce8bf11'

@status-im-auto
Copy link
Member

@alexjba
Copy link
Contributor

alexjba commented Sep 27, 2024

@yakimant I think we'll need to find a way to share the nix packages. I've been naive enough to give it a spin in a linux VM and 15h later it's still compiling chromium.

I'm really a nix noob, but I see lots of resources on sharing the pre-compiled packages.
E.g. https://www.tweag.io/blog/2019-11-21-untrusted-ci/

@yakimant
Copy link
Member Author

We have it setup already:
08d8c9e

So you need to run

export NIX_USER_CONF_FILES := $(PWD)/nix/nix.conf

before entering the nix shell.

I will make sure it is set for all the cases, added to TODO.

@alexjba
Copy link
Contributor

alexjba commented Oct 2, 2024

@anastasiyaig, issue with app crashing (or freezing) on export FLAG_DAPPS_ENABLED=1 is workarounded by QTWEBENGINE_CHROMIUM_FLAGS="--disable-gpu".

You can try the latest build to test.

Would be interesting to know if there are any issues with that.

Hopefully a more permanent fix here #16443

@anastasiyaig
Copy link
Contributor

@yakimant i dont see nix linux artefact here. perhaps i am getting dumb. Which build to look at?

@jakubgs
Copy link
Member

jakubgs commented Oct 2, 2024

Isn't it just the linux one?

@anastasiyaig
Copy link
Contributor

Isn't it just the linux one?

there was a link to nix build job , i used that one before.. Maybe i need to use it again, hence asking :D

@anastasiyaig
Copy link
Contributor

@yakimant @alexjba tried a recent linux build from this PR with env var set as suggested

image

@yakimant
Copy link
Member Author

yakimant commented Oct 3, 2024

@anastasiyaig, this PR is also getting rid of non-Nix build in Jenkins (subject to change).
So just use a Linux build.

@yakimant
Copy link
Member Author

yakimant commented Oct 3, 2024

@anastasiyaig, very good! I'm not good in Stats / QtWebEngine functionality.
Is everything alright with the broeser?
We disabled hardware accelaration, so speed might be affected, some glitches appear, etc.
(especially animations, font/images scaling/antialiasing,..)

@anastasiyaig
Copy link
Contributor

it looks like we dont care much about Browser as standalone part of the app (with a hope and plans to rewrite it some day). All is needed now is to make the wallet connect thing working (on the screenshot), it seem to be working :)

i will wait what @alexjba says

@alexjba
Copy link
Contributor

alexjba commented Oct 3, 2024

@anastasiyaig, very good! I'm not good in Stats / QtWebEngine functionality. Is everything alright with the broeser? We disabled hardware accelaration, so speed might be affected, some glitches appear, etc. (especially animations, font/images scaling/antialiasing,..)

Short term it's ok to disable the gpu on webviews. Long term it's probably not. But we won't need this once #16443 is merged. Found a way to overcome the freeze on 5.15.8 without disabling anything.

@alexjba
Copy link
Contributor

alexjba commented Oct 7, 2024

export QT_XCB_GL_INTEGRATION="none" has a few side-effects on the app built with nix (not sure yet if it's the only thing to blame):

  1. Missing PNGs
Screenshot 2024-10-07 at 14 56 26 Screenshot 2024-10-07 at 14 56 12
  1. Missing background and popups
Screenshot 2024-10-07 at 14 57 46

@yakimant
Copy link
Member Author

yakimant commented Oct 9, 2024

nixGL issue, when used with 20.09 nixpkgs: nix-community/nixGL#183

bisected nixGL to find the last working commit and it works!
4469a6b

@alexjba, please try make run, I will test run-storybook and run-linux-gdb meanwhile.

@alexjba
Copy link
Contributor

alexjba commented Oct 9, 2024

nixGL issue, when used with 20.09 nixpkgs: nix-community/nixGL#183

bisected nixGL to find the last working commit and it works! 4469a6b

@alexjba, please try make run, I will test run-storybook and run-linux-gdb meanwhile.

I'm getting

qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

SIGABRT: Abnormal termination.
make[1]: *** [Makefile:864: run-linux] Aborted (core dumped)

@alexjba
Copy link
Contributor

alexjba commented Oct 10, 2024

nixGL issue, when used with 20.09 nixpkgs: nix-community/nixGL#183
bisected nixGL to find the last working commit and it works! 4469a6b
@alexjba, please try make run, I will test run-storybook and run-linux-gdb meanwhile.

I'm getting

qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.

SIGABRT: Abnormal termination.
make[1]: *** [Makefile:864: run-linux] Aborted (core dumped)

NVM! Had an issue with the display and all graphical apps would fail to find the display.

@yakimant Works nicely!

Copy link
Member

@jakubgs jakubgs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks nice. Good work.

check-nix-shell:
ifeq ($(detected_OS),Linux)
ifndef IN_NIX_SHELL
$(error Running outside of Nix shell is not supported)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Harsh :D.

Makefile Show resolved Hide resolved
Makefile Show resolved Hide resolved
}:

let
qtCustom = (with pkgs.qt515_8;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another point in case, the latest released Qt version is 5.15.15, why do we have to use sth that's years old?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was originally requested by:
#9350

Switching to newer version will not be a problem. It's a next step.

Copy link
Member

@caybro caybro Oct 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be great, and since this PR is still WIP and has many TODOs, how hard would be to make the switch now and not later? ;)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If with switching to Qt 5.15.15 I will not need to implement and opt-out logic (to build and run with system libs) - I would certainly prefer this.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deal ;) I can test this locally on my machine next week, and provide patches/PR on top of this PR if needed

nix/shell.nix Show resolved Hide resolved
@caybro
Copy link
Member

caybro commented Oct 11, 2024

To summarize my concerns here; the usecase is pretty simple, I as a developer want to be able to:

  • build/link the application natively, that is using the OS's toolchain
  • run it natively, either directly or via gdb
  • be able to use these under any IDE

The compatibility changes I'd like to propose are pretty simple, touching just the Makefile, and not disrupting this NIX effort at all:

  • introduce a new set of makefile compat targets that continue doing what they are now in master
  • the "native" compat targets would continue using the system Qt version via the existing check-qt-dir

For (a simple) example, the new run-storybook is using NIX >= add a compat target called run-storybook-native, and copy the old code there.

Similarly, old run-linux becomes run-linux-native, run-linux-gdb => run-linux-gdb-native, and so on with also defining nim_status_client-native w/o the NIX checks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants