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

Fix configure script generated by pkgconf-2.3.0 #38954

Merged
merged 1 commit into from
Nov 16, 2024

Conversation

vbraun
Copy link
Member

@vbraun vbraun commented Nov 10, 2024

Pkgconf 2.3.0 changes the PKG_PROG_PKG_CONFIG macro to error out instead of marking it as not found. Arguably this is the correct default for most but not for us, since we support building on macos where Apple, in their infinite wisdom, decided not to ship their dev tools with it.

See also: https://github.com/pkgconf/pkgconf/blob/master/NEWS

dnl PKG_PROG_PKG_CONFIG([MIN-VERSION], [ACTION-IF-NOT-FOUND])
dnl ---------------------------------------------------------
dnl Since: 0.16
dnl
dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
dnl first found in the path. Checks that the version of pkg-config found
dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
dnl used since that's the first version where most current features of
dnl pkg-config existed.
dnl
dnl If pkg-config is not found or older than specified, it will result
dnl in an empty PKG_CONFIG variable. To avoid widespread issues with
dnl scripts not checking it, ACTION-IF-NOT-FOUND defaults to aborting.
dnl You can specify [PKG_CONFIG=false] as an action instead, which would
dnl result in pkg-config tests failing, but no bogus error messages.

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

Pkgconf 2.3.0 changes the PKG_PROG_PKG_CONFIG macro to error out
instead of marking it as not found. Arguably this is the correct
default for most but not for us, since we support building on macos
where Apple, in their infinite wisdom, decided not to ship their dev
tools with it.

See also: https://github.com/pkgconf/pkgconf/blob/master/NEWS

    dnl PKG_PROG_PKG_CONFIG([MIN-VERSION], [ACTION-IF-NOT-FOUND])
    dnl ---------------------------------------------------------
    dnl Since: 0.16
    dnl
    dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
    dnl first found in the path. Checks that the version of pkg-config found
    dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
    dnl used since that's the first version where most current features of
    dnl pkg-config existed.
    dnl
    dnl If pkg-config is not found or older than specified, it will result
    dnl in an empty PKG_CONFIG variable. To avoid widespread issues with
    dnl scripts not checking it, ACTION-IF-NOT-FOUND defaults to aborting.
    dnl You can specify [PKG_CONFIG=false] as an action instead, which would
    dnl result in pkg-config tests failing, but no bogus error messages.
vbraun pushed a commit to vbraun/sage that referenced this pull request Nov 10, 2024
Pkgconf 2.3.0 changes the PKG_PROG_PKG_CONFIG macro to error out instead
of marking it as not found. Arguably this is the correct default for
most but not for us, since we support building on macos where Apple, in
their infinite wisdom, decided not to ship their dev tools with it.

See also: https://github.com/pkgconf/pkgconf/blob/master/NEWS

    dnl PKG_PROG_PKG_CONFIG([MIN-VERSION], [ACTION-IF-NOT-FOUND])
    dnl ---------------------------------------------------------
    dnl Since: 0.16
    dnl
    dnl Search for the pkg-config tool and set the PKG_CONFIG variable
to
    dnl first found in the path. Checks that the version of pkg-config
found
    dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0
is
    dnl used since that's the first version where most current features
of
    dnl pkg-config existed.
    dnl
    dnl If pkg-config is not found or older than specified, it will
result
    dnl in an empty PKG_CONFIG variable. To avoid widespread issues with
    dnl scripts not checking it, ACTION-IF-NOT-FOUND defaults to
aborting.
    dnl You can specify [PKG_CONFIG=false] as an action instead, which
would
    dnl result in pkg-config tests failing, but no bogus error messages.

<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [ ] The title is concise and informative.
- [ ] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->

URL: sagemath#38954
Reported by: Volker Braun
Reviewer(s):
Copy link

Documentation preview for this PR (built with commit f882056; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@kwankyu
Copy link
Collaborator

kwankyu commented Nov 13, 2024

I am new to this territory. So perhaps a stupid question: Is pkgconf or pkg-config a build prerequisite on mac? I think it should because either of them must provide the macro PKG_PROG_PKG_CONFIG in the first place. But then why it does not appear here: https://doc-release--sagemath.netlify.app/html/en/reference/spkg/_prereq ?

@vbraun
Copy link
Member Author

vbraun commented Nov 13, 2024

The pkgconf m4 scripts are, together with autoconf/autotools, a prerequisite for generating configure.ac -> configure.

But they are not required for building Sage from source. The bootstrap script will either run autoconf or, failing that, download a pre-generated configure. This is build/pkgs/configure, and I generate a new one whenever I push a new version.

Fedora 40 -> 41 updated the pkgconf m4 scripts, so this the breakage comes from.

Copy link
Collaborator

@kwankyu kwankyu left a comment

Choose a reason for hiding this comment

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

Thanks for explaining how bootstrap things work. LGTM.

@vbraun vbraun merged commit ba94a56 into sagemath:develop Nov 16, 2024
22 of 25 checks passed
vbraun added a commit to vbraun/sage that referenced this pull request Nov 30, 2024
Followup to sagemath#38954, where I
followed the pkgconf documentation to set PKG_CONFIG=false if it is
not found. But Sage uses "test -z $PKG_CONFIG", so it must instead be
set to empty.

This causes pkgconf not to be built if pkgconf/pkg-config is not
found. Which is basically only macOS.
vbraun pushed a commit to vbraun/sage that referenced this pull request Dec 1, 2024
Followup to sagemath#38954, where I
followed the pkgconf documentation to set `PKG_CONFIG=false` if it is
not found. But Sage uses `"test -z $PKG_CONFIG"`, so it must instead be
set to empty.

This causes pkgconf not to be built if pkgconf/pkg-config is not found.
Which is basically only macOS.

URL: sagemath#39063
Reported by: Volker Braun
Reviewer(s):
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants