Commit Graph

39456 Commits

Author SHA1 Message Date
Matthew Flatt
0c6d22a04a hash-ref: guard against fixnum argument when JIT-inlined
Closes #2409
2018-12-01 06:22:08 -07:00
Matthew Flatt
3a19809268 compiler/cm: protect a ".dep" use against old versions 2018-12-01 06:00:49 -07:00
Matthew Flatt
b94f84a909 expander: load modules on demand for recompile 2018-11-30 22:54:10 -07:00
Matthew Flatt
68e105c0ed cs: prompts for module-body expressions
Module definitions and expression need to have a prompt around them to
delimit continuation capture, variable assignment needs to happen at
the right point to ensure that reassignment is guarded and
non-assignment is detected. But avoid the prompt when it's not needed,
such as around function definitions.

Closes #2398
2018-11-30 22:54:10 -07:00
Matthew Flatt
6f0748108c cs: fix module-variable initialization order
Similar to a255def019, but for side effects potentially
exposed by definition RHS expressions, instead of
expressions not in a definition. Improve that commit and
this one by only forcing variable assignments at non-simple
expressions.
2018-11-30 22:54:10 -07:00
Matthew Flatt
8b15ad971c cs: fix embedded modules in places 2018-11-30 22:54:10 -07:00
Matthew Flatt
f2fb2ebc55 racketcs: fix command-line handling after non-flag argument 2018-11-30 22:54:10 -07:00
Sam Tobin-Hochstadt
1bf17f7743 Don't set this up quite yet. 2018-11-29 21:49:16 -05:00
Sam Tobin-Hochstadt
28ba449102 Add issue templates 2018-11-29 21:46:20 -05:00
Philip McGrath
bd7de80d98 raco pkg new: Remove deprecated sudo: false from .travis.yml
Travis is eliminating its container-based infrastructure
and deprecating the `sudo` keyword.

This commit also updates the example build matrix to use
more recent Racket versions.

Corresponds to https://github.com/greghendershott/travis-racket/pull/29
2018-11-29 19:21:13 -05:00
Philip McGrath
4362e98b58 Clarify docs for filter-map (#2405)
See discussion on the mailing list: https://groups.google.com/d/topic/racket-users/8vyJX9MqMFY/discussion
2018-11-29 16:00:04 -08:00
Matthew Flatt
4d032bdd64 adjust raco exe tests to use racocs, etc. 2018-11-29 10:38:40 -07:00
Matthew Flatt
2e3b16f77c makefile: fix redundant path separators 2018-11-29 10:08:19 -07:00
Matthew Flatt
e607ae09de makefile: speed up make in "cs" build directory
Take advantage of ".d" files that are already generated to speed up a
`make` in the "cs" build dierctory when nothing needs to be done.
2018-11-29 09:41:49 -07:00
Matthew Flatt
50cb877184 makefile: fix SERVER_COMPILE_MACHINE handling
More targets need to support the `SERVER_COMPILE_MACHINE` option.
2018-11-29 06:23:01 -07:00
Philip McGrath
2798608ccd cs: fix error message from raise-argument-error
Closes https://github.com/racket/racket/issues/2400
2018-11-28 06:19:12 -07:00
Matthew Flatt
7823b6eecf raco decompile: support machine-independent bytecode 2018-11-27 20:59:52 -07:00
Matthew Flatt
a7499ab854 expander: more determinsitic machine-independent "bytecode"
Discard local-variable names to avoid `gensym` artifacts in the same
way that a more complete compilation would discard the names. This
change does not affect function names, which are preserved through
separate properties.
2018-11-27 20:01:43 -07:00
Matthew Flatt
8c6af1a234 expander: avoid format in common paths
Use `string-append`, `symbol->string`, etc., instead of `format` for
constructing some symbols.
2018-11-27 19:26:59 -07:00
Matthew Flatt
432dfcdb4a hash-{map,for-each}: strengthen try-order? guarantee
Promise a specific order for a hash table that uses only certain
primitive, non-compound datatypes for keys.
2018-11-27 17:50:48 -07:00
Matthew Flatt
da62067d8f maefile: adjust SERVER_COMPILE_MACHINE convention
The old way wasn't delivering needed information to
`distro-build/drive-clients`.
2018-11-27 10:34:52 -07:00
Matthew Flatt
5f940e462e call-with-atomic-output-file: option to make Windows moves more atomic
It most cases, it's more important for `compiler/cm` to reliably
replace a file that might be busy than to make the file update atomic.
To suport that kind of use, `call-with-atomic-output-file` implemented
a fairly reliable, multi-step, non-atomic process for replacing a file
on Windows.

For recompilation of bytecode in machine-independent form, however,
`compiler/cm` now really wants to atomically write a replacement
bytecode file. That's not generally possible on Windows (except on
NTFS with transactions, which are discouraged...), but MoveFileEx work
atomically in some cases and it's likely to work for the cases needed
by `compiler/cm`. Probably.

