8000 feat(nix): remove submodules for nix build by ratson · Pull Request #43 · linkfrg/ignis · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(nix): remove submodules for nix build #43

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

Merged
merged 1 commit into from
Dec 1, 2024

Conversation

ratson
Copy link
Contributor
@ratson ratson commented Nov 20, 2024

By copying the submodule source during nix build,
remove the required submodule checkout introduced by #25.

@linkfrg
Copy link
Owner
linkfrg commented Nov 21, 2024

tried building on archlinux and got error:

$ sudo nix build "github:linkfrg/ignis" --extra-experimental-features nix-command --extra-experimental-features flakes
error: builder for '/nix/store/yl91s9jkaxz0iqlscbxichayh73vv3pp-ignis-0.3+date=20241115_24fd6ab.drv' failed with exit code 1;
       last 25 log lines:
       > source root is n58ba9znwicyniqnn7f00sv6w1bwa6bl-source
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > mesonConfigurePhase flags: --prefix=/nix/store/1cfw6yis8xhvwlg8vws1n1vxjnkdfjgc-ignis-0.3+date=20241115_24fd6ab --libdir=/nix/store/1cfw6yis8xhvwlg8vws1n1vxjnkdfjgc-ignis-0.3+date=20241115_24fd6ab/lib --libexecdir=/nix/store/1cfw6yis8xhvwlg8vws1n1vxjnkdfjgc-ignis-0.3+date=20241115_24fd6ab/libexec --bindir=/nix/store/1cfw6yis8xhvwlg8vws1n1vxjnkdfjgc-ignis-0.3+date=20241115_24fd6ab/bin --sbindir=/nix/store/1cfw6yis8xhvwlg8vws1n1vxjnkdfjgc-ignis-0.3+date=20241115_24fd6ab/sbin --includedir=/nix/store/1cfw6yis8xhvwlg8vws1n1vxjnkdfjgc-ignis-0.3+date=20241115_24fd6ab/include --mandir=/nix/store/1cfw6yis8xhvwlg8vws1n1vxjnkdfjgc-ignis-0.3+date=20241115_24fd6ab/share/man --infodir=/nix/store/1cfw6yis8xhvwlg8vws1n1vxjnkdfjgc-ignis-0.3+date=20241115_24fd6ab/share/info --localedir=/nix/store/1cfw6yis8xhvwlg8vws1n1vxjnkdfjgc-ignis-0.3+date=20241115_24fd6ab/share/locale -Dauto_features=enabled -Dwrap_mode=nodownload --buildtype=plain
       > The Meson build system
       > Version: 1.5.2
       > Source dir: /build/n58ba9znwicyniqnn7f00sv6w1bwa6bl-source
       > Build dir: /build/n58ba9znwicyniqnn7f00sv6w1bwa6bl-source/build
       > Build type: native build
       > Project name: ignis
       > Project version: undefined
       > Host machine cpu family: x86_64
       > Host machine cpu: x86_64
       > Program python3 found: YES (/nix/store/wfbjq35kxs6x83c3ncpfxdyl5gbhdx4h-python3-3.12.6/bin/python3.12)
       > Found pkg-config: YES (/nix/store/mi7q9m86m3rkqmc0niyvfv25ji9fxxha-pkg-config-wrapper-0.29.2/bin/pkg-config) 0.29.2
       > Run-time dependency glib-2.0 found: YES 2.80.4
       > Run-time dependency gobject-introspection-1.0 found: YES 1.80.1
       > Run-time dependency gio-2.0 found: YES 2.80.4
       > Run-time dependency gtk4 found: YES 4.14.5
       > Run-time dependency gtk4-layer-shell-0 found: YES 1.0.3
       >
       > meson.build:31:0: ERROR: Subproject exists but has no meson.build file.
       >
       > A full log can be found at /build/n58ba9znwicyniqnn7f00sv6w1bwa6bl-source/build/meson-logs/meson-log.txt
       For full logs, run 'nix log /nix/store/yl91s9jkaxz0iqlscbxichayh73vv3pp-ignis-0.3+date=20241115_24fd6ab.drv'.

@linkfrg linkfrg assigned linkfrg and unassigned linkfrg Nov 21, 2024
@linkfrg linkfrg added the nix Related to the Nix package manager label Nov 21, 2024
@ratson ratson force-pushed the nix-no-submodules branch 2 times, most recently from a0254c4 to 069a0f4 Compare November 23, 2024 10:00
@ratson
Copy link
Contributor Author
ratson commented Nov 23, 2024

@linkfrg should work now, you may build with

nix build "github:ratson/ignis/069a0f4b23b7be1bbbe7e94de3c59f29908ad98a"

