install|upgrade: tell that --fetch-only only downloads
The summary of a --fetch-only operation was the one of a real operation:
it asked to proceed with "this action" and announced the space which would
be freed or required, although nothing is installed, upgraded or removed
and only the packages are downloaded.
Say so in the summary, ask to proceed with the download, and leave the
space announcement out. Add pkg_jobs_get_flags(), the counterpart of
pkg_jobs_set_flags(), to let the frontend know about the flags of the
jobs.
Reported in #2716.
install: resolve the ownership in the root directory
The users and groups of a package were resolved with getpwnam(3) and
getgrnam(3), which read the database of the host: a file declared as
belonging to a user of the root directory pkg installs into was given the
id the host knows for that name, or 0 when the host does not know it at
all, so the files were not owned by their user in the target.
Read the user and group databases of the root directory instead when pkg
installs into one, and keep resolving on the host when the files are not
there or do not carry the name. pkg check, which resolves the names the
same way, compares against the right ids too.
Reported in #2179.
fetch: retry a transfer which fails in the middle
Only the connection set up was retried, FETCH_RETRY times per server, so a
connection which died in the middle of a large package aborted the whole
transaction and the bytes already downloaded were dropped.
Retry the transfer itself, the same number of times, resuming the package
where it stopped: the archives are opened for appending and the request is
ranged, which is the mechanism already used to resume a package left over
by an interrupted run.
Reported in #2786.
geom: Restore group operator
Traditionally, in BSD, the operator group has been intended for backup
operators and has been granted read-only access to disks and related
devices. This includes geom.ctl, because backup operators need to be
able to dump partition tables.
Unfortunately, the geom.ctl device previously lacked proper access
control, and anyone with read access to it was able to modify GEOM
configuration, including modifying or destroying partitions, RAID
volumes, etc. As a workaround, the ownership of geom.ctl was changed to
root:wheel so that only users who presumably already have root
privileges were able to access it.
Now that access control has been implemented, we can restore the
original ownership so backup operators can once more dump partition
tables.
This reverts commit 7d576f1d657fc21f97cedc28cc971621ee2490a7.
[CIR] Shorten the #cir.fenv parameter names
Rename the #cir.fenv parameters dynamic_rounding_mode, except_mode and
strict_except to rounding, except and strict, so a constrained op prints as
fenv<rounding = tonearest, except = unknown, strict = true>. The fields stay
optional with the same meaning and defaults; the OrDefault helpers follow the
new getter names. No functional change.
Assisted-by: Claude Code (Opus 5.5).
[CIR] Give complex FP add/sub the fenv memory effects
cir.complex.fadd and cir.complex.fsub were Pure even with a constrained
fenv attribute, so they could be speculated or erased like unconstrained
ops. Derive them from CIR_FenvOp, as the other fenv ops are: constrained
ops read and write the FP environment and are only conditionally
speculatable, unconstrained ops stay effect-free.
Assisted-by: Claude Code (Opus 5.5).
[AMDGPU] Expand AS6 prefetch addresses during selection (#245568)
Keep 32-bit constant addresses through SelectionDAG lowering so the
scalar prefetch selector can fold nonwrapping offsets. Widen the address
after any wrapping arithmetic has completed.
Assisted by: GPT 6.2-Sol
[Clang][OpenMP] Fix declare variant calls to member functions
When a declare variant is selected for a call to a member function,
ActOnOpenMPCall built the call to the variant from the original call
treated as a CXXMemberCallExpr, through a '.' MemberExpr. That is wrong
in two ways:
- A call to a member function is not always a CXXMemberCallExpr. Calls
to static member functions, and member calls in a template (even with
non-dependent arguments), are CallExprs with a MemberExpr callee.
The existing dereference of a CXXMemberCallExpr would crash on e.g.:
template <typename T> struct CT {
void m_v(T);
#pragma omp declare variant(m_v) match(user = {condition(1)})
void m(T);
void use(T t) { m(t); }
};
[6 lines not shown]
[Clang][OpenMP] Add code generation for the dispatch construct
I had previously made a start on dispatch directive support (#126914)
but saw that another implementation was underway (#117904, then #131838)
so stopped to avoid duplicate effort. Now it seems that the latter
effort stalled, so I've tried to synthesize the two patches together
into a new version (with Claude's help).
The resulting patch implements code generation for the 'dispatch'
construct, with its 'novariants', 'nocontext' and 'depend' clauses.
Other features ('device', 'adjust_args', 'append_args') are still TBD.
Sema builds the alternative forms of the associated statement
that the clauses select at run time, and stores them as children of
OMPDispatchDirective: one with the target-call replaced by a call to the
base function ('novariants'), and one with it replaced by the variant
selected without 'dispatch' ('nocontext'). Codegen emits the dispatch
region inline and selects between them:
[9 lines not shown]
[CIR] Reject the empty fenv attribute
`#cir.fenv<>` with no parameter set was accepted, printed as `fenv<>` and
lowered to a constrained intrinsic, so an unconstrained operation had two
spellings. Give `#cir.fenv` a verifier that requires at least one
parameter, leaving a missing `fenv` attribute as the only way to say an
operation is unconstrained. An absent parameter takes its value in the
default FP environment (tonearest, masked, non-strict). Speculation,
lowering and VecFCmpOp::fold share one FenvAttr::canIgnoreExceptions()
check (masked and not strict): such ops are speculatable, lower to
fpexcept.ignore and fold, and a strict op stays fpexcept.strict even when
masked. Drop FPEnvConstrainedOpInterface, whose only user was FenvOpTrait,
and let the trait read the attribute from the concrete op. Add a
CIR_FenvOp base class carrying the fenv traits and argument, which the
fenv ops prepend their operands to.
Assisted-by: Claude Code (Opus 5.5).
NAS-145364 / 28.0.0-BETA.1 / middleware: strengthen path handling (#20280)
Paths that an unprivileged user may control are opened with safe_open,
safe_open_raw and safe_makedirs from truenas_os_pyutils, which refuse a
symlink anywhere in the path, and a FIFO, socket or device node before
opening it.
- rsync: create and chown ~/.ssh/known_hosts through symlink-refusing
fds; cap the known_hosts read at 4 MiB
- ssh-keyscan: pass "--" before the host
- user: read authorized_keys with safe_open, capped at 1 MiB; unlink it
through a symlink-free .ssh fd
- filesystem.mkdir: chmod, rmdir and listxattr through fds; compare .ssh
by component
- NFS: refuse export paths that exportfs would rewrite
- nvmet: a FILE namespace must be a symlink-free regular file in a data
pool
- SMB: path_suffix and dataset_naming_schema must stay beneath the share
- filesystem.set_zfs_attributes: callers without FULL_ADMIN are limited
[10 lines not shown]
[MLIR][OpenACC] Add acc-loop-collapse pass (#245448)
Collapse each multi-dimensional scf.parallel inside an
acc.compute_region into a one-dimensional scf.parallel. The original
induction variables are recovered with remsi and divsi. Reductions are
carried over by mlir::collapseParallelLoops.
The collapsed loop keeps all discardable attributes of the original
loop, such as acc.par_dims, acc.gpu_block_redundant and acc.chunk_size.
The pass sets acc.collapse_count to the number of collapsed dimensions,
which remark emission reads. Loops outside an acc.compute_region are
unchanged.
/bin/sh - minor DEBUG mode extension
This is a DEBUG mode only change, it does not affect any
shell built normally (nothing built by the NetBSD build
machinery) in any way -- the whole file being changed is
effectively #ifdef DEBUG and (in sh builds) DEBUG is
never defined (except by me, and perhaps, one day, someone
else.)
This adds a (trivial) mechanism to allow sh debug mode trace
files to be placed in some other directory than "." -- mostly
so it is possible to run a DEBUG compiled shell with debug
enabled while running ATF tests, without the trace file being
removed ("cleaned up") by ATF as soon as the test finishes.
NFC for any normal shell. Definitely no pullups.
/bin/sh - source code maintenance
KNF (including kreNF and 80-col police).
One grammar fix in a comment.
Some small DEBUG mode enhancements (more info dumped),
NFC for any normal shell. Definitely no pullups.
[NFC] Add lit.local.cfg to SPIRV test directory (#245588)
The SPIR-V tests run opt with -mtriple=spirv64, and since #244345 their
checks depend on the SPIR-V TTI. In a build without the SPIR-V target,
opt falls back to the generic expansion and the checks fail. Mark the
tests unsupported in that case, as the other target directories here do.
Assisted by: Cursor
Co-authored-by: Cursor <cursoragent at cursor.com>
[CIR] Shorten the #cir.fenv parameter names
Rename the #cir.fenv parameters dynamic_rounding_mode, except_mode and
strict_except to rounding, except and strict, so a constrained op prints as
fenv<rounding = tonearest, except = unknown, strict = true>. The fields stay
optional with the same meaning and defaults; the OrDefault helpers follow the
new getter names. No functional change.
Assisted-by: Claude Code (Opus 5.5).
tests/bin/sh/t_expand.sh - minor cleanups (NMFC)
These changes make several minor changes to the layout
of the source file, more than anything else.
There are 3 kinds of changes (repeated throughout)
1. Use ' quoting rather than " quoting for the strings
used as the value of the ATF descr variable for each
test. This allows $ and " to be used in those strings
without requiring \ escaping, making them easier to read.
Also, drop meaningless leading/trailing spaces in these
strings, they don't use C string concat, which simply abuts
the contents of the strings, but more like sh "$*" which
puts spaces between the strings when joined into one.
2. Consistently write multi-line sh function definitions as
func_name()
{
[23 lines not shown]
src/tests/bin/sh - add a source code maintenance script
The sh tests contain many sets of tests which, when one fails, reports the
number of the test which failed (along with symptoms, actual code, ...) as
part of the failure log. Those numbers match numbers inserted as comments
with the tests, to allow the actual test to be more easily found (there tend
to be many which differ in just small details, hunting for the correct code
can be time consuming and error prone).
Until now, keeping those (comment) numbers correct has been a manual process,
itself almost as likely to fail as any of the tests the numbers are intended
to help identify.
This script (which has a very limited scope, just the shell ATF test sources
- and not even all, or even a majority, of those) will create a modified
version of the source code with all the comment numbers corrected. That
can then be compared with the unmodified version, and if all looks good,
replace it.
[14 lines not shown]