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

Meson fixes #1087

Merged
merged 9 commits into from
Oct 29, 2024
Merged

Meson fixes #1087

merged 9 commits into from
Oct 29, 2024

Conversation

Kangie
Copy link
Contributor

@Kangie Kangie commented Oct 27, 2024

A collection of fixes for differences to the autotools build as noted by @somiaj.

Happy to drop, amend, squash, or split off any of these commits as directed.

  • We could probably drop libs/asprintf.c
  • Can't see where SETPGRP_VOID is supposed to come from?
  • Thoughts on USE_LIBICONV?

meson.build Outdated
@@ -360,6 +358,11 @@ endif
# Hard-coded
non_configurable_ops = [
'FMiniIconsSupported',
'FORK_CREATES_CHILD',
'HAVE_MKSTEMP', # POSIX 2001; safer since 2008; no real need to check for this on a modern system.
Copy link
Member

@ThomasAdam ThomasAdam Oct 27, 2024

Choose a reason for hiding this comment

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

You can drop this commit; it's covered on Linux by _DEFAULT_SOURCE which we define.

Copy link
Contributor Author

@Kangie Kangie Oct 28, 2024

Choose a reason for hiding this comment

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

I have removed HAVE_MKSTEMP however kept the tidyup and still define HAVE_SAFETY_MKSTEMP - As far as I can tell if we're relying on _DEFAULT_SOURCE we're POSIX 2008 which is safer (at least based on the man) down the line we may be able to drop the 'host does not have safe mkstemp' path.

I am happy to copy the code check from autotools if you would prefer that we properly check for all platforms :)

@ThomasAdam
Copy link
Member

ThomasAdam commented Oct 27, 2024

@Kangie

I'm OK with this.

Drop the commit C89: Assume RETSIGTYPE void and SIGNAL_RETURN return -- I'm aware of the difference; don't want to change it right now.

Re: making xent a default dependency, you'll need to update README.md as well.

The wait3 change -- I had this in a previous commit; looks like it was never cherry-picked over when we were reviewing this. That's frustrating.

As for SETPGRP -- what don't you understand? We're currently not checking for it in meson.build, and we should be. It's currently not setting the process group when we call Exec. This should really be happening.

I'm not sure why we can drop libs/asprintf.c -- on MacOS, you won't find it. Also on other systems as well. We're keeping it.

I don't see anything in here about LIB_ICONV-- what was your question?

@ThomasAdam ThomasAdam added the area:build Relates to compiling/buildsystem of fvwm label Oct 27, 2024
@ThomasAdam ThomasAdam added this to the 1.1.1 milestone Oct 27, 2024
@somiaj
Copy link
Collaborator

somiaj commented Oct 27, 2024

@ThomasAdam, libs/Ficonv.c checks for USE_LIBICONV and _LIBIONCV_H, which seems autotools has an older check for. So the question is does meson also need to do this, or is this just an older check that isn't needed for any modern implementation of libc which seems iconv is native. Though I think we only looked at glibc and musl.

@ThomasAdam
Copy link
Member

I'll check later on, but FreeBSD needed this.

@Kangie Kangie force-pushed the meson-fixes branch 2 times, most recently from 645f5e6 to ff8c92c Compare October 28, 2024 03:26
Reported-by: Jaimos Skriletz <jaimosskriletz@gmail.com>
Signed-off-by: Matt Jolly <kangie@gentoo.org>
@Kangie
Copy link
Contributor Author

Kangie commented Oct 28, 2024

Drop the commit C89: Assume RETSIGTYPE void and SIGNAL_RETURN return -- I'm aware of the difference; don't want to change it right now.

Done. I made it into its own PR, but no need to merge that in the short term (or at all).

Re: making xent a default dependency, you'll need to update README.md as well.

Xext is already listed; the meson build was defective. I haven't checked if it's fatal on autotools - I assume that "automagic" ensures that it's pulled in most of the time.

The wait3 change -- I had this in a previous commit; looks like it was never cherry-picked over when we were reviewing this. That's frustrating.

Sorry, I ended up clobbering a bunch of my commits when I thought I'd been working on my laptop but had actually been on my dev desktop. Thought I'd fixed all the changes but obviously missed that one.

As for SETPGRP -- what don't you understand? We're currently not checking for it in meson.build, and we should be. It's currently not setting the process group when we call Exec. This should really be happening.

