[clang][C23] Delay thread storage recovery for constexpr diagnostics (#236758)
When a thread storage specifier conflicts with another storage class,
DeclSpec clears it before diagnosing a C23 constexpr conflict. The
second diagnostic then reports "unspecified" and loses the specifier's
source range.
For a block-scope declaration:
Before:
```
a:2:22: error: cannot combine with previous 'register' declaration specifier
2 | constexpr register _Thread_local int x = 1;
| ~~~~~~~~ ^
a:2:3: error: cannot combine with previous 'unspecified' declaration specifier
2 | constexpr register _Thread_local int x = 1;
| ^
2 errors generated.
```
[13 lines not shown]
[Offload][AMDGPU] Return the real user count from getUserCount
This patch fixes the return type of AMDGPUQueueTy::getUserCount, which
currently returns bool: that collapses the count to 0 or 1, which upsets
the occupancy measurement in assignNextQueue.
A new test checks that work is queued appropriately across hardware
queues.
Assisted-By: Claude
[clang][Sema][NFC] Consolidate checking for vector reduction builtins (#238663)
Share argument conversion, element type extraction, and result type
assignment across the single-argument reduction builtins. Preserve each
builtin's element type restrictions and diagnostics, and reuse
getVectorElementType for fixed-size and sizeless vectors.
[NFC][OpenMP] Track Fortran OpenMP support status only in the Flang docs (#240917)
The Clang OpenMP support page had a "Fortran Status" column in its 5.2,
6.0 and 6.1 tables that was not kept up to date with the Flang page. For
OpenMP 5.2 alone it disagreed with flang/docs/OpenMPSupport.md on 13
rows (e.g. "if clause on teams", "otherwise clause" and "pure procedure
support" were listed as unclaimed for Fortran but are done in Flang).
Make the Flang page the only place Fortran status is recorded. The Clang
page now covers Clang (C/C++) and the LLVM OpenMP runtimes, whose status
applies to both languages.
[Offload][AMDGPU] Return the HSA queue as a queue's native handle (#241300)
Implement getNativeQueueHandle (introduced by #234186) for AMDGPU, so
that olGetQueueInfo can report OL_QUEUE_INFO_NATIVE_HANDLE for an AMDGPU
queue instead of UNSUPPORTED. The handle is the hsa_queue_t the queue's
stream is bound to; a stream is bound on first use, so querying binds
one if necessary. Several streams may share an HSA queue, in which case
their queues report the same handle.
Assisted-By: Claude
Log TrueSearch to its own file and keep SMB running in its tests
syslog-ng writes the messages of truesearchd and truesearch-indexer to
/var/log/truesearchd.log. The default log files no longer get them.
logrotate rotates the new file. test_475_syslog checks both programs.
The TrueSearch api2 tests created a second share with smb_share. That
asset stops the SMB service when it exits. Middleware then stopped
TrueSearch. The later tests found no daemon. A helper in the test
module now creates and deletes the second share. It does not stop SMB.
truesearch.query requires a path. test_legacy_api no longer calls it
without arguments.
Add truenas-truesearch to Build-Depends and rename the service
The package build runs alembic. Alembic imports every plugin. The
truesearch plugin imports truesearch_client, and truenas-truesearch
installs that module.
The service base checks the model names of the public methods. Each
name must start with the name of the service class. The models are
named Truesearch, so the class is named TruesearchService.
Trim the TrueSearch query-filters documentation
The description of query-filters now names only the filter fields
that are not in the results: macos_kind, tags and comment. The
validation errors give the fields, the operators and the choices.
The docstring of truesearch.query no longer refers to a list of
fields, operators and examples.
Replace the TrueSearch program with truesearchd
- The `truesearch` service runs two units, `truesearchd` and
`truesearch-indexer`. Samba uses `spotlight backend = truesearch`.
- Middleware writes `/etc/truesearchd/truesearch.conf` while the index
dataset is mounted. A dataset gets one `[target]` row if it holds an
SMB share with Spotlight search on or a WebShare share with search on,
or if it is mounted beneath such a share. Time Machine shares, home
shares and private datasets shares are not indexed.
- Encrypted datasets are indexed. A dataset keeps its index in a
disabled row while its shares are disabled, its share service does
not run, its pool is not imported, or it is locked. The index of a row
that leaves the file is dropped.
- A reload waits until both daemons release the datasets of the rows
that it disabled or removed. A dataset destroy, a dataset lock and a
pool export release the rows first. A pool import configures
TrueSearch.
- `.system/truesearchd` replaces `.system/truesearch`. On a data pool,
it is encrypted with the pwenc secret as a raw key. Middleware does
[17 lines not shown]
Keep the TrueSearch index on a data pool and replace mock tests
The boot pool cannot hold an encrypted dataset. The installer makes it
with compatibility=grub2, which leaves the encryption feature disabled.
So the system dataset spec has the TrueSearch index dataset only on a
data pool. TrueSearch does not run while the system dataset is on the
boot pool. There, unavailable_reasons gives only that reason.
The tables of the query filters are read-only mappings.
The unit tests used stand-ins for middleware. Now tests/unit keeps only
the tests of pure functions. The api2 tests use the system:
- The pwenc-encrypted dataset: its setup, the rekey of a configuration
upload, the pool unlock and the system dataset setup.
- The query refuses bad paths and paths that no index holds.
- The status while both daemons are stopped.
- A daemon that runs alone restarts with the other.
- Time Machine and home shares are not indexed.
Remove the TrueSearch warning from the SMB search_protocols docs
The description of search_protocols in v27 and v28 is again the text
that it had before TrueSearch. The WebShare search field keeps its
warning.
Move the query-filters documentation into the API modules
The import contract of the API schemas does not allow an import of
truesearch_filters. The truesearch API modules took the limit and the
query-filters documentation from it. Each API version now holds them
as text. truesearch_filters keeps the Spotlight attribute and the
choices of each field. A unit test checks that the current API
documents each field and each choice.
Return the file handle from truesearch.query
- Each entry has `handle`, the ZFS file handle of the file encoded in
base64, as `open_by_handle_at` takes it. `generation` is removed,
because the handle holds it.
- `truesearch_client` builds the handle from the inode number and the
generation that truesearchd returns.
Use truesearch_client for the TrueSearch file and sockets
- The plugin writes and reads `truesearch.conf` through
`truesearch_client.config`. It asks both control sockets and waits
for a release through `truesearch_client.control`.
`middlewared/utils/truesearch.py` is removed, and its tests move to
the client.
- truesearchd and truesearch-indexer answer `status` with `ok` and a
JSON object. `truesearch.status` reads the object through the client.
Before, it read lines of `key=value` fields.
- The free space is `null` when the indexer cannot read it.
- The plugin imports `truesearch_client` when it loads. The
`middlewared` package depends on `truenas-truesearch`, which installs
it.
- The docstring of `truesearch.query` marks its literals with double
backticks. Each line of the `TruesearchQueryOptions` docstring ends
with a period.
- This change needs the TrueSearch change that adds these client modules
and answers in JSON. Both changes land together.
Leave the TrueSearch index dataset out of pool unlocks
The pwenc secret encrypts .system/truesearchd. Its key is not in the
database. The system dataset setup loads it. A recursive pool unlock
at boot or at failover also tried the dataset. It had no key, so the
unlock logged a failure.
encryption_roots now skips an encryption root whose keylocation is
the pwenc secret. So the pool unlock, its summary and the pool import
leave the dataset alone. PWENC_KEY_LOCATION moves to
middlewared.utils.pwenc, where the ZFS code can import it.
Name the index dataset in the TrueSearch status
The descriptions of index_bytes, free_bytes, space_low and index_size
now name the index dataset and not the system dataset. The index
dataset is .system/truesearchd on the pool of the system dataset.
The dataset status no longer has queue_position. The API does not
expose the queue of the indexer.
Rewrap the index key on a config upload and trim TrueSearch docs
The pwenc secret encrypts .system/truesearchd. A configuration from
another system brings another secret. That secret replaces the
secret of this system at the next boot, and the index dataset then
did not unlock. When the uploaded secret differs, a config.on_upload
hook now wraps the key of the index dataset with the uploaded secret.
ZFS reads the new key from the uploaded file. The key location is
then set back to the pwenc secret file. So the dataset unlocks after
the boot and keeps its indexes. Only the node that has imported the
pool does this. A dataset on the boot pool is not encrypted.
The API docs of TrueSearch no longer name the query options that
truesearch.query does not have. The description of handle says what
the handle is for. The WebShare search description is again the text
that it has on master. The comment on the default socket of the
Samba backend is gone.
Expect the Reports folder in the Spotlight access test
test_the_user_does_not_find_what_the_user_cannot_open searches for
names that start with "report". The search ignores case. Thus the
folder Reports is a hit too. The test now expects the folder and the
file in it. The private file is still not a hit.
Fix TrueSearch times, service gates and system dataset handling
truesearch.query:
- A stat time that datetime cannot hold, such as a year after 9999,
is null. One such file no longer fails the query. A time is not
rounded into the next second.
- A list of the indexed datasets that was read across a configure or
a mount serves one query and is not kept.
- "/mnt/" is refused, as "/mnt" is.
- A recursive query as a user skips a directory that is gone. A user
who cannot reach the path gets a CallError with EACCES.
- A date filter gives a year of four digits. A date outside the years
1 to 9999 in UTC is a validation error.
- The method docstring no longer describes parameters. The username
field says that the user must be able to access path.
The service:
- configure() logs a start, restart, reload or stop that systemd
reports failed. It then does not wait for released datasets. It
[19 lines not shown]
Expect a ValidationError for a regular expression filter
truesearch.query raises one ValidationError when its query-filters
do not convert into a Spotlight query. test_query_filters expected
ValidationErrors for the "~" filter, so the test failed. Query
options that the model does not have still raise ValidationErrors.
[libc] Use a syscall wrapper for symlinkat (#241205)
This PR move symlinkat behind the centralized syscall wrappers,
following libc/docs/dev/syscall_wrapper_refactor.md.
[libc] Use a syscall wrapper for symlink (#241204)
This PR move symlink behind the centralized syscall wrappers, following
libc/docs/dev/syscall_wrapper_refactor.md.
[libc] Use a syscall wrapper for linkat (#241203)
This PR move linkat behind the centralized syscall wrappers, following
libc/docs/dev/syscall_wrapper_refactor.md.
[libc] Use a syscall wrapper for getsid (#241202)
This PR move getsid behind the centralized syscall wrappers, following
libc/docs/dev/syscall_wrapper_refactor.md.