@linkfrg
Copy link
Owner
linkfrg commented Nov 23, 2024

@linkfrg should work now, you may build with

nix build "github:ratson/ignis/069a0f4b23b7be1bbbe7e94de3c59f29908ad98a"

Oh, i forgot it's a PR, sorry

But anyway can't build:

$ nix build "github:ratson/ignis/069a0f4b23b7be1bbbe7e94de3c59f29908ad98a" --extra-experimental-features nix-command -
-extra-experimental-features flakes

error: builder for '/nix/store/5fkcgj2j4llgbvbdwd8c6pi15ka8x609-ignis-0.3+date=20241123_069a0f4.drv' failed with exit code 1;
       last 25 log lines:
       > /build
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > mesonConfigurePhase flags: --prefix=/nix/store/c372qvnxdjjrw605yyp1arf6d5frsb00-ignis-0.3+date=20241123_069a0f4 --libdir=/nix/store/c372qvnxdjjrw605yyp1arf6d5frsb00-ignis-0.3+date=20241123_069a0f4/lib --libexecdir=/nix/store/c372qvnxdjjrw605yyp1arf6d5frsb00-ignis-0.3+date=20241123_069a0f4/libexec --bindir=/nix/store/c372qvnxdjjrw605yyp1arf6d5frsb00-ignis-0.3+date=20241123_069a0f4/bin --sbindir=/nix/store/c372qvnxdjjrw605yyp1arf6d5frsb00-ignis-0.3+date=20241123_069a0f4/sbin --includedir=/nix/store/c372qvnxdjjrw605yyp1arf6d5frsb00-ignis-0.3+date=20241123_069a0f4/include --mandir=/nix/store/c372qvnxdjjrw605yyp1arf6d5frsb00-ignis-0.3+date=20241123_069a0f4/share/man --infodir=/nix/store/c372qvnxdjjrw605yyp1arf6d5frsb00-ignis-0.3+date=20241123_069a0f4/share/info --localedir=/nix/store/c372qvnxdjjrw605yyp1arf6d5frsb00-ignis-0.3+date=20241123_069a0f4/share/locale -Dauto_features=enabled -Dwrap_mode=nodownload --buildtype=plain
       > The Meson build system
       > Version: 1.5.2
       > Source dir: /build/f4af2sjpysvpsrp9cvsch6lydzsh8n3y-source
       > Build dir: /build/f4af2sjpysvpsrp9cvsch6lydzsh8n3y-source/build
       > Build type: native build
       > Project name: ignis
       > Project version: undefined
       > Host machine cpu family: x86_64
       > Host machine cpu: x86_64
       > Program python3 found: YES (/nix/store/wfbjq35kxs6x83c3ncpfxdyl5gbhdx4h-python3-3.12.6/bin/python3.12)
       > Found pkg-config: YES (/nix/store/mi7q9m86m3rkqmc0niyvfv25ji9fxxha-pkg-config-wrapper-0.29.2/bin/pkg-config) 0.29.2
       > Run-time dependency glib-2.0 found: YES 2.80.4
       > Run-time dependency gobject-introspection-1.0 found: 
YES 1.80.1
       > Run-time dependency gio-2.0 found: YES 2.80.4
       > Run-time dependency gtk4 found: YES 4.14.5
       > Run-time dependency gtk4-layer-shell-0 found: YES 1.0.3
       >
       > meson.build:31:0: ERROR: Subproject exists but has no meson.build file.
       >
       > A full log can be found at /build/f4af2sjpysvpsrp9cvsch6lydzsh8n3y-source/build/meson-logs/meson-log.txt
       For full logs, run 'nix log /nix/store/5fkcgj2j4llgbvbdwd8c6pi15ka8x609-ignis-0.3+date=20241123_069a0f4.drv'.

@ratson
Copy link
Contributor Author
ratson commented Nov 23, 2024

@linkfrg strange, I could build that.

Would you try nix build -L --rebuild --refresh "github:ratson/ignis/069a0f4b23b7be1bbbe7e94de3c59 f29908ad98a"?

It should print the first few lines like

ignis> Running phase: unpackPhase
ignis> unpacking source archive /nix/store/l3h49fiiax2qn6dn3hakawb44vxjyjs0-vx6wq1zpi61w37k2mdjigb4pifl0f2fl-source
ignis> source root is vx6wq1zpi61w37k2mdjigb4pifl0f2fl-source
ignis> /build/vx6wq1zpi61w37k2mdjigb4pifl0f2fl-source /build
ignis> /build
ignis> Running phase: patchPhase
ignis> Running phase: updateAutotoolsGnuConfigScriptsPhase
ignis> Running phase: configurePhase

