Skip to content

Build system: fix configure script for HAS_SOCKETS#10156

Merged
gasche merged 1 commit intoocaml:trunkfrom
TheLortex:fix-configure-sockets
Feb 9, 2021
Merged

Build system: fix configure script for HAS_SOCKETS#10156
gasche merged 1 commit intoocaml:trunkfrom
TheLortex:fix-configure-sockets

Conversation

@TheLortex
Copy link
Copy Markdown
Contributor

@TheLortex TheLortex commented Jan 15, 2021

Until now, the HAS_SOCKETS definition in s.h is set to 1 even if sockets are not available.

This PR aims to fix the sockets feature detection in the configure script.

@TheLortex TheLortex changed the title Fix configure script for HAS_SOCKETS Build system: fix configure script for HAS_SOCKETS Jan 15, 2021
@TheLortex TheLortex force-pushed the fix-configure-sockets branch from e20dda5 to bce8373 Compare January 15, 2021 14:07
@ksromanov
Copy link
Copy Markdown
Contributor

No problems on Solaris.

Copy link
Copy Markdown
Member

@damiendoligez damiendoligez left a comment

Choose a reason for hiding this comment

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

The macro AC_CHECK_FUNCS seems to be designed to handle this kind of thing without the need for a cascade of tests.

@TheLortex TheLortex force-pushed the fix-configure-sockets branch from bce8373 to b0005fc Compare January 18, 2021 10:42
@TheLortex
Copy link
Copy Markdown
Contributor Author

@damiendoligez Thanks for the advice, I updated the PR.

Copy link
Copy Markdown
Member

@dra27 dra27 left a comment

Choose a reason for hiding this comment

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

What is here is correct - I would however state it slightly differently, changing sockets=false on L1296 to sockets=true and removing the sockets=true lines from L1301, L1304, L1307 and L1309 - i.e. change the assumption to be that we have sockets and then AC_CHECK_FUNCS refutes that assumption. At the moment, sockets is set to false then always set to true and then possibly set back to false.

@dra27
Copy link
Copy Markdown
Member

dra27 commented Feb 5, 2021

As it fixes a bug, it's definitely worth a Changes entry

@dra27 dra27 modified the milestone: 4.12 Feb 5, 2021
@TheLortex TheLortex force-pushed the fix-configure-sockets branch 2 times, most recently from 69b0cfd to 12621a5 Compare February 8, 2021 15:03
Copy link
Copy Markdown
Member

@damiendoligez damiendoligez left a comment

Choose a reason for hiding this comment

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

Very good, thanks.
Good to merge as soon as CI is happy.

Copy link
Copy Markdown
Member

@dra27 dra27 left a comment

Choose a reason for hiding this comment

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

You appear not to have regenerated configure, so I include the layout fix to Changes for the same time!

@dra27
Copy link
Copy Markdown
Member

dra27 commented Feb 8, 2021

@Octachron - this is a bug fix, is it OK for 4.12?

@TheLortex TheLortex force-pushed the fix-configure-sockets branch from 12621a5 to 7b21acc Compare February 8, 2021 15:58
@TheLortex
Copy link
Copy Markdown
Contributor Author

Updated the branch according to reviews !

For reference, I had to downgrade autoconf to version 2.69, because in version 2.70 make configure generates a huge diff (what I pushed initially) and outputs some warnings.

@dra27
Copy link
Copy Markdown
Member

dra27 commented Feb 8, 2021

Updated the branch according to reviews !

For reference, I had to downgrade autoconf to version 2.69, because in version 2.70 make configure generates a huge diff (what I pushed initially) and outputs some warnings.

That'll teach you to use Arch 😉

@dra27
Copy link
Copy Markdown
Member

dra27 commented Feb 8, 2021

More seriously, there was an 8.5 year gap between autoconf 2.69 and 2.70, so we'll need to look at changing CI at some point.. however, the fact that 2.71 has been released within 2 months suggests that holding at 2.69 might be sensible for a bit.

@TheLortex TheLortex force-pushed the fix-configure-sockets branch from 7b21acc to 8bcbb48 Compare February 9, 2021 08:40
@gasche gasche merged commit e24b85d into ocaml:trunk Feb 9, 2021
@gasche
Copy link
Copy Markdown
Member

gasche commented Feb 9, 2021

this is a bug fix, is it OK for 4.12?

My understanding is "no". The signalling was less clear than in previous releases (to me at least) but I think we morally are in the "release candidate" phase, where only major issues can be integrated, at the cost of delaying the release.

@gasche
Copy link
Copy Markdown
Member

gasche commented Feb 9, 2021

(But it could be backported in the release branch after the 4.12 release. Maybe we should fork the 4.12 branch into a temporary 4.12.0 branch at the start of the release-candidate phase?)

@Octachron
Copy link
Copy Markdown
Member

Octachron commented Feb 9, 2021

Reading the discussion, I am not sure when this fixed bug can be triggered?
Thus, by default, I agree that it seems safer to err on the side of 4.12.1 at this point of time.

@TheLortex
Copy link
Copy Markdown
Contributor Author

For context, I encountered the issue when building ocaml-freestanding which is a cross-compiler based on solo5 and a freestanding libc implementation (which doesn't have sockets). As we're in control of the build process it's not a critical bug: we can simply override the configure output by adding #undef HAS_SOCKETS in s.h.

@dra27
Copy link
Copy Markdown
Member

dra27 commented Feb 9, 2021

Indeed, the bug was triggered on any OS which happens not to have sockets... of course, these days, that's not many!

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.

6 participants