Commit Graph

3953 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Matthew Flatt
744d440ab9 schemify: ensure that deserialized constants are immutable
Closes #2394
2018-11-21 10:16:19 -07:00
Matthew Flatt
669e51768d io: normalize path to current-directory[-for-user]
Closes #2393
2018-11-21 09:58:16 -07:00
Matthew Flatt
299692a38a io: fix initial print-as-expression value
Closes #2391
2018-11-21 09:48:14 -07:00
Matthew Flatt
e5bfba5f3c cs: repairs for byte-string comparison operators 2018-11-21 09:38:32 -07:00
Matthew Flatt
7231f11b60 cs: don't treat crashes as constract errors
Converting "invalid memory reference" to an `exn:fail:contract` (which
is the default conversion) hides crashes as success when a test
expects an error.

Also, fix a bug that was hiding as an expected excdeption.
2018-11-21 09:28:28 -07:00
Matthew Flatt
701854a404 expander: remove unused require of racket/fasl 2018-11-21 09:08:48 -07:00
Matthew Flatt
13fa23e79a unbreak cify build 2018-11-21 08:37:48 -07:00
Matthew Flatt
6f6d121611 move linklet bundle and directory to expander layer
The Racket and RacketCS implementations had separate copies of
linklet-directory and linklet-bundle reading and writing. Move the
implementation into the expander layer.

The primitive '#%linklet instance now omits directory and bundle
operations and `read-compiled-linklet`. It intead must provide
`write-linklet-bundle-hash`, `read-linklet-bundle-hash`, and
`linklet-virtual-machine-bytes`.
2018-11-21 07:23:50 -07:00
Robby Findler
8cee5a09da improve the redundancy checking for class contracts
In particular, when there isn't any redundancy detected, then
just make a single call into the projection and create just a single
class.

This seems to help on at least one of the configurations of
dungeon, which completes in about 6 minutes with this commit
and I gave up waiting after 15 minutes for the version of
racket that didn't have it
2018-11-20 21:30:39 -06:00
Gustavo Massaccesi
b4e3030a0d rumble: fix some type checks in bytes.ss 2018-11-20 16:50:50 -03:00
Sam Tobin-Hochstadt
940e46df6c Rebuild expander.
Should have been included in 1258d9d28.
2018-11-20 11:56:28 -05:00
Sam Tobin-Hochstadt
1258d9d28a
Point to body forms in missing-expression error. (#2356)
Improves the error message for:

```
(define-syntax (like-lambda stx)
  (syntax-case stx  ()
    [(_ e) #'(lambda () e)]))

(like-lambda (define x 1))
```

Based on a report from @pkoronkevich.
2018-11-20 11:43:28 -05:00
Matthew Flatt
daed85e1dc setup/dirs: fix cases where paths are unavailable
When an executable distibution is created, some path become
unavailable at run time, such as the result of `find-links-file`.

Change the contract on those functions and adjust the implementation
to return `#f` in those cases. This is a backward-compatible change in
the sense that uses that now return `#f` would have crashed before
(although it does shift the blame in that case).

Based on an initial patch by Shu-Hung.

Closes #2352
2018-11-19 19:15:49 -07:00
Sam Tobin-Hochstadt
c1d2e4031e
Guard free-identifier=? comparisons in shared. (#2382)
Fixes #2381.
2018-11-17 22:26:11 -05:00
Alex Feldman-Crough
c4189ff934 untar: treat the tag #\nul as a synonym for #\0
The GNU Tar manual (at
https://www.gnu.org/software/tar/manual/html_node/Standard.html) says
that older archives may have the typetag AREGTYPE (\0) instead of
REGTYPE ('0'), and that AREGTYPE should silently be treated as
REGTYPE.
2018-11-17 18:00:15 -07:00
Matthew Flatt
ef9e9e3f7e cs: check initialization of variables on instance linking 2018-11-17 16:44:08 -07:00
Matthew Flatt
a255def019 cs: fix state of module instance interrupted by error
Closes #2380
2018-11-17 16:30:56 -07:00