The main result is that `path->selative-string/library' now generates
"<pkg>/..." strings.
To make that possible, minimal support for reading the
installed-package database moved to a new `pkg/path' library.
To make that possible and avoid poetntial problems from concurrent
reading and writing of the database file, `racket/file' now provides
`call-with-atomic-output-file', which implements the write-and-move
dance that CM uses for compiled bytcode (i.e., `with-compile-output').
The new function is used to write links and installed-package files.
Finally, `racket/base' provides the new function
`call-with-default-reading-parameterization', which is used to guard
various file `read's to make them consistent and avoid security holes.
Use `filesystem-change-evt' (where supported) to detect changes to
collection link files.
Add "static root" as a new kind of collection root directory in links
files. A static root directory is assumed to not change (in terms of
its collection subdirectories) as long as the links file itself does
not change.
Propagate the notion of static roots through `raco link' and `raco pkg
install'.
Change the `pkg-links' makefile target to install static links
instead of plain links.
The result of all of these changes is to cut 25%-33% of the
time for `racket -l racket', bringing it back in line with
the pre-package-reorganization time.
The `filesystem-change-evt' function takes a path to a file
or directory and returns an event that becomes ready when
the file or directory changes (conservatively, so false
positives are possible).
These events are supported on Linux, Mac OS X and other BSD
variants with kqueue(), and Windows.
This is a variant of the bug fixed in
49fbca5b18,
where a GC-notification callback still
could cause problems in a GC during a finalization
callback.
(Bug found by running tests in GC-stress mode.)
A foreign procedure's data could get GCed before the procedure
was called, if the procedure is not otherwise reachable.
(Bug found by running tests in GC-stress mode.)
In the case that a case-> type included a case with a *
domain and had additional branches, a use of `apply` with
that type would fail to report a type error. This was
because the type of the applied list was ignored for type
error generation.
Closes PR 13893