This flag may be useful for checking for unnecessary dependencies, but
beware that it reports many false negatives, either because relevant
files are not compiled, because the dependency is dynamic, or because
unused packages are intentially listed as dependencies as a
convenience (as is the case for "main-distribution").
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).
When installing a package "P" and the usual directory already exists
and cannot be deleted, then use the path "P+1", etc., and record the
alternate path in the package database.
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.
This is useful for telling people how to install a new pkg, from
GitHub or elsewhere: just get the files, and then do
`raco pkg install` in the relevant directory.
Also, both cabal (the Haskell package manager) and npm (the node.js
package manager) behave this way.
To explicitly get the old behavior, specify the sources as
`--pkgs pkg-srcs ...`. This is useful in scripts, when `pkg-srcs`
might be empty.
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.
The package split exposed another place where searching
is needed, because the fallback in `collection-file-path`
to `collection-path` didn't work after the split.
This repair needs a test case, but I think the test will require a lot
of scaffolding to set up a package configuration, so I'm leaving that
part on my todo list for now.
`cext-lib` contains much of the contents of `dynext`, which
is no longer very widely used.
Also moved the implementation of the `mzc` executable
to a more appropriate package.
Also, used `lazy-require` consistently for dynamically
loading implementations.
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.
compression so that it gets a Content-Length field that
it can use back from the server
this may or may not be the right long-term fix but
for now it at least gets things working again
When adding a package installation-wide, drop redundant "COPYING.txt"
and "COPYING_LESSER.txt" files (i.e., ones that are the same as the
ones the "share" directory of a Racket installation).
This rule is ad hoc, but it avoids almost 150 copies of the file in
the main distribution.
Arrange for documentation added through an installation-wide package to
use the installation's "scribble.css", etc., files. Also, add "doc-site.css"
and "doc-site.js" files (both empty) to allow installation-specific customization
that will not get overwritten by document installs or builds.
The `--all-platforms` flag causes the package manager to follow all
package dependencies, even for dependencies that are specific to
platforms other than the current one.
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.
Various `net/url` operations need to request a close of the
connection after the operation completes, and `het/http-client`
needs to actually close the input-port half of a connection.
Also, add `http-conn-abandon!`.
Also also, add limits on internal pipes, so that data doesn't pile
up in a connection-processing thread, and fix POST/PUT by adding
a needed CRLF after posted data.
I'm not sure that #:defaults and #:fast-defaults predicates should ever refer to
methods from the same generic interface, but the behavior should be divergence
rather than an undefined variable error.
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.
Besides changing the URL scheme, the tag or branch is optional and
specified as a fragment (inspired by npm). Also, any subpath is expressed
as a "path=..." query (which similarly avoids giving a different meaning
to URLs than `git' itself would). The repository name can have a ".git"
suffix.
The "github://..." format is still supported for compatibility, but
`--type github' adds "git://..." instead of "github://..." if
neither is already present (which is incompatible, since branches
and tags are handled differently for the two forms).
Closes PR 13656
(See the PR for a discussion and my rationale for this choice.)
It's possible that an installation will have a package X already and
a user wants to install a different X. To make it all work out,
the user may have to also install a new Y for every installation-scoped
Y that refers to X --- maybe not easy, but at least possible as
a last resort.
This option makes install and update even more consistent, also
`--auto` still implies `--update-deps` only in update mode.
Make `--update-deps' consult the user in `search-ask' mode,
make it ignored in `fail' or `force' mode.
This reverts commit de230bc1ef.
Now that path computatons are built in, and now that the sandbox allows
reading the configuration file, using the installation name doesn't
break with sandboxing.
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 implementation of SSL ports is less complete than `openssl', but
it's complete enough to drive HTTPS, and so it can be used to download
a package that provides the DLLs needed for the `openssl' library.
The `net/url' library uses `net/win32-ssl' on Windows when `openssl'
is not available (due to the absence of the OpenSSL DLLs).
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.
When an argument to `raco pkg update` is a package source,
use it to place the currently installed package.
Also, make the set of available command-line arguments more
consistent, especially for `raco pkg install` and `raco pkg update`.
Finally, fix the `--update-deps` flag, including checking
the dependencies of each updated packages based on then update,
instead of the pre-updated package.
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.)
Otherwise, imagine uninstalling packages without `--auto', using `raco
pkg show' to confirm that none are left, and be surprised by a later
error about installed packages.
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.
When a client sends a query to a package catalog, it includes a
version number in the query, and a package catalog can customize its
response to the version. That approach allows evoluation of the way
that versions are mapped to results, but it does not allow a
directory-implemented catalog to offer version-specific information.
Allowing both the server and the client to filter on the version is
even more flexible, and in particular allows a directory-implemented
catalog to include version-specific mappings.
The exn:fail:support exception is used to signal "unsupported" values for
generic methods, e.g. a vector as argument to dict-remove. Right interface,
just the wrong kind of instance. The exception type helps define the notion of
a "supported" method, since a method might have a fallback implementation yet
some values are not considered "supported".
They need to be encoded in the same way that strings are
encoded. (Report and fixed by Phil Roberts.)
Also added a FIXME about leftover occurrences of \U in the output.
Closes PR 13966.
Loading "info.rkt" files always from source turns out to be
expensive (adding 1 second or so on my machine to the startup
time for `raco setup'). Change bootstrap mode to try the compiled
form and fall back to source if its doesn't work.
Separate state and functions, and convert a key loop to functional
style. As it turns out, this has no significant effect on performance,
but it looks a lot better to me.
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))))
Bootstrap mode disables the use of a compiled form of "info.rkt",
in case the compiled form is broken. It also attaches `info'-language
modules from the `setup/getinfo' namespace to the "info.rkt"-loading
namespace.
Formerly, `raco setup' relied on capturing the bytecode-compilation
bootstrap context used for `raco setup' itself when loading info
files. But when `raco pkg install' used `raco setup', it didn't have
the same bootstrapping context in place, so it could get confused
(e.g., if you unlink a package from one Racket version and install it
as a link in a different Racket version). Now, both `raco setup' and
`raco pkg' use `#:bootstrap?' mode for `get-info/full'.
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'.
Consistently sorting shouldn't cost much relative to the
cost of `directory-list' (except for the path->bytes conversion?),
and it makes directory traversals (including archive packaging)
more deterministic across runs and platforms.
(Eli suggested this a long time ago.)
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.
closes PR 13946
This is probably not the optimal way to make this change; better would
have been to refactor the existing provide/contract implementation so
it does not glom the provides all together in the first place (instead
of pulling them out afterwards). Do it this way anyways, because I
have a big pile of contract-system changes in another branch that also
changes around how provide/contract works: this way will be much
easier to rebase those changes off of.
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.
This reverts commit ac20e7fc0d.
Using the installation name name seems right, but it creates sandbox
trouble, since finding the instalation name requires several
path-chasing steps. I think the sandbox problem shoudl be fixed,
somehow, but since I don't have a good idea right now, I'm reverting
the PLaneT change.
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.
When you `raco pkg install' a package that is already present as
an auto-installed package, the installation is promoted to
an explicitly installed package.
When you `raco pkg remove --demote' a package, then it is changed
from an explicitly installed package to an auto-installed package.
Combine `--demote' with `--auto' to remove a package only
if there are no dependencies, leaving it auto-installed otherwise.
The defaults (promote in the case of `install', not demote in the case
of `remove') are different because it seems more likely that you
really mean to remove a package when using `pkg remove', while it
seems likely that you just want to start using a package that happened
to be auto-installed already for `pkg install'.
Also, make the package scope inferred for `raco pkg' commands
that take a list of package names, and fix up lock handling and
error reporting.
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.