Bug 274793 - graphics/qgis: build fails with wrong sed version; use grass8 instead of grass7 [patch]
Summary: graphics/qgis: build fails with wrong sed version; use grass8 instead of gras...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Rainer Hurling
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-29 16:02 UTC by Martin Birgmeier
Modified: 2024-01-12 18:58 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (rhurlin)


Attachments
patch to find the right sed and to use grass8 instead of grass7 (3.69 KB, patch)
2023-10-29 16:02 UTC, Martin Birgmeier
no flags Details | Diff
improved patch (3.86 KB, patch)
2023-10-29 16:30 UTC, Martin Birgmeier
no flags Details | Diff
patch to find the right sed and to use grass8 instead of grass7 (4.93 KB, patch)
2023-10-30 10:35 UTC, Martin Birgmeier
no flags Details | Diff
patch to find the right sed and to use grass8 instead of grass7 (4.35 KB, patch)
2023-10-30 17:10 UTC, Martin Birgmeier
no flags Details | Diff
qgis-3.34.1 with grass 8 (4.20 KB, patch)
2023-11-29 09:34 UTC, Martin Birgmeier
no flags Details | Diff
create python3 link only if it does not yet exist (738 bytes, patch)
2023-12-27 08:59 UTC, Martin Birgmeier
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Birgmeier 2023-10-29 16:02:37 UTC
Created attachment 245974 [details]
patch to find the right sed and to use grass8 instead of grass7

Scenario:
- FreeBSD 12.4 latest
- ports latest
- using portmaster to upgrade ports
- graphics/qgis has been bumped to 3.34.0

Result:
- build fails with wrong version for sed
- build uses grass7 although grass8 is already available

Expected result:
- build should succeed and use grass8

Patch attached.

-- Martin
Comment 1 Martin Birgmeier 2023-10-29 16:30:23 UTC
Created attachment 245975 [details]
improved patch

textproc/flex is only needed on FreeBSD < 13. Update the patch.
Comment 2 Martin Birgmeier 2023-10-30 10:35:02 UTC
Created attachment 245991 [details]
patch to find the right sed and to use grass8 instead of grass7

One patch was missing...
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-10-30 17:09:52 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=a5b13ac5f0508383b447fc52b994975662f94f0f

commit a5b13ac5f0508383b447fc52b994975662f94f0f
Author:     Rainer Hurling <rhurlin@FreeBSD.org>
AuthorDate: 2023-10-30 16:59:22 +0000
Commit:     Rainer Hurling <rhurlin@FreeBSD.org>
CommitDate: 2023-10-30 17:07:30 +0000

    graphics/qgis: Readd patch to fix flex version

    For FreeBSD versions < 1300501 the existing version of FLEX in base is
    unsufficient. Readd old patch to install the ports version of FLEX.

    CMake Error at /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230
      (message): Could NOT find FLEX: Found unsuitable version "2.5.37",
      but required is at least "2.6" (found /usr/bin/flex)
    Call Stack (most recent call first):
      /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:598
        (_FPHSA_FAILURE_MESSAGE)
      /usr/local/share/cmake/Modules/FindFLEX.cmake:269
        (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
      CMakeLists.txt:339 (find_package)

    Thanks to Martin Birgmeier <d8zNeCFG@aon.at> for reporting.

    PR:             274793

 graphics/qgis/Makefile | 8 ++++++++
 1 file changed, 8 insertions(+)
Comment 4 Martin Birgmeier 2023-10-30 17:10:23 UTC
Created attachment 245997 [details]
patch to find the right sed and to use grass8 instead of grass7

should test before submitting, even if it takes a while ;-)
Comment 5 Rainer Hurling freebsd_committer freebsd_triage 2023-10-30 17:19:37 UTC
Hi Martin,

Thanks for reporting and the patches.

