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

qgis: add server support #267301

Merged
merged 1 commit into from
Oct 28, 2024
Merged

qgis: add server support #267301

merged 1 commit into from
Oct 28, 2024

Conversation

imincik
Copy link
Contributor

@imincik imincik commented Nov 13, 2023

Description of changes

Add QGIS server support for QGIS and QGIS-LTR.

This PR is co-authored by @bgamari in #259303 .

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@imincik imincik marked this pull request as draft November 13, 2023 21:10
@imincik imincik self-assigned this Nov 13, 2023
@imincik imincik mentioned this pull request Nov 13, 2023
12 tasks
@github-actions github-actions bot added the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label Nov 13, 2023
@ofborg ofborg bot requested review from willcohen, nh2, lsix and sikmir November 13, 2023 23:28
@ofborg ofborg bot added 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1 labels Nov 13, 2023
@imincik imincik force-pushed the qgis-server branch 5 times, most recently from 2369f2a to 1ad1fda Compare November 15, 2023 04:24
@imincik imincik changed the title qgis: build with server support qgis: add server support Nov 15, 2023
@imincik imincik requested a review from bgamari November 15, 2023 04:27
@imincik
Copy link
Contributor Author

imincik commented Nov 15, 2023

@ofborg build qgis qgis-ltr

@imincik imincik marked this pull request as ready for review November 15, 2023 04:54
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/week-in-geospatial-team-11-17-dec-2023/37035/1

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/week-in-geospatial-team/37035/2

@nialov
Copy link
Contributor

nialov commented Jan 14, 2024

Result of nixpkgs-review pr 267301 run on x86_64-linux 1

2 packages failed to build:
  • qgis
  • qgis-ltr

@nialov
Copy link
Contributor

nialov commented Jan 14, 2024

Getting a build error for PDAL which is a bit unexpected I guess?

error: builder for '/nix/store/34r5sjavrbr7pjhj3a176zk96pizk999-pdal-2.5.6.drv' failed with exit code 2;
       last 25 log lines:
       > [ 36%] Building CXX object CMakeFiles/pdal_base.dir/pdal/StageExtensions.cpp.o
       > [ 36%] Building CXX object CMakeFiles/pdal_base.dir/pdal/StageFactory.cpp.o
       > [ 37%] Building CXX object CMakeFiles/pdal_base.dir/pdal/Streamable.cpp.o
       > [ 37%] Building CXX object CMakeFiles/pdal_base.dir/pdal/SubcommandKernel.cpp.o
       > [ 37%] Building CXX object CMakeFiles/pdal_base.dir/pdal/Writer.cpp.o
       > [ 37%] Building CXX object CMakeFiles/pdal_base.dir/pdal/XMLSchema.cpp.o
       > [ 37%] Building CXX object CMakeFiles/pdal_base.dir/pdal/compression/DeflateCompression.cpp.o
       > [ 37%] Building CXX object CMakeFiles/pdal_base.dir/pdal/compression/LazPerfVlrCompression.cpp.o
       > /build/source/pdal/XMLSchema.cpp: In member function 'bool pdal::XMLSchema::validate(xmlDocPtr, const std::string&)':
       > /build/source/pdal/XMLSchema.cpp:257:9: error: invalid conversion from 'void (*)(void*, xmlErrorPtr)' {aka 'void (*)(void*, _xmlError*)'} to 'xmlStructuredErrorFunc' {aka 'void (*)(void*, const _xmlError*)'} [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-fpermissive-fpermissive8;;]
       >   257 |         &SchemaParserStructuredErrorHandler, m_global_context);
       >       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       >       |         |
       >       |         void (*)(void*, xmlErrorPtr) {aka void (*)(void*, _xmlError*)}
       > In file included from /build/source/pdal/XMLSchema.hpp:50,
       >                  from /build/source/pdal/XMLSchema.cpp:34:
       > /nix/store/iqjsxkcdnvvz1bfpq960ygicc5clz9hv-libxml2-2.12.3-unstable-2023-12-14-dev/include/libxml2/libxml/xmlschemas.h:156:65: note:   initializing argument 2 of 'void xmlSchemaSetParserStructuredErrors(xmlSchemaParserCtxtPtr, xmlStructuredErrorFunc, void*)'
       >   156 |                                          xmlStructuredErrorFunc serror,
       >       |                                          ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
       > [ 38%] Building CXX object CMakeFiles/pdal_base.dir/pdal/compression/ZstdCompression.cpp.o
       > [ 38%] Building CXX object CMakeFiles/pdal_base.dir/pdal/pdal_config.cpp.o
       > make[2]: *** [CMakeFiles/pdal_base.dir/build.make:2386: CMakeFiles/pdal_base.dir/pdal/XMLSchema.cpp.o] Error 1
       > make[2]: *** Waiting for unfinished jobs....
       > make[1]: *** [CMakeFiles/Makefile2:739: CMakeFiles/pdal_base.dir/all] Error 2
       > make: *** [Makefile:166: all] Error 2
       For full logs, run 'nix log /nix/store/34r5sjavrbr7pjhj3a176zk96pizk999-pdal-2.5.6.drv'.
error: 1 dependencies of derivation '/nix/store/219shfbf0y2sljyfi97bs9r1ifa02f3p-grass-8.3.1.drv' failed to build
error: 2 dependencies of derivation '/nix/store/qsc6v3k5r3af0pjh3wq3br11n9l987hn-qgis-ltr-unwrapped-3.28.14.drv' failed to build
error: 2 dependencies of derivation '/nix/store/3v0hbpdff85d575vb8jhpnmd2bda2lim-qgis-unwrapped-3.34.2.drv' failed to build
error: 1 dependencies of derivation '/nix/store/f9zjmknpw2lgrcc9d9p553nfyww1lgvg-qgis-3.28.14.drv' failed to build
error: 1 dependencies of derivation '/nix/store/l20aw7b6zh7yik6wqhrrzmjfwcjbq2z6-qgis-3.34.2.drv' failed to build
error: 2 dependencies of derivation '/nix/store/iwzfrx7r1gl8gsi5k4z3blb7mnp99q0k-review-shell.drv' failed to build

