The implement of `free-id-table' uses `identifier-binding'
to decide on a symbolic name as a key for each identifier,
but `identifier-binding' doesn't provide enough information
for local and top-level bindings. The new `identifier-binding-symbol'
function provides that information.
Closes PR 13911
(plus one new file to act as a driver for
running the whole test suite)
Beyond the obviousness of this cleanup, it also helps me
test the contract system without having to load any code
that depends on it (making the test cases far more useful
when I'm breaking low-level parts of the contract system
(like ->))
They're now stored as relative (if possible), instead of always
as absolute. When transitioning from old paths to new paths,
the old ones need to be purged explicitly.
More generally, `LINK_MODE' controls how the `PKGS' value is saved
or restored: "--save" saves the value (the default), "--restore"
uses a previously saved value (if any), and "" disables saving or
restoring.
The `again' target recurs to `in-place' with `LINK_MODE=--restore'.
Documentation for a user-scoped package is rendered inside a
collection path but moved outside of the collection path when
later installed in installation-wide, so it's important to
try a destination-relative path first.
In many cases, `path->collects-relative' is used instead of
`path->main-collects-relative' to generalize existing support
for collection-relative paths.
I was going to use this extension to implement `path->module-path',
but it turns out that `path->module-path' already exists and in
a form that works with packages. Still, this extension might be
useful in the future.
A path that is not relative to the enclosing file can show up
due to cross-module inlining. Package-based modules do not have
a good relative path to "collects", which creates trouble for
distributing compiled modules where, say, `map' was inlined.
It might be possible to keep the path in module-path-index form
so that a path can be constructed appropriately at run time, but
it's much simpler to just punt on function source locations in
this relatively rare case.
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.