So, add a mode to `call-with-atomic-output-file` to get "more atomic"
updates on Windows. This mode is enabled by a callback that makes the
caller responsible for deciding what to do with the move fails, such
as waiting a while and trying again. And `compiler/cm` now waits a
while and tries again, up to a limit, which should be good enough for
recompilation.
2018-11-27 09:47:11 -07:00
Robby Findler
b68866db0f added object=-hash-code 2018-11-27 16:00:24 +01:00
Matthew Flatt
a001b5b231 raco setup: multi-machine cross-compile support
Enable `raco {setup|make}` to build two sets of compiled files: one
set that is suitable for the current machine, and another set that is
suitable for a different machine or for all machines (i.e.,
machine-independent bytecode).

In the long run, this new `raco setup` mode support cross compilation
where the build machine and target machine have different bytecode
formats --- unlike the current cross-compliation mode, which relies on
there being a single bytecode format in traditional Racket for all
platforms.

In the short run, the new mode enables the faster creation of
Racket-on-Chez distribution builds. The build server can send out
machine-independent bytecode to client machines while using
machine-specific bytecode for itself to drive the build process.

The new compilation mode relies on a somewhat delicate balance of the
`current-compile-target-machine` and `current-compiled-file-roots`
parameters (as reflected by the `-M` and `-R` command-line flags for
Racket) as well as cross-compilation mode (as enabled by the `-C`
command-line flag).
2018-11-26 19:49:33 -07:00
Matthew Flatt
4a080ada04 system-type: add 'target-machine
The 'target-machine result from `system-type` reports the
default value of `current-compile-target-machine`.

Also, fill in pieces to make `setup/cross-system` work
for RacketCS, although cross-compilation is still several
steps away.
2018-11-25 12:10:09 -07:00
Matthew Flatt
7cdf9f1c0b raco setup: remove -M/--compile-any
This commit mostly reverts 9441f7075f, because it looks like relying
on `racket`-level configuration is the right idea after all.
2018-11-25 12:10:09 -07:00
Matthew Flatt
695e270197 compiler/cm: avoid race in recompile
The new path for recompiling from machine-independent files
trues to read a ".zo" file without holding the recmopilation
lock and without an `exn:fail:filesystem` handler.
2018-11-25 08:11:21 -07:00
Matthew Flatt
3833a22f75 setup: leave cm trace handler alone in places
When `--vv` is not provided, leave the default `compiler/cm` trace
handler in place so that logging works as intended.
2018-11-25 08:06:28 -07:00
Matthew Flatt
055642a40a raco setup: less eager removal of ".zo" files
Wait until replacement is more assured before deleting an existing
".zo" file.

