Using select() to check whether a pipe is ready for writing seems to
fail on Mac OS X 10.8 and 10.9. See the PR for a small C program to
demonstrate. It's possible that the small program is broken and
there's no bug, but the program works on Linux and on Mac OS X 10.7
and 10.6.
Although poll() seems to work, switching completely to poll() is not a
good option on Mac OS X, since poll() does not support devices on that
platform.
The kqueue() facility seems to handle pipes and writing ok, so work
around the bug by enabling the use of kqueue() on pipes.
Closes PR 14596
Show the content of the buffer and the content of the temporary buffer
used to predict the size; then, I should be able to track down the
source of a mismatch.
This is the third try to fix the bug exposed by "fuzz.rkt". Previous
repairs addressed a symptom at the point of printing bad symbols,
instead of the cause at a failure to validate a symbol's encoding
when reading bytecode. This one fixes reading.
Commit 6a5a3037b4 was not quite right, because it used sightly the
wrong variant among a dozen decoding functions. The test suite caught
the problem, but I forgot to run it before pushing.
Also, repair the "Inside" documentation on the function that was
incorrectly used, and document the new variant.
Allow an effect-free `if` to not increment the effect-tracking
virtual clock (but increment the clock during branches, to avoid
moving computation into a branch).
Spend empty-`let`-elimination fuel more precisely, so that more
empty `let`s can be removed while still avoiding quadratic
compile times.
Convert
(let-values ([(<id> ...) (if <id-t>
(values <e1> ...)
(values <e2> ...))])
....)
to
(let ([<id> (if <id-t> <e1> <e2>)]
...)
....)
which duplicates the `(if <id-t> ....)` test, but that's likely to
be worthwhile to avoid multiple-values shuffling and enable more
constant and copy propagation.
A related improvement is to more eagerly discard `let` wrappers
with unused bindings during optimization, which could enable
further optimization, and allow moving conditionals relative
to other expressions to avoid intermediate binding.
Eagerly discarding `let` wrappers exposed a bug in the optimizer's
shifting of variable locations by exercising the relavant shifting
operation in shift_closure_compilation().
Closes PR 14588
While the commit comment in 3150b31eb7 still seems right, the changed
overlooked the fact that the arguments to a split `values` might get
reordered (due to the way binding positions are calculated). Fix the
optimizer to make sure that reordering is allowed.
The change touches a lot of code, because we want to use
"omittable" to implement "movable", and it's not ok to
reorder access of mutable variables (in case some other thread is
mutating them). We have to fix all the calls to "omittable"
to support the slight generalization.
The optimizer was willing to convert `(pair? (cons w (random)))` to
`(begin (random) #t)`, but not `(car (cons w (random)))` to
`(begin (random) w)` because the `(car (cons ....))` transformation
required simple ignored arguments. Put the treatment of ignored,
non-omittable arguments of a dropped operation in one place. Also,
recognize expressions within `begin` whose results will be ignored.
Windows parses relative-path links with yet another set of rules ---
slightly different from the many other existing rules for parsing
paths. Unfortunately, a few OS calls don't provide an option for
having the OS follow links, so we have to re-implement (our best guess
at) the OS's parsing of links.
While something like `(if 7 e1 e2)` was already reduced to `e1`,
this improvement makes `(if (let ([x (random)]) 7) e1 e2)`
reduce to `(if (let ([x (random)]) #t) e1 e2)`.
The previous build attempted to cooperate with Valgrind in a way that
truncates a 64-bit address to a 32-bit address. Disable Valgrind
cooperation. (Other builds seem ok for now, but future rebuilds will
disable Valgrind cooperation for them, too.)
Visual Studio 2008 is still supported by "9.sln" projects and
".vcproj" files, while ".sln" and ".vcxproj" work for 2010, 2012,
and 2013. The "build.bat" script detects which version of
Visual Studio is active and uses the appropriate ".sln" files.
The bad news is that we have two copies of each project until we
decide to drop support for Visual Studio 2008. (We had two copies
before, but one copy was unmaintained.) The good news is that
we have only 2 copies of each project, because recent versions of
Visual Studio are willing to use 2010 projects as-is.
Change project and related files to text instead of always CRLF,
because that seems to be ok for modern Windows tools.
Calling the default module name resolver with three arguments logs an
error message. The intent is that 3-argument support will be removed,
eventually.
Binary package installation failed in the case of collection
splicing, because module-name resolution via `collection-file-path`
did not check for compiled files along hte search path of
registered collection directories.
Use a recursive call to try again, instead of trying to reset local
state. The reset-local-state variant is definitely broken in
some caes, though I could not provoke the JIT buffer overflow
that I was hoping to fix with this change.
The optimizer's inference that could incorrectly that that a
conditional produced a flonum (when it actually produced a fixnum or a
fixnum in one branch and flonum in the other).
As in "Fixing Letrec". This improvement corrects a performance
regression with the revised expansion of R5RS `letrec`, which
wraps right-hand sides with `values`.
Besides detecting effect-free primitives, we have to fix the
treatment of the right-hand side for a multi-binding `letrec-values`
clause. For now, we conflate all of the bindings in a single
clause.
Fix some comparisions that are written as pointer comparisons
when they're actually integer comparisons. Also, remove an
unnecessarily slow variant of pointer compairson for x86_64.
On x86_64, the JIT compiler initially generates code with 32-bit
jumps, but it switches to 64-bit jumps when so much code is allocated
that it gets spaced out enough. That transition could happen during a
recursive call to the JIT compiler or while one place is in the JIT
and other installs a shared code pointer, in which case a bad jump
could be generated. This problem is unlikely to happen, but it looks
possible.
Generalize some of the tracking and optimization of predicates
with respect to constructors and bindings.
This generalization exposed an old bug in the optimizer, which is
that information accumulated in the "then" branch of a conditional
was not reliably flushed when continuing analysis after the conditional.
Logged messages could get dropped if a log receiver is specialized
to a name that is provided as an argument to `log-message` instead
of used from the target logger.
Add an option to `log-message` to avoid adding the name to the
start of the message string, which is needed to propagate messages
from one logger to another.
The bug incorrectly tracks the value that is available in virtual
register R0 --- only in the case that some value was known to be ready
in R0, and some other value was known to be ready in R1, and a value
is moved from R1 to R0.
Closes PR 14523
Building MzCOM without ATL means that Visual Studio Express --- or
other free compilers, in principle --- can build MzCOM. It also cleans
up and simplifies the build.
The non-ATL implementation is based on "Com in Plain C" by
Jeff Glatt, and uses a lot of his code (with instructive
comments intact).
The xform bootstrap sets `current-library-collections-path` without
changing the namespace, which is a bad idea that was exposed by
the module name resolved cache change (commit a7ad0e3a01).
The cache was keyed on `current-library-collection-paths`, but
not other parameters such as `current-library-collection-links`,
so it was too "sticky" in the case that some parameters changed.
Adjust the cache to be specific to loaded module in a namespace's
module registry.
Avoid polling a file descriptor to determine whether it has bytes;
just try to read, and then go to epoll/kevent mode when available,
skipping a poll/select.
Mac OS Classic and Palm ae long since unsupported.
TCP support implies sockets (since old Mac TCP is gone).
For what it's worth, make the build work without TCP support, although
no one ever builds that way.
In v6.0.1.7, I tried to give a port-flushing job to custodians. They
turned out to be unqualified, so let's try employing specialists.
Thanks to Eli for pointing out the problem with the v6.0.1.7 design:
attaching callbacks to custodians allows a sandboxed task to escape
through the custodian hierarchy. Plumbers avoid this problem by
having no hierarchy.
The bug was a kind of typo: using `&` where `%` was intended to
implement a counter wraparound.
This bug is an even more likely candidate to be resopnsible for the
occassional crashes from the DrRacket easter-egg test.
Commit 5ea4c2ab68 broke GCing of a thread that is blocked
via `sync` (as opposed to `place-channel-get`) on a place
channel whose write end is inaccessible.
I broke uses of LDRD and STRD when compacting the set of registers
used by the JIT. The LDRD and STRD instructions are given one
register explicitly, but they implicitly use the next regsister, too,
and the specified register must be even-numbered. Lining up a pair of
registers requires a little shuffling before and after the operation.
Also, the LDRDI and STRD encodings were broken, and the inlined
fl->fx conversion was not right.
Closes PR 14470
Split 'atomic-interior allocation to separate pages from other 'interior
allocation, and do not page-protect 'atomic-interior memory. Otherwise,
atomic-interior memory passed from one place to another --- especially
via the `#:in-original-place?` option on foreign functions --- can crash
due to triggering a write barrier in the wrong place.
Commit c18f6e8d6d, which changed some cross-place arguments to Pango and
Cairo to be 'atomic-interior, exposed the problem.
Merge to v6.0.1
When submodules were introduced, the handling of taint-transparent
syntax changed to keep its lexical context. Restore the original
behavior, which is necessary to protect bindings, and fix taint
handling on submodules.
Recent changes made use-before-initialization an error for
`letrec` bindings, `class` fields, and `unit` definitions.
Now, assignment-before-initialization is also an error.
Don't optimize away a use-before-definition in an early compiler
pass. (More specifically, adjust the meaning of a flag within an
optimization helper function so that it works for decisions before the
letrec-fixing pass.)
The bounding box in the Courier New font is wrong in Mac OS X
10.7 and 10.8. Recognize that combination and make the bounding
box bigger as a workaround.
* Fix a clipped-rendering problem for text in Cairo.
* Fix Pango's CoreText back-end to support non-BMP characters.
Note that Emoji characters still do not render. Cairo uses
CGContextShowGlyphsWithAdvances() to draw glyphs, but it
would need to use CTFontDrawGlyphs() to make Emoji work.
(Mozilla has a patch to do that for some older version
of Cairo, so look there if it seems worth doing one day.)
* Disable Pango's CoreText font fallbacks in favor of the
Racket-implemented fallback.
This is not obviously a good idea, but it restore the
`racket/draw` hack of prefering "Arial Unicode MS". Otherwise,
various symbol glyphs are chosen badly, such as #\u273A,
at least on my machine.
* Drop the clusters argument to `pango_cairo_show_glyph_string`,
which turns out to be unnecessary.
Mostly upgrades the drawing stack to the latest Cairo, Pango, Glib,
etc., but also upgrades the OpenSSL library on Windows to 1.0.1g.
The new "racket/src/native-libs" directory provides scripts to
rebuild the libraries from source. Those script are fragile, because
library sources and configuration scripts are fragile. The
scripts at least archive some expertise/advice in a mostly executable
form.
The bug particularly broke `#:async-apply` handling for an FFI callback,
causing the current thread always to be equated with the target thread.
For example, the teachpack documentation (which now renders images
to SVG) kept crashing on a multi-place build due to callbacks getting
invoked in the wrong place.
Invoking a non-composable, empty continuation during the right-hand
side of a variable definition skips the definition --- while continuing
the module body. The compiler assumes, however, that variable references
later in the module do not need a check that the variable is undefined.
Fix that mismatch by changing `module` to double-check that defined
variables are really defined before continuing the module body.
(The check and associated prompt are skipped in simple cases, such as
function definitions.)
A better choice is probably to move the prompt to the right-hand
side of a definition, both in a module and at the top level. That's
a much different language, though, so we should consider the point again
in some future variant of Racket.
Closes PR 14427
Improve the "can unbox test" to include patterns that were already covered
by the more restrictive "can unbox without disturbing N registers" test
(which is always tried first, but the weaker test recurs within patterns
that the stronger test does not recognize).
When the compiler sees `(if #f A B)`, it compiles A in a throwaway
mode, but the throwaway mode need to produce a slightly more plausible
result than it was so that further throwaway transformation is not
confused.
Note that even the movement of operations like `unsafe-fl+` is
constrained, since the operation can allocate. For example, a
continuation captured in
(let ([a (unsafe-fl+ x y)])
(call-with-composable-continuation ....)
a)
should return an `eq?` result. The compiler must not only refrain from
moving the `unsafe-fl+` call, it must not mark `a` as a flonum
binding, because that would cause the JIT to delay allocation of `a`
until the return site.
I'm running into stuck processes via `subprocess`, where the stuck
process is in malloc() for environment variables. I'm not really sure
of the problem, but moving that work before the fork() could
avoid problems related to pages or signal handlers.
Space used by GMP needs to be immobile, and the allocation path
on 3m still used a strategy of allocating page-sized blocks;
the GC now provides much better support for small, immobile
blocks.
The new `PLTUSERHOME` environment variable redirects all of the
user-specific paths reported by `find-system-path`.
Also, improve the tests for `raco exe` (particularly the bug
fixed in 6cb6f3fbf1) using `PLTUSERHOME`.
This change paves the way for JIT-inlining FFI operations
such as `ptr-ref`. Even without JIT treatment, the change
slightly reduces the overhead for calling FFI primitives.
When both branches of an `if` form can produce unboxed results, then
allow the unboxed result. Similarly, allow a `begin` form's last
expression to be unboxed.
This commit is a follow-up to e96d592735. The bug fixed this time is
more subtle, because the overflowing computation is never used, but
that doesn't matter in terms of avoiding undefined behavior.
Thanks for Pascal Cuoq and John Regehr.
Also, extend fixnum fast path to work more often in 64-bit mode.
More review would be appreciated to help ensure that the revised
implementation avoids undefined behavior in C.
On FreeBSD and related systems, calling localtime() on an out-of-range
value (e.g., where the year doesn't fit in 32 bits) still returns a
tm pointer, instead or returning NULL for an error. To avoid this
problem, restrict the argument to 51 bits (which seems like a lot
of bits, but is still confortably away from the overflow point).
Closes PR 14305
Incorporate a few x86_64 assembly routines from the latest GMP,
which provides a small speed boost for operations such as bignum
multiplication and division.
The warnings need to be suppressed only when compiling preprocessed
code during 3m compilation (because clang doesn't complain about
the relevant patterns when it knows that macros produced them).
Using MZ_INLINE on scheme_get_realint_val() and
scheme_get_unsigned_realint_val() leads to a link
error when using the current clang on Mac OS X 10.9.
Remove the MZ_INLINE declaration, since a modern C
compiler will inline, anyway.
When `dynamic-require` is used to access an export that isn't a
variable defined in the same module, `dynamic-require` falls
back to `eval` in a fresh namespace, which can be expensive.
The new fast path handles the case that a variable is re-exported.
The new fast path is relevant to deserialization, which now
uses a submodule that re-exports from an enclosing module.
Commit 5bae9773aa broke `chaperone-procedure` and `impersonate-procedure`
so that it didn't always produce a chaperone or impersonator. Also,
the arity-error changeds intended for that commit were not complete,
because tests were accidentally commented out.
The main repair involves a new internal property that keeps track of an
accessor that is used to extract a procedure from a field in a structure
type that has `prop:procedure`.
The main change is to add an option to `syntax-local-infer-name` to
select whether `syntax-local-name` is used, and to use the new option
to disable `syntax-local-name` for the function expression in a
keyword `#%app`.
Improvements in the expander/compiler generalize a previous repair.
Merge to v6.0
Fix various problems, including a bad result from `procedure-arity`
and problems with chaperones and arity error messages when a
structure's `prop:procedure` value is a keyword-accepting procedure.
Merge to v6.0
When a GC is needed for the shared space, a GC is triggered
in all places, and the places wait until each other place
has completed. However, the places also need to wait until
all other places are ready to *start* a GC; otherwise, a
place may be modifying a shared record while some other place
traverses it for a GC.
Closes PR 14229
Merge to v6.0
A hash-table size grew based on the number of key slots occupied,
instead of the number of value slots, where the two differ when
keys are added and removed in the table.
Thanks to Ryan for the example.
Seems to work for Mac OS X 10.9 (Mavericks), at least.
In Retina mode, a drawing unit corresponds to two pixels on
the screen or in a bitmap created by `make-screen-bitmap'.
In particular, a bitmap created by `make-screen-bitmap' is
actually twice as big in each dimension as requested, and the
bitmap is scaled when transferring to other drawing contexts.
When transferring onto the screen, scalings cancel so that the
result looks right.
Adds `get-display-backing-scale` to `racket/gui/base`, and
also `get-backing-scale` to `bitmap%`.
To do: add a way to set the backing scale of a bitmap. That
option will provide a way to give controls higher-resolution
bitmaps as labels.
Make sure it's at the end of the `raco setup` command line, and set
the executable name to "raco" instead of "raco setup" so that the `-l`
flag is effectively implied.
OpenBSD provides pthread_stackseg_np(), which directly reports
the stack-bounds information that Racket needs, so we can use
that instead of the approach used on other Unix variants. The
approach used for other Unix variants seems not to work for OpenBSD
because the stack location at the point that main() is called
is already significantly far from the stack base (on the order
of 100k on a 32-bit system in my test using OpenBSD 5.2).
A pipe's limit is supposed to apply only to unpeeked bytes, but
there were problems related to triggering further writes after
a peek, and also triggering further reads after a partial
write.
Avoids including the bit thet indicates whether the object
is GCable in the eq hash code (in a configuration where
bits are available in the GC header for hashing).
Closes PR 14059
Symbols in the PR were mapped to coliding hashes in
groups of 4 because the low 2 bits of the `eq?` hash
code were begin dropped to generate an `equal?` hash
code. Those two bits got lost due to a refectoring
a while back that moved the dropping of two useless
bits to a more centralized place, but the 2-bit shift
did not get removed from the `equal` hash code comparision.
The PR's example program will still generate groups of 2
when hashing around 10k symbols (which used to be groups of 8).
That's because there's a bit in the hash-code counter that
turns out to be forced to 1.
The problem mainly affected `register-custodian-shutdown`
from `ffi/unsafe/custodian`, which is used by `math/bigfloat`
and `ffi/unsafe/com`.
When a value is registered with a custodian, the value is held
weakly, but the shutdown procedure is intended to be held
strongly. At the C API level, the data associated with a shutdown
function pointer is intended to be held strongly.
A custodian itself, however, is retained weakly by other custodians
in its family, so that custodians can be GCed and their elements
transferred to a parent custodian. Since the custodian itself may
be held only weakly, the callback & data in a custodian was effectively
held weakly --- which, in turn, can break assumptions in code such
as `ffi/unsafe/custodian` that expects strong references to prevent
finalizers from running.
Fix the problem by registering a reference to callback data as
data in a custodian's finalizer, which makes the data strongly
retained no matter how the custodian is retained.
Bug found initially by Juan Francisco Cantero Hurtado. Reported by many.
Mark Kettenis (from the OpenBSD Project) found the real reason of the
crash and created this patch for libffi. Patch taken from OpenBSD Ports.
The `--checksum` argument's main use is that it lets you pick a specific
commit from a GitHub repository. More generally, it lets you simulate
a package-catalog result, which includes a checksum.
Also, adjust checking of downloaded checksums to ensure that they
match the expected checksum, as predicted by a package catalog or
by the `--checksum` argument.
Also, move remaining "srfi" libraries to "srfi-lite-lib".
In principle, "base" should depend on "scheme-lib" and
"srfi-lite-lib", and a new "base2" package would represent the new,
smaller base. But I don't think the window has yet closed on
determining the initial "base" package.
The "srfi" libraries moved to "srfi-lite-lib", instead of "srfi-lib",
to avoid creating many extra dependencies on "srfi-lib" and all of its
dependencies. The SRFIs in "srfi-lite-lib" depend only on "base",
and they are used relatively widely.
Having `__VFP_FP__` defined does not mean that VFP instructions are
available; it just means that floating-point is native-endian.
According to
https://wiki.debian.org/ArmEabiPort
the absence of `__SOFTFP__` combined with the precense of `__VFP_FP__`
can mean VFP, though.
The computations already existed in the built-in code, so moving
the functions reduces code duplication. Caching the values will
save a little time, but mostly it will avoid sandbox interactions
with the task of locating the main "collects" and "etc" directories.
This variable is intended to support machine-code tracing
experiments. To enable a dump of ranges on exit, both
define PLT_DUMP_JIT_RANGES at compile time and as an environment
variable at run time.
Document and adjust `hash-clear!', `hash-clear', and `hash-empty?'.
Also, add `hash-copy-clear'.
The clear operations are constant-time for a non-impersonated
hash table, otherwise they always remove keys one-by-one to
trigger the impersonator's interpositions.
The `hash-clear' operation works only on immutable hash tables,
in contrast to the original implementation. The new `hash-copy-clear'
works on both immutable and mutable hash tables. The "copy"
in its name is meant to suggest a difference with `hash-clear',
even on immutable hash tables: any chaperone on the input
is not on the outpue.
Change `set-clear' to be like `hash-clear', and add
`set-copy-clear'.
(Changes are in consultation with Carl.)
When an existing entry in the AVL tree for an immutable hash
is replaced with a new one, the new one did not always get
the right depth, which could throw off the tree balance.
Make the stack-safety margin twice as big for 64-bit platforms
as 32-bit platforms. That was already done for Windows, but it's
also needed for Mac OS X. Also, double-check that there's a
good amount of space on the stack before calling a foreign
function.
There was an off-by-one error in trimming overflow
records in a captured continuation.
I provoked the crash by running the program below on Mac OS X;
resizing the frame caused a crash. It has something to do with the
`try-atomic' implementation, I think. I wasn't able to make a test
case in a half-hour of trying, however, and I'm giving up for now.
(define f (new frame% [label "deep"]))
(define b (new button%
[parent f]
[label "0"]))
(send f show #t)
(let loop ([n 0] [m 0])
(if (= n 10000)
(begin
(send b set-label (format "~a" m))
(for ([i 10]) (yield))
(loop 0 (add1 m)))
(cons 1 (loop (add1 n) m))))
These comparisons are useful for sorting while avoiding the overhead
of conversions to bytes or strings.
Having `path<' reduces the cost of sorting in `directory-list'.
A launcher can have a ".desktop" file (found like other files: as the
same name as the main launcher file, but with a ".desktop" suffix),
where the "Exec" and "Icon" fields are added automatically. A ".png"
or ".ico" file can be supplied for the icon (where the ".ico" file
is already used for Windows launchers).
Closes PR 13953
Fix various problems with Unix-style install from an installer.
Also, add an ugly icon for the Racket Package Manager, with the hope
that it will provoke someone to create a nicer one.
The issue is that gcc and the Sun linker do not cooperate
correctly to implement thread-local variables on x86_64.
Since gcc is normally configured to use the Sun linker by
default, enabling places and futures is asking for trouble.
Fix SIGCHLD suspension for fork()-based file locks (i.e., Solaris).
Also, fix commit ea51d32e, which broke termination of process groups
where the main process terminated before the rest of the group,
because it used sigwait() before the terminate action.
Make the GC always use the mmap() block cache, since mmap() on Solaris
allocates much more than a page when a single page is requested.
Enable places and threads by default on x86 and x86_64.
Fix pthread-related compilation flags.
The range of values used to represent "improper lists"
of length 36 to 65 overlapped with the range of values
used to represent other things.
This bug is the new chapion of the "how did we not hit that
earlier?" category. The bug was introduced around v300, at
the latest.
The intent of disallowing `handle-evt?' arguments to `wrap-evt',
`handle-evt', and `chaperone-evt' was that those extra wrappers
break the tail-handling behavior that is almost certainly intended
when `handle-evt' is used. The extra checking was not obviously
worthwhile (we don't have any checked "this procedure should be called
in tail position" annotations, after all), and pushing the distinction
through Typed Racket looked particularly inconvenient.
Dropping the constraint is trivial if we say that wrapping a
`handle-evt' result disables the tail invocation of the handler
procedure.
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.
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.
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.
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.
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?'.
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
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'.
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.
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.
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.
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).
The "racket" directory contains a pared-back version of the
repository, roughly.
The "pkgs" directory everything else in the repository, but
organized into packages.