We do check for setpgrp and set HAVE_SETPGRP if found.

fvwm3/meson.build

Lines 146 to 147 in 1067a72

'setpgid': {},
'setpgrp': {},

I don't see where SETPGRP_VOID comes from (I can't see anything in the commit that added it either). Is there some missing check?

fvwm3/libs/setpgrp.c

Lines 34 to 36 in 1067a72

# ifdef HAVE_SETPGRP
# ifdef SETPGRP_VOID
rc = setpgrp();

This is currently based on the CI PR's branch; if that gets merged the diff should get down to only the changes we are about here.

@Kangie Kangie force-pushed the meson-fixes branch 3 times, most recently from 16b9b00 to f317e61 Compare October 28, 2024 04:33
@ThomasAdam
Copy link
Member

@Kangie

I think SETPGRP_VOID comes from Solaris -- so something we can ignore. It's never going to be defined on most platforms that are currently being used.

Reported-by: Jaimos Skriletz <jaimosskriletz@gmail.com>
Signed-off-by: Matt Jolly <kangie@gentoo.org>
This has been safe since 2008 so we don't need to check for it.

Tidyup: Add `true` values to `non_configurable_ops`

Reported-by: Jaimos Skriletz <jaimosskriletz@gmail.com>
Signed-off-by: Matt Jolly <kangie@gentoo.org>
We don't actually guard this anywhere in the codebase.

Reported-by: Jaimos Skriletz <jaimosskriletz@gmail.com>
Signed-off-by: Matt Jolly <kangie@gentoo.org>
As XSHM is mandatory we can no longer build without
Xext, so tidy up the build code.

Signed-off-by: Matt Jolly <kangie@gentoo.org>
The X Network Transport layer has been shipped with X11 for some time now.
We no longer need to support configurations without this feature.

Reported-by: Jaimos Skriletz <jaimosskriletz@gmail.com>
Signed-off-by: Matt Jolly <kangie@gentoo.org>
All remotely modern and supported platforms allow this.

Reported-by: Jaimos Skriletz <jaimosskriletz@gmail.com>
Signed-off-by: Matt Jolly <kangie@gentoo.org>
Reported-by: Jaimos Skriletz <jaimosskriletz@gmail.com>
Signed-off-by: Matt Jolly <kangie@gentoo.org>
@Kangie
Copy link
Contributor Author

Kangie commented Oct 29, 2024

Ack. Dropped the CI commit. If you're happy with HAVE_ICONV as-is this is good to merge.

If we need to get closer to current behaviour for BSD we could do something a bit like this:

if get_option('iconv').allowed() #set to auto or enabled
  iconv = dependency('iconv', required: false, method: 'builtin')
  if iconv.found()
    conf.set10('HAVE_ICONV', true)
  else
    iconv = dependency('iconv', required: true, method: 'system')
    conf.set10('HAVE_ICONV', true)
    conf.set10('USE_LIBICONV', true)
  endif
  # add to deps as usual here
endif

@Kangie
Copy link
Contributor Author

Kangie commented Oct 29, 2024

I think SETPGRP_VOID comes from Solaris -- so something we can ignore. It's never going to be defined on most platforms that are currently being used.

Looks like it's the other way around; from the autoconf manual:

Macro: AC_FUNC_SETPGRP

If setpgrp takes no argument (the Posix version), define SETPGRP_VOID. Otherwise, it is the BSD version, which takes two process IDs as arguments. This macro does not check whether setpgrp exists at all; if you need to work in that situation, first call AC_CHECK_FUNC for setpgrp.

This macro is obsolescent, as current systems have a setpgrp whose signature conforms to Posix. New programs need not use this macro.

I'll just define it always if SETPGRP is found?

All current systems have a setpgrp whose signature conforms to Posix.

We need to set this to use the correct implementation internally
but we don't need to check for it.

Signed-off-by: Matt Jolly <kangie@gentoo.org>
@ThomasAdam
Copy link
Member

@Kangie -- Riiiight. All makes sense now, re: SETPGRP.

This looks good to go. Will merge.

@ThomasAdam ThomasAdam added the skip:changelog Issue/PR should skip CHANGELOG label Oct 29, 2024
@ThomasAdam ThomasAdam merged commit a528d2b into fvwmorg:main Oct 29, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:build Relates to compiling/buildsystem of fvwm skip:changelog Issue/PR should skip CHANGELOG
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants