Commit Graph

39327 Commits

Author SHA1 Message Date
Matthew Flatt
4a763c72d0 cs: repairs for Windows build 2018-09-13 10:48:26 -06:00
Matthew Flatt
2a053caa1a makefile: always make automatic checkout of Chez Scheme
If `make cs` is run without specifying a SCHEME_SRC, then make sure
that `configure` and `make` are re-run in the Chez Scheme checkout,
in case it was updated.
2018-09-13 10:48:26 -06:00
Matthew Flatt
287157cc6d cs: _stdcall for Windows -> __stdcall for Windows x86 2018-09-13 10:48:26 -06:00
Matthew Flatt
2e8e479a52 thread & io: makefile repairs to work with nmake 2018-09-13 10:48:26 -06:00
Matthew Flatt
31d7180e5b makefile: shorten win32-cs bootstrap 2018-09-13 10:48:26 -06:00
Matthew Flatt
1b703f8823 makefile: add CPUS support to the cs-base target 2018-09-13 10:48:26 -06:00
shhyou
9f0bc0896f Update document to be more accurate 2018-09-13 10:48:43 -05:00
shhyou
40b8ae7a33 Coerce the arg in contract-random-generate/choose 2018-09-13 10:48:43 -05:00
Matthew Flatt
d9218abc71 makefile: add CPUS support to the cs target 2018-09-13 07:42:18 -06:00
Matthew Flatt
efd601cb51 cs: avoid thread misuse during GC
A collection can only invoke certain callabcks (e.g., for DrRacket's
GC icon) when the collection is performed in the main thread. Also,
delay posting GC logging events to receivers that cannot work at
interrupt time.
2018-09-13 06:05:58 -06:00
Alexis King
6b56156d55 Revert "Allow local-expand to opt-out of implicit extension of the stop list"
This reverts commit 41fd4f3a5e.

The problems this change was intended to solve can be solved in other
ways, without loosening guarantees about expansion order. See the
discussion in #2154 for more details.

closes #2154
2018-09-12 15:06:33 -05:00
Ryan Culpepper
5be4109495 openssl: change dummy path name to avoid spaces 2018-09-12 15:32:03 +02:00
Ryan Culpepper
fc19d75b40 openssl: add workaround for natipkg openssl lib cert locations
Reference: https://www.happyassassin.net/2015/01/12/a-note-about-ssltls-trusted-certificate-stores-and-platforms/
2018-09-12 15:32:03 +02:00
Ryan Culpepper
dc8a2ca6ec openssl: log error if no existing cert locations
This may help with situations like #1919 and #2184.
2018-09-12 15:32:03 +02:00
Matthew Flatt
b2e4d51b1b raco setup: fix problem with processes-based build
The procsses-based build was technically broken with the addition of a
"prefetch" thread (some time back) to improve parallelism, because the
`write`-based implementation of messages did not protect again
interleaving by different threads. The problem turns out to be easier
to expose when running with RacketCS.
2018-09-12 06:17:47 -06:00
Matthew Flatt
fd730a6772 raco setup: add --places and --processes flags
Provide access to subprocess-based parallel builds even when places
are available.
2018-09-11 19:08:59 -06:00
shhyou
dabbfed09f Randomly shuffle contracts in contract-exercise 2018-09-11 16:15:24 -05:00
Matthew Flatt
9cf9be60b0 io: fix retention of blocked log receiver
Don't GC a log receiver that is blocked on a logger that
might receiver relevant events.
2018-09-11 12:15:07 -06:00
Matthew Flatt
862c05d64a thread & cs: fix place bugs 2018-09-11 09:55:11 -06:00
Matthew Flatt
30fb62e438 cs: add sanity check for proper callbacks during blocking callouts 2018-09-11 09:55:11 -06:00
Robby Findler
90514ef075 add a @deftech for ``convertible'' 2018-09-11 10:51:41 -05:00
Matthew Flatt
2e7d608fb3 native-libs: update openssl build, especially for natipkg
Record a recoganizable dummy path as the default location for
certificates.
2018-09-11 08:39:52 -06:00
Matthew Flatt
2637cf4519 fix INSTALL.txt to claim that VS 2017 works
Relevant to #2259
2018-09-10 07:41:05 -06:00
Matthew Flatt
0e2ad7d596 raco pkg: change --scope-dir search-path handling
Formerly, `--scope-dir` would include only the specified directory in
the search path for already installed packages, etc., which means that
it would only work right as a kind of installation scope that is a
step beyond "installation" on the "user"-to-"installation" spectrum.
The `'pkgs-search-dirs` confiugration entry, meanwhile, provides more
control over search ordering in installation scope. Make `--scope-dir`
work more consistently with that search-path configration.

