When using `compound-unit/infer` and similar, check the `link` clause
against each unit's static information for initialization dependencies.
Also, propagate dependency information in `define-compount-unit`.
Racket wasn't reparsing correctly; the strategy worked ok
for links created by `mklink`, but not with other tools that
leave the "printed name" field blank.
A consequence of various fixes is that reparse points like
"My Documents" (in a typical configuration) correctly resolve
to actual paths like "Documents".
Finally, `directory-exists?` didn't handle root directories like
"C:/" correctly. The query would actually report properties of
the OS-level current working directory, and when junctions are
involved, the current directory can be a link instead of a directory.
Relevant to PR 14950 and PR 14912
Unlike `collapse-module-path`, it makes sense for
`collapse-module-path-index` to convert a relative module path index
to a plain module path. In other words, `collapse-module-path-index`
can convert a module path index to a module path.
be equal?-based contracts instead of = based contracts.
Before this change, the contract (or/c 1 2 +nan.0) was the same
contract as (or/c 1 2), because +nan.0 was the same contract as
the predicate (lambda (x) (= x +nan.0)), which is the same as
(lambda (x) #f). Now, +nan.0 and +nan.f are the only numbers
that are treated as equal?-based contracts, but this means that
(or/c 1 2 +nan.0) actually accepts +nan.0.
A `this%` expression used in a finalization callback implicitly
referred to `this`, since it's a dynamic reference to the object's
class. As a result, the finalizer for `this` refers to `this`, so
`this` never becomes collectable. The problem is fixed by
lifting the `this%` out of the `lambda`.
Less significantly, the finalizer thread in "prepared.rkt" captured
various parameters on creation, including the current namespace. If a
prepared statement is bound to a module-level variable, then the
finalizer thread refers through the namespace to the prepared
statement, so the prepared statement can never be finalized. Setting
the current namespace to a fresh empty one while creating the thread
avoids that specific problem. (Other parameters could cause similar
problems, but solving the namespace one works well enough for now.)
Optimization can cause a `lambda` that was going to refer to a
top-level variable or syntax object to not refer to it after all.
Ideally, the prefix should be dropped from the closure, but
the change here is more conservative: it fixes the `lambda`s
annotation that's used by the GC to indicate that nothing will
be used from the prefix.
For GC purposes, if a "prefix" (a closure frame that caprues
top-level or module-level bindings) may refer to syntax objects
that are not used by any reachable closure, in which case the
syntax object can be dropped. This pruning of syntax objects
uses the infrastructure already in place to prune variables.
Syntax objects were not included in the original pruning
implementation, because they are unlikely to create
finalization cycles in the way that global-variable
references can. A syntax object can retain a namespace's
table of module imports, however, which can be substantial
and worth releasing of a closure is only held, say, for
a low-level finalization action.
Although names were cleared correctly, the trie used for
the mapping was not pruned correctly, so lots of empty
branches could accumulate (especially in 64-bit mode).
Even when `(variable-reference-constant? (#%variable-reference ....))`
cannot be optimized to a boolean, the expression should not retain a
reference to the enclosing namespace. That space guarantee is
important for the compilation of calls to keyword-accepting functions.
The handling of `for-template` imports by `namespace-attach-module`
didn't match the docs. The actual handling was to refrain from
attaching instances of a phase-0 module if the instance was reachable
only through a `for-template`. The rationale had to do with such
modules instances being created only through instantiation of
phase-1 modules, and phase-1 module instances aren't attached;
it doesn't work well that way, though, when different modules
are attached with intervening `namespace-require`s on the target
namespace.
The change includes a documentation correction. Previously and still,
only modules at the same phase as the attached module (as opposed to
the same phase or less) are instantiated in the target namespace.
Closes PR 14938
Document and and exploit that any fragment in the Git or GitHub URL
for a package source must name a branch or tag (as opposed to a
commit) to work with clone linking.
When a clone-linked package is updated, a temporary extra clone
is created to checkout the target commit for dependency and conflict
checking.
The current strategy for cloning a repository doesn't work for some
Git versions. The problem is that the target commit is unlikely to
be reachable from any current branch or tag, and so it might not
get carried along in the clone (depending on the Git version).
Originally, a `git fetch <commit>` compensated for that problem,
but fetching a particular commit doesn't work for all Git versions,
either.
The new strategy is to clone with `--shared`, which ensures that
just-fetched commits are all available in the temporary clone (and
it also avoids a little unnecessary copying work).
If a file or directory delete fails, try adjusting the file or directory
permissions to allow writes, then try deleting again. This process should
provide a more Unix-like experience and make programs behave more
consistently.
A new `current-force-delete-permissions` parameter provides access to
the raw native behavior.
Check for an empty path after dropping `"`s, instead of before.
Otherwise, a bad PATH setting interferes with functions like
`find-executable-path`, which in turn can prevent DrRacket from
starting up.
Closes PR 14930
Instead of introducing a subtype of `file-dependency` to imply one new
option, add a subtype that has an options table for easier
extensibility. (Thanks to Sam for pointing out that I shouldn't make
this mistake again.)
If module M in package P imports module N from package Q,
and if N has a `lazy-require` for a module in R that is
triggered during the compilation of M, then P doesn't really
depend on R; P depends on Q, and Q depends on R, and P
shoudn't necessarily know anything about Q. At the same time,
a change to the file in R means that M must be recompiled.
So, continue to track the compilation dependency, but mark
it as "indirect" so that the package-dependency checker can
ignore the dependency.
If the slow path has to be taken because the number of
list elements is greater than the stack size, then the
old implementation would copy all the arguments --- which
still might be too much for the available stack space.
Avoid that copy.
Also, add pad word to the end of the stack to help detect
overflow.
Not really sure about this one. The API kind of
forces my hand here and the way this works limits
the non-dep side of the dependent pair to always
be drawn from a fixed set. Not sure if that matters
in practice or not.
For example, reduce (begin x (error 'e) y) ==> (begin x (error 'e)) and
(f (error 'e) y ) ==> (begin f (error 'e)).
Also, reduce (if (error 'e) x y) ==> (error 'e) and propagate the type information
and clocks when only one branch produce an error.
If the clone directory's checkout includes a target commit, then
use the clone directory directly for staging (i.e., for checking
dependencies and collisions). That way, changes made locally are
used for metadata checks.
before this commit it would copy them only when the weren't
already impersonated/chaperoned, leading to different
contract checking that can be confusing in that case
it did this because the chaperone-of? check wasn't general
enough to cope with copying always, but since commit
b05d07ad10 it now is
- Modify the features used by OpenBSD (not everything was
tested). Mostly copied from Linux, FreeBSD and NetBSD.
- Add support for Bitrig, a fork of OpenBSD. Eventually
they will differ more and more from OpenBSD.
- Typos and extra trailing spaces.
- Update config.guess and config.sub from GNU.
Unintentional shadowing caused the info-domain clean-up code to reject
all PLaneT path registrations. As a result, installing a PLaneT
package removes all info-domain mappings (used to find documentation,
`raco` commands, etc.) for other PLaneT packages. Running `raco setup`
repairs the problem, because it re-adds all entries after
(incorrectly) clearing them out.
A table was incorrectly used to track both the checksum and
update status of packages; fix that, so that `raco pkg update --all`
doesn't generate a plan with multiple updates of a single package.
Meanwhile, also protect against multiple and inconsistent planned
updates of a package (by collapsing multiple consistent plans into
one).
In the case that packages are only auto-installed in a particular
scope, `raco pkg show` should just say "[none]", instead of adding the
note about auto-installed packages that are not being shown.
The implemented default for `raco pkg update` actually depended on the
way that a package is installed, and it's difficult to reason about or
to implement the default that is suggested by the documentation.
Meanwhile, `search-ask` seems the most sensible always in interactive
mode (now that we have a way to specify batch mode).
When updating a linked package whose dependencies have changed,
and when a dependency is missing, then effectively reinstall
the link to get updates as requested by the user.
The implementation of caching stack-trace information in the
stack didn't work right in libunwind mode, with the result that
`(current-continuatiom-marks)` took O(N) time for a continuation
of size N, when it should be amortized constant time.
If "sqlite3.dll" is installed as a foreign library but shouldn't
be, then `raco setup` cannot simply deleet the file, because
starting `raco setup` opened the DLL. To avoid that problem,
rename the file to start with "raco-setup-delete-", then attempt to
delete the renamed file; the delete won't work, but the file
will be moved out of the way, and a future `raco setup` can
clean up.
The prefix "raco-setup-delete-" thus becomes special on Windows for
the directories that hold foreign libraries, shared files, and
man pages, because `raco setup` will try to delete any file
that starts with "raco-setup-delete-".
It's all very ugly, but I don't have a better idea for the
problems that I keep hitting.
Restore (but in a hopefully better way) a step that installs native
libraries before trying a full `raco setup`, since the libraries
may be needed for the setup proces --- especially on Windows.
* `raco pkg show typed-racket` now shows just the "typed-racket" pkg.
* `raco pkg show --rx typed-racket` shows all packages that match the
regular expression "typed-racket".
* `raco pkg show` now only shows the first 8 characters of checksums
unless you provide the `--full-checksum` argument.
The "Resolving..." status reports are meant mainly to indicate when
network access is happening. Don't print in advance when a local
catalog is being used, but do print when a local catalog provided the
answer.
The `path->pkg` funciton shouldn't return the name of a package that
isn't installed, including a case-folded version of a package that is
installed. On Windows, where we match case-normalized paths, we have
to work a little harder to map a case-normalized path element to the
installed package name, given that package names are case-sensitive.
Closes PR 14861
A value-printing truncation discovered after a stack-overflow handle
and return could go badly, because the truncation escape wasn't
reset correctly after overflow handling (in contrast to truncation
discovered during the overflow handling, which was handled correctly).
Closes PR 14870
Packages that are installed as other than a link are not meant to be
edited, but work can get lost if a package is edited and then removed
or updated. Avoid that work loss by moving removed or updated packages
to a trash folder.
By default, the trash folder holds up to 512 packages for up to 48
hours. To disable the trash folder (for a given scope), use
raco pkg config --set max-trash-packages 0
(I expect that some variant of Greenspun's rule predicted the eventual
inclusion of "backup" management in the package system.)
For example,
raco pkg update --clone my/clone/test-pkg
raco pkg update my/clone/test-pkg
will check for updates in the second case, not change the installation
to a directory link.
The linked package cannot be updated, but maybe its dependencies
can, so just alert the user that the linked package is skipped
instead of rejecting the request.
In other words, suggestion conversions in the non-clone direction the
same as conversions in the clone direction. As a way of disambiguation
the right direction, the non-clone direction is only suggested for
sharing that is immediately discovered from the command-line arguments
(as opposed to sharing that becomes apparent as other packages are
updated or installed via dependencies).
Since `begin0` at the bytecode level always evaluates an initial
expression in non-tail position, we don't have to work so hard
to ensure that an extra expression sticks around.
Move begin0 inside begin, for example
(begin0 (begin X Y) Z) ==> (begin X (begin0 Y Z))
Try to replace more begin0 with begin when the first expression is movable
Drop the begin0 when it has only one non omitable expression that preserves
the continuation marks.
Allow a "file://" URL to specify a type that causes the path
to be installed as a link or static link. A type query like
that is mainly intended for use in a catalog, where a catalog
of local directories could create links as needed for other
packages (that might be pulled from other catalogs).
For some reason, I previously made the package manager parse file URLs
by stripping away "file://" and treating the rest directly as a
path. Maybe it was to support relative paths, or maybe it was to
implicitly disallow query and fragment parts of the URL, but it seems
like a terrible idea; I've switched to `string->url` plus `url->path`.
As a result, parsing now implicitly allows and ignores query and
fragment parts of a "file://" URL. That's intended as a feature,
allowing extra information to be attached to a path in, for example,
a catalog.
The source to the split packages is in repositories under the
`racket` organization on GitHub. The repositories are all named
according to the pkg name, except for multiple-package
repositories such as `racket/compiler` which is named based on the
old directory name without the `-pkgs` suffix. Thus
`pkgs/compiler-pkgs` -> https://github.com/racket/compiler
The Makefile has also been adjusted to pull packages from the
catalog when you type `make`. This currently relies on some tricks
that will break if you try to specify a particular set of `PKGS` on
the command line. We plan to improve this soon.
The packages in `pkgs/racket-pkgs` and `pkgs/base` are staying in
the repository, since they logically belong with the core code.
The `plt-services` package is still in the repository, but will
move out soon.
The combination of `--lookup`, `--clone`, and `--catalog` can provide
a one-step path from a snapshot's built implementation of a package to
a repository-linked clone, for example. In that situation, however,
`raco pkg` will have limited ability to detect that packages
originally drawn from the same repository are consistenly installed as
clones (and we can revisit if it turns out to be an issue).
The optimizer converts (car (cons X Y)) to (begin0 X Y) and then reduces
it to (begin Y X) if X is movable.
Check that the movement is safe for space and for continuation captures.
When continuation C2 extends continuation C1, C2 shares the copy
of the internal stack with C1. It needs to skip the bit of
C1's stack that corresponds to arguments to `call/cc`, though.
That skipping assumed that `call/cc` takes 1 argument, but it can
take 2. The bug broke `racklog`, which captures continuations using
its own prompt. (It seems like there should be a simple test that
is independent of Racklog, but I couldn't construct it.)
Meanwhile, the continuation shouldn't retain the arguments to
`call/cc`, so clear them. (That was easy to test.) Sharing still
has to compensate for the locations of the arguments, though.
With the wrong namespace, then installing and updating a package
within the GUI package manager would not pick up an info-domain
change for the updated package.
Fix the "self" argument propagation through an impersonator that has
no redirection function (but that probably has impersonator
properties).
Closes PR 14852
The new library provides a way to force a user-specific documentation
etry point into existence. Normally, that would happen when a package
with documentation is installed in user scope. After the entry point
exists, then it sticks around even if all user-scope packages are
removed. In some cases, it may be useful to force the entry point into
existence as if packages had been installed and removed.
(This might be useful for avoiding a quarantine on installed
documentation files on Mac OS X, or a trampoline might be better.)
When packages A and B have the same Git repository source, and
when at least one of them is linked as a repository clone, then
the package system doesn't require A and B to both be linked or
both be linked to the same clone... but that can lead to confusion
for users. The package manager now detects this situation and in
many situations can update non-clones to make then clone links
at the same repository.
When a package is installed via a catalog, and the source provided
by the catalog is a Git repostory, then allow `--clone` to use
that repository when just the package name is given.
Using `--clone <dir>` with a Git-based package source causes the
package installation to be linked to a clone of the repository
as a subdirectory of <dir>. The package can be developed locally
in the usual way with Git tools, but `raco pkg update` can itself
pull updates to the package/repository.
See the new chapter 6 in "Package Management in Racket" for
more information.
a more dynamic notion of failure
use that to try harder with and/c contracts. In particular,
the contract system now tries to generate the arguments
on their own and then uses the other arguments to filter
(when they are all flat contracts, of course)
closes PR 14832
The new variants pass a "self" argument to the wrapper procedure in
the same way that `{impersonate,chaperone}-struct` provides a "self"
argument to redirection procedures.
A large message that hasn't been delivered can trigger a inter-place
GC. The intent is to force a GC to avoid messages piling up that can
never be delivered, but the GC didn't adjust to a state where messages
stay both undelivered and uncollected, and it would continuosly
trigger GCs. Trigger a GC only if the pending-message size has grown
relative to the previous GC.
Add 'auto alias for 'sslv2-or-v3, both of which now mean
"negotiate a reasonably secure protocol version", where
"secure" excludes SSL 2.0 and 3.0 (since POODLE).
Some expression movements are limited by the possibility of retaining
a value in a way that interacts with space safety, but primitives that
return immediately shouldn't get in the way of those movements.
When a variable X is bound to an expression that implies properties of
other bindings, and if X is used only once and can be replaced by
its value expression, then further optimization of that expression must
not assume the properties that are established by evaluating the
expression.
Also, don't move expressions past unsafe operations, since the expression
might implicitly guard against unsafety.
Closes PR 14819
I think that `-static-libgcc` didn't solve any problems with gcc
3.7.x, but with 3.8.x, divdi3() shows up, and that leads to
a "libgcc_s.dll" dependency unless `-static-libgcc` is used.
I don't see a reason to include `(find-dll-dir)` in the result of
`(get-lib-search-dirs)`. It's practically always redundant, and
including it causes problems for sandboxes --- since `(find-dll-dir)`
must inspect the Racket executable on Windows and Mac OS X, and that
access is normally not allowed by a sandbox.
Fix various configuration problems, and make the build work with 3m
(probably for the first time).
The repairs include corrections for the manual link table, but also
switch Cygwin to relying on normal DLL exports, instead, to work
properly with the FFI.
The `--enable-shared` comfiguration option is no longer required for
Cygwin. When it is used, the `gracket` launcher does not work right,
because the Cygwin DLL is in the "bin" directory and "gracket.exe" is
in the "lib" directory. Along similar lines, stand-alone executables
won't work with `--enable-shared`.
The change to `ffi/winapi` makes it match the documentation.
These two functions allow the creation of relays that receive events
on logger B where there are interested receivers for logger A.
Based on comments from Tony Garnock-Jones.
With the new propagation-filtering support, CM's accomplice channel
doesn't need a receiver that accepts all events, and so less logging
logging work will be triggered during compilation.
Events to propagate to a parent are described in the same way
as events to receive for a log receiver. The default is still
to propagate all events to the parent, which corresponds to
a propagation specification of 'debug.
Making a propagation-filtering specification built-in, instead of
allowing arbitrary filter functions, keeps `log-level?` efficient and
avoid hooks that might be implemented by untrusted code.
The optional callback argument was added (by me) in f2d87085. This is
a backward-incompatible change, but allowing an arbitrary callback
on a logger now seems like an especially bad idea; forms like
`log-error` otherwise work in constrained contexts, while an arbitrary
callback function allows potentially untrusted code in those contexts.
Meanwhile, the addition doesn't satisfactorily solve the original
problem, since it intereferes with `log-level?` and similar filters.
There seems to be a problem in kqueue() on Mac OS X for watching for
FIFO write availability, where adding a read event for the same FIFO
(at a different file descritor) can disable the write event.
Merge to v6.1.1
If a write to a non-blocking descriptor fails, then try again
with fewer bytes, since nothing in the spec write() seems to
promise writing partial amounts. In particular, writing to
a FIFO no Mac OS X might fail even if there are a few bytes of
space; as it happens, the select() function seems to compensate
and claim that such a FIFO is full, but kqeueue() doesn't.
The check that the current meta-continuation matches the captured one
would always fail (I think), since the current meta-continuation is
pruned on capture. Keep a weak link to the original meta-continuation
to enable detection of capturing a continuation that matches or
extends one that was previously captured.
Enabling sharing exposed a problem with the code that saves
continuation marks for partial sharing, since that implementation
became out of sync with the main implementation (so merge the
implementations).
avoids piling up redundant instanceof/c contracts
This is not a general purpose solution, but instead a hack that covers
certain hopefully likely patterns of redundant contracts for objects.
This commit looks for redundant contracts according in a slightly more
general pattern than just "is the most recently attached contract
stronger than the one I'm about to put on here and does it have the
same blame labels?", because that predicate isn't good enough to cover
the example below. In the example below, we repeatedly get the same
contract put on an object, but with different blame labels. So we need
to drop "inner" contracts. That is, when we have two contracts on
there and we go to add the third, we can tell that the second one
would no longer ever signal blame, so we can keep just the first in
the third.
More concretely, if we had these two contracts on 'v' with the given
blame labels (higher lines means the contract is "outside" or applied
later and the blame labels are in positive/negative order):
(-> x y) <c,d>
(-> x y) <a,b>
then the two possible blames we get here are blaming d for a non-x
argument and blaming a for a non-y result. And now lets say we add a
third contract to the stack that's a copy of the first, but possibly
with different blame labels:
(-> x y) <e,f>
(-> x y) <c,d>
(-> x y) <a,b>
Now we can blame f for non-x argument and a for a non-y result, both
of which are things covered by the first and third contract, so we can
safely drop the middle one and use this stack:
(-> x y) <e,f>
(-> x y) <a,b>
The example above is couched in terms of arrow contracts, but this
commit doesn't do this for arrow contracts, it does it for
instanceof/c contracts.
And also the way that we tell that the inner contract is redundant
isn't that it is equal; instead we use contract-stronger?. In
particular, the above reasoning works, I believe, when we have that
the inner contract is stronger than the one we're removing and when
the outer contract is also stronger than the one we're
removing. That's the check that actually happens in the code.
-------
The code below is the example below is an example Asumu sent me (but
with the TR parts stripped out). Before this commit, the contract
wrapping grows without bound, but with this commit it stays constant.
In the example below we get only two different sets of blame labels
(and equal contracts) and thus are actually more contracts that could
be eliminated, but this commit does limit it to just two contracts. (I
think it could be alternating between one and two contracts instead of
always two if the code that dropped the contracts were more clever.)
#lang racket/base
(module State racket/base
(require racket/contract racket/class)
(define state/c
(recursive-contract
(class/c
[m (-> any/c (instanceof/c state/c))]
[n (-> any/c (instanceof/c state/c))])))
(define state%
(class object%
(super-new)
(define/public (m) (send this n))
(define/public (n) (new state%))))
(define (tree-next o) (send o m))
(define (make-tree) (new state%))
make-tree
(provide
(contract-out
[tree-next (-> (instanceof/c state/c) (instanceof/c state/c))]
[make-tree (-> (instanceof/c state/c))])))
(require (submod "." State))
(require racket/sandbox)
(with-limits #f
100
(let loop ([o1 (make-tree)] [n 0])
(printf "~a\n" n)
(define o2 (tree-next o1))
(loop o2 (add1 n))))
When calling a wrapper procedure for a field accessor or mutator,
provide the structure that was originally passed to the accessor or
mutator, instead of the value that was wrapped to create an
impersonator.
This is a backward-incompatible change, but I can't find any uses of
that initial argument to the wrapper procedure. Also, a wrapper can
capture the original value in its closure, while passing "self" allows
wrappers that are sensitive to overridden impersonator properties.
The OS doesn't necessarily react to a zero-sized buffer the way
that `udp-receive!` is supposed to work, so provide only a
non-zero-sized buffer to the OS.
Use the `net/git-checkout` library to support git repository servers
in general, instead of supporting only GitHub. A HTTP(S) source is
treated as a repository source when it ends with the ".git" suffix.
The new argument is needed to reliably write to a tmp file, for
example, where the existence of the tmp file prevents other processes
from using the same name.
Git-based hosting services most commonly support the smart HTTPS
protocol, which carries "git://"-format payload in a fairly straightforward
way. (Supporting the dumb protocol looks much more difficult.)
The `net/git-checkout` library implements enough of `git clone` to
extract a tree from a repository that is accessed via the "git://"
protocol. It doesn't preserve a local clone, and it attempts to
download only the slice of the repository that is needed for the
requested tree (depending on how the tree is referenced).
In particular, a #f argument can make sense if the length is 0.
Technically, a byte string's byte array is supposed to be nul-terminated,
but many uses of byte strings get away without that terminator. I've
adjust the documentation to note that `bytes-copy` will work with a
non-terminated byte string.
Merge to v6.1.1
The fixup is not allowed to changed the virtual
address of a SHT_PROGBITS section, so a expanded
".dynstr" section might have to be moved to a
virtual address after everything else.
This bug could result in weird "cannot re-define a constant: lifted.0.2"
errors, or probably even worse collsisions of definitions, but I think
only in a namespace created from `module->namespace`.
So far, I haven't been able to create a reasonably small test,
because so many things have to line up in just the right way.
Merge to v6.1.1
If you set the locale to something like "us_EN.1252", then
"1252" was returned as the encoding, but "CP1252" is more likely
to be recognized by `bytes-open-converter`.
Also, document representation information on paths. In particular,
explain that Unix and Mac OS X paths are natively byte strings, while
Windows paths are natively UTF-16 code-unit sequences. The byte-string
representation of a Windows path is a UTF-8-like encoding of the UTF-16
code-unit sequence, which is why it makes no sense to convert it using
the current locale's encoding.
The `--enable-natipkg` configuration option adds "-natipkg" to the
platform library subpath. The suffix is intended to trigger the
installation of packages that supply native libraries for supported
platforms (where 64-bit Linux is the supported platform, for now, for
main-distribution packages), instead of relying on libraries installed
via the OS's package manager.
The intended client for "-natipkg" is the package-build service, where
installing packages via the OS package manager would require network
access and either trust or constrained installations. The build
machine is intentionally disconnected from the network and can only
access Racket packages, so repackaging native libraries as Racket
packages makes those libraries accessible.
A disadvantage of this approach to installing native libraries is that
it creates work for implementers of packages that access native
libraries. Those implementers will have to supply packages for 64-bit
Linux versions of native libraries to the degree needed to build and
(eventually) test the package. An advantage of the approach is that it
requires no changes to the package system; it will be cheap to replace
this approach if we find a better way to deal with native libraries
and/or OS packages in the package-build service.
Generalize `udp-send-to`, etc., to try each possibility of
a resolved address (instead of just the first one) like
`udp-connect!` does. This matters, for example, when using
"localhost" as an address, when the machine resolves "locahost"
to both "127.0.0.1" and "::1", and when the socket is created
for the second one that would be tried.
Also, detect and discard asynchronous ICMP errors.
The closure could be allocated as uninitialized memory with the
expectation that it would be filled right away, but boxing values
to put in the closure could expose the uninitialized memory to
the GC. Fix the problem by boxing before allocating closures.
This avoids mysterious errors later in the build process related to
TR and static-contracts. I don't see how the pattern-expander code
could possibly cause the errors that occur, but this commit fixes them.
On Windows, a "soft link" or "junction" is different from a
"symbolic link". The current Windows documentation is
incomplete in that it describes the behavior of GetFileAttributesEx
for a symbolic link, but not for a junction, and I guessed wrong.
For consistency, junctions need to be treated like symbolic links.
The `racket/draw` library is now independent of the screen resolution
on Windows. Font sizes in "points" are the only place where the
resolution mattered before, and now `racket/draw` assumes a
traditional 96dpi on Windows and Linux (and a traditional 72dpi
on Mac OS X).
Setting the scale for "text and other items" in Windows now adjusts
the backing scale of screen and canvas-compatible bitmaps, as well as
setting a scale on canvas drawing. Window and screen positions and
sizes are similarly scaled; for example, if the screen is 2048x1436
with text scaled by 200%, then `racket/gui` reports the display size
as 1024x768 (and the display backing scale as 2.0).
Backing scales of 1.25 and 1.5 are common for Windows. Rounding
associated with those scales could cause trouble for virtual -> actual
-> virtual conversions.
by making the equal, eq, and regexp contracts all have
an extra field to hold the name. This mostly has the advantage
that flat-named-contract has to turn a flat contract into it's
predicate a bit less often
(as requested by Asumu)
A witness accessor or mutator is still required to create a structure
chaperone, but `#f` can be provided in place of a redirection, and
then impersonator properties can be attached to the chaperone.
At the same time, adjust `(chaperone-of? v1 v2)` so that `v1` as a
chaperone is not required to preserve non-redirecting chaperones of
`v2`.
The overall consequence is that a redirection procedure can cooperate
with a (suitably protected) impersonator property to override
redirection behavior without running afoul of the chaperone invariant
and without requiring O(N) space for O(N) overrides. For example, the
contract system can implement the re-application of a contract with
different blame information by overriding blame information as
represented by properties, instead of adding a new chaperone layer
every time that blame changes.
... and all the same for non-chaperone impersonators, of course.
Specifically, add a mechanism so that contract combinators
can accumulate contracts on a value (instead just storing
only one) and then use that in instanceof/c to avoid
putting contracts on values more often.
Also, fill in better contract-stronger implementations in
some of the combinators
This creates a catalog from the specified currently-installed
packages. The catalog can then be used to replicate some or
all of the currently-installed packages in another installation
or other context.
Also extend `pkg/command` so that `#:multi` is useful.
While a foreigh call is normally guarded by a check on the amount
of available stack space, a callbacks triggered by the
scheduler will first put Racket in no-stack-overflow mode, and
then it's too late to check stack space before making further
foreign calls. With Cocoa, there's some chance that the process
will run out of space. Avoid the mismatch by checking the stack
availability at the start of a scheduler iteration.
Fixes a mistake in commit 768b93be82, which dropped a check that is
needed to trigger GCs during a sequence of large-block allocations.
Closes PR 14738
slightly less terrible
... but ->i still doesn't do as good a job as -> and ->* do for arity
errors (specifically, ->i is still letting the blame-less errors that
application constructs thru when it could be assigning blame)
Refactor the code to move inside 'let' or 'begin'.
Also, in the test position of a 'if', recognize the 'not' inside a 'let' or 'begin'.
For example, transform (if (begin ... (not p)) x y) => (if (begin ... p) y x)
Previously, this conversion was made only when
the 'not' was the outermost expression.
And use the refactored code to move application inside 'let' or 'begin' in a single step
For example, transform ((let (...) ... (let (...) ... f) x) => (let (...) ... (let (...) ... (f x))
In the conversion, it's necessary to shift x to the new coordinates inside the 'let's.
In the new version x is shifted only once.
Before this commit:
- unzip would attempt to seek the input port via file-position in some cases
After this commit:
- unzip reads and discards bytes as needed to skip forward
With `replace-evt` the time that the system needs to wake up
to check the event can drift later, but scheduling state was
carried in a way that works only if the wake-up time drifts
earlier.
Unfortunately, I don't know how to write a test for this bug.
The usual stategy of using `system-idle-evt` to detect busy
waiting doesn't work here, because the business happens despite
the scheduler's conclusion that the system is idle.
As reported by Jan Dvořák on the mailing list.
Fixes a problem with c4508ad0d9, which disabled module-code
caching too often. A symptom of the disabled cache was that
running "math/scribblings/math.scrbl" would use twice
as much memory.
This repair turns out to matter for Mac OS X 10.10, where creating
a list box in a frame somehow makes the frame an instance of a
subclass (that implements notifications of some sort, I think).
That subclassing broke an `(objc-is-a? ... RacketWindow)` test to
recognize windows that belong to a particular eventspace.
For some types, (equal? x y) is transformed into (eq? x y) in the resolve phase.
This commit adds this transformation to the optimizer phase. This improves
constant folding and enable some optimizations that are prevented
because equal? can run arbitrary code.
Also, transform (eq? #f x) => (not x) and (eq? '() x) => (null? x) to use
the type information of x when it's known.
If a Mach-O file installed with `{copy,move}-foreign-libs` has a
"@loader_path/" reference to a library that is installed in a
different target directory (normally because it's from a package that
is installed in a different scope), then change "@loader_path/" to an
absolute-path reference to that target.
Currently the optimizer can convert ((let (...) ... proc) x) to
(let (...) ... (proc x)). This is useful especially if proc can be
inlined. Extend this to begin's forms.
Previously, the optimizer simplified the application of some unary functions inside let,
for example (car (let () ... (cons 1 2)) => (let () ... 1). This commit extends this to begin forms,
like (car (begin ... (cons 1 2)) => (begin ... 1).
Also, constant folding and some reductions were only availed in the direct case, for example
(procedure? car) => #t. With this commit these reductions are extended to the expressions
inside let and begin, for example (procedure? (let () (begin ... car))) => (let () (begin ... #t).
got broken in 2e284cc783
The racket version of libunwind is not compatible with QNX but old-style stacktraces are still working with the default gcc version
If "p" is available as a source package, which is typical, then `raco
pkg install --binary p` would strip away the build dependencies of "p",
so that "p" would not install properly.
This commit changes `raco pkg install` to look for an annotation on
the package and complain if the annotation is inconsistent with the
requested conversion: a binary package cannot be used as a source
package or vice versa. (A built package, as provided by a snapshot
site, can be used as any kind of package.)
The `--binary-lib` mode is like `--binary`, but it also omits
documentation to form a "binary library package".
The `--binary-lib` flag and "X-lib" vs. "X-doc" approaches solve the
same problem with different trade-offs:
* When a package is split into "-lib" and "-doc" packages, then it's
easier install non-documentation parts, and it's possible to
install them from source. A programmer has to work more to split
the packages, however, and the library and its implementation must
have separate sources (i.e., no or restricted in-source
documentation).
* When a package is just "X", then users can install a no-source,
no-documentation version by specifying `--binary-lib`, but only
when the package is available from some catalog and provider in
built form (such as from a distribution site or a package-build
service).
In the long run, I think that relying on `--binary-lib will be best
and typical for most packages. The "X-lib" plus "X-doc" approach
that's common in the current distribution's packages, meanwhile, will
likely stick around for basic packages that are commonly useful in
constrained settings (including the setting of a package-build
service).
The `update-implies` declaration is half of `implies` (even though the
name is bigger): update of the package implies an update of another,
but a dependency on the package is no license to access the content
of the other.
This declaration is intended as an alternative to keeping version and
dependency declarations in sync for a pair of packages that are always
updated together, normally because the packages are in the same
repository. For example, a "-test" or "-doc" package might have an
`update-implies` declartion on the corresponding "-lib" package.
Adjust dependency tracking and makefile rules to that when
`--enable-racket=...` is provided to `configure`, intermediate
CGC objects are not compiled.
The new approach uses dependency tracking that was already supported
by xform, previously used only for Windows.
Although newer versions of Visual Studio can open 2010 projects, the
meaning of the project turns out to be: use 2010 tools. So, I've added
a step in the build script to automatically upgrade the solutions and
projects based on the version of Visual Studio that is being run.
Meanwhile, since my previous tests for VS 2012 and VS 2013 were using
VS 2010 projects, I wasn't actually testing with the 2012 and 2013
compilers. Additional changes are needed to make those work, notably a
fresh implementation of setjmp() and longjmp() for Win64.
This was all very painful, but the projects are now in much better
shape, so maybe it won't be so bad from here.
The manifest was intended to enable XP-style controls, but at this
point it doesn't seem to do anything except interefere with some
variants of the build tools.
This new default for Unix and Mac OS X trades performance for
portability (hopefully), but for most users the switch affects only
for the build process, where `racketcgc` is used to build `racket`.
To continue using Boehm GC, configure with `--disable-sgc`.
For now, Boehm GC continues to be the default for Windows.
Allocation of executable memory is intended to make SELinux
happier by mmapping with PROT_EXEC instead of using mprotect()
to allow execution after the fact.
Performance improvements bring SGC within 30% of the Boehm GC on
`racketcgc -cl racket`, which makes SGC an even more plausible
substitute.
When a module is loaded with submodules intact, it should not be
cached and used for a later load that is intended to obtain the
module without submodules. Avoid mismatches by constraining the
cache to modules without submodules.
Error reports used the "source" field of a module, which
doesn't have submodule information, or the "name" field of
a module, which might not match an actual filename (".ss"
vs. ".rkt"). Create the right combination.
Adjust the compiler pass to insert checks for #<unsafe-undefined>.
The chanegs amount to throwing out the old attempt to follow the
implementation sketched in "Fixing Letrec", and instead use a
simpler abstract interpretation.
Bindings in `let` and `let*` need to be tracked much the same
way as for `letrec`, so that
(letrec ([b (let ([d (lambda () c)])
(d))]
[c 1])
b)
raises an exception.
A thread can be swapped out while it's in transition between a
mandling of the mark-stack position and recovering from C-stack
overflow. Fix up that case.
Previoulsy, `expand` mode explicitly disallowed cross-phase declaration
in commit 2e652fc2b3. I'm not sure why, and that commit has no test
case that fails when the restriction is removed, so my best guess is
that it was a debugging strategy that I forgot to undo.
The mz-gdbinit script (generated by mk-gdbinit.rkt) gives the type when using
pso, even when the default template did not include the type.
It defaults to printing out only the name of the type without additional
information.
Use call-as-atomic that can handle exceptions instead of dynamic-winding
start-atomic and end-atomic. Exceptions can be found in the functions's
result wrapper such as:
(define-lib find-some-object
(_fun (name : _string/utf-8)
(object : (_ptr o _some-object-pointer))
--> (result : _int)
--> (begin
(when (negative? result)
(error 'find-some-object "unknown name"))
object))
#:wrap (allocator free-some-object))
Signed-off-by: Jan Dvořák <mordae@anilinux.org>
Allows conversion of negative "seconds" to reach dates before
1970, and fixes year-varying DST tracking for versions of
Windows that know about those details.
As far as I can tell, we have to compute ourselves whether a
date is in daylight-saving time based on specifications of
when daylight and standard times start. That part seems tricky
and could use extra review.
Problem, example, and solution from Sam; see the dev mailing-list post
on 24-JUL-2014.
When a chaperoned accessor, mutator, or property accessor is used to
chaperone a struct, the chaproning procedure must not be able to
see things that the chaproned accessor, mutator, or property accessor
would not allow.
required that the identifier wrapped by `#%top` not have a local
binding. Change the documentation to match the implementation in that
way. (Since local binding in an identifier's lexical information
contributes to its identity as a top-level binding, that specification
of `#%top` would make sense everywhere, but I've left the top level
alone for backward compatibility.)
Also, change `local-expand` to never introduct `#%top`
wrappers. That's a little more consistent with what `#%top` has
evolved to mean, and it specifically works better with
`local-expand/capture-lifts`.
Closes PR 14635 and PR 14654