@linkfrg
Copy link
Owner
linkfrg commented Nov 23, 2024

@linkfrg strange, I could build that.

Would you try nix build -L --rebuild --refresh "github:ratson/ignis/069a0f4b23b7be1bbbe7e94de3c59 f29908ad98a"?

It should print the first few lines like

ignis> Running phase: unpackPhase
ignis> unpacking source archive /nix/store/l3h49fiiax2qn6dn3hakawb44vxjyjs0-vx6wq1zpi61w37k2mdjigb4pifl0f2fl-source
ignis> source root is vx6wq1zpi61w37k2mdjigb4pifl0f2fl-source
ignis> /build/vx6wq1zpi61w37k2mdjigb4pifl0f2fl-source /build
ignis> /build
ignis> Running phase: patchPhase
ignis> Running phase: updateAutotoolsGnuConfigScriptsPhase
ignis> Running phase: configurePhase

@linkfrg strange, I could build that.

Would you try nix build -L --rebuild --refresh "github:ratson/ignis/069a0f4b23b7be1bbbe7e94de3c59 f29908ad98a"?

It should print the first few lines like

ignis> Running phase: unpackPhase
ignis> unpacking source archive /nix/store/l3h49fiiax2qn6dn3hakawb44vxjyjs0-vx6wq1zpi61w37k2mdjigb4pifl0f2fl-source
ignis> source root is vx6wq1zpi61w37k2mdjigb4pifl0f2fl-source
ignis> /build/vx6wq1zpi61w37k2mdjigb4pifl0f2fl-source /build
ignis> /build
ignis> Running phase: patchPhase
ignis> Running phase: updateAutotoolsGnuConfigScriptsPhase
ignis> Running phase: configurePhase
error: some outputs of '/nix/store/yl91s9jkaxz0iqlscbxichayh73vv3pp-ignis-0.3+date=20241115_24fd6ab.drv' are not valid, so checking is not possible

Btw I also rebooted to NixOS iso, tried building and got the same errors in both scenarios

nix/ignis.nix Outdated
postUnpack = ''
pushd $sourceRoot
mkdir -p subprojects
cp -rf --no-preserve=mode ${gvc} ./subprojects/gvc
Copy link
Contributor
@0x006E 0x006E Nov 23, 2024

Choose a reason for hiding this comment

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

I think you are copying the wrong folder here.
cp -rf --no-preserve=mode ${gvc}/. ./subprojects/gvc works fine.

For more info, see why cp works like that
https://unix.stackexchange.com/a/412262

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you for the information 👍

@ratson
Copy link
Contributor Author
ratson commented Nov 24, 2024

@linkfrg PR updated, can be tested with nix build "github:ratson/ignis/005e3e8705aa11ab529677087fa0f877c6292935"

@linkfrg
Copy link
Owner
linkfrg commented Nov 24, 2024

@linkfrg PR updated, can be tested with nix build "github:ratson/ignis/005e3e8705aa11ab529677087fa0f877c6292935"

$ nix build "github:ratson/ignis/005e3e8705aa11ab529677087fa0f877c6292935" --extra-experimental-features nix-command --extra-experimental-features flakes

error: builder for '/nix/store/0gackcrdr6wxl2zld07y2gyv07qfq2y0-ignis-0.3+date=20241124_005e3e8.drv' failed with exit code 1;
       last 25 log lines:
       > /build
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > mesonConfigurePhase flags: --prefix=/nix/store/bamiffh2zfv0zl65hhsm91zscvqsmg43-ignis-0.3+date=20241124_005e3e8 --libdir=/nix/store/bamiffh2zfv0zl65hhsm91zscvqsmg43-ignis-0.3+date=20241124_005e3e8/lib --libexecdir=/nix/store/bamiffh2zfv0zl65hhsm91zscvqsmg43-ignis-0.3+date=20241124_005e3e8/libexec --bindir=/nix/store/bamiffh2zfv0zl65hhsm91zscvqsmg43-ignis-0.3+date=20241124_005e3e8/bin --sbindir=/nix/store/bamiffh2zfv0zl65hhsm91zscvqsmg43-ignis-0.3+date=20241124_005e3e8/sbin --includedir=/nix/store/bamiffh2zfv0zl65hhsm91zscvqsmg43-ignis-0.3+date=20241124_005e3e8/include --mandir=/nix/store/bamiffh2zfv0zl65hhsm91zscvqsmg43-ignis-0.3+date=20241124_005e3e8/share/man --infodir=/nix/store/bamiffh2zfv0zl65hhsm91zscvqsmg43-ignis-0.3+date=20241124_005e3e8/share/info --localedir=/nix/store/bamiffh2zfv0zl65hhsm91zscvqsmg43-ignis-0.3+date=20241124_005e3e8/share/locale -Dauto_features=enabled -Dwrap_mode=nodownload --buildtype=plain
       > The Meson build system
       > Version: 1.5.2
       > Source dir: /build/8kg866bnj4jbm8bw2hw2cvccsp2xh1zj-source
       > Build dir: /build/8kg866bnj4jbm8bw2hw2cvccsp2xh1zj-source/build
       > Build type: native build
       > Project name: ignis
       > Project version: undefined
       > Host machine cpu family: x86_64
       > Host machine cpu: x86_64
       > Program python3 found: YES (/nix/store/wfbjq35kxs6x83c3ncpfxdyl5gbhdx4h-python3-3.12.6/bin/python3.12)
       > Found pkg-config: YES (/nix/store/mi7q9m86m3rkqmc0niyvfv25ji9fxxha-pkg-config-wrapper-0.29.2/bin/pkg-config) 0.29.2
       > Run-time dependency glib-2.0 found: YES 2.80.4
       > Run-time dependency gobject-introspection-1.0 found: 