This change also makes "instllation"-scope operations use the search
path more consistently, since some actions used to use the whole
search list while others pruned any prefix before the main
installation directory in the search list.
2018-09-10 06:14:34 -06:00
Matthew Flatt
292dac4e51 cify: repair for big-endian platforms
Relevant to #2018
2018-09-09 14:01:09 -06:00
Matthew Flatt
138e6c11c0 ffi/objc: add with-blocking-tell
Add a way to declare an Objective-C method call as blocking in the
sense of the `#:blocking?` argument to `_cprocedure`.

Usingf `with-blocking-tell` should allow the Cocoa backend for
`racket/gui` to wait for events in the main place without blocking
other places.
2018-09-09 11:56:26 -06:00
Matthew Flatt
9776e4cd8e cs: fully enable places
Fix various problems with the implementation of places, and let
`processor-count` return the actual number of processors. A parallel
build via `raco setup` seems to work but not scale well.
2018-09-09 11:33:33 -06:00
Matthew Flatt
bf9a5f2730 move processor-count core to rktio
Also, repair various problems with places in RacketCS, but make
`(processor-count)` still return 1 for now, since there are still
problems.
2018-09-08 18:59:10 -06:00
Matthew Flatt
3b0336a30a rktio: make fd transfer across rktio_ts explicit
Instead of defining `rktio_fd_t` to be independent of a `rktio_t`,
which isnt quite true, introduce `rktio_fd_detach` and
`rktio_fd_attach` functions to make a transfer explicit, such as when
a file descriptor goes through a place channel.

This adjustment avoids a corner case in cleaning up a file descriptor
from an abandoned channel, where the finalizer might run in a Chez
Scheme thread that is not associated with any place.
2018-09-08 15:57:34 -06:00
Matthew Flatt
ef72554fe4 cs & io: fix potential file-descriptor leak
If a file descriptor is in a place channel message that is never
received and the channel becomes inaccessible, finalize the place
channel.
2018-09-08 13:31:11 -06:00
Matthew Flatt
cd9071cb9b bytecode optimizer: fix inlining bug
When a single-use function is inlined late enough in the optimization
process, and when the body has the only use of some variable computed
by an expression that can be move in place of the use in the inlined
function (but not in the non-inlined function), then it's a problem if
the function binding isn't pruned away early enough. Make sure the
binding to the function is marked as unused after the function is
inlined.

This bug was exposed by a recent change to the "dssl2" package.
2018-09-05 20:33:05 -06:00
Matthew Flatt
66b624e8ca byte compiler: unsafe-make-place-local should not fold 2018-09-05 16:11:12 -06:00
Matthew Flatt
c50d2753c0 cs, thread & io: finish implementing places
Implement place channels and messages, and change `place-enabled?` to
claim that places are enabled, but `processor-count` still reports 1.

