scorpion-26 / gBar

Blazingly fast status bar written with GTK
MIT License
478 stars 17 forks source link

Nix: gBar build failure #10

Closed Eken-beep closed 1 year ago

Eken-beep commented 1 year ago

Please fill out this form and delete the defaults(everything not in bold font), so I can help you better Describe the bug Build Fails with the flake

When revertnig the flake to the old commit some days ago but the rest of the system the same it works.

Steps to Reproduce Build latest gBar

Expected behavior Builds successfully

Screenshots/Error logs last 10 log lines:

/nix/store/qmmd097h4rwh2pwgz9l9i0byxb0x8q8l-binutils-2.40/bin/ld: :(.text.startup+0x127): undefined reference to Window::Run(int, char**)' /nix/store/qmmd097h4rwh2pwgz9l9i0byxb0x8q8l-binutils-2.40/bin/ld: <artificial>:(.text.startup+0x12c): undefined reference toSystem::FreeResources()' /nix/store/qmmd097h4rwh2pwgz9l9i0byxb0x8q8l-binutils-2.40/bin/ld: :(.text.startup+0x13d): undefined reference to Window::~Window()' /nix/store/qmmd097h4rwh2pwgz9l9i0byxb0x8q8l-binutils-2.40/bin/ld: <artificial>:(.text.startup+0x1ac): undefined reference toBar::Create(Window&, int)' /nix/store/qmmd097h4rwh2pwgz9l9i0byxb0x8q8l-binutils-2.40/bin/ld: :(.text.startup+0x238): undefined reference to Plugin::LoadWidgetFromPlugin(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Window&, int)' /nix/store/qmmd097h4rwh2pwgz9l9i0byxb0x8q8l-binutils-2.40/bin/ld: <artificial>:(.text.startup+0x314): undefined reference toLogging::Log(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)' /nix/store/qmmd097h4rwh2pwgz9l9i0byxb0x8q8l-binutils-2.40/bin/ld: :(.text.startup+0x391): undefined reference to `Logging::Log(std::cxx11::basic_string<char, std::char_traits, std::allocator > const&)' /nix/store/qmmd097h4rwh2pwgz9l9i0byxb0x8q8l-binutils-2.40/bin/ld: :(.text.startup+0x3d2): undefined reference to `Window::~Window()' collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed. For full logs, run 'nix log /nix/store/k7bh10a2akn4rc0ybcp5axilny8152jg-gbar.drv'.

Information about your system and gBar

scorpion-26 commented 1 year ago

When revertnig the flake to the old commit

commit sha256 if possible [https://github.com/scorpion-26/gBar/commit/c536e43cd095db536b5bcb5a5c6f727723e60a50]

c536e43 is the most recent commit. Which of these informations is correct? If the first is correct, why do you want to use an old version?

Can you try these things in order and post the results (For the commit you want to use)?

  1. Completely clean the gBar Nix package and rebuild it
  2. Rebuild gBar locally and see if that builds -> git clone ..., meson setup build, ninja -C build, build/gBar bar 0
  3. If that doesn't work, please attach the full nix build log as a file (run the command suggested by the logs you posted)
Eken-beep commented 1 year ago

The sha sum you quoted is the one which doesn't build, the one I reverted to doesn't. I don't want to use the old one but thats the only one that builds.

following was made with the most recent commit

  1. Git cloning the gBar repo and running nix build, ie isolating the issue from my nixos config yields the same results;
    $ nix build
    error: builder for '/nix/store/k7bh10a2akn4rc0ybcp5axilny8152jg-gbar.drv' failed with exit code 1;
       last 10 log lines:
       > /nix/store/qmmd097h4rwh2pwgz9l9i0byxb0x8q8l-binutils-2.40/bin/ld: <artificial>:(.text.startup+0x127): undefined reference to `Window::Run(int, char**)'
       > /nix/store/qmmd097h4rwh2pwgz9l9i0byxb0x8q8l-binutils-2.40/bin/ld: <artificial>:(.text.startup+0x12c): undefined reference to `System::FreeResources()'
       > /nix/store/qmmd097h4rwh2pwgz9l9i0byxb0x8q8l-binutils-2.40/bin/ld: <artificial>:(.text.startup+0x13d): undefined reference to `Window::~Window()'
       > /nix/store/qmmd097h4rwh2pwgz9l9i0byxb0x8q8l-binutils-2.40/bin/ld: <artificial>:(.text.startup+0x1ac): undefined reference to `Bar::Create(Window&, int)'
       > /nix/store/qmmd097h4rwh2pwgz9l9i0byxb0x8q8l-binutils-2.40/bin/ld: <artificial>:(.text.startup+0x238): undefined reference to `Plugin::LoadWidgetFromPlugin(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Window&, int)'
       > /nix/store/qmmd097h4rwh2pwgz9l9i0byxb0x8q8l-binutils-2.40/bin/ld: <artificial>:(.text.startup+0x314): undefined reference to `Logging::Log(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
       > /nix/store/qmmd097h4rwh2pwgz9l9i0byxb0x8q8l-binutils-2.40/bin/ld: <artificial>:(.text.startup+0x391): undefined reference to `Logging::Log(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
       > /nix/store/qmmd097h4rwh2pwgz9l9i0byxb0x8q8l-binutils-2.40/bin/ld: <artificial>:(.text.startup+0x3d2): undefined reference to `Window::~Window()'
       > collect2: error: ld returned 1 exit status
       > ninja: build stopped: subcommand failed.
       For full logs, run 'nix log /nix/store/k7bh10a2akn4rc0ybcp5axilny8152jg-gbar.drv'.
  2. When opening nix-shell with all the dependencies exposed to path via $ nix-shell -p pkg-config meson cmake ninja wayland bluez gtk3 gtk-layer-shell libpulseaudio and building with the included build instructions I get the following error. https://gist.github.com/Eken-beep/0270c45c91961f14af261ac85fb7513f
  3. Nix log after building: https://gist.github.com/Eken-beep/087552e50e18d7b42857b46d1ea1beb8
scorpion-26 commented 1 year ago

Should now be fixed. Issue was missing gcc-ar script in path required by gcc for static-library LTO (Link-time-Optimization). Apparently, Nix doesn't provide gcc-ar (https://github.com/NixOS/nixpkgs/issues/86272). LTO is now disabled by default, fixing the issue. Please reopen/ping if the issue persists.