... for the purpose of "populate 'compiled' directories" --- but only if
the user has write permission for the package directory.
This change may or may not be a good idea. The idea is that installed
packages generally should be treated in the same way as the main
"collects" tree (e.g., avoiding debugging instrumentation), but if you
happen to be developing a package, then you want it treated like things
that are not in the main "collects" tree. So, how do you pick? Maybe
opening a file in the package is a good way to pick.
If DrRacket decides to skip a file for "populate compiled",
then there may exist a file in "compiled/drracket", anyway,
or there may be such a file for some depenency of the skipped
file. Before this patch, that situation was considered to be a
broken installation, and things would go bad in the likely
case that the "compiled/drracket" files were out of date.
To avoid that problem, parameterize `used-compiled-file-paths'
to drop the DrRacket "populate compiled" target while loading
the skipped file.
This change sets up a more selective "populate compiled" where
a package's modules might switch between eligible and
ineligible for compilation by DrRacket.
Make the installed-package database lock reentrant, change some
functions to take the lock, and fix the documentation on when a
lock is expected to be taken outside of functions.
The code was assuming that the record type was
MX even though this could be false. Also adjusted
some code to also make it easier to test.
Note: the behavior when MX records are missing
is probably still not right.
Closes PR 13654
Adds `pkg/pnr-db', `raco pkg index-copy', and `raco pkg index-show'.
Includes tools to build a database of modules that are supplied by
packages, which will be useful for a tool to recommend package
installs when a module is not found.
Also, document `pkg/lib' and add extra helper functions
for getting package information from a package name resolver.
The validator was not as smart as the compiler in determining
that a `let' expression could be relied on to produce a
constant-shaped function (without side effect or error) in the case
that a right-hand side expression is a call to a known structure
constructor or predicate.
Closes PR 13679
Merge to v5.3.4
Swap order of argument for `environment-variables-get'
and `environment-variables-set!', so that the environment
variables come first --- which follows the usual order.
This change means that the parameter isn't used to get
the default environment variables, but that seems ok; the
convenient interface is `getenv' and `putenv'.
On Windows, case-normalized environment variable names.
Also, change the implementation to use an immutable hash
internally.
By default, a sandbox gets a fresh environment variable set,
which means that it does not affect environment variables
outside the sandbox (which means that sandboxed code cannot
set the Racket process's OS-level environment variables).
Closes PR 13667
The `current-environment-variables' parameter determines the current
mutable "environment variable set". If that set is the initial one for
a Racket process, then using the set corresponds to working with OS
environment variables. Otherwise, it's really just a hash table that
is packaged up as OS environment variables if a subprocess is created.
The new environment-variable interface works in terms of bytes, instead
of assuming that environment variable names and values fit in a string
encoding.
The string-based `getenv' and `putenv' are still available as
convenience wrappers. The checking on environment-variable names
for those wrappers is a little tighter, preventing any attempt to use a
name that contains "=".
The code duplication was there only to support
constructing the name for the optimized contract;
instead we actually just built the name as we go
(the old version actually built the old contract
and then used that to get the name)
also:
- racket/contract/base now requires basic-opters.rkt
so all of the opters are registered when racket/contract/base
is loaded, not just the non-basic ones
- fix the ordering of the names of subcontracts in or/c
- make opt-contracts print a more meaningful name
* Some racketisms.
* Use explicit `in-list' etc in for loops.
* Remove some redundant requires from `net/dns'.
* Move all tests to `tests/net', including a new `tests/net/ip'. In the
future there's a plan to have things like stripped zos etc for
distribution, but we're not there yet, and the net collection is
already organized nicely so this also makes it more uniform.
* Include the dns tests in the main test file.
For instance, (normalize-arity (list 1 (arity-at-least 2))) now produces
(arity-at-least 1). The implementation and the tests for normalize-arity both
reflect this change. The randomized tests now also check that the output
represents the same arity as the input.
The lexer mishandled cases like "#x1E+2", because "E" is
not an exponent marker for hexadecimal --- and it has been that
way forever, but the repair isn't all that difficult.
These result from something like
@racket[(x y)]
being treated by Scribble as multiple RktXXX items rather than one. As
a result the Markdown emitted was:
`(``x`` ``y``)`
But obviously instead we want:
`(x y)`
Kludgosity alert: Although it would probably be more-correct to
consolidate the RktXXX items at the Scribble structure level, I don't
easily see how. `@racket` is baking in the concept of Racket
lexing (classifying text as various kinds of Racket elements). This is
handy when the render will be HTML or Latek, and is benignly N/A when
it will be plain text. But it's a bit square-peg/round-hole when the
render will be Markdown. Rather than attempt to "un-lex" the Scribble
structures (I'm having trouble seeing how), I'm handling it
"after-the-fact" -- adjusting the generated Markdown text.
If anyone thinks the preceding is an elaborate rationalization for an
ugly kludge, I wouldn't argue, but I would need some help
understanding the preferable way to go about it.
Unlike plain `racketblock`, `examples` and `interaction` are
"nested". As a result we emitted bad Markdown like:
```racket
Examples:
```racket
some-code
```
```
Markdown code blocks can't nest, so this needs to be:
```racket
Examples:
some-code
```
Also: Updated the unit test with examples of `examples` and
`interaction`.
Allow a thread to be GCed when it is blocked on a place
channel for reading and the place channel's write end
is inaccessible.
GC is limited to threads that do not participate in cycles
of such threads, where the otherwise unerachable threads
are blocked on place channels that are reachable among the
set of threads. In other words, the GC finds the greatest
fix point (as measured by the threads to retain) instead of
least fix point --- which isn't what you want, but finding
the least fix point seems to require significant extra GC
machinery across places.
This improvement was intended to solve the same problem as
commit 7b0608c, but that case seems to run into the limitation
on cycles.
A tail call with certain kinds of primitives would fail to
clear local bindings in a detectable way. For example, a
tail call to `sync' that blocks could retain references
to unreachable data in the context of the `sync' call.
Primitives that can cause problems in the run-time system
are already identified as "imemdiate" primitives. The
safe-for-space pass now inserts clearing actions before a tail
call, unless the call it to a known immediate primitive or a
Racket-implemented function.
Clearing operations are now omitted before non-tail calls
to immediate operations like structure predicates.
The newly added clearing operations could affect performance,
but they probably won't, since the clear operations are still
avoided in tail-call cases that are otherwise fast. The newly
omitted clearing operations may improve performance.
The shortcut could be triggered in a bad case (first
argument as `#f' in non-timeout mode) and returned the
wrong result (void instead of the semaphore).