The implementation of place channels has an interesting use of
ephemerons --- that is, a use that isn't just solving a key-in-value
problem. Using epehemerons solves the problem of forgetting a place
channel and any thread blocked on the read end when there are no
producers on the write end. Along similar lines, when only the write
end is retained (i.e., no readers), the channel data is forgotten and
writes become a no-op. The read end holds a "read key" and references
the channel data through an ephemeron keyed by a "write key"; the
write end similarly holds a "write key" and uses an ephemeron keyed by
the "read key". This use of an epehemeron implements a reachability
"and": retain the place-channel data only if the read end *and* the
write end are both reachable. (Minor point: a read end also holds onto
the "write key" anytime the channel already has data.)
2018-09-05 16:02:19 -06:00
Matthew Flatt
aad98e563d avoid a compiler warning 2018-09-04 14:53:22 -06:00
Matthew Flatt
8ff8b36bdf racket/place: remove place-sleep
The `place-sleep` function was undocumented, should not have existed,
and has no uses that I find.
2018-09-04 14:53:22 -06:00
Matthew Flatt
fa3c5abd00 syntax-parametereize: fix set! with rename transformers
Relevant to bootstrapworld/curr#423
2018-09-04 14:53:22 -06:00
Matthew Flatt
62a5086b2a thread, io, & cs: fill in stdio setup for places 2018-09-04 14:53:22 -06:00
Ben Greenman
63f2a0fd39
doc: update contract for 3rd argument to hash-ref! (#2248) 2018-09-04 16:30:11 -04:00
Robby Findler
988e0d441b add another special case to and/c to detect a situation that's really just integer-in 2018-09-03 20:30:07 -05:00
Matthew Flatt
416447e842 thread, io, & cs: place startup, wait, break, & kill
Fill in more of place creation and termination, which exposed
additional places that the thread layer needs place-specific
variables.
2018-09-03 16:47:00 -06:00
Matthew Flatt
35af40d850 cs & thread: move places API to the thread layer
The Rumble layer provides a primitive `fork-place` operation and
`start-place` hook to tie in place initialization from other layers
(especially "io"), but the rest can live in the "thread" layer,
especially to handle place-channel synchronization.
2018-09-03 09:12:52 -06:00
Matthew Flatt
f03d5c0076 raco exe: add ++lang support
When a stand-alone executable created by `raco exe` needs to load
modules that start with a `#lang` line, there have been various
obstacles to adding the right run-time support via `++lib`. The
`++lang` flag addresses those problems and makes it easy to indicate
that enough should be embedded to support loading modules with a
specified language.

There are problems in the way that various handlers interact for the
"lang/reader.rkt" versus `(submod "." reader)` search path that
converts a language name to a reader. To accomodate the search in a
standalone executable (that does not provide access to collections in
general), the module name resolver must refrain from raising an
exception for a non-existent submodule path that refers to a
non-existent collection.
2018-09-02 07:53:47 -06:00
Matthew Flatt
3127bc239b raco exe: fix declare-preserve-for-embedding submodule 2018-09-02 07:25:16 -06:00
Matthew Flatt
8c5eebc513 cs: fix races with places in the Rumble layer 2018-09-02 07:25:16 -06:00
Ben Greenman
8b4a17e33e
typo: fx=,fx<,etc. take 1+ arguments (#2247) 2018-09-01 23:07:05 -04:00
shhyou
ef5467a9d4 Fix dom exercisers in randomly generated function 2018-08-30 13:46:13 -05:00
Matthew Flatt
7faf874000 cs: first cut at support for places
There's no place-channel communication yet --- just enough of a
conversion to thread-load storage to make places possible.

In contrast to traditional Racket, where the expander linklet is
instantiated once per place, the flattened expander linklet is
instantiated only once in RacketCS (because it's inlined into a Chez
Scheme library). The expander therefore needs to keep per-place state
separate, and the same for the thread, io, and regexp laters.

In the expander/thread/io/regexp source, place-local state is put in
an unsafe place-local cell. For traditional Racket, a place-local cell
is just a box. For RacketCS, the thread through expander layers are
compiled in a way that maps each cell to a fixed index in a vector
that is stored in a virtual register, so the value is roughly two
pointer indirections away (thread context -> virtual register array ->
place-local vector). Multiple Chez Scheme threads in a place, such as
threads to run futures, share the same place-local vector.

Although `place-enabled?` reports #f, `dynamic-place` from `'#%place`
can create a place as a Chez Scheme thread and load a module there.
2018-08-29 09:52:29 -06:00
shhyou
1ad4d82691 Have arg-dep-ctcs return the contract directly 2018-08-28 15:42:31 -05:00
Matthew Flatt
37c9169874 expander: fix body scope for letrec-syntax
An extra scope is needed to separate the bindings of a `letrec` from
the `letrec` body, in case a macro moves right-hand-side expressions
to the body.

Michael Ballantyne and William Hatch reported this problem and its
solution in December 2016, but I forgot to add the repair.

Relevant to #2237
2018-08-28 14:08:36 -06:00
Matthew Flatt
1d65a89f53 cs: faster continuation-mark-set-first
Avoid allocating mark-chain elements, and change search function so
that it's more recognizable as a loop.
2018-08-28 14:08:36 -06:00