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

cmake: use IMPORTED_TARGET to create imported target for botan2 #3090

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

NickCao
Copy link
Contributor

@NickCao NickCao commented Aug 25, 2024

No description provided.

@pbek
Copy link
Owner

pbek commented Aug 25, 2024

Thank you very much! Seems to build fine for me on x86_64.
@Waqar144, any objections?

@pbek
Copy link
Owner

pbek commented Aug 25, 2024

@NickCao, is there a good way to test the build on aarch64?

I tried:

nix-build -E '((import <nixpkgs> {}).pkgsCross.aarch64-multiplatform.qt6Packages.callPackage (import ./default.nix) { })'

But it errors out with:

CMake Error at translations/cmake_install.cmake:54 (file):
  file INSTALL cannot copy file
  "/build/qttranslations-everywhere-src-6.7.2/build//nix/store/gg3y5q6j549x74ld4l3frkmgc2r9avqh-qttranslations-6.7.2/translations/assistant_ar.qm"
  to
  "/nix/store/gg3y5q6j549x74ld4l3frkmgc2r9avqh-qttranslations-6.7.2/translations/assistant_ar.qm":
  Permission denied.
Call Stack (most recent call first):
  cmake_install.cmake:47 (include)


FAILED: CMakeFiles/install.util 
cd /build/qttranslations-everywhere-src-6.7.2/build && /nix/store/aqckch626lg0vxh41dabyzrq0jx7gdk5-cmake-3.29.6/bin/cmake -P cmake_install.cmake
ninja: build stopped: subcommand failed.
error: builder for '/nix/store/pip1mhmprdla2hh5b9s7g6lv2gj0qn83-qttranslations-6.7.2.drv' failed with exit code 1;
       last 10 log lines:
       >   to
       >   "/nix/store/gg3y5q6j549x74ld4l3frkmgc2r9avqh-qttranslations-6.7.2/translations/assistant_ar.qm":
       >   Permission denied.
       > Call Stack (most recent call first):
       >   cmake_install.cmake:47 (include)
       >
       >
       > FAILED: CMakeFiles/install.util
       > cd /build/qttranslations-everywhere-src-6.7.2/build && /nix/store/aqckch626lg0vxh41dabyzrq0jx7gdk5-cmake-3.29.6/bin/cmake -P cmake_install.cmake
       > ninja: build stopped: subcommand failed.
       For full logs, run 'nix log /nix/store/pip1mhmprdla2hh5b9s7g6lv2gj0qn83-qttranslations-6.7.2.drv'.
error: 1 dependencies of derivation '/nix/store/a1izhcz432cy6ymmpfkrp4dqmsqval42-qtbase-6.7.2.drv' failed to build
error: 1 dependencies of derivation '/nix/store/sn82rk2g04hjx8mx120n6c1y9qwwhwrr-qttools-6.7.2.drv' failed to build
error (ignored): error: cannot unlink '/tmp/nix-build-glibc-aarch64-unknown-linux-gnu-2.39-52.drv-1/build/build/elf': Directory not empty
error (ignored): error: cannot unlink '/tmp/nix-build-unixODBC-aarch64-unknown-linux-gnu-2.3.12.drv-0/build/unixODBC-2.3.12': Directory not empty
error (ignored): error: cannot unlink '/tmp/nix-build-liburcu-aarch64-unknown-linux-gnu-0.14.0.drv-0/build': Directory not empty
error (ignored): error: cannot unlink '/tmp/nix-build-pkg-config-aarch64-unknown-linux-gnu-0.29.2.drv-0/build/pkg-config-0.29.2/glib': Directory not empty
building '/nix/store/9shxzkskdx7rac2pj5b9jfpikknq05si-uthash-aarch64-unknown-linux-gnu-2.3.0.drv'...
building '/nix/store/bgmwb1czq1girn9ih3z19fwjqigznw9f-validate-pkg-config.drv'...
building '/nix/store/jwvwv6wx8fpz86zg25jzvqphw5d3vv46-wrap-python-hook.drv'...
building '/nix/store/6aa8k9rnsi3m4fwv45y815dgxa8s5imk-xcb-util-aarch64-unknown-linux-gnu-0.4.1.drv'...
building '/nix/store/bg6cl0s8jaaww7fr0qc5bpcr7xqmazch-xcb-util-renderutil-aarch64-unknown-linux-gnu-0.3.10.drv'...
building '/nix/store/aww8vy21njagygcj8g1whl64hq7a06nk-xcb-util-wm-aarch64-unknown-linux-gnu-0.4.2.drv'...
building '/nix/store/w7frg9ja3n0j1jch6fmiv4dzyiqhbifg-xkeyboard-config-aarch64-unknown-linux-gnu-2.42.drv'...
error (ignored): error: cannot unlink '/tmp/nix-build-xcb-util-aarch64-unknown-linux-gnu-0.4.1.drv-0/build/xcb-util-0.4.1': Directory not empty
error: 1 dependencies of derivation '/nix/store/xwvjsc6h8r8ni4ygkgrs7ps5n1w7v4mc-qownnotes-aarch64-unknown-linux-gnu-local-build.drv' failed to build

@Waqar144
Copy link
Contributor

Why remove all the old code? Whats the reasoning behind this?

@NickCao
Copy link
Contributor Author

NickCao commented Aug 25, 2024

is there a good way to test the build on aarch64?

Qt cross compilation in nixpkgs doesn't work well yet, so you have to find a aarch64 machine. I'm using nixbuild.net for that matter. Or you might use qemu user emulation, which can be enabled in github actions with https://github.com/multiarch/qemu-user-static

@NickCao
Copy link
Contributor Author

NickCao commented Aug 25, 2024

Why remove all the old code? Whats the reasoning behind this?

The IMPORTED_TARGET parameter of pkg_check_modules can construct the cmake target for us, effectively replacing the old add_library and set_target_properties call. Still I'm happy to bring some of the old logic around checking target existence etc. back if you find them necessary.

@pbek
Copy link
Owner

pbek commented Aug 25, 2024

Why remove all the old code? Whats the reasoning behind this?

The IMPORTED_TARGET parameter of pkg_check_modules can construct the cmake target for us, effectively replacing the old add_library and set_target_properties call. Still I'm happy to bring some of the old logic around checking target existence etc. back if you find them necessary.

@Waqar144, do we need the old parts?

@pbek
Copy link
Owner

pbek commented Aug 25, 2024

is there a good way to test the build on aarch64?

Qt cross compilation in nixpkgs doesn't work well yet, so you have to find a aarch64 machine. I'm using nixbuild.net for that matter. Or you might use qemu user emulation, which can be enabled in github actions with https://github.com/multiarch/qemu-user-static

@NickCao, https://nixbuild.net looks nice, thank you.
I haven't found a lot how to use qemu-user-static in a GitHub workflow with nix. 🤔

@Waqar144
Copy link
Contributor

Okay, if it works then thats all that matters.

@pbek
Copy link
Owner

pbek commented Aug 26, 2024

Thank you!

@pbek pbek merged commit a344eb9 into pbek:main Aug 26, 2024
27 of 32 checks passed
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.

3 participants