Although not documented as such, the implementation used to return
form did not take the special meaning of #f into account. It seems
better to fix `syntax-local-lift-context' to match its documentation.
The `--enable-portable-binary' flag disables optimizations specific
to the build machine's processor that may ne unportable to other
machines.
This also fixes a problem where a VirtualBox runs on an x86_64 machine
with AVX support, and so `congure' enables AVX operations, but AVX
doesn't work within a virtual machine.
Specifically, set/c no longer behaves as a flat contract, so it is necessary to
apply at least one set operation to detect a contract error on an element. It
is possible the flat behavior can be restored for some kinds of sets, but it's
not immediately obvious what kinds those should be. (Immutable hash sets in
particular? Any sets that don't implement set-add! or set-remove!?)
The 'start-menu? aux key for launcher creation changed to 'start-menu,
with a real-number value indicating a request and precedence for
auto-launching (where a precedence is needed because only one application
can be auto-launched).
The "repo-time-stamp" collection used to be omitted from a
release, but to keep things simpler, it's staying in the
"drracket" (and therefore "main-distribution") package. The
build process installs an empty `build-stamp' value (by default)
into a release build, or it installs a useful stamp for
a non-release build.
Also add "gui-pkg-manager" packages, including a "Racket Package Manager"
GUI application (that needs a better icon).
The package that supplies "Racket Package Manager" is not in the main
distribution, since DrRacket already includes the GUI package manager.
An installation has a name (via the configuration file "config.rktd")
that defaults to the version string. The name, instead of the
Racket version, is used for forming the path to the user "collects"
directory, user packages, and so on. The `user' package scope is
thus user- and installation-name-specific (instead of user- and
version-specific).
Remove `shared' package and link scope, since the notion of
installation names generalizes the concept (a set of installations
can be given the same name) and fits it into `user' scope.
Added four macros to racket/generic:
- chaperone-generics
- impersonate-generics
- redirect-generics (dynamically chooses between the above two)
- generic-instance/c
All take pairs of method names and wrappers (procedures or contracts),
and turn those into appropriate chaperone, impersonator, or contract wrappers
on the method tables of the given structs.
Used this to rewrite set/c to give better error messages.
Sets are now implemented as a generic interface, and lists count as sets. Most
of the set functions have been added as methods, including mutable versions of
imperative update methods.
The definition form and function consume an equality predicate and optional hash
code functions and key predicate, and produce predicates and constructor
functions for hash table-based dictionaries using the given equality and hash
functions. Immutable, mutable, and weak dictionaries are defined.
- Added hash-empty?, hash-clear, and hash-clear! for hash tables.
- Added dict-empty?, dict-clear, and dict-clear! for dictionaries.
- Made all dict functions exported by racket/dict into generic methods; turned
the existing implementations into fallbacks.
The #:dispatch option specifies a second, less strict predicate for a #:defaults
or #:fast-defaults clause. The main predicate is still used for the generics
group's type predicate, but the dispatch predicate is used in choosing which
method implementation to use. The #:dispatch option is useful when the dispatch
predicate is disjoint from all other instances, is significantly cheaper to run
than the main predicate, and the full checks can be meaningfully deferred in
method implementations.
Specifically, this is useful in the implementation of iteration for
association-list dictionaries. The dict-iterate-{next,key,value} functions do
not need to test (andmap pair? dict) if the given dict is eq? to the one stored
in the given iterator. The dispatch predicate, list?, is much cheaper.
The #:defined-predicate option is like #:defined-table, but it defines a
two-argument predicate that only processes the requested method name and doesn't
allocate a hash table each time it is called.
Method implementations provided via #:fallbacks, #:defaults, and #:fast-defaults
are now called directly by method procedures rather than stored in a vector and
extracted by index. This should hopefully improve inlining for methods.
For datatypes that are disjoint with structs that might implement the generic,
this adds a "fast path" implementation that doesn't need to test for struct
properties.
This work is in preparation for widening the interface of gen:dict with
operations like dict-for-each, dict-update, etc., each with a fallback
implementation. The property prop:dict, with its documented, fixed-length
vector representation, cannot be extended, whereas a generic with optional
methods can be.
The define-generics form can now derive existing struct properties, so that any
instance of the new generics group is also an instance of the struct property.
Previously, a failure during the first-order checks would print out the name of
the full contract for all the methods, while describing the value for just one
method. This is both misleading, and incredibly verbose. The new version
prints out just the relevant contract.
These flags allow a package downloaded in "built" form to be
stripped to source or binary form, which allows a single catalog
to serve three kinds of installations.
The "share" directory holds platform-independent files, while
"lib" holds platform-specific files.
In principle, the "collects" directory belongs in "share",
as does "doc". Those directories are put into "share"
by a Unix-style install, but left at top level for an
in-place install.
Packages in installation scope are put in "share" instead
of "lib", and the top-level Makefile puts development links
in "share/devel-pkgs".
The `configure' script now supports `--docdir' and `--collectsdir'.
Changed the version to 5.90.0.1.
In consultation with Sam, partially reverts efba034e01. The default
module name resolver uses `planet/resolver' for the build-in
`(planet ....)' form. The `raco planet' command is still in
"planet-lib", though.
A package like "gui" does not depend on a package like "gui-test",
which means that you have to specifically ask for a test package if
you want the tests. A new "main-distribution-test" package
aggregates the tests for packages that are in "main-distribution".
The "plt-services" package, meanwhile, depends on the
"main-distribution-test" package, which means that all tests are
compiled by default for an in-place build.
Specifically, in the case when the arrow is of the shape
(-> any/c ... any), then the predicate didn't ensure that
there were no mandatory keywords in the given function
Specifically, this change disables the use of inotify() for detecting
changes to collection-links files, because the latency is too large
on some (many?) Linux configurations. (The fallback is to detect changes
to a links file by reading the whole content every time.)
Create a single inotify() connection per place, which should reduce
the latency of operations on filesystem change events and make
them generally scale better on Linux.
Internally, add a filesystem-never-changes mode, which could be useful
for platforms with fixed filesystems, but it's also for experiments in
checking the cost of filesystem change events.
Use SHA1s instead of timestamps for detecting dependency changes,
which works with pre-built documentation. (The problem with
timestamps didn't come up before because dependency checking was
broken.)
Some non-transparent but serializable data structures broke
the comparison between previous and new outputs, which caused
too many document rebuilds.
Includes a change to make module path indexes work with `equal?'.
Added tests using define/generic in both #:defaults and #:fallbacks, both inside
modules and at the top level. Changed the implementation of define-generics so
that defaults and fallbacks come after method definitions so that define/generic
works properly. Changed internal names to be created with format-id and
syntax-local-introduce rather than generate-temporaries so that they work at the
top level.
The `mzlib/compile' module re-exports the moved function.
Also, fix `make-directory*' so that it never fails on an existing
directory. Remove `unstable/file', since it was just the same
clean-up of `make-directory*'.
The #:fallbacks option specifies a set of method definitions. Each definition
is used for any value that does not support the specific method. Like
allows define/generic and absent method definitions. If neither a specific
implementation or the #:fallbacks clause defines a given method, the normal
runtime error is raised. The #:defined-table option reports whether a value's
specific implementation supports a method; the presence of a #:fallbacks
implementation for a method does not change this result.
Specifically, implementations for the #:defaults keyword in define-generics can
now use define/generic to get at the generic implementation of a method for
which a specific implementation is defined locally. Also, unimplemented methods
are handled properly now in #:defaults. Previously, an unimplemented method in
a #:defaults specification would go into an infinite loop if applied, because
the implementation for the specific type wound up referring to the generic
implementation of the method.
A lot of the back-end implementation of generics changes in this commit:
- The new module racket/private/generic-methods provides a uniform mechanism for
defining method tables and recording static information about generics
groups. Both #:methods in [define-]struct and #:defaults in define-generics
use this framework now. In addition, generics based on existing properties
such as gen:stream, gen:equal+hash, and gen:custom-write now use the struct
from this module to store the names associated with the generics groups.
- Generic methods now expand directly into functions with the appropriate arity,
and refer directly to the appropriate argument to perform generic method
dispatch. The previous implementation used procedure-reduce-keyword-arity to
restrict the arity dynamically, and used list-ref to find the generic
argument.
- Some error messages have changed slightly; hopefully for the better, but this
change did require some changes to tests for specific error messages.
Now the primitive generics form just defines generics with their properties and
methods, and the surface-level form calls the contract definition form
directly. This means the primitive generics form now requires an explicit name
for a struct property accessor, so that the same name can be used for the
contract.
In the few cases that used this option, the only definition needed from the
private define-generics macro was gen:<name>. This is easy to define directly
without using the macro, so I have changed the code to do so and avoid redundant
definitions of methods.
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
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'.
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.
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.)
GC during allocation of a pair, weak box, ephemeron, or
weak array went wrong if the GC-notification callback
allocated any of those kinds of things.
(Bug found by running tests in GC-stress mode.)
Remaining are:
- parts of unit200 that Matthew plans to remove.
- the `mzscheme` implementation itself.
The implementation of `mzscheme` has been moved
to the `mzscheme` collection (from the `racket` and
`scheme` collections). The `scheme/mzscheme`
language, which was undocumented, has been removed.
This is slightly backwards-incompatible, because
the `xform` handling of precompiled headers now
evaluates code in a `racket/base`-like namespace,
instead of in a `mzscheme`-like namespace.
I'm not sure why a problem with the "package closure" operation
didn't create problems earlier for `raco setup' --- or maybe it
did, but they're difficult to see.
Also, reduce redundancy in reporting of reasons for dependency
mismatches (but keep multiple reports of the same missing
dependency but for different reasons).
Report packages that have no dependency declarations as "warnings"
(to stdout instead of stderr).
Report specific information when a dependency is discoeverd missing,
insteda of reporting it only in verbose mode.
The new `--no-pkg-deps' or `-K' flag skips the check.
If a module in package X refers to a module in package Y, check that
package X declares a dependency on Y. Note that package X must
specifically depend on Y --- not another package that at the moment
happens to declare a dependency on Y.
A new "base" package represents the content of the core (so that, if
the core shrinks, a new "base2" can represent the smaller core).
Most every package now needs a dependency on "base".
Sometimes, it makes sense for X to access Y when X declares a
dependency on Z, because Z promises to always depend on Y. For
example, the "gui" package is defined to combne "gui-lib" and
"gui-doc", so it's appropriate to use the modules of "gui-lib" when
depending on "gui". A package's "info.rkt" can therefore define
`implies' as a subset of the dependencies listed in `deps', which
means that depending on the package implies a dependency on the listed
packages. (It's even possible for packages to mutually imply each
other, which is why the dependency checking code ends up with a
union-find.)
Dependency checking distinguishes between run-time dependencies and
build-time dependencies: anything listed in a ".dep" file is a build
dependency, at least. To imply a run-time dependency, a reference must
appear in a bytecode file's imports, and not in a subdirectory or
submodule that would be pruned for a binary package.
The `--fix-pkg-deps' flag attempts to automatically fix package
dependency declarations (i.e., modify a package's "info.rkt" file)
based on inferred dependencies.
The problem with allowing `(require string-constants)' in an
"info.rkt" file is that "string-constants-lib" is a package that might
not be installed. Removing it allows any "info.rkt" file to be loaded
with just the core.
Strings constants were used for `textbook-pls' and
`drscheme-language-positions' entries. To enable access to string
constants for those specifications, DrRacket now recognizes
`get-textbook-pls' and `get-drscheme-language-positions' as
module path plus symbol specifications.
Also, fix up conflict checking in `raco pkg install' so that ".zo"
files without source do not count as provided modules unless an
"info.rkt" declares `assume-virtual-sources' (which is where we
got into trouble, again, with `string-constants'), making it
consistent with the way that `raco setup' removes ".zo" files.
Use `PKGS' with the top-level makefile to select packages for
a development-mode build. The default is "main-distribution",
which includes all packages in "pkgs".
Making them "etc"-relative intercts badly with redirecting
a configuration to override just a few values --- such as
the links path, which is what `make core' needs.
* Clarified bogosity of toplevel .gitignore (and other such files)
* Removed "doc/" in the toplevel file -- looks like this was some broken
leftover, and it's dangerous for at least "scribble/doc" (which
contains code).
* Collapse more common patterns into worksp instead of in each file.
* Use a trailing "/" for directories.
* racket/lib/collects/pkg/.gitignore looks like a leftover that is no
longer needed.
A package's "info.rkt" file should define `collection' as a
string to name a single-collection package's collection, or as
the symbol 'multi to declare the package as multi-collection.
If `collection' is 'same-as-pkg, then the package name is used
as the collection name.
The default for `collection' is 'multi for now, but the intent
is to change the default to 'same-as-pkg after a conversion
period. Also, support for a `single-collection' definition remains
in place, but it wil be removed.
Allow the location of the installation-specific "links.rktd" file to
be specified in "config.rktd", and also allow extra link files to
be provided.
Allow the same for package directories.
The main file/directory in each case corresponds to the file/directory
that can be modified by an installation-scope install. Extra files
or directories in a search path supports constant links and libraries
that are shared across installations --- like "/usr/lib" versus "/lib".
The 1-second granularity of filesystem timestamps is not
good enough to deetct changes to the file --- especially
when `raco pkg' installs links and runs `raco setup' (in
the same Rcket process), in which case a newly installed link
might not be detected.
The longer-term repair is probably to add file-changed
events to Racket (based on `inotify' and similar interfaces
provided by OSes).
A collection declares release notes with a `release-notes' field in
"info.rkt".
The "doc" directory is now populated exclusively by generated content,
instead of having a static "release-notes" directory (and a "keep-dirs.rktd"
file to record the static directories).
Keep track of the out<n>.sxref timestamps, so that `raco setup'
can detect when the database is out of sync (instead of assuming that
it's always in sync with out<n>.sxref files).
The "racket" directory contains a pared-back version of the
repository, roughly.
The "pkgs" directory everything else in the repository, but
organized into packages.