YES 1.80.1
       > Run-time dependency gio-2.0 found: YES 2.80.4
       > Run-time dependency gtk4 found: YES 4.14.5
       > Run-time dependency gtk4-layer-shell-0 found: YES 1.0.3
       >
       > meson.build:31:0: ERROR: Subproject exists but has no meson.build file.
       >
       > A full log can be found at /build/8kg866bnj4jbm8bw2hw2cvccsp2xh1zj-source/build/meson-logs/meson-log.txt
       For full logs, run 'nix-store -l /nix/store/0gackcrdr6wxl2zld07y2gyv07qfq2y0-ignis-0.3+date=20241124_005e3e8.drv'.

Maybe I'm doing something wrong? is there anyone else who gets this error

@0x006E
Copy link
Contributor
0x006E commented Nov 24, 2024

Maybe I'm doing something wrong? is there anyone else who gets this error

@linkfrg PR updated, can be tested with nix build "github:ratson/ignis/005e3e8705aa11ab529677087fa0f877c6292935"

$ nix build "github:ratson/ignis/005e3e8705aa11ab529677087fa0f877c6292935" --extra-experimental-features nix-command --extra-experimental-features flakes

error: builder for '/nix/store/0gackcrdr6wxl2zld07y2gyv07qfq2y0-ignis-0.3+date=20241124_005e3e8.drv' failed with exit code 1;
       last 25 log lines:
       > /build
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > mesonConfigurePhase flags: --prefix=/nix/store/bamiffh2zfv0zl65hhsm91zscvqsmg43-ignis-0.3+date=20241124_005e3e8 --libdir=/nix/store/bamiffh2zfv0zl65hhsm91zscvqsmg43-ignis-0.3+date=2024112
8000
4_005e3e8/lib --libexecdir=/nix/store/bamiffh2zfv0zl65hhsm91zscvqsmg43-ignis-0.3+date=20241124_005e3e8/libexec --bindir=/nix/store/bamiffh2zfv0zl65hhsm91zscvqsmg43-ignis-0.3+date=20241124_005e3e8/bin --sbindir=/nix/store/bamiffh2zfv0zl65hhsm91zscvqsmg43-ignis-0.3+date=20241124_005e3e8/sbin --includedir=/nix/store/bamiffh2zfv0zl65hhsm91zscvqsmg43-ignis-0.3+date=20241124_005e3e8/include --mandir=/nix/store/bamiffh2zfv0zl65hhsm91zscvqsmg43-ignis-0.3+date=20241124_005e3e8/share/man --infodir=/nix/store/bamiffh2zfv0zl65hhsm91zscvqsmg43-ignis-0.3+date=20241124_005e3e8/share/info --localedir=/nix/store/bamiffh2zfv0zl65hhsm91zscvqsmg43-ignis-0.3+date=20241124_005e3e8/share/locale -Dauto_features=enabled -Dwrap_mode=nodownload --buildtype=plain
       > The Meson build system
       > Version: 1.5.2
       > Source dir: /build/8kg866bnj4jbm8bw2hw2cvccsp2xh1zj-source
       > Build dir: /build/8kg866bnj4jbm8bw2hw2cvccsp2xh1zj-source/build
       > Build type: native build
       > Project name: ignis
       > Project version: undefined
       > Host machine cpu family: x86_64
       > Host machine cpu: x86_64
       > Program python3 found: YES (/nix/store/wfbjq35kxs6x83c3ncpfxdyl5gbhdx4h-python3-3.12.6/bin/python3.12)
       > Found pkg-config: YES (/nix/store/mi7q9m86m3rkqmc0niyvfv25ji9fxxha-pkg-config-wrapper-0.29.2/bin/pkg-config) 0.29.2
       > Run-time dependency glib-2.0 found: YES 2.80.4
       > Run-time dependency gobject-introspection-1.0 found: 