In a first commit (a5b13ac5f) I fixed the problem with the wrong FLEX version for OS_VERSIONS <= 1300501. With QGIS 3.34.0 I had removed this patch by mistake. Now my old patch is back :)

The following line in the pre-configure target should not be removed. It is needed when multiple Python versions are installed. Then cmake has problems to find the default version without this line:

	${MKDIR} ${CONFIGURE_WRKSRC}/bin && ${LN} -s ${PYTHON_CMD} ${CONFIGURE_WRKSRC}/bin/python3

I intend to switch from GRASS 7 to GRASS 8 in another commit, as suggested in your patch. There are still some tests necessary.

Thanks again,
Rainer
Comment 6 Martin Birgmeier 2023-10-30 17:23:13 UTC
Hi Rainer,

Thank you for this.

In fact there still seem to be some errors when building with grass8, even if the build ultimately succeeds (and qgis seems to run fine, at least with the first simple tests).

As you write, more tests are needed.

-- Martin
Comment 7 Martin Birgmeier 2023-10-30 18:01:47 UTC
(In reply to Rainer Hurling from comment #5)

There is one issue with the pre-configure target: It inhibits restarting a make because the link already exists. It should be removed before being created.

-- Martin
Comment 8 Martin Birgmeier 2023-11-29 09:34:35 UTC
Created attachment 246655 [details]
qgis-3.34.1 with grass 8

(In reply to Rainer Hurling from comment #5)

This is just to let you know that I am running QGIS with GRASS 8 since a month. For my purposes it seems to be working.

With the upgrade to 3.34.1 I just reverted the "CMAKE_OFF += WITH_GRASS8" part, and it again seems to be o.k.

What kind of breakage should I be expecting with GRASS 8?

-- Martin

p.s. Attached the current diff from mainline ports.
Comment 9 Rainer Hurling freebsd_committer freebsd_triage 2023-12-03 21:15:16 UTC
(In reply to Martin Birgmeier from comment #8)
Hi Martin,
Thanks for the info about GRASS 8, that's good information.

I have (temporarily) disabled support for GRASS 8 in QGIS because a QGIS developer (upstream) told me about pending difficulties with GRASS 8 integration in QGIS in general. He is working on it and hopes to have everything ready by the end of the year so that support for GRASS 7 can even be deprecated in QGIS.

One difficulty with the port so far is that I have entries in pkg-plist for either GRASS 7 or GRASS 8. 

I am currently working on a patch that should temporarily allow a choice in the support of GRASS 7 or GRASS 8. This will hopefully give users who have been using GRASS 7 enough time to migrate to GRASS 8.
Comment 10 commit-hook freebsd_committer freebsd_triage 2023-12-27 06:33:08 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=89af289ed2be9979a283b58518303d7c37552f8e

commit 89af289ed2be9979a283b58518303d7c37552f8e
Author:     Rainer Hurling <rhurlin@FreeBSD.org>
AuthorDate: 2023-12-27 06:21:08 +0000
Commit:     Rainer Hurling <rhurlin@FreeBSD.org>
CommitDate: 2023-12-27 06:30:03 +0000

    graphics/qgis: Update to 3.34.2

    Introduce radio option to choose between GRASS7 and GRASS8 (default) or
    none of both.

    Changelog: https://github.com/qgis/QGIS/compare/final-3_34_1%5E...final-3_34_2

    PR:             274793

 graphics/qgis/Makefile                             |  39 +-
 graphics/qgis/distinfo                             |   6 +-
 .../qgis/files/patch-cmake_FindGRASS.cmake (new)   |  17 +
 graphics/qgis/pkg-plist                            | 877 +++++++++++----------
 4 files changed, 491 insertions(+), 448 deletions(-)
Comment 11 Rainer Hurling freebsd_committer freebsd_triage 2023-12-27 06:36:08 UTC
Hi Martin,

I have just committed QGIS 3.34.2. With this commit I have introduced the possibility to choose between the GRASS7 and GRASS8 options using radio buttons and even to build without GRASS.

Can you please check if everything builds, installs and works as desired in your scenario. Thank you very much.
Comment 12 Martin Birgmeier 2023-12-27 08:59:48 UTC
Created attachment 247281 [details]
create python3 link only if it does not yet exist

Hi Rainer,

Thank you, it builds perfectly. I'll install and test it on my work machine in the next days, and I do not expect any issues.

I have added a small patch to create the python3 link only if it does not already exist. This makes it easier to restart builds that have aborted for any reason (for example, by interrupting them manually). An alternative to the proposed solution might be to forcibly remove the link before creating it.

Furthermore, I have found the following warnings in the build log. I guess the first one is an artifact of the GRASSx_CMAKE_* Makefile logic. In the second the Python3_EXECUTABLE line seems to be interesting.

----------------------------------------------------------------------------
===>  Performing out-of-source build
/bin/mkdir -p /usr/tmp/net/hal/z/SRC/FreeBSD/ports/MBi/main/graphics/qgis/work/.build
CMake Warning:
  Ignoring extra path from command line:

   "/usr/tmp/net/hal/z/SRC/FreeBSD/ports/MBi/main/graphics/qgis/work/.build/WITH_GRASS8"
----------------------------------------------------------------------------

----------------------------------------------------------------------------
-- Generating done (4.4s)
CMake Warning:
  Manually-specified variables were not used by the project:

    BOOST_PYTHON_SUFFIX
    ENABLE_TESTING
    FETCHCONTENT_FULLY_DISCONNECTED
    Python3_EXECUTABLE
    Python_ADDITIONAL_VERSIONS

-- Build files have been written to: /usr/tmp/net/hal/z/SRC/FreeBSD/ports/MBi/main/graphics/qgis/work/.build
===>  Building for qgis-3.34.2
----------------------------------------------------------------------------

Best regards,

Martin
Comment 13 Rainer Hurling freebsd_committer freebsd_triage 2023-12-27 09:24:47 UTC
Hi Martin,

Thanks for the feedback, the patch and the log issues.

I will investigate, but that will take some days.
Comment 14 commit-hook freebsd_committer freebsd_triage 2024-01-12 16:31:51 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=02b2e1bdf494faf52c2827c7116cccb08e948129

commit 02b2e1bdf494faf52c2827c7116cccb08e948129
Author:     Rainer Hurling <rhurlin@FreeBSD.org>
AuthorDate: 2024-01-12 16:10:17 +0000
Commit:     Rainer Hurling <rhurlin@FreeBSD.org>
CommitDate: 2024-01-12 16:31:16 +0000

    graphics/qgis: Avoid CMake warning MAKE_GRASS

    CMake Warning:
      Ignoring extra path from command line:
       "/usr/ports/graphics/qgis/work/.build/WITH_GRASS8"

    This happens, because of unneeded CMAKE_OFF=WITH_GRASSx.
    Not functional change, not bump of PORTREVISION necessary.

    PR:             274793
    Reported by:    Martin Birgmeier <d8zNeCFG@aon.at>
    MFH:            2024Q1

 graphics/qgis/Makefile | 2 --
 1 file changed, 2 deletions(-)
Comment 15 commit-hook freebsd_committer freebsd_triage 2024-01-12 16:33:54 UTC
A commit in branch 2024Q1 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=bc450d2923d85dca0c8d871adc45779c009d3115

commit bc450d2923d85dca0c8d871adc45779c009d3115
Author:     Rainer Hurling <rhurlin@FreeBSD.org>
AuthorDate: 2024-01-12 16:10:17 +0000
Commit:     Rainer Hurling <rhurlin@FreeBSD.org>
CommitDate: 2024-01-12 16:32:33 +0000

    graphics/qgis: Avoid CMake warning MAKE_GRASS

    CMake Warning:
      Ignoring extra path from command line:
       "/usr/ports/graphics/qgis/work/.build/WITH_GRASS8"

    This happens, because of unneeded CMAKE_OFF=WITH_GRASSx.
    Not functional change, not bump of PORTREVISION necessary.

    PR:             274793
    Reported by:    Martin Birgmeier <d8zNeCFG@aon.at>
    MFH:            2024Q1

    (cherry picked from commit 02b2e1bdf494faf52c2827c7116cccb08e948129)

 graphics/qgis/Makefile | 2 --
 1 file changed, 2 deletions(-)
Comment 16 commit-hook freebsd_committer freebsd_triage 2024-01-12 16:40:56 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ae0bf0d52f69edaad5ff3f99c7b6c4e0838064eb

commit ae0bf0d52f69edaad5ff3f99c7b6c4e0838064eb
Author:     Rainer Hurling <rhurlin@FreeBSD.org>
AuthorDate: 2024-01-12 16:37:36 +0000
Commit:     Rainer Hurling <rhurlin@FreeBSD.org>
CommitDate: 2024-01-12 16:37:36 +0000

    graphics/qgis-ltr: Avoid CMake warning MAKE_GRASS

    CMake Warning:
      Ignoring extra path from command line:
       "/usr/ports/graphics/qgis/work/.build/WITH_GRASS8"

    This happens, because of unneeded CMAKE_OFF=WITH_GRASSx.
    Not functional change, not bump of PORTREVISION necessary.

    PR:             274793
    Reported by:    Martin Birgmeier <d8zNeCFG@aon.at>
    MFH:            2024Q1

 graphics/qgis-ltr/Makefile | 2 --
 1 file changed, 2 deletions(-)
Comment 17 commit-hook freebsd_committer freebsd_triage 2024-01-12 16:42:58 UTC
A commit in branch 2024Q1 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=efa0602848b5305a0693b08a4973a347321d1a32

commit efa0602848b5305a0693b08a4973a347321d1a32
Author:     Rainer Hurling <rhurlin@FreeBSD.org>
AuthorDate: 2024-01-12 16:37:36 +0000
Commit:     Rainer Hurling <rhurlin@FreeBSD.org>
CommitDate: 2024-01-12 16:42:06 +0000

    graphics/qgis-ltr: Avoid CMake warning MAKE_GRASS

    CMake Warning:
      Ignoring extra path from command line:
       "/usr/ports/graphics/qgis/work/.build/WITH_GRASS8"

    This happens, because of unneeded CMAKE_OFF=WITH_GRASSx.
    Not functional change, not bump of PORTREVISION necessary.

    PR:             274793
    Reported by:    Martin Birgmeier <d8zNeCFG@aon.at>
    MFH:            2024Q1

    (cherry picked from commit ae0bf0d52f69edaad5ff3f99c7b6c4e0838064eb)

 graphics/qgis-ltr/Makefile | 2 --
 1 file changed, 2 deletions(-)
Comment 18 Rainer Hurling freebsd_committer freebsd_triage 2024-01-12 16:51:53 UTC
(In reply to Martin Birgmeier from comment #12)

Hi Martin,

The reason for the first CMake warning about WITH_GRASS8 came from the GRASS7_CMAKE_OFF=WITH_GRASS8 and GRASS8_CMAKE_OFF=WITH_GRASS7 lines in the Makefile. Obviously, they are not needed. All is done by the GRASSx_BOOL=WITH_GRASSx lines, as described in [1]. I think, this one is resolved ;)

[1] https://docs.freebsd.org/en/books/porters-handbook/makefiles/#options-cmake_bool


Your second issue with the CMake warning about Python3_EXECUTABLE seems to come from the ports framework. If one add USES=python, this line appears in the configure phase. So most probably nothing, I can solve.

Thanks again for your report. I will close this PR now.
Comment 19 Martin Birgmeier 2024-01-12 18:58:22 UTC
Hi Rainer,

Thank you for all your efforts!

Best regards, Martin