Also, don't delete a ".zo" file that is later in the
`current-compiled-file-roots` search path than the one being written.
This refinement supports setting up a search path to try
machine-specific compiled files and fall back to machine-independent
files, for example.
2018-11-24 19:39:01 -07:00
Matthew Flatt
f4a08af16b makefile: add setup step after unpack-collects
When unpacking a "collects" tree that is compiled in
machine-independent mode, an extra `raco setup` is needed
before `raco pkg`.
2018-11-24 13:59:56 -07:00
Matthew Flatt
a70c1b5242 compiler/cm: add missing version check 2018-11-24 12:02:41 -07:00
Matthew Flatt
1d2a7dec62 raco setup: show target machine in startup info 2018-11-24 11:46:36 -07:00
Matthew Flatt
e87d03cdc0 makefile: propagate SETUP_MACHINE_FLAGS to distro-build 2018-11-24 11:38:58 -07:00
Matthew Flatt
9441f7075f raco setup: add -M/--compile-any
Add `-M`/`--compile-any` to `raco setup`, `raco pkg install`, etc., to
build machine-independent bytecode, which is useful in the process of
building distributions.
2018-11-24 11:19:09 -07:00
Matthew Flatt
0bc010d972 raco setup: avoid recompilation in parallel mode
The `parallel-lock-client` protocol expects a #f back when a
file was meanwhile compiled by another process. So, don't
just forget about a file after it is compiled, in case there
is still a lock request on the way for that file.
2018-11-23 18:14:42 -07:00
Matthew Flatt
4946196c91 recompile-linklet: accept option argument
Add an options argument for consistency with `compile-linklet`.
2018-11-23 18:04:48 -07:00
Matthew Flatt
ac70e9a058 compiler/cm: detect and take recompilation shortcut
When a module is compiled to platform-independent form, recompile from
that form for the current platform, instead of recompiling from source.
2018-11-23 17:59:20 -07:00
Matthew Flatt
1c437793a6 expander: fix another recompilation problem
Fix merging of extra-inspector sets, which recompilation ignores
anyway.
2018-11-23 11:28:51 -07:00
Matthew Flatt
600a6b4c29 expander: fix compiled-expression-recompile
Linklets other than the body linklet may need conversion from
machine-independent form to machine-specific form.
2018-11-23 09:58:02 -07:00
Matthew Flatt
d6802444fa cify: repair bytes-ref and bignum handling
These problems were exposed by cifying `racket/fasl`.
2018-11-23 08:03:45 -07:00
Matthew Flatt
f47f685af9 schemify: fix srcloc marshaling
Partly fix it, anyway. More is needed in general to reduce
recording build-time paths in compiled code.
2018-11-22 19:31:46 -07:00
Matthew Flatt
19e709d27b revise compile-target parameter
Replace `compile-machine-independent` with
`current-compile-target-machine` to set up
better for future cross-compilation support.
2018-11-22 17:36:31 -07:00
Matthew Flatt
c5f000c4fc expander: recompile converts from machine-independent to -specific
Actually, the machine-independent-to-specific part is trivial. The
hard part was making `compiled-expression-recompile` enable
cross-linklet optimization as it recompiles, since that involves
pulling apart metadata and putting it back together afterward.
2018-11-22 16:39:55 -07:00
Matthew Flatt
2bbaa64cd6 add machine-independent compilation mode
The `compile-machine-indendent` parameter controls whether `compile`
creates a compiled expression that writes (usually in a ".zo" file) to
a machine-independent form that works for anhy Racket platform and
virtual machine. The parameter can be set through the
`-M`/`--compile-any` command-line flag or the `PLT_COMPILE_ANY`
environment variable.

Loading machine-independent code is too slow for many purposes, but
separating macro expansion from backend compilation seems likely to be
a piece of the puzzle from cross-compilation and faster distribution
builds.
2018-11-22 13:41:36 -07:00
Matthew Flatt
fd52cb5dda fix test
This test was meant to be part of 744d440ab9.
2018-11-22 07:23:02 -07:00
Matthew Flatt
d84d35870a expander: fix set! in namespace from module->namespace
Closes #2369
2018-11-22 07:21:30 -07:00
Matthew Flatt
ad14cca1e8 expader: fix caching for flattening 2018-11-22 06:39:38 -07:00
Matthew Flatt
fd462604bd cs: make gensym add a counter for the printed form
Although the counter doesn't make the generated symbol any more
distinct, it's often a helpful hint.

Closes #2396
2018-11-22 05:43:53 -07:00
Sam Tobin-Hochstadt
df88852e24 Additional files to ignore. 2018-11-21 12:39:56 -05:00
Sam Tobin-Hochstadt
18afdb54d6 Use linklet functions from '#%linklet instead of from lower level. 2018-11-21 12:39:56 -05:00