YES 1.80.1
       > Run-time dependency gio-2.0 found: YES 2.80.4
       > Run-time dependency gtk4 found: YES 4.14.5
       > Run-time dependency gtk4-layer-shell-0 found: YES 1.0.3
       >
       > meson.build:31:0: ERROR: Subproject exists but has no meson.build file.
       >
       > A full log can be found at /build/8kg866bnj4jbm8bw2hw2cvccsp2xh1zj-source/build/meson-logs/meson-log.txt
       For full logs, run 'nix-store -l /nix/store/0gackcrdr6wxl2zld07y2gyv07qfq2y0-ignis-0.3+date=20241124_005e3e8.drv'.

Maybe I'm doing something wrong? is there anyone else who gets this error

Yes, I get the same error, the problem I see is that.
since subprojects/gvc exists

when
cp -rf --no-preserve=mode "${gvc}/" ./subprojects/gvc
is used to copy the submodule, instead of copying it to subprojects/gvc it is copied to subprojects/gvc/somehash-build/
, that is the cause of the error.

There needs to be a period (dot) after ${gvc}/ so that only the contents are copied instead of the folder itself

cp -rf --no-preserve=mode "${gvc}/." ./subprojects/gvc
__________________________________^___________________
_____________________________This dot

@ratson
Copy link
Contributor Author
ratson commented Nov 24, 2024

@linkfrg @0x006E Would you give another try with nix build "github:ratson/ignis/c334576ca24e43c719071d9b4f36b4851e0ee847".

It will delete subprojects/ first if exists.

@0x006E
Copy link
Contributor
0x006E commented Nov 24, 2024

@ratson Builds fine for me. But I don't think these lines are needed

    rm -rf subprojects
    mkdir -p subprojects

Since subprojects/gvc already exists in the repo and we only need the contents of gvc

@linkfrg
Copy link
Owner
linkfrg commented Nov 24, 2024

@linkfrg @0x006E Would you give another try with nix build "github:ratson/ignis/c334576ca24e43c719071d9b4f36b4851e0ee847".

It will delete subprojects/ first if exists.

@ratson builds successfully

@ratson
Copy link
Contributor Author
ratson commented Nov 24, 2024

@0x006E Could you try if removing those lines works on your computer?

I got build error cp: cannot create directory './subprojects/gvc': No such file or directory without mkdir -p subprojects.
rm -rf subprojects is added just in case it is presented, which could be safely removed.

@0x006E
Copy link
Contributor
0x006E commented Nov 24, 2024

@0x006E Could you try if removing those lines works on your computer?

I got build error cp: cannot create directory './subprojects/gvc': No such file or directory without mkdir -p subprojects. rm -rf subprojects is added just in case it is presented, which could be safely removed.

@ratson
I can actually build it fine, you can test it out using
nix build "github:0x006e/ignis"

Maybe there are difference in how git or nix behaves across versions or system. This should be why your first changes didn't build on mine (those folders exist in mine when nix clones the repo)

~/projects via C v13.3.0-gcc via  v20.18.0 via ❄  impure (shell) ❯ nix --version
nix (Lix, like Nix) 2.91.1
~/projects via C v13.3.0-gcc via  v20.18.0 via ❄  impure (shell) ❯ git --version
git version 2.47.0

Yea those two lines are no problem, it's fine if its kept. :)

@ratson
Copy link
Contributor Author
ratson commented Nov 24, 2024

possibly, so keep the lines for compatibility reason.

❯ nix --version
nix (Nix) 2.24.10

❯ git --version
git version 2.47.0

@linkfrg
Copy link
Owner
linkfrg commented Nov 24, 2024

@ratson i just checked (old) ags flake and found this:

prePatch = ''
    mkdir -p ./subprojects/gvc
    cp -r ${gvc-src}/* ./subprojects/gvc
  '';

it looks a little simpler

@linkfrg
Copy link
Owner
linkfrg commented Dec 1, 2024

Couldn't test last week, was busy

Builds successfully on the latest commit, so merging!
Thanks!

@linkfrg linkfrg merged commit 4499140 into linkfrg:main Dec 1, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nix Related to the Nix package manager
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0