Skip to content

Add IBM i PASE detection#466

Open
gsnw-sebast wants to merge 1 commit intoschweikert:developfrom
gsnw:issue/465
Open

Add IBM i PASE detection#466
gsnw-sebast wants to merge 1 commit intoschweikert:developfrom
gsnw:issue/465

Conversation

@gsnw-sebast
Copy link
Collaborator

Enabling detection of IBM i systems during source compilation
This was requested in issue #465

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces support for compiling the fping utility on IBM i systems running the Portable Application Solutions Environment (PASE). By adding an automatic detection mechanism to the configure.ac script, the build process can now dynamically adjust compiler and linker flags, ensuring compatibility and simplifying the compilation workflow for this specific platform.

Highlights

  • IBM i PASE Detection: Implemented logic in configure.ac to automatically detect the IBM i PASE environment during compilation. This detection enables fping to be built on IBM i systems by setting appropriate CPPFLAGS and LDFLAGS.
  • Build Configuration: When IBM i PASE is detected, the build system now includes specific include paths (-I/QOpenSys/pkgs/include), defines (-D_SIGSET_T, -DHAVE_STDLIB_H, -DIP_RECVTOS=0), and library paths (-L/QOpenSys/pkgs/lib) to ensure successful compilation.
  • Changelog Update: The CHANGELOG.md file has been updated to reflect the addition of IBM i PASE detection, crediting @acerbis and @gsnw-sebast for their contributions.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • CHANGELOG.md
    • Added an entry for IBM i PASE detection under the 'Next' release section.
  • configure.ac
    • Introduced a new AC_COMPILE_IFELSE block to check for the __PASE__ macro, indicating an IBM i PASE environment.
    • Configured CPPFLAGS to include /QOpenSys/pkgs/include and define _SIGSET_T, HAVE_STDLIB_H, and IP_RECVTOS=0 when PASE is detected.
    • Configured LDFLAGS to include /QOpenSys/pkgs/lib when PASE is detected.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gsnw-sebast gsnw-sebast linked an issue Mar 13, 2026 that may be closed by this pull request
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds detection for the IBM i PASE environment to allow fping to be compiled on that platform. The changes involve updating the changelog and adding a check in configure.ac. While the detection logic is sound, the compiler and linker flags being set can be improved for correctness and robustness. I've left a specific comment with suggestions to refine these flags.

@coveralls
Copy link

coveralls commented Mar 13, 2026

Coverage Status

coverage: 88.091% (+0.05%) from 88.037%
when pulling 3bffcc5 on gsnw:issue/465
into b862609 on schweikert:develop.

@gsnw-sebast
Copy link
Collaborator Author

@acerbis
I've implemented the improvements suggested by gemini-code-assist.
Can you test again to see if this works for IBM i?

@acerbis
Copy link

acerbis commented Mar 13, 2026

Does NOT work now (was working in the first attempt, just move the var defs before, prepending and not post).

-DHAVE_STDLIB_H is necessary because configure doesn't detect it apparently autonomously so compilation will fail.
-D_SIGSET_T is necessary to avoid double definitions (guard).
-DIP_RECVTOS=0 is necessary because some platforms doesn't have a setsockoptions possible with TOS

yes -DIP_RECVTOS=0 is clearly hackish but doesn't have big impact.

A more elegant way would be to have in fping a conditional to skip TOS releated code stuff for the platforms lacking TOS handling and then use such variable if TOS is present or not (i.e. like you did with PASE try in .ac to compile a source with IP_RECVTOS if the symbol is missing one would disable TOS support it).

my 2c

@gsnw-sebast
Copy link
Collaborator Author

I've put the old code back in, but the workaround using -DIP_RECVTOS=0 has been resolved here in the code.
Please test again.

The test scripts in the ci/ folder fail on IBM i when --print-tos is included in the command.

@acerbis
Copy link

acerbis commented Mar 16, 2026

Hello!
I confirm working. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

compile in PASE IBM i from sources

3 participants