@imincik
Copy link
Contributor Author

imincik commented Jan 15, 2024

@nialov , thank you very much for reviewing

Getting a build error for PDAL which is a bit unexpected I guess?

I think, the reason why pdal build was failing at the moment of your review was because of latest staging-next containing some breaking libxml change which broke PDAL .

staging-next branch was merged 3 days ago and our PDAL fix was merged yesterday.

@imincik
Copy link
Contributor Author

imincik commented Jan 15, 2024

Result of nixpkgs-review pr 267301 run on x86_64-linux 1

2 packages failed to build:
  • qgis
  • qgis-ltr

qgis fails during `sip-build (see: #281100) which a new issue.

@ofborg ofborg bot requested review from das-g, r-burns and nialov January 15, 2024 12:55
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/week-in-geospatial-team/37035/3

@wegank wegank added the 2.status: merge conflict This PR has merge conflicts with the target branch label Mar 20, 2024
Copy link
Contributor

@autra autra left a comment

Choose a reason for hiding this comment

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

Looks good to me! thanks for this, it's going to be really useful!

pkgs/applications/gis/qgis/default.nix Outdated Show resolved Hide resolved
pkgs/applications/gis/qgis/unwrapped-ltr.nix Outdated Show resolved Hide resolved
pkgs/applications/gis/qgis/unwrapped-ltr.nix Outdated Show resolved Hide resolved
(lib.cmakeBool "WITH_PDAL" true)
(lib.cmakeBool "WITH_QTWEBKIT" withWebKit)
(lib.cmakeBool "WITH_SERVER" true)
"-DQGIS_CGIBIN_SUBDIR=${placeholder "out"}/lib/cgi-bin"
Copy link
Contributor

Choose a reason for hiding this comment

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

For my culture, why do we need placeholder "out here? $out directly doesn't work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure if I remember correctly, but I guess just using $out didn't work.

Copy link
Member

Choose a reason for hiding this comment

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

Why not $(out)?

@autra
Copy link
Contributor

autra commented Sep 12, 2024

Note: I've tested on the rebased version, build is passing and the executable is working fine (I tested only simple stuff: GetCapabilities and GetMap on a basic project).

@imincik imincik force-pushed the qgis-server branch 2 times, most recently from 0df17ec to 9dc5029 Compare September 18, 2024 10:14
@imincik
Copy link
Contributor Author

imincik commented Sep 18, 2024

Note: I've tested on the rebased version, build is passing and the executable is working fine (I tested only simple stuff: GetCapabilities and GetMap on a basic project).

Great thanks for reviewing this PR. I rebased it on current master.

The only remaining todo is to disable server by default and add some user friendly way to override it with withServer = true . Currently, it is quite hard to do, because qgis-unwrapped being called in let binding . Any suggestion ?

@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Sep 18, 2024
@ofborg ofborg bot requested review from l0b0 and autra September 18, 2024 10:53
@l0b0 l0b0 removed their request for review September 18, 2024 21:30
@autra
Copy link
Contributor

autra commented Sep 19, 2024

The only remaining todo is to disable server by default and add some user friendly way to override it with withServer = true . Currently, it is quite hard to do, because qgis-unwrapped being called in let binding . Any suggestion ?

Well I'd just propagate the argument:

  qgis-unwrapped = libsForQt5.callPackage ./unwrapped.nix { withServer = withServer;  };

Not entirely sure this works, as I'm still new to nixpkgs.

I guess #259445 won't be of much help, since we need the wrap for python packages right?

@imincik
Copy link
Contributor Author

imincik commented Sep 25, 2024

@autra , @sikmir , what about b0e306f to make unwrapped package overridable (majority of changes in this commit is renaming of qgis-unwrapped variable to unwrapped) ?

@ofborg ofborg bot added 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux and removed 10.rebuild-linux: 1-10 labels Sep 25, 2024
@autra
Copy link
Contributor

autra commented Sep 27, 2024

I'd prefer a solution that expose these parameters directly to the user:

  • it's more standard for the user (=the person using pkgs.qgis in their nix files)
  • it's more discoverable for the user (the only place they have to look at is the parameters of default.nix, they don't have to 1/ find where other files are imported 2/ look in these other files)

Granted, it's a bit more boilerplate for us because we have to propagate every parameters, but I prefer that than to put the burden on users.

Btw, I think we should also document these options in meta.longDescription, so that they appear in search.nixos.org.

@imincik
Copy link
Contributor Author

imincik commented Sep 30, 2024

I'd prefer a solution that expose these parameters directly to the user:

  • it's more standard for the user (=the person using pkgs.qgis in their nix files)
  • it's more discoverable for the user (the only place they have to look at is the parameters of default.nix, they don't have to 1/ find where other files are imported 2/ look in these other files)

Granted, it's a bit more boilerplate for us because we have to propagate every parameters, but I prefer that than to put the burden on users.

I agree.

Btw, I think we should also document these options in meta.longDescription, so that they appear in search.nixos.org.

Yes.

@autra
Copy link
Contributor

autra commented Oct 25, 2024

Code looks good! Tested and works like expected. Thanks!

@imincik
Copy link
Contributor Author

imincik commented Oct 28, 2024

Code looks good! Tested and works like expected. Thanks!

Thanks for review.

@imincik imincik merged commit 120be03 into NixOS:master Oct 28, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants