Errors related to sa_sigaction
on AIX and How to Mitigate Them
If you encounter errors similar to the following, it is likely due to using an outdated crate version (such as jobserver
in this example). Please update your Cargo.toml
to use the fixed versions, e.g., jobserver
v0.1.33.
error[E0609]: no field `sa_union` on type `sigaction`
--> /home/buildusr/.cargo/registry/src/index.crates.io-d11c229612889eed/jobserver-0.1.32/src/unix.rs:399:17
|
399 | new.sa_union.__su_sigaction = sigusr1_handler;
| ^^^^^^^^ unknown field
|
= note: available fields are: `sa_sigaction`, `sa_mask`, `sa_flags
This kind of error can also occur if your code references sa_union.__su_sigaction
on AIX. In that case, update it to use sa_sigaction
directly instead.
This change is due to a recent update in the libc
crate, where sa_sigaction
is now defined as a direct member of struct sigaction
on AIX. In the AIX system header, struct sigaction
contains a union named sa_union
, which includes two members: __su_handler
and __su_sigaction
, corresponding to the sa_handler
and sa_sigaction
fields defined in the POSIX specification. Previously, the definition of struct sigaction
in the libc
crate mirrored this AIX structure directly, using the union. As a result, any Rust code referencing sa_sigaction
, whether in shipped crates or user code, needed to use sa_union.__su_sigaction
on AIX.
Other operating systems, such as Linux, also define a union for sa_handler
and sa_sigaction
within struct sigaction
. However, the libc
crate implementations on those platforms define sa_sigaction
directly as a member of struct sigaction
rather than within a union, which greatly simplifies the code.
To bring AIX in line with other platforms, we have updated the libc
crate's AIX implementation to define sa_sigaction
as a direct member of struct sigaction
. This change is included in libc
v0.2.171 and later. We have also updated the nix
(v0.29.0), jobserver
(v0.1.33), and signal-hook
(patch pending review) crates, along with relevant test cases, to reflect this change.
------------------------------
Xing Xue
------------------------------
Original Message:
Sent: Thu April 03, 2025 10:09 AM
From: David Tenty
Subject: IBM Open SDK for Rust on AIX - Community Edition Feedback
A migration tip: AIX support in the broader Rust crate ecosystem in under active development, so it's often necessary to move dependencies to newer versions when building for AIX to solve build issues related to limited support.
We maintain a list of crates for which IBM has contributed AIX support, and the versions where that support starts, in our official documentation here:
https://ibmdocs-test.dcs.ibm.com/docs/en/osfroa/1.84?topic=started-introducing-rustc-compiler
------------------------------
David Tenty
Original Message:
Sent: Mon March 31, 2025 01:17 PM
From: Adam D'Andrea
Subject: IBM Open SDK for Rust on AIX - Community Edition Feedback
Hi everyone,
If you've used our IBM Open SDK for Rust on AIX Community Edition for 1.84 (available for download at: https://early-access.ibm.com/software/support/trial/cst/programwebsite.wss?siteId=2171&h=null&p=null )
and have feedback or questions for us we'd be interested to hear it!
We'll also post in this thread to address some common issues you might be encountering.
Thanks,
Adam
------------------------------
Adam D'Andrea
------------------------------