NAS-139051 / 26.04 / Use annotations for public API methods (#17882)
`@api_method` decorator now accepts `check_annotations=True` for this
new behavior. The default is `False`, but we should eventually come to a
state where the default is `True` and this parameter will be remove
altogether.
What changes? First, each public method type annotation will be checked
to match the method's declared accept and return models.
Second: no more dict typing. If the API method accepts a pydantic model,
that pydantic model will be passed to it, not dict. This allows for IDE
autocompletion, static analysis, less AI coding agent errors.
As an example, I converted webshare plugin to this new behavior.
tools/cam: Start to add the testing tools for CAM
Create a directory for testing tools arond CAM. These are snippets of
what will eventually be camio. At the moment, it was written using fbt
traces. This is OK, but fragile, so they need to be re-written with the
cam provider. cam_all_but_scsi.d is the first step. It shows how to do
this with the new cam dtrace provider.
Sponsored by: Netflix
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D54472
cam: When inq data isn't valid, pass NULL
When the device isn't there, we don't have valid inq data. Pass NULL in
this case. All the routines that receive this test against NULL already.
Sponsored by: Netflix
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D54470
cam: Start adding dtrace provider 'cam'
Start to provide robust tracing in cam now that clang has broken my
fbt-based dtrace scripts a couple of times.
Sponsored by: Netflix
Reviewed by: adrian
Differential Revision: https://reviews.freebsd.org/D54468
[clang-doc] Serialize repository URL in Mustache templates
Location tags didn't handle possible `FileURL` fields when a repository
URL was specified in a clang-doc invocation. This also cleans up all
location occurences to use `<p>` instead of `<div>` and allows linking
to the repository URL.
[clang-doc] Don't serialize non-existant locations in HTML
The function template didn't check to see if a `Location` existed before
emitting the definition location line.
[clang-doc] Add protected members to class template (#174883)
There were already tags for protected members in the Mustache template,
but didn't use the proper tags for the newer JSON scheme.
[clang-doc] Serialize repository URL in Mustache templates
Location tags didn't handle possible `FileURL` fields when a repository
URL was specified in a clang-doc invocation. This also cleans up all
location occurences to use `<p>` instead of `<div>` and allows linking
to the repository URL.
loader: Only warn when we have neither FDT nor ACPI
Sponsored by: Netflix
Reviewed by: adrian, andrew
Differential Revision: https://reviews.freebsd.org/D54510
[libc++] Revert undesired `[[nodiscard]]` added to conversion functions (#173658)
Because
- no one should use them in explicit function call forms, and
- value-discarding casts to non-`void` are already diagnosed by Clang.
Also add explanation for this to `CodingGuidelines.rst`.
loader.efi: Only use SPCR if enabled.
SerialPort in the SPCR is zeroed when serial redirection is disabled,
rather than the SPCR being omitted from the ACPI tables ony many
systems. Check to see that SerialPort.Address is non-zero before using.
FreeBSD would fail to boot on systems that could have a serial port
redireciton, but don't have it enabled because the loader would create a
bogus hw.uart.console. While one could unset this value to boot, you
couldn't do that automatically very easily. Instead, don't even look
at the SPCR table if the SerialPort is zero'd.
PR: 292206
MFC After: 3 days
Sponsored by: Netflix
Co-authored-by: Warner Losh <imp at FreeBSD.org>
Closes: https://github.com/freebsd/freebsd-src/pull/1948
[clang][bytecode] Check for non-trivial default ctors in unions (#174745)
When activating a union member, none of the unions in that path can have
a non-trivial constructor. Unfortunately, this is something we have to
do when evaluating the bytecode, not while compiling it.
[NFC][PowerPC] fix IR to be splat and not zeroinitializer (#174699)
IR should be a splat of 7 as this compares vector of elements with 7
(`vec[i]!=7`). Having `zeroinitializer` goes against this comparison.
Co-authored-by: himadhith <himadhith.v at ibm.com>