Commit Graph

1758 Commits

Author SHA1 Message Date
Matthew Flatt
2837c995a9 fix continuation reuse in non-JIT mode
The continuation mark to generate stack traces interfered with the
detection of equivalent continuations.
2014-12-05 10:16:56 -07:00
Matthew Flatt
38da2aa2e7 fix a problem mixing JIT and non-JIT code
Crashes the "optimize.rktl" test suite when the JIT supported but
disabled, because that test suite re-enables the JIT.
2014-12-05 10:16:40 -07:00
Matthew Flatt
b7039106e6 restore non-places parallel build
The build protocol had evolved to include paths in messages passed
between places/processes, and that doesn't work with processes.
2014-12-05 10:16:23 -07:00
Gustavo Massaccesi
2d95c39051 simplify treatmenet of begin0 and discarding expressions
Since `begin0` at the bytecode level always evaluates an initial
expression in non-tail position, we don't have to work so hard
to ensure that an extra expression sticks around.
2014-12-05 07:00:40 -07:00
Gustavo Massaccesi
60934f1415 optimizer: more optimizations for begin0
Move begin0 inside begin, for example
(begin0 (begin X Y) Z) ==> (begin X (begin0 Y Z))
Try to replace more begin0 with begin when the first expression is movable
Drop the begin0 when it has only one non omitable expression that preserves
the continuation marks.
2014-12-05 06:56:29 -07:00
Matthew Flatt
c140105068 raco pkg: fix removal before re-instal of extra clone-sharing packages 2014-12-04 19:30:01 -07:00
Matthew Flatt
c6d2548e22 make: fix Unix-style build 2014-12-04 19:30:01 -07:00
Matthew Flatt
d05c00de3e fix build for a fresh checkout 2014-12-04 13:05:53 -07:00
Matthew Flatt
d593f5420b make: link packages via local catalog
Change the way that packages in "pkgs" are handled by `make`:
create a catalog that causes them to be installed on demand
as directory links.
2014-12-04 12:46:03 -07:00
Matthew Flatt
344bffc959 package manager: "file://" URLs and "?type=..." queries
Allow a "file://" URL to specify a type that causes the path
to be installed as a link or static link. A type query like
that is mainly intended for use in a catalog, where a catalog
of local directories could create links as needed for other
packages (that might be pulled from other catalogs).
2014-12-04 10:03:52 -07:00
Matthew Flatt
e7264d2d98 package manager: adjust parsing of file:// URLs
For some reason, I previously made the package manager parse file URLs
by stripping away "file://" and treating the rest directly as a
path. Maybe it was to support relative paths, or maybe it was to
implicitly disallow query and fragment parts of the URL, but it seems
like a terrible idea; I've switched to `string->url` plus `url->path`.

As a result, parsing now implicitly allows and ignores query and
fragment parts of a "file://" URL. That's intended as a feature,
allowing extra information to be attached to a path in, for example,
a catalog.
2014-12-04 10:03:52 -07:00
Sam Tobin-Hochstadt
2987338218 Split almost everything else from the main repository.
The source to the split packages is in repositories under the
`racket` organization on GitHub. The repositories are all named
according to the pkg name, except for multiple-package
repositories such as `racket/compiler` which is named based on the
old directory name without the `-pkgs` suffix. Thus

   `pkgs/compiler-pkgs` -> https://github.com/racket/compiler

The Makefile has also been adjusted to pull packages from the
catalog when you type `make`. This currently relies on some tricks
that will break if you try to specify a particular set of `PKGS` on
the command line. We plan to improve this soon.

The packages in `pkgs/racket-pkgs` and `pkgs/base` are staying in
the repository, since they logically belong with the core code.

The `plt-services` package is still in the repository, but will
move out soon.
2014-12-04 10:33:19 -05:00
Matthew Flatt
f3dba3eb6b fix over-eager shortcut in the implementaiton of continuation jumps
Don't jump past a prompt when jumping to a continuation that is
a prefix of the current one.

Reported by Max New
2014-12-03 07:15:34 -07:00
Sam Tobin-Hochstadt
46a5ed0aad Provide additional identifiers needed for pkg-index. 2014-12-02 21:06:26 -05:00
Matthew Flatt
2e69ece74b raco setup: make --check-pkg-deps work on a collection subset
Lift the remaining caveat about using `--check-pkg-deps` when
supplying specific collections to `raco setup`.
2014-12-01 10:58:55 -07:00
Matthew Flatt
20fa0ce790 raco pkg update: make --lookup and --clone work right together
The combination of `--lookup`, `--clone`, and `--catalog` can provide
a one-step path from a snapshot's built implementation of a package to
a repository-linked clone, for example.  In that situation, however,
`raco pkg` will have limited ability to detect that packages
originally drawn from the same repository are consistenly installed as
clones (and we can revisit if it turns out to be an issue).
2014-11-30 15:23:19 -07:00
Gustavo Massaccesi
60433b15f7 optimizer: fix do_make_discarding_sequence
The optimizer converts (car (cons X Y)) to (begin0 X Y) and then reduces
it to (begin Y X) if X is movable.
Check that the movement is safe for space and for continuation captures.
2014-11-30 14:28:56 -07:00
Matthew Flatt
3638ee6129 raco pkg show: add -l'/--long', and adjust the default mode
Make `raco pkg show` more readable by default by constraining the
output to 80 characters and adjusting the way some columns print.
2014-11-30 14:28:56 -07:00
Matthew Flatt
3cc1514a7d raco pkg {install,update,remove}: add --batch
Adjust defaults for `--deps` and `--multi-clone` to depend on
interactive vs. batch mode.
2014-11-30 12:41:32 -07:00
Matthew Flatt
ebe1537450 raco pkg update --clone: offer advice on converting directory links 2014-11-30 11:37:48 -07:00
Matthew Flatt
936f4abd3d improve a package-dependency error report from raco setup 2014-11-30 11:19:10 -07:00
Sam Tobin-Hochstadt
49c1cb1718 Avoid error on relative paths in raco pkg install --clone. 2014-11-29 10:23:16 -05:00
Robby Findler
5354142825 give pair? the same treament as list? got in 9ee9f676 2014-11-28 12:36:00 -06:00
Robby Findler
0e22209a81 add obligation properties to ->*
for online check syntax to pick up
2014-11-27 16:41:33 -06:00
Robby Findler
9ee9f6767d adjust contract system to use (listof any) when it sees
the list? predicate

(so that random generation and contract stronger work better)
2014-11-27 14:53:14 -06:00
Matthew Flatt
dd02cf8952 pkg catalog-update: install updates as a single transaction
Relevant to PR 14848
2014-11-26 06:53:03 -07:00
Matthew Flatt
596a4f655c pkg/db: add support for grouping calls as a single transaction
Also avoids reundant table-preparation checks for calls that are
grouped together.
2014-11-26 06:53:03 -07:00
Matthew Flatt
7596668762 pkg/db: fix some missing table preparations 2014-11-26 06:47:28 -07:00
Matthew Flatt
5fca59e2ed fix problems with continuations & sharing
When continuation C2 extends continuation C1, C2 shares the copy
of the internal stack with C1. It needs to skip the bit of
C1's stack that corresponds to arguments to `call/cc`, though.
That skipping assumed that `call/cc` takes 1 argument, but it can
take 2. The bug broke `racklog`, which captures continuations using
its own prompt. (It seems like there should be a simple test that
is independent of Racklog, but I couldn't construct it.)

Meanwhile, the continuation shouldn't retain the arguments to
`call/cc`, so clear them. (That was easy to test.) Sharing still
has to compensate for the locations of the arguments, though.
2014-11-25 16:37:41 -07:00
Matthew Flatt
6e473958de raco setup: use proper namespace for info-domain setup
With the wrong namespace, then installing and updating a package
within the GUI package manager would not pick up an info-domain
change for the updated package.
2014-11-25 12:34:36 -07:00
Matthew Flatt
6096d567af make-path->relative-string: handle immediate directory path 2014-11-24 16:27:11 -07:00
Matthew Flatt
d0b94f48e0 {chaperone,impersonate}-procedure*: fix argument propagation
Fix the "self" argument propagation through an impersonator that has
no redirection function (but that probably has impersonator
properties).

Closes PR 14852
2014-11-24 16:27:11 -07:00
Matthew Flatt
89ca0c26ce add setup/materialize-user-docs and related raco setup flags
The new library provides a way to force a user-specific documentation
etry point into existence. Normally, that would happen when a package
with documentation is installed in user scope. After the entry point
exists, then it sticks around even if all user-scope packages are
removed. In some cases, it may be useful to force the entry point into
existence as if packages had been installed and removed.

(This might be useful for avoiding a quarantine on installed
documentation files on Mac OS X, or a trampoline might be better.)
2014-11-23 10:51:07 -07:00
Matthew Flatt
b2a919af40 raco pkg {install,update}: help users keep repo clones consistent
When packages A and B have the same Git repository source, and
when at least one of them is linked as a repository clone, then
the package system doesn't require A and B to both be linked or
both be linked to the same clone... but that can lead to confusion
for users. The package manager now detects this situation and in
many situations can update non-clones to make then clone links
at the same repository.
2014-11-23 07:32:35 -07:00
Matthew Flatt
37a209b60e net/git-checkout: finish support for "dumb" HTTP(S)
Full dumb-server support is even more useful for testing.
2014-11-23 06:31:01 -07:00
Matthew Flatt
8498eff8ef raco pkg {install,update}: track Git repo source from a catalog
When a package is installed via a catalog, and the source provided
by the catalog is a Git repostory, then allow `--clone` to use
that repository when just the package name is given.
2014-11-23 06:31:01 -07:00
Matthew Flatt
6379aaddef raco pkg {install,update}: add --clone <dir> mode
Using `--clone <dir>` with a Git-based package source causes the
package installation to be linked to a clone of the repository
as a subdirectory of <dir>. The package can be developed locally
in the usual way with Git tools, but `raco pkg update` can itself
pull updates to the package/repository.

See the new chapter 6 in "Package Management in Racket" for
more information.
2014-11-23 06:31:01 -07:00
Matthew Flatt
04f5fe3815 net/git-checkout: support "dumb" protocol for discovery
Supporting just reference discovery can be useful for certain
testing configurations.
2014-11-23 06:31:01 -07:00
Sam Tobin-Hochstadt
bb83f51a28 Avoid trying to check dependencies for planet packages. 2014-11-21 14:18:31 -05:00
Matthew Flatt
1b4236722d raco setup: fix --fix-pkg-deps to imply --check-pkg-deps 2014-11-20 07:50:11 -07:00
Matthew Flatt
aa5e7d1039 remove redundant declaration & GC registration 2014-11-20 07:50:11 -07:00
Matthew Flatt
67ec4fb982 fix use of embedded bytecode 2014-11-20 07:50:10 -07:00
Robby Findler
b6ebd4101a add a new section to the contract guide on building combinators, plus
export a few new functions to smooth some rough edges in the new combinators api
2014-11-19 22:40:46 -06:00
Robby Findler
bc6492a797 remove unused require 2014-11-19 22:40:46 -06:00
Ryan Culpepper
26fe66b141 syntax/parse: fix action patterns in splicing stxclass
closes PR 14837
2014-11-18 10:33:15 -05:00
Robby Findler
5495595535 generalize the random contract generation APIs to allow
a more dynamic notion of failure

use that to try harder with and/c contracts. In particular,
the contract system now tries to generate the arguments
on their own and then uses the other arguments to filter
(when they are all flat contracts, of course)

closes PR 14832
2014-11-16 20:48:41 -06:00
Robby Findler
43229abf05 rewrite (and/c pair? (listof ...)) into (non-empty-listof ...)
related to PR 14832
2014-11-16 20:44:58 -06:00
Leif Andersen
b38c81139a Fix a few edge cases for raco pkg new
Also fix typos/indentation
2014-11-13 17:29:40 -05:00
Leif Andersen
bfbce31382 Add raco pkg new utility for creating new packages 2014-11-13 14:57:18 -05:00
Matthew Flatt
80a7ff831f read: reject non-Latin-1 characters in byte-string literals
This is a backward-incompatible change, but the old behavior (truncate
the character value to 8 bits) was never intended and seems clearly bad.
2014-11-13 09:46:27 -07:00
Ryan Culpepper
7ed82a5f15 db: even more error information for sqlite3 errors 2014-11-13 11:19:48 -05:00
Matthew Flatt
1681126ed5 add {impersonate,chaperone}-procedure*
The new variants pass a "self" argument to the wrapper procedure in
the same way that `{impersonate,chaperone}-struct` provides a "self"
argument to redirection procedures.
2014-11-12 10:10:23 -07:00
Matthew Flatt
50a8863169 fix places-GC trigger when a large message is pending
A large message that hasn't been delivered can trigger a inter-place
GC. The intent is to force a GC to avoid messages piling up that can
never be delivered, but the GC didn't adjust to a state where messages
stay both undelivered and uncollected, and it would continuosly
trigger GCs. Trigger a GC only if the pending-message size has grown
relative to the previous GC.
2014-11-12 09:30:30 -07:00
Sam Tobin-Hochstadt
731a98de64 Avoid creating impersonators/chaperones when not required in struct/dc. 2014-11-11 09:26:54 -05:00
Matthew Flatt
de65bb5586 parallel-compile-files: fix docs and argument check for the handler callback 2014-11-09 08:39:41 -07:00
Eric Dobson
37232a90fe Fix error handling of parallel-compile-files.
Related to PR 14809.
2014-11-09 08:10:17 -07:00
Tony Garnock-Jones
9fb5346652 Keep track of (and return) a list of modules (re)loaded during dynamic-rerequire 2014-11-09 08:09:05 -07:00
Gustavo Massaccesi
06d76961e5 Fix prefix-out for identifiers with spaces 2014-11-09 07:34:35 -07:00
Eric Dobson
8f238fe9e2 Add event logging to caching-managed-compile and parallel compile.
This allows for understanding where time is spend during a compile.
2014-11-07 22:52:54 -08:00
Ryan Culpepper
18bad4ce6e net/win32-ssl: adjust protocol handling like openssl 2014-11-05 13:40:59 -05:00
Ryan Culpepper
2422218dd9 replace 'sslv2-or-v3 with 'auto in net libs 2014-11-05 13:40:59 -05:00
Ryan Culpepper
933a71ce71 openssl: disable old SSL protocols by default
Add 'auto alias for 'sslv2-or-v3, both of which now mean
"negotiate a reasonably secure protocol version", where
"secure" excludes SSL 2.0 and 3.0 (since POODLE).
2014-11-05 13:40:58 -05:00
Ryan Culpepper
2d38b089cd db: report SQL stmt in errors when available 2014-11-05 13:40:58 -05:00
Ryan Culpepper
b2434ab5b9 db: more information on sqlite3 errors 2014-11-05 13:40:58 -05:00
Matthew Flatt
a88c79fd5b expt: repair for non-integer power of negative inexact
If the inexact approximation of the power is an integer, then
the result was a real number when it should be a complex number.
2014-11-05 09:50:32 -07:00
Matthew Flatt
1e9d7c1d2a expt: repair for large power of inexact between 0 and -1
Closes PR 14824
2014-11-05 09:50:31 -07:00
Matthew Flatt
b9d8f65fc9 reduce CPP noise 2014-11-05 09:50:31 -07:00
Matthew Flatt
edd50a24a8 optimizer: preserve implied properties from a let RHS
In an expression such as

 (let ([x (car y)])
   ....)

the information that `y` must be a pair didn't reach the body of the
`let` in most cases.
2014-11-03 06:06:04 -07:00
Matthew Flatt
89106b6708 optimizer: refine tracking of when space safety is a constraint
Some expression movements are limited by the possibility of retaining
a value in a way that interacts with space safety, but primitives that
return immediately shouldn't get in the way of those movements.
2014-11-03 06:06:04 -07:00
Matthew Flatt
9a94366c2c optimizer: fix reordering problems
When a variable X is bound to an expression that implies properties of
other bindings, and if X is used only once and can be replaced by
its value expression, then further optimization of that expression must
not assume the properties that are established by evaluating the
expression.

Also, don't move expressions past unsafe operations, since the expression
might implicitly guard against unsafety.

Closes PR 14819
2014-11-03 06:06:04 -07:00
Matthew Flatt
0d6deb84de README tweak
Based on a suggestion from freshlikeesch.
2014-11-03 06:06:04 -07:00
Matthew Flatt
823e8cf8d3 repair for more recent MinGW
I think that `-static-libgcc` didn't solve any problems with gcc
3.7.x, but with 3.8.x, divdi3() shows up, and that leads to
a "libgcc_s.dll" dependency unless `-static-libgcc` is used.
2014-11-03 06:06:04 -07:00
Matthew Flatt
795d26a673 setup/dirs: don't include (find-dll-dir) in (get-lib-search-dirs)
I don't see a reason to include `(find-dll-dir)` in the result of
`(get-lib-search-dirs)`. It's practically always redundant, and
including it causes problems for sandboxes --- since `(find-dll-dir)`
must inspect the Racket executable on Windows and Mac OS X, and that
access is normally not allowed by a sandbox.
2014-11-02 08:40:29 -07:00
Leif Andersen
627c775b6f Add 'subprocesses mode to current-process-milliseconds 2014-11-02 06:41:59 -07:00
Matthew Flatt
0b200abe63 unbreak GC for Linux and some other Unix variants
Corrects another problem with cceda78374.
2014-11-01 14:08:11 -06:00
Matthew Flatt
fe557c0e93 Cygwin: one more repair
Also, add a missing dependency that caused me to miss this correction
before.
2014-11-01 10:42:28 -06:00
Matthew Flatt
cdf0dc8ed2 Windows: MinGW fixes 2014-11-01 08:17:52 -06:00
Matthew Flatt
cceda78374 restore Cygwin support
Fix various configuration problems, and make the build work with 3m
(probably for the first time).

The repairs include corrections for the manual link table, but also
switch Cygwin to relying on normal DLL exports, instead, to work
properly with the FFI.

The `--enable-shared` comfiguration option is no longer required for
Cygwin. When it is used, the `gracket` launcher does not work right,
because the Cygwin DLL is in the "bin" directory and "gracket.exe" is
in the "lib" directory. Along similar lines, stand-alone executables
won't work with `--enable-shared`.

The change to `ffi/winapi` makes it match the documentation.
2014-11-01 06:50:24 -06:00
Matthew Flatt
58eb802468 add log-all-levels and log-level-evt
These two functions allow the creation of relays that receive events
on logger B where there are interested receivers for logger A.

Based on comments from Tony Garnock-Jones.
2014-10-31 16:48:41 -06:00
Matthew Flatt
38ac6e052c compiler/cm: filtered logging propagation instead of manual
With the new propagation-filtering support, CM's accomplice channel
doesn't need a receiver that accepts all events, and so less logging
logging work will be triggered during compilation.
2014-10-31 16:48:29 -06:00
Matthew Flatt
159c82fc4a make-logger: support specification of events to propagate
Events to propagate to a parent are described in the same way
as events to receive for a log receiver. The default is still
to propagate all events to the parent, which corresponds to
a propagation specification of 'debug.

Making a propagation-filtering specification built-in, instead of
allowing arbitrary filter functions, keeps `log-level?` efficient and
avoid hooks that might be implemented by untrusted code.
2014-10-31 16:48:29 -06:00
Matthew Flatt
83b4595741 log-level?, log-max-level: accept optional name argument
Change `log-error`, etc., to check the name that will be used for
the message, in addition to the log level.
2014-10-31 16:48:29 -06:00
Matthew Flatt
65e323d266 make-logger: rescind optional callback argument
The optional callback argument was added (by me) in f2d87085. This is
a backward-incompatible change, but allowing an arbitrary callback
on a logger now seems like an especially bad idea; forms like
`log-error` otherwise work in constrained contexts, while an arbitrary
callback function allows potentially untrusted code in those contexts.
Meanwhile, the addition doesn't satisfactorily solve the original
problem, since it intereferes with `log-level?` and similar filters.
2014-10-31 16:48:29 -06:00
Robby Findler
73f4fa86a3 Replace the racket/list shuffle function with
the fisher-yates shuffling algorithm.

Thanks to Daniel Prager for the push to fix this and doing
most of the work.

The timing tests below seem to indicate that it takes a constant
amount of time per element (about 1/7th of a microsecond per element
on my laptop) and even for 10 element lists it runs faster than
the sort-based version that this code replaces.

Below is some code that I used to explore the shuffles. I used Mike
Bostock diagrams (http://bost.ocks.org/mike/shuffle/compare.html)
to double check that the FY algorithm was implemented properly.

 #lang racket/gui
(require pict)

;; some shuffling algorithms:

(define (st-shuffle l)
  (sort l < #:key (λ(_) (random)) #:cache-keys? #t))

(define (fy-shuffle l)
  (define a (make-vector (length l)))
  (for ([x (in-list l)] [i (in-naturals)])
    (define j (random (add1 i)))
    (unless (= j i) (vector-set! a i (vector-ref a j)))
    (vector-set! a j x))
  (vector->list a))

(define (naive-swap-random->random l)
  (define v (apply vector l))
  (define len (vector-length v))
  (for ([x (in-range len)])
    (define n (random len))
    (define m (random len))
    (define t (vector-ref v n))
    (vector-set! v n (vector-ref v m))
    (vector-set! v m t))
  (vector->list v))

;; replication of the ``Will it Shuffle?'' diagram

(define green '(0 100 0))
(define red '(165 42 42))

(define (shuffle-pict shuffle size)
  (define pict-size 300)
  (define sq-size (/ pict-size size))
  (define v (build-vector size (λ (i) (make-vector size 0))))
  (define ht (make-hash))
  (define l (build-list size values))
  (define shuffles 10000)
  (for ([x (in-range shuffles)])
    (for ([x (in-list (shuffle l))] [i (in-naturals)])
      (define r (vector-ref v x))
      (vector-set! r i (+ (vector-ref r i) 1))))
  (apply
   hc-append
   (for/list ([r (in-vector v)])
     (apply
      vc-append
      (for/list ([e (in-vector r)])
        (colorize (filled-rectangle sq-size sq-size #:draw-border? #f)
                  (triple->color
                   (sq-color shuffles size e))))))))

(define (sq-color shuffles size n)
  (define mid-point (/ shuffles size))
  (cond
    [(<= n mid-point)
     (interp-color red
                   (- 1 (map-between (/ mid-point 3) mid-point n)))]
    [else
     (interp-color green (map-between mid-point (* mid-point 3) n))]))

(define (map-between lower-bound upper-bound n)
  (cond
    [(<= lower-bound n upper-bound)
     (/ (- n lower-bound) (- upper-bound lower-bound))]
    [(<= n lower-bound) 0]
    [else 1]))

(define (interp-color color %)
  (define (i n) (- 255 (* (- 255 n) %)))
  (list (i (list-ref color 0))
        (i (list-ref color 1))
        (i (list-ref color 2))))

(define (triple->color triple)
  (define (get n) (inexact->exact (floor (list-ref triple n))))
  (make-object color% (get 0) (get 1) (get 2)))

(module+ test
  (require rackunit)
  (check-equal? (map-between 10 110 0) 0)
  (check-equal? (map-between 10 110 10) 0)
  (check-equal? (map-between 10 110 20) 1/10)
  (check-equal? (map-between 10 110 100) 9/10)
  (check-equal? (map-between 10 110 150) 1)
  (check-equal? (sq-color 1000 10 0) red)
  (check-equal? (sq-color 1000 10 100) (list 255 255 255))
  (check-equal? (sq-color 1000 10 1000) green))

(define (pictures)
  (values
   (shuffle-pict st-shuffle 60)
   (shuffle-pict fy-shuffle 60)
   (shuffle-pict naive-swap-random->random 60)))

;; timing tests

(define (time-it a-shuffler size iters)
  (printf "~a ~a ~a " (object-name a-shuffler) size iters)
  (flush-output)
  (define l (build-list size values))
  (collect-garbage) (collect-garbage) (collect-garbage)
  (time (for ([x (in-range iters)])
          (a-shuffler l))))

(define (timings)
  (time-it fy-shuffle 10 100000)
  (time-it fy-shuffle 100 10000)
  (time-it fy-shuffle 1000 1000)
  (time-it fy-shuffle 10000 100)

  (time-it st-shuffle 10 100000)
  (time-it st-shuffle 100 10000)
  (time-it st-shuffle 1000 1000)
  (time-it st-shuffle 10000 100))

(module+ main (timings))
2014-10-31 13:26:50 -05:00
Stephen Chang
ef34c5db01 restore set/c default #:kind to 'immutable; update tests and docs to match 2014-10-29 16:47:58 -04:00
Stephen Chang
40422d35d3 change set/c default #:kind to dont-care, to match docs
- add set/c tests
2014-10-29 16:31:25 -04:00
Robby Findler
0fa5f866ae make path->relative-string/library use "<doc>/...." prefixes files in the docs 2014-10-28 17:09:53 -05:00
Matthew Flatt
8e34ef3a9d libffi: fix problems with gcc-4.0 on 32-bit Mac OS X
Based in part on https://trac.macports.org/changeset/122079
2014-10-28 08:06:13 -06:00
Matthew Flatt
35a762b556 remove internal sorted-dirlist function
The result of `directory-list` is now sorted by default, so the
extra function is not needed.
2014-10-27 16:01:49 -06:00
Matthew Flatt
9291726482 racket/file: add make-parent-directory*
Also, clarify behavior of `make-directory*` in the case of a relative
path when the current directory does not exist.
2014-10-27 16:01:49 -06:00
Matthew Flatt
2d85fdc02f libffi: restore some small patches
Also, revert file-permission changes.
2014-10-27 11:18:16 -06:00
Gustavo Frederico Temple Pedrosa
9832ad7750 Update libffi to 3.1
Update libffi to 3.1 to add support for new architectures.
2014-10-27 11:18:16 -06:00
Matthew Flatt
f31c6563e4 make read-line interruptable on a primitive port
Closes PR 14800

Merge to v6.1.1
2014-10-27 07:00:30 -06:00
Matthew Flatt
a352470914 work around a kqueue bug(?) on Mac OS X
There seems to be a problem in kqueue() on Mac OS X for watching for
FIFO write availability, where adding a read event for the same FIFO
(at a different file descritor) can disable the write event.

Merge to v6.1.1
2014-10-26 09:51:17 -06:00
Matthew Flatt
2679638e74 fd read and write: avoid redundant O_NONBLOCK flag setting 2014-10-26 09:21:28 -06:00
Matthew Flatt
b2509614e2 fd write: accomodate non-partial writes to a non-full descriptor
If a write to a non-blocking descriptor fails, then try again
with fewer bytes, since nothing in the spec write() seems to
promise writing partial amounts. In particular, writing to
a FIFO no Mac OS X might fail even if there are a few bytes of
space; as it happens, the select() function seems to compensate
and claim that such a FIFO is full, but kqeueue() doesn't.
2014-10-26 09:21:28 -06:00
Greg Hendershott
9de70551dc Fix bug with equal? on small bit-vectors. 2014-10-24 15:28:25 -04:00
Matthew Flatt
1f764a3dba fix internal meta-continuation comparison for continuation sharing
The check that the current meta-continuation matches the captured one
would always fail (I think), since the current meta-continuation is
pruned on capture. Keep a weak link to the original meta-continuation
to enable detection of capturing a continuation that matches or
extends one that was previously captured.

Enabling sharing exposed a problem with the code that saves
continuation marks for partial sharing, since that implementation
became out of sync with the main implementation (so merge the
implementations).
2014-10-22 13:14:58 -06:00
Matthew Flatt
d9f2a84951 repairs for {impersonator,chaperone}-struct
Commit 0b71b8481d didn't have the tests that I thought I had
written, and so the changes were unsurprisingly buggy.
2014-10-21 21:09:36 -06:00
Robby Findler
e589f591fb take advantage of the new impersonator support to hack in something that
avoids piling up redundant instanceof/c contracts

This is not a general purpose solution, but instead a hack that covers
certain hopefully likely patterns of redundant contracts for objects.

This commit looks for redundant contracts according in a slightly more
general pattern than just "is the most recently attached contract
stronger than the one I'm about to put on here and does it have the
same blame labels?", because that predicate isn't good enough to cover
the example below. In the example below, we repeatedly get the same
contract put on an object, but with different blame labels. So we need
to drop "inner" contracts. That is, when we have two contracts on
there and we go to add the third, we can tell that the second one
would no longer ever signal blame, so we can keep just the first in
the third.

More concretely, if we had these two contracts on 'v' with the given
blame labels (higher lines means the contract is "outside" or applied
later and the blame labels are in positive/negative order):

  (-> x y)  <c,d>
  (-> x y)  <a,b>

then the two possible blames we get here are blaming d for a non-x
argument and blaming a for a non-y result. And now lets say we add a
third contract to the stack that's a copy of the first, but possibly
with different blame labels:

  (-> x y)  <e,f>
  (-> x y)  <c,d>
  (-> x y)  <a,b>

Now we can blame f for non-x argument and a for a non-y result, both
of which are things covered by the first and third contract, so we can
safely drop the middle one and use this stack:

  (-> x y)  <e,f>
  (-> x y)  <a,b>

The example above is couched in terms of arrow contracts, but this
commit doesn't do this for arrow contracts, it does it for
instanceof/c contracts.

And also the way that we tell that the inner contract is redundant
isn't that it is equal; instead we use contract-stronger?. In
particular, the above reasoning works, I believe, when we have that
the inner contract is stronger than the one we're removing and when
the outer contract is also stronger than the one we're
removing. That's the check that actually happens in the code.

-------

The code below is the example below is an example Asumu sent me (but
with the TR parts stripped out). Before this commit, the contract
wrapping grows without bound, but with this commit it stays constant.

In the example below we get only two different sets of blame labels
(and equal contracts) and thus are actually more contracts that could
be eliminated, but this commit does limit it to just two contracts. (I
think it could be alternating between one and two contracts instead of
always two if the code that dropped the contracts were more clever.)

 #lang racket/base
(module State racket/base
  (require racket/contract racket/class)

  (define state/c
    (recursive-contract
     (class/c
      [m (-> any/c (instanceof/c state/c))]
      [n (-> any/c (instanceof/c state/c))])))

  (define state%
    (class object%
      (super-new)
      (define/public (m) (send this n))
      (define/public (n) (new state%))))

  (define (tree-next o) (send o m))
  (define (make-tree) (new state%))
  make-tree
  (provide
   (contract-out
    [tree-next (-> (instanceof/c state/c) (instanceof/c state/c))]
    [make-tree (-> (instanceof/c state/c))])))

(require (submod "." State))
(require racket/sandbox)
(with-limits #f
             100
             (let loop ([o1 (make-tree)] [n 0])
               (printf "~a\n" n)
               (define o2 (tree-next o1))
               (loop o2 (add1 n))))
2014-10-21 20:12:26 -05:00
Matthew Flatt
8a45f9d341 impersonated mutator: fix internal stack overflow
This is not a new bug, but it was exposed by the interaction
of the changed to the impersonated-mutator protocol and
the `unstable/option` test suite.
2014-10-21 13:53:09 -06:00
Eli Barzilay
e52f273491 Prevent irregular real numbers from being treated as valid JSON values.
Fixes PR 14628.
2014-10-21 10:15:36 -06:00
Matthew Flatt
0b71b8481d {impersonator,chaperone}-struct: change protocol to receive self
When calling a wrapper procedure for a field accessor or mutator,
provide the structure that was originally passed to the accessor or
mutator, instead of the value that was wrapped to create an
impersonator.

This is a backward-incompatible change, but I can't find any uses of
that initial argument to the wrapper procedure. Also, a wrapper can
capture the original value in its closure, while passing "self" allows
wrappers that are sensitive to overridden impersonator properties.
2014-10-21 10:05:02 -06:00
Matthew Flatt
99832efb45 openssl: fix ssl-load-default-verify-sources! for Win64
Closes PR 14784

Merge to v6.1.1
2014-10-21 07:33:11 -05:00
Matthew Flatt
3323605fa9 racket/udp: adjust receive into a zero-sized buffer
The OS doesn't necessarily react to a zero-sized buffer the way
that `udp-receive!` is supposed to work, so provide only a
non-zero-sized buffer to the OS.
2014-10-21 07:31:07 -05:00
Matthew Flatt
fbdfa36594 raco pkg: support "git://..." and "http[s]://[...].git" sources
Use the `net/git-checkout` library to support git repository servers
in general, instead of supporting only GitHub. A HTTP(S) source is
treated as a repository source when it ends with the ".git" suffix.
2014-10-18 09:16:01 -05:00
Matthew Flatt
ce464810d5 file/tar: add #:exists-ok? argument
The new argument is needed to reliably write to a tmp file, for
example, where the existence of the tmp file prevents other processes
from using the same name.
2014-10-18 07:14:50 -05:00
Matthew Flatt
ecc1d5dff2 net/git-checkout: repairs for HTTP(S)
Declare a "git" user agent, and use a secure client context for HTTPS
unless the `GIT_SSL_NO_VERIFY` environment variable is defined.
2014-10-18 07:14:50 -05:00
Matthew Flatt
06803e4da7 net/git-checkout: support ref -> ID mapping without download 2014-10-18 07:14:50 -05:00
Matthew Flatt
bbf154ba36 net/git-checkout: support the smart HTTP(S) transport
Git-based hosting services most commonly support the smart HTTPS
protocol, which carries "git://"-format payload in a fairly straightforward
way. (Supporting the dumb protocol looks much more difficult.)
2014-10-18 07:14:50 -05:00
Matthew Flatt
babd420293 net/git-checkout: checkout a tree via the "git://" protocol
The `net/git-checkout` library implements enough of `git clone` to
extract a tree from a repository that is accessed via the "git://"
protocol. It doesn't preserve a local clone, and it attempts to
download only the slice of the repository that is needed for the
requested tree (depending on how the tree is referenced).
2014-10-18 07:14:50 -05:00
Matthew Flatt
3a3ffe1efa note v6.1.1 in Racket "HISTORY.txt"
Merge to v6.1.1
2014-10-17 07:19:11 -06:00
Matthew Flatt
5650e8fc03 reorganize pkg/lib implementation
Split the module into several (smaller) modules.
2014-10-14 17:37:05 -06:00
Matthew Flatt
1cc86d3cea ffi/unsafe: fix make-sized-byte-string on a #f argument
In particular, a #f argument can make sense if the length is 0.
Technically, a byte string's byte array is supposed to be nul-terminated,
but many uses of byte strings get away without that terminator. I've
adjust the documentation to note that `bytes-copy` will work with a
non-terminated byte string.

Merge to v6.1.1
2014-10-14 16:43:20 -06:00
Robby Findler
ec4542383c add list*of 2014-10-11 23:23:38 -05:00
Matthew Flatt
608ac636eb repair ELF fixup on native-library installation
The fixup is not allowed to changed the virtual
address of a SHT_PROGBITS section, so a expanded
".dynstr" section might have to be moved to a
virtual address after everything else.
2014-10-11 14:11:21 -06:00
Matthew Flatt
71c93c2615 raco setup: unbreak for native libraries on Windows and Mac OS X
Repairs commit bd29411579.
2014-10-11 08:25:32 -06:00
Matthew Flatt
d4ad0a20e4 macro expander: fix an internal hash-table traversal bug
This bug could result in weird "cannot re-define a constant: lifted.0.2"
errors, or probably even worse collsisions of definitions, but I think
only in a namespace created from `module->namespace`.

So far, I haven't been able to create a reasonably small test,
because so many things have to line up in just the right way.

Merge to v6.1.1
2014-10-10 17:51:07 -06:00
Matthew Flatt
3692abf61e Windows: add "CP" before code page number as locale encoding
If you set the locale to something like "us_EN.1252", then
"1252" was returned as the encoding, but "CP1252" is more likely
to be recognized by `bytes-open-converter`.
2014-10-10 17:51:07 -06:00
Matthew Flatt
d8793e5b8b Always convert string<->paths with UTF-8 on Windows
Also, document representation information on paths. In particular,
explain that Unix and Mac OS X paths are natively byte strings, while
Windows paths are natively UTF-16 code-unit sequences. The byte-string
representation of a Windows path is a UTF-8-like encoding of the UTF-16
code-unit sequence, which is why it makes no sense to convert it using
the current locale's encoding.
2014-10-10 17:51:07 -06:00
Matthew Flatt
7e984c6009 fix allocation bug in equal? on deeply nested values
Based on the core file, this bug seems likely responsible for the
`raco setup` crash on DrDr for push 29346.

Merge to v6.1.1
2014-10-10 08:20:33 -06:00
Matthew Flatt
bd29411579 setup and pkg create: adjust ELF RPATH on install and uninstall
Allow a library installed as user-specific to refer to libraries
installed installation-wide.
2014-10-10 05:54:42 -06:00
Ryan Culpepper
653939ffa7 Post-release version for the v6.1.1 release 2014-10-08 14:39:56 -04:00
Matthew Flatt
40f5ec070a configure: add --enable-natipkg and 64-bit Linux native libraries
The `--enable-natipkg` configuration option adds "-natipkg" to the
platform library subpath. The suffix is intended to trigger the
installation of packages that supply native libraries for supported
platforms (where 64-bit Linux is the supported platform, for now, for
main-distribution packages), instead of relying on libraries installed
via the OS's package manager.

The intended client for "-natipkg" is the package-build service, where
installing packages via the OS package manager would require network
access and either trust or constrained installations. The build
machine is intentionally disconnected from the network and can only
access Racket packages, so repackaging native libraries as Racket
packages makes those libraries accessible.

A disadvantage of this approach to installing native libraries is that
it creates work for implementers of packages that access native
libraries. Those implementers will have to supply packages for 64-bit
Linux versions of native libraries to the degree needed to build and
(eventually) test the package. An advantage of the approach is that it
requires no changes to the package system; it will be cheap to replace
this approach if we find a better way to deal with native libraries
and/or OS packages in the package-build service.
2014-10-08 05:19:33 -06:00
Matthew Flatt
9d864b1182 fix UDP improvement for Windows 2014-10-03 06:44:47 -06:00
Matthew Flatt
2a387aceea racket/network: improve UDP support
Generalize `udp-send-to`, etc., to try each possibility of
a resolved address (instead of just the first one) like
`udp-connect!` does. This matters, for example, when using
"localhost" as an address, when the machine resolves "locahost"
to both "127.0.0.1" and "::1", and when the socket is created
for the second one that would be tried.

Also, detect and discard asynchronous ICMP errors.
2014-10-02 11:33:38 -06:00
Robby Findler
7aa4c94b9b fix some random generators broken when refactoring things to improve contract-stronger? 2014-10-01 21:44:02 -05:00
Matthew Flatt
b946d4639e JIT: fix allocation of letrec-bound closure over unboxed flonums
The closure could be allocated as uninitialized memory with the
expectation that it would be filled right away, but boxing values
to put in the closure could expose the uninitialized memory to
the GC. Fix the problem by boxing before allocating closures.
2014-10-01 13:13:37 -06:00
Ryan Culpepper
b2c6022989 syntax/parse: support pvar:literal patterns 2014-10-01 10:39:56 -04:00
Ryan Culpepper
e1e2e7e5da syntax/parse: conventions have lowest priority 2014-10-01 10:39:56 -04:00
Ryan Culpepper
ee65681a90 syntax/parse: literals shadow pattern forms etc
closes PR 14750
2014-10-01 10:39:56 -04:00
Jay Kominek
320079eeab add server-side support for TLS SNI 2014-10-01 10:39:56 -04:00
Robby Findler
221519f47f change the recursive contract stronger implementation
to use hash tables instead of association lists
2014-09-30 21:02:13 -05:00
Ryan Culpepper
3d5fcaa355 move pattern-expander contracts to outer modules, trim exports
This avoids mysterious errors later in the build process related to
TR and static-contracts. I don't see how the pattern-expander code
could possibly cause the errors that occur, but this commit fixes them.
2014-09-30 11:05:04 -04:00
AlexKnauth
81cc6bf4d0 add pattern-expanders to syntax/parse 2014-09-30 11:05:04 -04:00
Vincent St-Amour
e5fd7e504d Revert "Revert "fix a bug in f669c47c1""
This reverts commit 2e29a18039.

Reverted the wrong commit.
2014-09-29 15:41:51 -04:00
Matthias Felleisen
2e29a18039 Revert "fix a bug in f669c47c1"
This reverts commit 379ed6b46e.

Stupid robby experiment
2014-09-29 12:06:47 -04:00
Matthew Flatt
cf7c013477 Windows: fix handling of junctions as links
On Windows, a "soft link" or "junction" is different from a
"symbolic link". The current Windows documentation is
incomplete in that it describes the behavior of GetFileAttributesEx
for a symbolic link, but not for a junction, and I guessed wrong.
For consistency, junctions need to be treated like symbolic links.
2014-09-27 20:45:13 -06:00
Matthew Flatt
2eb943e0de racket/place: fix nested-place termination 2014-09-26 06:41:41 -06:00
Robby Findler
a9c0c8bccd add hash/c stronger
also, bring down below 102 columns
2014-09-25 17:42:43 -05:00
Matthew Flatt
116e06407b racket/draw Windows: patch Cairo for clipped DC surface creation 2014-09-25 16:17:29 -06:00
Robby Findler
a41ba9d37f add stronger for parametric->/c
(and test cases for stronger with new-∀/c)
2014-09-24 16:53:35 -05:00
Robby Findler
1f1479c7be add stronger to implementation?/c and subclass?/c
also, bring down below 102 cols
2014-09-24 16:53:25 -05:00
Robby Findler
9e3a9d17d5 add stronger to is-a?/c 2014-09-24 16:53:25 -05:00
Robby Findler
748e3ef7cc add stronger to syntax/c 2014-09-24 16:53:25 -05:00
Matthew Flatt
a64a1cb177 racket/gui: DPI-aware on Windows
The `racket/draw` library is now independent of the screen resolution
on Windows. Font sizes in "points" are the only place where the
resolution mattered before, and now `racket/draw` assumes a
traditional 96dpi on Windows and Linux (and a traditional 72dpi
on Mac OS X).

Setting the scale for "text and other items" in Windows now adjusts
the backing scale of screen and canvas-compatible bitmaps, as well as
setting a scale on canvas drawing. Window and screen positions and
sizes are similarly scaled; for example, if the screen is 2048x1436
with text scaled by 200%, then `racket/gui` reports the display size
as 1024x768 (and the display backing scale as 2.0).

Backing scales of 1.25 and 1.5 are common for Windows. Rounding
associated with those scales could cause trouble for virtual -> actual
-> virtual conversions.
2014-09-24 08:40:52 -06:00
Robby Findler
bbb4897ce2 add a stronger to class/c 2014-09-24 06:49:46 -05:00
Robby Findler
ac9b1cd05b add box/c stronger 2014-09-23 12:52:51 -05:00
Robby Findler
5da7104829 improve contract-stronger for vectors 2014-09-23 12:41:28 -05:00
Robby Findler
5099b380e6 improve contract stronger for promise/c 2014-09-22 21:39:43 -05:00
Robby Findler
932f041597 improve contract stronger for </c and >/c
and modernize those combinators, too
2014-09-22 20:45:18 -05:00
Robby Findler
379ed6b46e fix a bug in f669c47c1 2014-09-22 15:20:26 -05:00
Robby Findler
f669c47c1d improve contract-stronger for list-related contracts
also bring listof in line with the present
best practices of the contract library
2014-09-22 12:55:38 -05:00
Robby Findler
05185dcdde improve stronger for flat-named-contract
by making the equal, eq, and regexp contracts all have
an extra field to hold the name. This mostly has the advantage
that flat-named-contract has to turn a flat contract into it's
predicate a bit less often
2014-09-21 21:02:50 -05:00
Robby Findler
404c067286 improve chaperone-procedure error messages a little 2014-09-21 16:53:16 -05:00
Matthew Flatt
a8d0534e65 chaperones: allow procedure chaperones that supplies no redirection
The same as the change for structure chaperones, but for procedures.
2014-09-21 12:13:55 -05:00
Matthew Flatt
1f1a10db87 chaperones: allow struct chaperones that supply no redirections
(as requested by Asumu)

A witness accessor or mutator is still required to create a structure
chaperone, but `#f` can be provided in place of a redirection, and
then impersonator properties can be attached to the chaperone.

At the same time, adjust `(chaperone-of? v1 v2)` so that `v1` as a
chaperone is not required to preserve non-redirecting chaperones of
`v2`.

The overall consequence is that a redirection procedure can cooperate
with a (suitably protected) impersonator property to override
redirection behavior without running afoul of the chaperone invariant
and without requiring O(N) space for O(N) overrides. For example, the
contract system can implement the re-application of a contract with
different blame information by overriding blame information as
represented by properties, instead of adding a new chaperone layer
every time that blame changes.

... and all the same for non-chaperone impersonators, of course.
2014-09-21 11:51:36 -05:00
Robby Findler
9681032783 improve contract-stronger for instanceof/c 2014-09-21 06:13:58 -05:00
Robby Findler
eaf48bbbf1 add a proper stronger implementation based for recursive-contract
Following _Subtyping Recursive Types_ by Roberto M. Amadio and Luca Cardelli
2014-09-19 23:29:11 -05:00
Robby Findler
929ed92f40 fix bug in ->i expansion when the name ctc is used in certain ways 2014-09-19 23:29:11 -05:00
Robby Findler
ad7e2a71b7 Those commits can change the blame assignment in
incorrect ways

This reverts commit 0aee13bf22.
This reverts commit a0880f7403.
2014-09-19 23:29:10 -05:00
Robby Findler
a0880f7403 improve contract-stronger and related things
Specifically, add a mechanism so that contract combinators
can accumulate contracts on a value (instead just storing
only one) and then use that in instanceof/c to avoid
putting contracts on values more often.

Also, fill in better contract-stronger implementations in
some of the combinators
2014-09-19 12:57:08 -05:00
Sam Tobin-Hochstadt
837abdd51a Add raco pkg archive.
This creates a catalog from the specified currently-installed
packages. The catalog can then be used to replicate some or
all of the currently-installed packages in another installation
or other context.

Also extend `pkg/command` so that `#:multi` is useful.
2014-09-19 11:03:26 -04:00
Matthew Flatt
43d6684ab9 avoid stack-overflow in scheduler-triggered foreign calls
While a foreigh call is normally guarded by a check on the amount
of available stack space, a callbacks triggered by the
scheduler will first put Racket in no-stack-overflow mode, and
then it's too late to check stack space before making further
foreign calls. With Cocoa, there's some chance that the process
will run out of space. Avoid the mismatch by checking the stack
availability at the start of a scheduler iteration.
2014-09-18 06:06:21 -05:00
Mike Sperber
9dbc4842f7 Unbreak the build on FreeBSD 10.
isnan expands into a use of a function called _Generic.

Tell xform not to worry about it.
2014-09-14 09:09:45 +02:00
Matthew Flatt
ad2243ee01 restore accidentally removed GC check
Fixes a mistake in commit 768b93be82, which dropped a check that is
needed to trigger GCs during a sequence of large-block allocations.

Closes PR 14738
2014-09-12 12:22:55 -06:00
Robby Findler
dcfe7ede67 make some arity error messages for ->i contracted functions
slightly less terrible

... but ->i still doesn't do as good a job as -> and ->* do for arity
errors (specifically, ->i is still letting the blame-less errors that
application constructs thru when it could be assigning blame)
2014-09-10 16:57:52 -05:00
William J. Bowman
c6b3f337e9 Added trace-define, trace-let, trace-lambda
In racket/collects/racket/trace.rkt
2014-09-08 16:36:16 -04:00
Robby Findler
863f7d6669 improve parametric->/c's cooperation with a few bells and whistles in contract error reporting 2014-09-08 09:29:11 -05:00
Gustavo Massaccesi
1542398822 optimizer: move more things inside let and begin
Refactor the code to move inside 'let' or 'begin'.

Also, in the test position of a 'if', recognize the 'not' inside a 'let' or 'begin'.
For example, transform (if (begin ... (not p)) x y) => (if (begin ... p) y x)
Previously, this conversion was made only when
the 'not' was the outermost expression.

And use the refactored code to move application inside 'let' or 'begin' in a single step
For example, transform ((let (...) ... (let (...) ... f) x) => (let (...) ... (let (...) ... (f x))
In the conversion, it's necessary to shift x to the new coordinates inside the 'let's.
In the new version x is shifted only once.
2014-09-07 19:33:46 -06:00
Matthew Flatt
cddfdca835 JIT: fix problem with arity checking with >= 25 arguments 2014-09-07 18:41:16 -06:00
Marc Burns
467786fc1c Handle data descriptor signatures in file/unzip
http://www.pkware.com/documents/casestudies/APPNOTE.TXT specifies that a data
descriptor signature may be placed after the compressed data and before the
data descriptor. file/unzip now handles this case.
2014-09-07 07:47:20 -06:00
Marc Burns
478b01b0e3 unzip: Handle non-seekable input ports.
Before this commit:
  - unzip would attempt to seek the input port via file-position in some cases

After this commit:
  - unzip reads and discards bytes as needed to skip forward
2014-09-07 07:47:20 -06:00
Matthew Flatt
f9f43a4be7 avoid compiler warnings 2014-09-07 07:47:19 -06:00
Matthew Flatt
289e908ab2 string-normalize-...: fix memcpy that should be memmove 2014-09-05 22:02:13 -06:00
Matthew Flatt
230ce10b11 bump version 2014-09-05 21:13:16 -06:00
Matthew Flatt
51d91032f5 optimizer: fix bug
Repair a typo in b0f4a32049; thanks to Blake Johnson.
2014-09-05 21:10:16 -06:00
Matthew Flatt
79f7a642e1 avoid compiler warnings 2014-09-05 19:06:02 -06:00
Matthew Flatt
33e97745e9 treat OS page manager (especially Linux) more gently
Batch up mprotect() calls when cleaning up a place. Hopefully,
this will avoid ENOMEM errors from mprotect() on DrDr's build.
2014-09-05 17:49:41 -06:00
Matthew Flatt
af9e891215 module caching: ensure consistency of directory paths
Use `path->directory-path` to normalize directory paths and
increase use of the cache.
2014-09-05 15:54:18 -06:00
Matthew Flatt
bc48e9b935 win32: reduce allocation in the scheduler
It's not clear that the changes affect anything in practice,
but they avoid unnecessary allocation and quadratic behavior
in principle.
2014-09-05 15:54:17 -06:00
Matthew Flatt
cd17e08f12 check result of mprotect() 2014-09-05 13:49:27 -06:00
Matthew Flatt
59d3663106 ffi/unsafe win32: fix inefficiency in call-in-orig-thread mode
The problem made simultaneous rendering of "plot" and "math"
documentation about 10 times slower than it should be.
2014-09-05 10:34:27 -06:00
Matthew Flatt
f32d4b0187 minor cleanup on thread termination 2014-09-04 23:49:50 +02:00
Matthew Flatt
52514a4af4 fix interaction of alarm-evt and replace-evt
With `replace-evt` the time that the system needs to wake up
to check the event can drift later, but scheduling state was
carried in a way that works only if the wake-up time drifts
earlier.

Unfortunately, I don't know how to write a test for this bug.
The usual stategy of using `system-idle-evt` to detect busy
waiting doesn't work here, because the business happens despite
the scheduler's conclusion that the system is idle.

As reported by Jan Dvořák on the mailing list.
2014-09-04 23:49:28 +02:00
Matthew Flatt
59fac3d38a racket/port: fix busy-wait bug in make-limited-input-port
As reported by Marc Burns on the mailing list
2014-09-04 23:46:18 +02:00
Jay McCarthy
34dc76bd05 Revert "Fix PR14692"
This reverts commit 92d5408aa8, because
it breaks the build due to recursive deps. (It also breaks if the core
is in the "racket" package.)
2014-09-03 10:53:28 -04:00
Jay McCarthy
92d5408aa8 Fix PR14692 2014-09-03 10:44:29 -04:00
Matthew Flatt
b942a21846 fix module-code caching
Fixes a problem with c4508ad0d9, which disabled module-code
caching too often. A symptom of the disabled cache was that
running "math/scribblings/math.scrbl" would use twice
as much memory.
2014-09-03 12:16:29 +02:00
Matthew Flatt
fa75aec408 make installers: avoid dot-files (like ".gitignore") in installers
Closes PR 14716
2014-09-01 12:08:45 +02:00
Matthew Flatt
b0f4a32049 fix cross-module function inlining and argument use-count tracking
Order mismatch between tracking an use could cause a multiply-used
argument to be treated after inlining as a single-use argument.

Closes PR 14717
2014-09-01 12:08:44 +02:00
Sam Tobin-Hochstadt
2d701f046c Add get-all-pkg-scopes. 2014-08-29 21:40:38 -04:00
Matthew Flatt
1cb16f6c36 ffi/unsafe/objc: fix objc-is-a? to recognize subclass instances
This repair turns out to matter for Mac OS X 10.10, where creating
a list box in a frame somehow makes the frame an instance of a
subclass (that implements notifications of some sort, I think).
That subclassing broke an `(objc-is-a? ... RacketWindow)` test to
recognize windows that belong to a particular eventspace.
2014-08-29 14:12:26 -06:00
Matthew Flatt
76f1ebded9 Mac OS X: incorporate Pango repair for Yosemite
Pango 1.36.6 fixes the problem, so update native libraries
and the Coretext patch.
2014-08-29 10:12:27 -06:00
Matthew Flatt
768b93be82 improve GC handling of out-of-memory
There's a point in attempting to allocate a new large page
where it makes sense to GC and try again.
2014-08-29 10:12:27 -06:00
Matthew Flatt
edf140a440 make server: snapshot source catalog, set local cache 2014-08-26 14:41:13 -06:00
Matthew Flatt
b00638c52d ffi/unsafe: changed the way ffi-lib uses a version number with ".dll"
Add the version with a "-" before ".dll", instead of with a "."
after ".dll".
2014-08-26 09:18:43 -06:00
Gustavo Massaccesi
35eb65628e optimizer: use the equal? => eq? transformation to the optimizer phase
For some types, (equal? x y) is transformed into (eq? x y) in the resolve phase.
This commit adds this transformation to the optimizer phase. This improves
constant folding and enable some optimizations that are prevented
because equal? can run arbitrary code.

Also, transform   (eq? #f x) => (not x)   and   (eq? '() x) => (null? x)   to use
the type information of x when it's known.
2014-08-26 09:18:43 -06:00
Matthew Flatt
3943826b70 raco setup: fix ".dylib" references on install
If a Mach-O file installed with `{copy,move}-foreign-libs` has a
"@loader_path/" reference to a library that is installed in a
different target directory (normally because it's from a package that
is installed in a different scope), then change "@loader_path/" to an
absolute-path reference to that target.
2014-08-25 17:16:01 -06:00
Gustavo Massaccesi
fdf1a1f7ae optimizer: Remove unused flag added in d14b4a8 2014-08-24 07:29:55 -06:00
Matthew Flatt
769c5b6edd optimizer: another ((begin ... proc) x) to (begin ... (proc x))
The tranformation this time applies before optimization of the rator
and complements Gustavo's variant, which applies after optimization of
the rator.
2014-08-23 09:13:49 -06:00
Gustavo Massaccesi
d14b4a8095 optimizer: transform ((begin ... proc) x) to (begin ... (proc x))
Currently the optimizer can convert ((let (...) ... proc) x) to
(let (...) ... (proc x)). This is useful especially if proc can be
inlined. Extend this to begin's forms.
2014-08-23 08:59:39 -06:00
Gustavo Massaccesi
1f2f7a1df4 optimizer: more optimizations for unary operations
Previously, the optimizer simplified the application of some unary functions inside let,
for example (car (let () ... (cons 1 2)) => (let () ... 1). This commit extends this to begin forms,
like (car (begin ... (cons 1 2)) => (begin ... 1).

Also, constant folding and some reductions were only availed in the direct case, for example
(procedure? car) => #t. With this commit these reductions are extended to the expressions
inside let and begin, for example (procedure? (let () (begin ... car))) => (let () (begin ... #t).
2014-08-21 09:37:10 -06:00
Tobias Hammer
e637d78a09 fix cross compile on QNX
got broken in 2e284cc783
The racket version of libunwind is not compatible with QNX but old-style stacktraces are still working with the default gcc version
2014-08-20 16:47:20 -06:00
AlexKnauth
0b045ba77b Add syntax-local-match-introduce 2014-08-15 11:19:48 -04:00
Matthew Flatt
b2b00010e3 annotate and check packages for build and binary modes
If "p" is available as a source package, which is typical, then `raco
pkg install --binary p` would strip away the build dependencies of "p",
so that "p" would not install properly.

This commit changes `raco pkg install` to look for an annotation on
the package and complain if the annotation is inconsistent with the
requested conversion: a binary package cannot be used as a source
package or vice versa. (A built package, as provided by a snapshot
site, can be used as any kind of package.)
2014-08-15 15:41:27 +01:00
Matthew Flatt
05523a0b42 raco pkg: add --binary-lib package stripping to remove docs
The `--binary-lib` mode is like `--binary`, but it also omits
documentation to form a "binary library package".

The `--binary-lib` flag and "X-lib" vs. "X-doc" approaches solve the
same problem with different trade-offs:

 * When a package is split into "-lib" and "-doc" packages, then it's
   easier install non-documentation parts, and it's possible to
   install them from source. A programmer has to work more to split
   the packages, however, and the library and its implementation must
   have separate sources (i.e., no or restricted in-source
   documentation).

 * When a package is just "X", then users can install a no-source,
   no-documentation version by specifying `--binary-lib`, but only
   when the package is available from some catalog and provider in
   built form (such as from a distribution site or a package-build
   service).

In the long run, I think that relying on `--binary-lib will be best
and typical for most packages. The "X-lib" plus "X-doc" approach
that's common in the current distribution's packages, meanwhile, will
likely stick around for basic packages that are commonly useful in
constrained settings (including the setting of a package-build
service).
2014-08-15 10:33:20 +01:00
Matthew Flatt
ed66ff4ecc pkg metadata: add update-implies
The `update-implies` declaration is half of `implies` (even though the
name is bigger): update of the package implies an update of another,
but a dependency on the package is no license to access the content
of the other.

This declaration is intended as an alternative to keeping version and
dependency declarations in sync for a pair of packages that are always
updated together, normally because the packages are in the same
repository. For example, a "-test" or "-doc" package might have an
`update-implies` declartion on the corresponding "-lib" package.
2014-08-14 16:49:52 +01:00
Matthew Flatt
c61a4714e8 doc clarifications and typo in command-line help 2014-08-14 14:00:01 +01:00
Matthew Flatt
906ba45c6c reegxp-match: fix problem with lazy string decoding and output port
Closes PR 14684
2014-08-13 13:28:51 +01:00
Matthew Flatt
c359f7ac29 build less when a pre-built racket is supplied
Adjust dependency tracking and makefile rules to that when
`--enable-racket=...` is provided to `configure`, intermediate
CGC objects are not compiled.

The new approach uses dependency tracking that was already supported
by xform, previously used only for Windows.
2014-08-13 07:33:09 +01:00
Matthew Flatt
7e141a89f7 suppress ar output for SGC library
The `nicear` script avoids stderr output on DrDr.
2014-08-13 07:33:09 +01:00
Matthew Flatt
a266d623aa windows: better approach to manifest
Works for VS 2008 and 2012, at least.
2014-08-12 18:07:28 +01:00
Matthew Flatt
3b962a235d Revert "windows: remove custom manifest"
This reverts commit 67007451b3.

Seems to be needed after all.
2014-08-12 16:43:26 +01:00
Matthew Flatt
fa66067359 fix no-places, no-futures build 2014-08-12 15:58:43 +01:00
Matthew Flatt
fc8b2f02f9 Windows: more changes to auto-adapt to Visual Studio version
Although newer versions of Visual Studio can open 2010 projects, the
meaning of the project turns out to be: use 2010 tools. So, I've added
a step in the build script to automatically upgrade the solutions and
projects based on the version of Visual Studio that is being run.

Meanwhile, since my previous tests for VS 2012 and VS 2013 were using
VS 2010 projects, I wasn't actually testing with the 2012 and 2013
compilers. Additional changes are needed to make those work, notably a
fresh implementation of setjmp() and longjmp() for Win64.

This was all very painful, but the projects are now in much better
shape, so maybe it won't be so bad from here.
2014-08-12 15:55:37 +01:00
Matthew Flatt
67007451b3 windows: remove custom manifest
The manifest was intended to enable XP-style controls, but at this
point it doesn't seem to do anything except interefere with some
variants of the build tools.
2014-08-12 15:42:13 +01:00
Matthew Flatt
df375daef4 avoid NULL argument to memcpy()
gcc 4.9 takes advantage of the specification of undefined behavior if
you pass a NULL to memcpy(), even if the last argument is 0
2014-08-12 08:47:14 +01:00
Matthew Flatt
3c8b5b672e windows: fix sgc allocation of executable pages 2014-08-12 07:33:43 +01:00
Matthew Flatt
881990eddf windows: switch projects to SGC by default 2014-08-12 06:44:55 +01:00
Matthew Flatt
a312f499cb racketcgc: use SenoraGC instead of Boehm GC by default
This new default for Unix and Mac OS X trades performance for
portability (hopefully), but for most users the switch affects only
for the build process, where `racketcgc` is used to build `racket`.

To continue using Boehm GC, configure with `--disable-sgc`.

For now, Boehm GC continues to be the default for Windows.
2014-08-12 05:14:44 +01:00
Matthew Flatt
2916fc34cc SenoraGC: support allocation of executable memory; tune for performance
Allocation of executable memory is intended to make SELinux
happier by mmapping with PROT_EXEC instead of using mprotect()
to allow execution after the fact.

Performance improvements bring SGC within 30% of the Boehm GC on
`racketcgc -cl racket`, which makes SGC an even more plausible
substitute.
2014-08-12 05:14:14 +01:00
Matthew Flatt
2220452b72 racket/place: protect place-creation bindings
Closes PR 14677
2014-08-11 10:48:58 +01:00
Matthew Flatt
c4508ad0d9 avoid cross-namespace submodule pollution via module-code cache
When a module is loaded with submodules intact, it should not be
cached and used for a later load that is intended to obtain the
module without submodules. Avoid mismatches by constraining the
cache to modules without submodules.
2014-08-11 10:26:32 +01:00
Matthew Flatt
2bdb8c1de5 fix rename-transformer-target for chaperoned structs 2014-08-11 07:41:47 +01:00
Matthew Flatt
5ef75682d7 fix run-time error reporting for variables in a submodule
Error reports used the "source" field of a module, which
doesn't have submodule information, or the "name" field of
a module, which might not match an actual filename (".ss"
vs. ".rkt"). Create the right combination.
2014-08-11 07:41:43 +01:00
Matthew Flatt
f4c1d7ec03 racket/class: add missing check for #<unsafe-undefined>
When a superclass method is called before the superclass
is initialized, then all field accesses need to be guarded.

Robby found this one.
2014-08-06 08:46:51 +01:00
Matthew Flatt
fe12e93192 bump version 2014-08-05 16:23:10 +01:00
Matthew Flatt
926e64f5f1 fix "fixing letrec" pass
Adjust the compiler pass to insert checks for #<unsafe-undefined>.
The chanegs amount to throwing out the old attempt to follow the
implementation sketched in "Fixing Letrec", and instead use a
simpler abstract interpretation.
2014-08-05 16:22:31 +01:00
Matthew Flatt
ac428f89fa use-before-definition analysis: fix checking of with-cont-mark form
Similar to the `set!` problem.
2014-08-05 16:00:19 +01:00
Matthew Flatt
6efac46b3f letrec-check analysis: remove no-op part of implementation
The `deferred_uvars` list is constucted so that it always
has the same length as `uvars`.
2014-08-05 16:00:19 +01:00
Matthew Flatt
837a55f484 use-before-definition analysis: fix handling of let[*]
Bindings in `let` and `let*` need to be tracked much the same
way as for `letrec`, so that

 (letrec ([b (let ([d (lambda () c)])
               (d))]
          [c 1])
   b)

raises an exception.
2014-08-05 16:00:19 +01:00
Matthew Flatt
7d85bccaa2 use-before-definition analysis: fix checking of set! form
Treat the RHS of `set!` as escaping to an unknown context, so
that any variables it references are treated as unprotected.
2014-08-05 16:00:19 +01:00
Matthew Flatt
30d30ce74c win32: fix 32-bit get-seconds 2014-07-31 09:53:07 +01:00
Matthew Flatt
dc271e8347 racket/port: enable buffering for peeking-input-port 2014-07-30 11:49:04 +01:00
Matthew Flatt
9d17a35539 fix expand on a module containing lifts from expression
Another attempt at the bug that b95baa1d25 was intended to fix.
2014-07-30 10:33:52 +01:00
Matthew Flatt
b95baa1d25 fix expand on a module containing a #%declare form 2014-07-30 08:49:28 +01:00
Matthew Flatt
21f78ecd14 fix problem with (continuation-marks <thread>)
A thread can be swapped out while it's in transition between a
mandling of the mark-stack position and recovering from C-stack
overflow. Fix up that case.
2014-07-30 07:20:45 +01:00
Matthew Flatt
807b909e73 allow expand on cross-phase-persistent modules
Previoulsy, `expand` mode explicitly disallowed cross-phase declaration
in commit 2e652fc2b3. I'm not sure why, and that commit has no test
case that fails when the restriction is removed, so my best guess is
that it was a debugging strategy that I forgot to undo.
2014-07-30 06:30:44 +01:00
Robby Findler
7472058fd9 fix contract random generation for -> when the range is 'any' 2014-07-29 09:38:09 -05:00
Leif Andersen
027fb52c66 mz-gdbinit script gives type when using pso
The mz-gdbinit script (generated by mk-gdbinit.rkt) gives the type when using
pso, even when the default template did not include the type.

It defaults to printing out only the name of the type without additional
information.
2014-07-29 14:22:07 +01:00
Jan Dvořák
8bd5aa38b1 allow mixing exceptions with ffi/unsafe/alloc
Use call-as-atomic that can handle exceptions instead of dynamic-winding
start-atomic and end-atomic. Exceptions can be found in the functions's
result wrapper such as:

    (define-lib find-some-object
                (_fun (name : _string/utf-8)
                      (object : (_ptr o _some-object-pointer))
                      --> (result : _int)
                      --> (begin
                            (when (negative? result)
                              (error 'find-some-object "unknown name"))
                            object))
                #:wrap (allocator free-some-object))

Signed-off-by: Jan Dvořák <mordae@anilinux.org>
2014-07-29 14:16:26 +01:00
Matthew Flatt
41e7d346d1 adjust link-all to avoid conflicts 2014-07-29 10:48:33 +01:00
Matthew Flatt
04c36e2c09 adjust pack-all script to flush status messages 2014-07-29 10:48:32 +01:00
Matthew Flatt
d2a8bfcfe6 raco pkg update: don't claim conflict with package being updated
Merge to v6.1
2014-07-28 16:29:43 +01:00
Robby Findler
e082f9b183 adjust real-in implementation so that it prints as (real-in ...) instead
of (between/c ...)
2014-07-28 08:37:19 -05:00
Matthew Flatt
135ccf094e Windows: use native Win32 API for dates
Allows conversion of negative "seconds" to reach dates before
1970, and fixes year-varying DST tracking for versions of
Windows that know about those details.

As far as I can tell, we have to compute ourselves whether a
date is in daylight-saving time based on specifications of
when daylight and standard times start. That part seems tricky
and could use extra review.
2014-07-25 15:37:35 +01:00
Matthew Flatt
816d09bb24 macro expander: fix #%top via local-expand
Fix bug in b25a2b83ba that breaks the teaching languages.
2014-07-25 11:21:20 +01:00
Matthew Flatt
8f8e3b7c65 close hole in chaperone implementation
Problem, example, and solution from Sam; see the dev mailing-list post
on 24-JUL-2014.

When a chaperoned accessor, mutator, or property accessor is used to
chaperone a struct, the chaproning procedure must not be able to
see things that the chaproned accessor, mutator, or property accessor
would not allow.
2014-07-25 11:02:08 +01:00
Matthew Flatt
b25a2b83ba The implementation of #%top within a module has, for a while,
required that the identifier wrapped by `#%top` not have a local
binding. Change the documentation to match the implementation in that
way. (Since local binding in an identifier's lexical information
contributes to its identity as a top-level binding, that specification
of `#%top` would make sense everywhere, but I've left the top level
alone for backward compatibility.)

Also, change `local-expand` to never introduct `#%top`
wrappers. That's a little more consistent with what `#%top` has
evolved to mean, and it specifically works better with
`local-expand/capture-lifts`.

Closes PR 14635 and PR 14654
2014-07-25 09:07:46 +01:00
Matthew Flatt
ccda0e4abb macro expander: fix identifier-binding on fully expanded module
Fix the case of an identifier that is used as a binding in a module
but originated from a different module.
2014-07-25 07:21:06 +01:00
Asumu Takikawa
1bf54b06ee Revert label phase check, do correct thing
Thanks to Matthew for advice
2014-07-24 13:46:42 -04:00
Matthew Flatt
682c92554f net/http-client: don't send a 0-sized chunk that isn't a terminator 2014-07-24 16:40:34 +01:00
Scott Bell
29922c8a77 Send a final, empty chunk as required by RFC 2616 in http-conn-send! 2014-07-24 16:39:41 +01:00
Matthew Flatt
1809df456a regexp-match: tune chunking of UTF-8 decoding
A `string-split` on a big string with lots of small matches sends the
regexp matcher a big string many times. Decoding 1024 bytes each time
is too much. Decoding 32 bytes is be a better trade-off between
chunking for large matches and being lazy for small matches.

For example, on a 60MB string with a space every 15 characters or so,
splitting on a space is about 3 times as fast with this adjustment.

I tried a few chunk sizes, and 32 worked the best in my experiments.
Naturally, as more bytes are read, the chunk size ramps up, so it's
a question of initial size; larger matches are relatively insensitive to
the initial size (so, again, it makes little sense to cater to large
matches with a large initial decoding size of 1024 bytes).
2014-07-24 16:07:01 +01:00
Matthew Flatt
fffcf9f921 equal?: remove redundant eqv? test 2014-07-24 14:39:51 +01:00
Matthew Flatt
f0e710179c filesystem-change-evt: report inotify_init() error correctly 2014-07-24 14:12:17 +01:00
Matthew Flatt
c570a86201 streamline some paths for equality and hashing
Cuts about 1/3 of the time for a string-hashing microbenchmark
provided by Pedro Ramos:

 #lang racket
 (define alphabet "abcdefghijklmnopqrstuvwxyz")
 (define (random-word n)
   (build-string n (lambda (x) (string-ref alphabet (random 26)))))
 (define words (for/list ([k 1000000])
                 (random-word 3)))
 (define d (make-hash))
 (time (for ([w (in-list words)])
         (if (hash-has-key? d w)
             (hash-set! d w (add1 (hash-ref d w)))
             (hash-set! d w 1))))
2014-07-24 13:33:11 +01:00
Asumu Takikawa
ad677478ab Test for begin at label phase 2014-07-23 12:20:50 -04:00
Matthew Flatt
a95e279219 fix submodule export of enclosing module's binding
When `x` and `x`-with-a-mark are both defined, then the order of
definitions affected the binding that `(provide x)` would export
in a submodule that uses `#f` as its language. The problem was
in the implementation of the implicit `require`, which needs to
look up a variable's symbolic name in two different environments
to set up the right mapping.
2014-07-23 16:46:51 +01:00
Matthew Flatt
4c8084e5d8 quasisyntax: fix reporting for misused unsyntax[-splicing]
Closes PR 14652
2014-07-23 11:01:41 +01:00
Matthew Flatt
df5bfe19c0 sync: accept 0 arguments
As suggested by Jonathan Schuster.

Note that the `choice-evt` constructor already accepted 0 arguments.
2014-07-23 07:55:17 +01:00
Robby Findler
f9b20d3789 fix bug in ->i 2014-07-22 22:42:41 -05:00
Asumu Takikawa
041c2b1a07 Add flatten-all-begins to syntax/flatten-begin 2014-07-22 17:38:08 -04:00
Robby Findler
2a07425f26 renaming bug in file/convertible's contract 2014-07-18 23:32:24 -05:00
Robby Findler
5641ab84db add contracts to file/convertible 2014-07-18 20:59:09 -05:00
Robby Findler
4a996cce6b add context into the blame record for struct-type-property/c
and use the standard contract printer
2014-07-18 20:33:41 -05:00
Matthew Flatt
e8278176fa update racket/HISTORY.txt
Merge to v6.1
2014-07-18 07:55:50 +01:00
Matthew Flatt
7a5746d9a7 future: fix completion of a future that ends with a delayed tail call
The completion needs to be set up as an lightweight contination so
that it can be captured.

Merge to v6.1
2014-07-17 17:02:02 +01:00
Matthew Flatt
4541a75e76 future: fix slow path for inlined struct getter
Merge to v6.1
2014-07-17 17:02:01 +01:00
Matthew Flatt
76aefcb508 fix sleep timeout in scheduler
In the case that the current time equals exactly the timeout of
a `sync/timeout`, the Racket process could get stuck (using no CPU)
instead of continuing as it should.

How did we not find this before? Why am I suddenly able to replicate
the problem (i.e., hitting exactly the target timeout in the secheduler
at the millisecond granularity)?

Merge to v6.1
2014-07-17 07:53:55 +01:00
Matthew Flatt
c681c6e8e5 raco pkg install: reject overlapping package directories
For example, if you accidentally type `raco pkg install` in your
"racket" directory, you'd rather have an error rather than competing
module paths that reach all libraries.
2014-07-16 17:20:17 +01:00
Matthew Flatt
d7f2c869b6 openssl: add supported-{client,server}-protocols
Use the new functions to avoid running a test that requires 'tls12
to succeed.
2014-07-16 12:53:18 +01:00
Matthew Flatt
0bb1bab059 file/tar: don't try to read link permissions or timestamp
Links don't (normally) have those properties, and attempting to
read them makes a link fail when its target does not exist.
2014-07-16 06:37:58 +01:00
Matthew Flatt
bc832a680b pkg/lib: make pkg-directory->additional-installs recognize root docs
Merge to v6.1
2014-07-15 15:34:07 +01:00
Matthew Flatt
bc69a9b05c Add replace-evt
As suggested by Jan Dvořák.

The event created by `replace-evt` is a kind of event-gated
version of `guard-evt`. In particular,

 (guard-evt thunk)

could be expressed as

 (replace-evt always-evt (lambda (_) (thunk)))

Use `replace-evt` as a shortcut for the case when you want to
synchronize on either A or C, but you need to wait for B to get C.
You could wait on A+B and then, if B is selected, wait on A+C;
wrapping B with `replace-evt` to generate C is a kind of shortcut that
is eaiser to write and avoids tear-down and re-setup of A.

The `replace-evt` constructor is more than a shortcut in the sense
that it builds the pattern A+B->A+C into `sync`, which enables
abstractions that need a B->C transition. So, `replace-evt` adds
expressiveness, but (perhap reassuringly) it does not add any new
rendezvous capability.

Naturally, the procedure given to `replace-evt` can produce
another `replace-evt`, and the event argument to
`replace-evt` could also be a `replace-evt`.
2014-07-15 15:22:11 +01:00
Matthew Flatt
add04001cd pkg/lib: fix pkg-directory->additional-installs
Merge to v6.1 (with a70b3173b2)
2014-07-15 10:39:53 +01:00
Matthew Flatt
a3af35754d prop:evt, prop:{input,output}-port and evt chaperones: fix up scheduling
Although it doesn't seem to be possible currently, avoid the case
that a property-based access or chaperone is called in a scheduler
context.
2014-07-15 09:12:14 +01:00
Matthew Flatt
fed14e1ce1 prop:evt: support chaperone when extracting field
Thanks to Sam for noticing this problem.
2014-07-15 08:50:13 +01:00
Matthew Flatt
a027e1445f chaperone-evt: don't drop other chaperones 2014-07-15 07:58:15 +01:00
Matthew Flatt
a70b3173b2 pkg/lib: make pkg-directory->additional-installs use 'compile-omit-paths
Otherwise, "test/pkgs" claims to provide various documents and executables
that are in test packages.

Merge to v6.1
2014-07-15 07:22:22 +01:00
Robby Findler
1dda800ca2 add contract-correct caveat to contract violation error messages 2014-07-14 08:10:51 -05:00
Matthew Flatt
e063b654fa xform: fix bad parsing of array sizes
A size expression N+M for a literal integer N was parsed as just N.
Report an error when that case happens (since it's difficult to
handle) instead of mishandling it.

Merge to v6.1
2014-07-13 18:42:45 +01:00
Matthew Flatt
c72f441d93 JIT: fix array-size expression that is handled badly by xform
This bug (in xform, really) appears to be responsible for recent "JIT
buffer overflow" crashes. It could also cause other memory-corruption
crashes.

The bug could be triggered by any program that uses operators like
`+`, `<`, and `bitwise-ior` on more than 2 and less than 6 operands
(which is a lot of programs), but only if a certain allocation and
GC pattern happens at just the right time (which is why a crash was
relatively rare).

Merge to v6.1
2014-07-13 18:41:11 +01:00
Matthew Flatt
689f449c8d ffi/unsafe/com: convert to date*, document limitations
Merge to v6.1 along with 7d65ee6127.
2014-07-12 08:17:47 +01:00
Kalimehtar
7d65ee6127 Fix _date to allow dates before 1970 year 2014-07-12 08:16:07 +01:00
Matthew Flatt
75e201cc06 optimizer: fix tail-position bug in recent optimizer change
Fixes a problem with a7a912eeab.

The existing test suite caught this bug, but I somehow overlooked
the failure report.
2014-07-11 13:59:57 +01:00
Matthew Flatt
f57c1c8e2a fix GC-cooperation bug in vector->values
The `vector->values` function set up multiple return values
badly in the case that the given vector is chaperoned.
The problem could lead to NULL as results for `vector->values`.

Merge to v6.1
2014-07-11 13:31:17 +01:00
Matthew Flatt
94bd5369b5 avoid over-large buffer for tail calls
Applying to a large number of arguments once causes the run-time
system to maintain a too-large buffer for managing tail calls in
the future. Decay the buffer size as it is reallocated.
2014-07-11 07:43:02 +01:00
Matthew Flatt
4aa61744c6 net/http-client: adjust data-procedure/c contract
Promise more (a `void?` result) and requies less (`any` instead of `any/c`).
2014-07-11 06:21:33 +01:00
Matthew Flatt
a7a912eeab optimizer: generalize moving expressions to single-value context
Gemeralize Gustavo's change so that immediately-used right-hand sides
can be moved into any position that (like the binding context) enforces
single-valuedness --- for arbitrary right-hand expressions.
2014-07-11 06:02:14 +01:00
Gustavo Massaccesi
25c05d66b6 optimizer: allow to move once_used to test position 2014-07-11 06:02:14 +01:00
Gustavo Massaccesi
82ffd40592 optimizer: transform (if v x v) to (if v x #f) 2014-07-11 06:02:14 +01:00
Matthew Flatt
55c040cf3a raco setup -c => disable everything else 2014-07-11 06:02:13 +01:00
Matthew Flatt
8f20264a83 fix marshaling of #'(.... . ()) to bytecode 2014-07-11 06:02:13 +01:00
Matthew Flatt
95a126b2e1 raco setup: reorganize command-line flags
Group flags and refine the descriptions and documentation.

Merge to v6.1
2014-07-11 06:02:13 +01:00
Robby Findler
b9f423c9c5 unbreak contract system
fix bug introduced in 72c83a32e
2014-07-10 04:56:02 -05:00
Robby Findler
72c83a32e6 improve the random checking for ->i so that it can exercise
simple ->i contracts

specifically, ones with no dependency. This is useful for
when there are dependent #:post conditions (which can't be
expressed with the other combinators)
2014-07-10 04:05:41 -05:00
Matthew Flatt
7ccac3c054 fix guard on references to unsafe functions in bytecode
The protection against unsafe-function references was designed for
bytecode that referred to unsafe operations indirectly, and that
was broken when the compiler changed to refer to unsafe functions
directly in bytecode (to simplify JIT inlining bytecode optimization).
Actually, the relevant code (now removed) seems to be pointless,
since protected-binding checking should cover it already. Maybe
something else changed, or maybe the code was not properly checked
in the first place.

Now, `read` rejects a bytecode stream if it contains a direct
reference to an unsafe function and the code inspector is not the
original code inspector. It's still possible to synthesize bytecode
that contains an indirect reference, and then protected-binding
checking does its job.
2014-07-10 07:10:03 +01:00
Matthew Flatt
efa9a1e920 fix protected-export checking in dynamic-require
The `dynamic-require` funciton was not checking correctly for
re-exported bindings.
2014-07-10 07:10:03 +01:00
Matthew Flatt
8559192944 fix order of file close and kqueue de-registration
Thanks to memcheck.

Merge to v6.1.
2014-07-10 07:10:03 +01:00
Matthew Flatt
45eb084d27 fix uses of uninitilized memory
Thanks to memcheck. (I'm unable to get far with Racket and memcheck,
but I get this far.)

Merge to v6.1.
2014-07-10 07:10:03 +01:00
Scott Bell
ec0468a1f1 Allow http-conn-send! to take a procedure as its #:data parameter 2014-07-09 09:45:15 -04:00
Matthew Flatt
42aeae24be raco pkg catalog-archive: handle interrupted update
While `catalog-archive` cannot handle arbitrary corruption of
a previous archive run, it should be able to handle a state
due to interruption or other transient errors.

Merge to v6.1.
2014-07-09 13:02:02 +01:00
Ryan Culpepper
406ba23077 Post-release version for the v6.1 release 2014-07-08 20:54:31 -04:00
Matthew Flatt
139452dcc2 read: fix long-double error reporting
This repair corrects an ocassional test failure in the `read`
test suite.
2014-07-08 08:00:16 +01:00
Matthew Flatt
7dde0e98cf refine attempt at debugging output for JIT buffer overflow 2014-07-08 07:02:42 +01:00
Matthew Flatt
5c5bc86915 raco setup: make --check-pkg-deps require dependency declarations
By default, `raco setup` skips checking dependencies when a package
declares no dependencies. Make `--check-pkg-deps` check in that
case, too.
2014-07-07 09:41:19 +01:00
Juan Francisco Cantero Hurtado
6922ba8c23 Define SCHEME_PLATFORM_LIBRARY_SUBPATH for some architectures on OpenBSD 2014-07-07 06:17:40 +01:00
Matthew Flatt
b2897b33d5 raco setup: add --pkgs argument
The arguments to `--pkgs` specify collections to set up as the collections
that are (partially) provided by a set of packages.

Closes PR 14396
2014-07-07 06:17:21 +01:00
Matthew Flatt
03413f2298 raco setup: add --check-pkg-deps for checking specified collections
This flag enables scalable package dependency checking to a large
degree, although dependencies related to documentation cross
references can escape detection.
2014-07-07 06:17:20 +01:00
Matthew Flatt
f5d4093ffa raco pkg install: make conflict checking sensitive to platform specifier 2014-07-07 06:17:20 +01:00
Matthew Flatt
739863099d add setup/matching-platform
Put a function that was implemented in two places in one place.
2014-07-07 06:17:20 +01:00
Matthew Flatt
b64db3d0e6 raco setup: propagate doc-build error in summary and exit status 2014-07-04 10:42:22 +01:00
Matthew Flatt
8d6870a7c3 fill in some missing history on Racket's slice of lightning 2014-07-04 06:21:26 +01:00
Matthew Flatt
f93f52474f fix encoding of CMN in ARM JIT
It looks like bits 12 through 15 of the ARM encoding for CMN
should be 0s, not 1s, although many processors don't care.
2014-07-04 05:17:20 +01:00
Matthew Flatt
e23f22a9af raco pkg: check for conflicting docs, executables, etc.
Unfortunately, many existing packages rely on the fact that documentation-name
conflicts do not cause trouble when a package is installed in user scope
(because the documentation in that case is rendered with the package).
So, flag conflicts only for installation scope by default, but add a
`--strict-doc-conflicts` flag for strict checking even for user scope.
2014-07-04 05:17:20 +01:00
Matthew Flatt
82326631a9 raco {pkg,planet}: exit with non-0 status for bad sub-command 2014-07-04 05:17:20 +01:00
Matthew Flatt
b99260bb32 fix declaration for non-places, non+futures build 2014-07-04 05:17:20 +01:00
Matthew Flatt
50715f7bda setup/pkg-deps: fix "racket" mapping
I'm unable to construct a test that exposes the problem, but fix the
"type" on the dependency list for the special "racket" package.
2014-07-04 05:17:20 +01:00
Robby Findler
f49dd363fa added list-contract?
and specialized a bunch of list-related contracts to track list?-ness,
notably recursive-contract now accepts a #:list-contract? argument
that means that it insists that values it accepts be list? (and
thus not cyclic)

related to PR 14559
2014-07-03 23:07:38 -05:00
Robby Findler
0db4df1d33 Revert "adjust recursive-contract so that it terminates on cyclic values"
This reverts commit 7728e062f4.
2014-07-03 22:18:33 -05:00
Robby Findler
822526a5a2 add natural-number/c random generator 2014-07-03 22:18:32 -05:00
Robby Findler
400e4de891 bring down below 102 columns 2014-07-03 22:18:32 -05:00
Matthew Flatt
116555c517 optimizer: fix crashing bug
A continuation of 22b7cc6a5e: a second old bug in
shift_closure_compilation() than became more exposed.
2014-07-02 12:09:50 +01:00
Matthew Flatt
183ad7e3e4 raco catalog-archive: fix dependencies and tags in new catalog 2014-07-02 09:07:36 +01:00
Matthew Flatt
d316652160 raco setup / raco pkg install: add --fail-fast flag
This flag is useful for speculative package installations runs where
we'd like to give up and try something else if it's not working.
Specifically, we might try installing multiple packages at once,
and then back off to a smaller subset if something goes wrong.
2014-07-02 09:07:36 +01:00
Matthew Flatt
795c13d4a4 file/untar: fix handling of filename prefix in USTAR format
Combine prefix and filename with a "/".
2014-06-30 18:38:00 +01:00
Matthew Flatt
22f90ce8fe pkg/lib: add #:package-exn-handler to pkg-catalog-archive 2014-06-30 09:18:38 +01:00
Matthew Flatt
356196d62b racket/port: fix problem with reencode-input-port
For the case that a larger buffer is needed than provided for
a read, decoding should make progress as long as some bytes are
converted.

Closes PR 14607
2014-06-27 07:51:07 +01:00
Asumu Takikawa
6fe2745f55 Add syntax properties in contract expansion for TR
This establishes a communication channel between the
contract system and TR. TR normally can't track the
relationship between the identifier bound to the transformer
that produces the lifted value expression (which has the
type in the environment) and the lifted expression
itself.

This also adds properties that indicate which parts are
lifted expressions and if a function has an extra negative
party argument.

Finally, the expansion of keyword arguments is modified
slightly to propagate syntax properties on function argument
syntax to the let-bound identifiers that the keyword application
generates.
2014-06-26 15:46:08 -04:00
Matthew Flatt
31c35d8da2 add missing casts that are required by some C compilers 2014-06-26 13:06:42 +01:00
Matthew Flatt
5cbe6cfdcb work around bug(?) in Mac OS X select()
Using select() to check whether a pipe is ready for writing seems to
fail on Mac OS X 10.8 and 10.9. See the PR for a small C program to
demonstrate. It's possible that the small program is broken and
there's no bug, but the program works on Linux and on Mac OS X 10.7
and 10.6.

Although poll() seems to work, switching completely to poll() is not a
good option on Mac OS X, since poll() does not support devices on that
platform.

The kqueue() facility seems to handle pipes and writing ok, so work
around the bug by enabling the use of kqueue() on pipes.

Closes PR 14596
2014-06-25 09:56:44 +01:00
Matthew Flatt
94a5c6e3fb add more debugging output for a JIT-buffer-overflow internal error
Show the content of the buffer and the content of the temporary buffer
used to predict the size; then, I should be able to track down the
source of a mismatch.
2014-06-25 07:46:39 +01:00
Matthew Flatt
d3e008af50 racket/tcp: use %E instead of %e for socket error reporting
Using "%E" is right for WinSock errors, instead of "%e".
2014-06-24 11:40:21 +01:00
Sam Tobin-Hochstadt
dcb5b09a14 Optimize match patterns of the form (list x ...).
This also applies to `(mlist x ...)`, even though
that involves two traversals when only one is
required by the old method. Timing suggests that
the new code is nonetheless faster.
2014-06-23 15:27:19 -04:00
Matthew Flatt
58eab92dc3 Fix reading of badly encoded symbols from bytecode
This is the third try to fix the bug exposed by "fuzz.rkt". Previous
repairs addressed a symptom at the point of printing bad symbols,
instead of the cause at a failure to validate a symbol's encoding
when reading bytecode. This one fixes reading.
2014-06-23 16:21:48 +01:00
Matthew Flatt
408d6bb773 Fix UTF-8 symbol repair
Commit 6a5a3037b4 was not quite right, because it used sightly the
wrong variant among a dozen decoding functions.  The test suite caught
the problem, but I forgot to run it before pushing.

Also, repair the "Inside" documentation on the function that was
incorrectly used, and document the new variant.
2014-06-23 15:35:25 +01:00
Matthew Flatt
6a5a3037b4 avoid getting stuck on non-UTF-8 symbol encodings in bytecode
Found by fuzz tester, and this bug seems to be a common reason for
the fuzz test to time out.
2014-06-23 13:27:52 +01:00
Matthew Flatt
431321f2cb fix use of wrong comparsion macro
The wrong comparison could possibly (though not likely) cause an
operation-skipping optimization to be missed.
2014-06-23 10:44:56 +01:00
Matthew Flatt
93fdbdc79c optimizer: refine virtual clock, more precise shift-fuel tracking
Allow an effect-free `if` to not increment the effect-tracking
virtual clock (but increment the clock during branches, to avoid
moving computation into a branch).

Spend empty-`let`-elimination fuel more precisely, so that more
empty `let`s can be removed while still avoiding quadratic
compile times.
2014-06-23 06:28:50 +01:00
Matthew Flatt
22b7cc6a5e optimizer: improvements mostly for splitting of multiple-value bindings
Convert

 (let-values ([(<id> ...) (if <id-t>
                              (values <e1> ...)
                              (values <e2> ...))])
    ....)

to

 (let ([<id> (if <id-t> <e1> <e2>)]
       ...)
    ....)

which duplicates the `(if <id-t> ....)` test, but that's likely to
be worthwhile to avoid multiple-values shuffling and enable more
constant and copy propagation.

A related improvement is to more eagerly discard `let` wrappers
with unused bindings during optimization, which could enable
further optimization, and allow moving conditionals relative
to other expressions to avoid intermediate binding.

Eagerly discarding `let` wrappers exposed a bug in the optimizer's
shifting of variable locations by exercising the relavant shifting
operation in shift_closure_compilation().

Closes PR 14588
2014-06-20 11:05:07 +01:00
Matthew Flatt
16a0727231 optimizer: fix reordering in let+values+values splitting
While the commit comment in 3150b31eb7 still seems right, the changed
overlooked the fact that the arguments to a split `values` might get
reordered (due to the way binding positions are calculated). Fix the
optimizer to make sure that reordering is allowed.

The change touches a lot of code, because we want to use
"omittable" to implement "movable", and it's not ok to
reorder access of mutable variables (in case some other thread is
mutating them). We have to fix all the calls to "omittable"
to support the slight generalization.
2014-06-20 08:08:17 +01:00
Matthew Flatt
da979b6c8d optimizer: fix with-continuation-mark optimization
Misuse of the function to optimize applications constrained the
body of a `with-continuation-mark` form to a single result
value.
2014-06-20 06:41:39 +01:00
Matthew Flatt
9c05eff875 make installers: give MSVC setup "x86_amd64" instead of "x64" by default
The "x86_amd64" mode seems to work more often, especially with
Visual Studio Express installations.
2014-06-19 15:09:26 +01:00
Matthew Flatt
92f76764c7 optimizer: recognize that arguments to void are ignored 2014-06-19 15:09:26 +01:00
Matthew Flatt
780a825d34 optimizer: boolean conversion on app of predicate-matching primitives 2014-06-19 15:09:26 +01:00
Gustavo Massaccesi
50ef3a8295 optimizer: optimizes the argument of not in a Boolean context
This enables more reductions, for example: (not (if x y 2)) => (not (if x y #t))
2014-06-19 15:09:26 +01:00
Matthew Flatt
23f6d1a651 optimizer: reorganize & generalize dropping of ignored operations
The optimizer was willing to convert `(pair? (cons w (random)))` to
`(begin (random) #t)`, but not `(car (cons w (random)))` to
`(begin (random) w)` because the `(car (cons ....))` transformation
required simple ignored arguments. Put the treatment of ignored,
non-omittable arguments of a dropped operation in one place. Also,
recognize expressions within `begin` whose results will be ignored.
2014-06-19 15:09:26 +01:00
Matthew Flatt
9fed5b585a windows: fix symbolic link handling to match the OS
Windows parses relative-path links with yet another set of rules ---
slightly different from the many other existing rules for parsing
paths. Unfortunately, a few OS calls don't provide an option for
having the OS follow links, so we have to re-implement (our best guess
at) the OS's parsing of links.
2014-06-19 05:28:16 +01:00
Matthew Flatt
e1c735f66f win64: fix fixnum-to-extfl conversion 2014-06-19 05:28:16 +01:00
Matthew Flatt
3e3cb71680 win32: support symbolic links
Windows supports symbolic links in Vista and later.
2014-06-19 05:28:16 +01:00
Matthew Flatt
c8c0972fec ignore .sl.cache files
Created by `msbuild`?
2014-06-19 05:28:15 +01:00
Matthew Flatt
2193d2ad87 optimizer: add missing "else"
Thanks to David Vanderson
2014-06-19 05:28:15 +01:00
Matthew Flatt
6a1ace3522 optimizer: unwrap let and begin around constant test in if
Takes advantage of Gustavo's improvements
2014-06-17 12:41:23 +01:00
Gustavo Massaccesi
2063511bfd optimizer: local known to satisfy predicate => #t in a boolean context
For example, `(if (pair? x) (if x e1 e2) e3)` => `(if (pair? x) e1 e3)`.
2014-06-17 12:41:23 +01:00
Gustavo Massaccesi
7cb37d1bc8 optimizer: reduce constants to #t/#f in boolean contexts
While something like `(if 7 e1 e2)` was already reduced to `e1`,
this improvement makes `(if (let ([x (random)]) 7) e1 e2)`
reduce to `(if (let ([x (random)]) #t) e1 e2)`.
2014-06-17 12:41:23 +01:00
Matthew Flatt
36aaf3dd7b bitwise-bit-field: repair fixnum overflow problems
Bug reported by Roman Klochkov
2014-06-17 07:17:16 +01:00
Matthew Flatt
6778604bd2 Makefile: improve DESTDIR support 2014-06-16 11:41:00 +01:00
Matthew Flatt
4f96f6fe62 Windows: long double fix for MSVC 2013 2014-06-16 10:25:34 +01:00
Matthew Flatt
cee00a1c6e Windows build: use msbuild instead of devenv or vsexpress 2014-06-16 10:25:34 +01:00
Matthew Flatt
5e3ddea2ae syntax-local-lift-...: fix for use during module visit
Closes PR 14573
2014-06-15 09:24:11 +01:00
Robby Findler
151e4cfac4 add missing guard 2014-06-14 06:04:43 -05:00
Robby Findler
fd3aaf6f20 fix struct/dc's flatness test so that contracts with lazy fields aren't flat
closes PR 14558
2014-06-14 04:03:15 -05:00
Matthew Flatt
49691c4000 fix glib build for Windows 64
The previous build attempted to cooperate with Valgrind in a way that
truncates a 64-bit address to a 32-bit address. Disable Valgrind
cooperation. (Other builds seem ok for now, but future rebuilds will
disable Valgrind cooperation for them, too.)
2014-06-13 16:32:51 +01:00
Matthew Flatt
dda2520a12 fix --enable-sgcdebug build 2014-06-13 16:32:51 +01:00
Matthew Flatt
aa487175ad change default MSVC projects to Visual Studio 2010 (version 10) and up
Visual Studio 2008 is still supported by "9.sln" projects and
".vcproj" files, while ".sln" and ".vcxproj" work for 2010, 2012,
and 2013. The "build.bat" script detects which version of
Visual Studio is active and uses the appropriate ".sln" files.

The bad news is that we have two copies of each project until we
decide to drop support for Visual Studio 2008. (We had two copies
before, but one copy was unmaintained.) The good news is that
we have only 2 copies of each project, because recent versions of
Visual Studio are willing to use 2010 projects as-is.

Change project and related files to text instead of always CRLF,
because that seems to be ok for modern Windows tools.
2014-06-13 16:32:51 +01:00
Matthew Flatt
b7610c405d distro-build: move a file out that is accessed directly
The "pack-all.rkt" file is needed before (and only before) the
distro-build package itself is ready, so move it to the "racket/src"
directory.
2014-06-13 16:32:51 +01:00
Robby Findler
0a0c62a1e6 add has-blame? and value-blame 2014-06-13 08:28:40 -05:00
Robby Findler
17451d9662 Revert "change recursive-contract to reject cyclic values"
This reverts commit d664ee1430.

This commit broke recursive-contract because it disallowed any sharing,
not just cycles. And fixing this in the obvious way leads to about a 20x
slowdown (compared to v6.0's recursive-contract) on the micro-benchmark
mentioned in the original change to recursive contract.

So, for now, just go back to accepting cycles.
2014-06-13 03:02:19 -05:00
Robby Findler
d664ee1430 change recursive-contract to reject cyclic values
For a few reasons:

 - this seems to fit better with how TR already works

 - cyclic values are something that, at least in my experience,
   abstractions are not generally equipped to handle (and,
   perhaps worse, don't seem all that useful when weighed against
   the non-termination problems that can come up)

 - there was a suspicious case in the projection where, when a
   cycle was detected the projection just returned its argument
   (the place in the diff for this commit where there is now a
   call to raise-blame-error). I couldn't get this to cause problems,
   but this might just be because I'm not smart enough

related to PR 14559
2014-06-12 23:54:52 -05:00
Ryan Culpepper
d0eff55de5 better error message for unused #:declare clause 2014-06-12 17:03:41 -04:00
Robby Findler
7728e062f4 adjust recursive-contract so that it terminates on cyclic values
closes PR 14559

This slows down tight recursive contract loops by about 10%, using
the code below as the micro-benchmark:

(require racket/contract/base)

(define c
  (recursive-contract
   (or/c #f (cons/c c c))
   #:flat))

(define n1
  (let loop ([i 500000])
    (cond
      [(zero? i) #f]
      [else (cons (loop (- i 1)) #f)])))

(define n2
  (let loop ([i 500000])
    (cond
      [(zero? i) n1]
      [else (cons (loop (- i 1)) #f)])))

(collect-garbage) (collect-garbage) (collect-garbage)

(void
 (time (contract c n1 'pos 'neg))
 (time (contract c n2 'pos 'neg)))

(cdr n1)
(cdr n2)
2014-06-12 07:55:39 -05:00
Matthew Flatt
42e0d69746 racket/runtime-path: fix problems with 'so paths
Search for versions within a library directory, instead of searching
across library directories for a version. That way, user-specific libraries
can take precedence generally.

Fix the construction of library names with versions to match `ffi-lib`.
Specifically, put the version after the suffix on platforms other than
Mac OS X.

Put the code to resolve 'so specs in one place.
2014-06-11 09:23:04 +01:00
Matthew Flatt
5b852cc4bd setup/dirs: adjust get-lib-search-dirs and use if find-dll-dir
Add `find-dll-dir` to the end, not the beginning, so that it doesn't
override the user's directory. Improve checking for whether the DLL
directory is already covered by the library directories.
2014-06-11 09:23:04 +01:00
Matthew Flatt
ce08805026 raco setup: fix dependency checking for "racket" as a dependency 2014-06-10 19:15:12 +01:00
Matthew Flatt
2ea5fa3631 pkg/lib: create and unpack ".zip" files with timestamps as UTC 2014-06-10 19:15:12 +01:00
Matthew Flatt
e5dd7183b5 file/[un]zip: add UTC and time-rounding option
A `zip` archive normally holds timestamps in local time; a new option
records/interprets a UTC time instead. (Use the option both to zip and
unzip.) Also, add an option to round the 2-second resolution of time
to the past instead of the future (to avoid files with timestamps in
the future) when zipping.
2014-06-10 19:15:12 +01:00
Matthew Flatt
3342c19210 raco pkg catalog-archive: build on raco pkg catalog-copy
... instead of `pkg-catalog-update-local`.
2014-06-10 19:15:12 +01:00
Matthew Flatt
f90bf5e43b win32: repair for VS Studio build
Thanks to Gustavo Massaccesi

Closes PR 14555
2014-06-09 06:57:22 -06:00
Matthew Flatt
006ffc8ae3 syntax/docprovide: fix direct call to module name resolver
Also, deprecate the library.
2014-06-09 08:46:44 +01:00
Matthew Flatt
8aaa3fc5b5 document and deprecate 3-argument call to default module name resolver
Calling the default module name resolver with three arguments logs an
error message. The intent is that 3-argument support will be removed,
eventually.
2014-06-09 08:46:44 +01:00
Matthew Flatt
27c9007a82 raco setup: fix for relative & multiple paths in PLTCOMPILEDROOTS
Fix the part of `raco setup` that deletes ".zo" files that
have no corresponding source.
2014-06-09 08:05:05 +01:00
Matthew Flatt
0f6cdbf9e3 raco setup: fix PLTCOMPILEDROOTS handling when checking pkg deps
Closes PR 14540
2014-06-04 19:57:57 +01:00
Matthew Flatt
8828865c79 raco pkg install: change interpretation of archive with a single directory
When an archive used as a package source has all of its content
within a single top-level directory, then treat that directory's
content as the package content, instead of treating the directory
itself as the package content.

The change makes "x.zip" created with

  zip -r x.zip x

work the same as "x" as a package source. It also makes a ".zip"
for a package's GitHub repository (from clicking the "Download ZIP"
button) work the same as the repository.

This change is backward incompatible, but it's unlikely to break
any working package (since that would be a single-collection package
that provides only a subcollection).
2014-06-04 16:49:18 +01:00
Matthew Flatt
0ed142b78f raco pkg install: fix tmp-directory clean-up
Fix when installing from a non-directory in `--source` or
`--binary` mode, and fix clean up of a GitHub-generated archive
when using a path within the archive.
2014-06-04 16:49:18 +01:00
Matthew Flatt
374742e905 zip: add #:path-prefix argument 2014-06-04 13:16:58 +01:00
Matthew Flatt
8792c52e1d raco pkg create: adjust rules for for {binary,source}-keep-files
Allow `{binary,source}-keep-files` to override omission of an
enclosing directory. Also, adjust the default for binary mode to
keep "doc" and "info.rkt" within "scribblings" and not "tests".

With this change, starting with Minimal Racket and installing DrRacket
in binary mode gets you a working DrRacket with documentation. A
binary install is less than half the space of a non-binary install,
in part because the binary installation has fewer dependencies.
2014-06-04 10:14:48 +01:00
Matthew Flatt
15214b9983 raco setup: clean up "library" installs that are directories 2014-06-04 10:14:45 +01:00
Matthew Flatt
4b5c907440 raco pkg: fix binary stripping of submodules 2014-06-04 09:35:51 +01:00
Matthew Flatt
25cc7c7125 raco setup: detect binary-only setup/scribble 2014-06-04 08:29:55 +01:00
Jay McCarthy
d909a9590d Adding things to unstable/error that are painful to remember and used everywhere 2014-06-02 18:31:31 -06:00
Matthew Flatt
b055db088c racket/base: fix module-compiled-submodules name handling
Mandled name handling breaks pkg binary-mode submodule stripping.
2014-06-02 21:34:42 +01:00
Matthew Flatt
f02d9268ec adjust some collection-file-path calls to work with binary packages
In a few cases, sources should be preserved in binary mode.
2014-06-02 20:13:00 +01:00
Matthew Flatt
fc74fa36ef change collection-file-path to check for compiled by default for ".rkt" 2014-06-02 20:12:41 +01:00
Matthew Flatt
8638a55b67 optimizer report use-before-definition check at debug level
It's too common and noisy as a warning.
2014-06-02 19:59:30 +01:00
Matthew Flatt
e17acf5fef Win64: fix JIT floating-point constant
Repairs commit 71591a62a4 for Win64, where `long` != `intptr_t`
2014-06-02 18:26:50 +01:00
Matthew Flatt
a539f4ed25 fix typo in Windows "build.bat" 2014-06-02 17:27:09 +01:00
Matthew Flatt
c1c12b05f5 raco pkg: fix conflict checking for PLTCOMPILEDROOTS
The fix is for a corner case that is unlikely to show up,
but the repaired code is simpler.
2014-06-02 16:46:45 +01:00
Matthew Flatt
5ea04493a2 raco setup: fix dependency checking and PLTCOMPILEDROOTS
Closes PR 14537
2014-06-02 15:45:22 +01:00
Matthew Flatt
2360a9f69a pkg/lib: more fixes to handling of relative package sources in catalogs
Relative paths in a catalog should be treated as relative URLs, not
relative paths.
2014-06-02 15:03:16 +01:00
Matthew Flatt
e27c51698b net/url: add relative-path->relative-url-string 2014-06-02 14:34:22 +01:00
Matthew Flatt
43d81b06da fix collection-file-path & related for binary package installation
Binary package installation failed in the case of collection
splicing, because module-name resolution via `collection-file-path`
did not check for compiled files along hte search path of
registered collection directories.
2014-06-02 11:57:08 +01:00
Matthew Flatt
e0a82393b7 raco pkg: fix treatmennt of "file://" package sources
A "file://" prefix on a package source needs to be consistently
removed. The new `package-source->path` function does that, so it
should be used to convert a package source to a filesystem path.
2014-06-02 11:57:07 +01:00
Matthew Flatt
ae2b0b93a1 raco pkg catalog-archive: fix handling of source with no checksum 2014-06-02 11:57:07 +01:00
Matthew Flatt
a718aeb441 raco pkg catalog-show: improve error for bad catalog 2014-06-02 11:57:07 +01:00
Matthias Felleisen
89dea63995 removed _contract_ language from _invariant-..._ as much as possible
added a hint as to why the error message uses the inappropriate contract language
2014-05-31 15:45:57 -04:00
Matthew Flatt
9d94ef725e update bytecode compiler/optimizer overview in source comments
Explain the recently added "letrec_check" pass.
2014-05-31 20:26:16 +01:00
Matthew Flatt
1558e1243a JIT: improve transition from 32-bit to 64-bit jumps
Use a recursive call to try again, instead of trying to reset local
state. The reset-local-state variant is definitely broken in
some caes, though I could not provoke the JIT buffer overflow
that I was hoping to fix with this change.
2014-05-31 20:26:16 +01:00
Robby Findler
ddb7477494 added invariant-contract
Jay implemented this
2014-05-30 21:03:11 -05:00
Matthew Flatt
2eef2ce409 optimizer: fix inference bug
The optimizer's inference that could incorrectly that that a
conditional produced a flonum (when it actually produced a fixnum or a
fixnum in one branch and flonum in the other).
2014-05-30 18:50:26 +01:00
Matthew Flatt
948a709b47 clarify comment in JIT implementation
Refines commmit c0ec9702e8.
2014-05-30 12:51:53 +01:00
Matthew Flatt
d1be74fc3b compiler letrec_check pass: recognize effect-free primitives
As in "Fixing Letrec". This improvement corrects a performance
regression with the revised expansion of R5RS `letrec`, which
wraps right-hand sides with `values`.

Besides detecting effect-free primitives, we have to fix the
treatment of the right-hand side for a multi-binding `letrec-values`
clause. For now, we conflate all of the bindings in a single
clause.
2014-05-30 12:51:21 +01:00
Matthew Flatt
71591a62a4 JIT: better code for floating-point constants on x86+SSE 2014-05-30 08:18:25 +01:00
Matthew Flatt
9b1a2e7b37 JIT: minor comparison repairs
Fix some comparisions that are written as pointer comparisons
when they're actually integer comparisons. Also, remove an
unnecessarily slow variant of pointer compairson for x86_64.
2014-05-30 07:51:05 +01:00
Matthew Flatt
c0ec9702e8 JIT: fix potential problem in transition to 64-bit jumps
On x86_64, the JIT compiler initially generates code with 32-bit
jumps, but it switches to 64-bit jumps when so much code is allocated
that it gets spaced out enough. That transition could happen during a
recursive call to the JIT compiler or while one place is in the JIT
and other installs a shared code pointer, in which case a bad jump
could be generated. This problem is unlikely to happen, but it looks
possible.
2014-05-30 07:07:28 +01:00
Matthew Flatt
3392ca36f7 pkg/db: make local package database's path relative to installation name
Instead of `(version)`, use `(get-installation-name)` for the path
of the local database used by the GUI package manager.
2014-05-29 13:42:57 +01:00
Matthew Flatt
f9d6edd8ec raco pkg catalog-archive: keep module & dependency info
Also fixes another relative-path problem.
2014-05-29 13:19:47 +01:00
Matthew Flatt
cc4d00efa6 raco pkg catalog-show: improve output format
Separate packages with a blank line, and fix formatting of
a module list.
2014-05-29 12:48:24 +01:00
Matthew Flatt
ab4172fbf2 raco pkg catalog-archive: parse sources like catalog-copy 2014-05-29 11:45:42 +01:00
Matthew Flatt
11aca05fb5 pkg/lib: fix pkg-catalog-update-local version selection
Also fixes problems with using a relative target path
with `raco pkg catalog-archive`.
2014-05-29 11:15:56 +01:00
Matthew Flatt
9393592a80 optimizer: another little step toward type inference
Generalize some of the tracking and optimization of predicates
with respect to constructors and bindings.

This generalization exposed an old bug in the optimizer, which is
that information accumulated in the "then" branch of a conditional
was not reliably flushed when continuing analysis after the conditional.
2014-05-29 09:22:29 +01:00
Matthew Flatt
eac2ce0ef6 optimizer: ad hoc optimization of predicates applied to constructions
This is probably more of a job for Typed Racket, but maybe it's
useful to detect some obviously unnecessary allocations of lists, etc.

Closes PR 14532
2014-05-28 20:11:24 +01:00
Matthew Flatt
ca315e6f34 optimizer: more ad hoc car and cdr cases
Closes PR 14533
2014-05-28 19:55:42 +01:00
Matthew Flatt
dad9d001e1 optimizer: enable movement of constants that shouldn't be duplicated
Closes PR 14531
2014-05-28 19:55:41 +01:00
Matthew Flatt
81f6f32440 racket/private/class-internal: protect ids private to class implementation 2014-05-28 13:10:29 +01:00
Matthew Flatt
8ad889e2c4 racket/class: shave a little time from send 2014-05-28 13:10:29 +01:00
Matthew Flatt
ec96592702 optimizer: treat known procedure bindings, etc., as #t for if
Closes PR 14526
2014-05-27 09:27:15 +01:00
Matthew Flatt
dfcadcfacf compiler/compilation-path: added
Provides functions for finding the bytecode path for a source file,
which might depend on PLTCOMPILEDROOTS, etc.
2014-05-27 09:27:15 +01:00
Jay Kominek
57753a7b6c define and use TLSEXT_NAMETYPE_host_name 2014-05-26 16:49:46 -04:00
Jay Kominek
52159fea13 add SSL Server Name Indication support 2014-05-26 16:49:45 -04:00
Robby Findler
5631732e9d improve ->i syntax error message when dependencies are cyclic 2014-05-26 14:53:31 -05:00
Matthew Flatt
9e3b984463 raco make: improve parallelism
The `require` macro now logs "prefetch" messages when it sees a `require`
with multiple module paths. The prefix information is approximate, since
parsing a `require` subform might depend on imports from a previous subform,
but in the common case, there are many obvious module paths to prefetch.

The parallel mode of `raco make` watches for prefetch messages and
records the suggested "prefetch" paths so they can be compiled by other
processes.
2014-05-26 18:56:50 +01:00
Matthew Flatt
e29418f204 compiler/cm: fix propagation of log messages 2014-05-26 18:56:50 +01:00
Matthew Flatt
e16b6fd06e logger: fix problems with level checking, add option to log-message
Logged messages could get dropped if a log receiver is specialized
to a name that is provided as an argument to `log-message` instead
of used from the target logger.

Add an option to `log-message` to avoid adding the name to the
start of the message string, which is needed to propagate messages
from one logger to another.
2014-05-26 18:56:50 +01:00
Matthew Flatt
7137c8d6a6 racket/unit: fix signature handling of define-values/invoke-unit/infer
Closes PR 14453
2014-05-26 08:43:34 +01:00
Matthew Flatt
0e9f468d3f repair JIT bug
The bug incorrectly tracks the value that is available in virtual
register R0 --- only in the case that some value was known to be ready
in R0, and some other value was known to be ready in R1, and a value
is moved from R1 to R0.

Closes PR 14523
2014-05-25 21:45:20 +01:00
Matthew Flatt
bcafba989f racket/unit: repairs related to signature extension
Fix signature extension so that the scope of identifiers in the
extended signature behaves the same as `open`.

Also, fix `struct` (or generally `define-values-for-export`)
in its interaction with `open` and `unit-from-context` (two
different bugs).
2014-05-23 18:58:42 +01:00
Robby Findler
81cd1e3404 vectorof contract: add some tests and make flat variant subscribe to the val-first protocol 2014-05-23 10:16:03 -05:00
Robby Findler
37a4a9ada6 adjust box/c to use the val-first-projection protocol 2014-05-21 23:42:49 -05:00
Robby Findler
1f1d1a38aa minor cleanups to contract-random-generate's API 2014-05-21 12:10:45 -05:00
Matthew Flatt
dfeba12997 MzCOM: avoid the ATL framework
Building MzCOM without ATL means that Visual Studio Express --- or
other free compilers, in principle --- can build MzCOM. It also cleans
up and simplifies the build.

The non-ATL implementation is based on "Com in Plain C" by
Jeff Glatt, and uses a lot of his code (with instructive
comments intact).
2014-05-21 08:58:33 +01:00
Matthew Flatt
165bae6c2c repair and streamline VS 2008 projects 2014-05-21 08:51:37 +01:00
Matthew Flatt
a57e712ba3 add scheme_jit_now() 2014-05-20 09:01:40 +01:00
Matthew Flatt
9b78847be0 add unix-style makefile target
Also, revise "INSTALL.txt" to better explain the build options.
2014-05-20 09:01:40 +01:00
Robby Findler
61dbf1a34f make struct/dc cooperate better with check syntax so that the struct name gets an arrow 2014-05-19 13:35:26 -05:00
Robby Findler
419f3fdee1 use the name in the exists contract in its error message 2014-05-17 22:22:31 -05:00
Robby Findler
01fb28fa87 fix cons/c for combinators that insist on projections for subcontracts
(instead of working with val-first projections)
2014-05-17 16:06:14 -05:00
Matthew Flatt
a0485cb58c fix build for module name resolver cache change
The xform bootstrap sets `current-library-collections-path` without
changing the namespace, which is a bad idea that was exposed by
the module name resolved cache change (commit a7ad0e3a01).
2014-05-17 21:25:05 +01:00
Matthew Flatt
02bc905c02 repair for identifier handling
Repairs commit d67082ea60.
2014-05-17 19:56:25 +01:00
Matthew Flatt
35c996d041 add scheme_jit_find_code_end 2014-05-17 07:20:04 +01:00
Matthew Flatt
d67082ea60 adjust handling of identifiers without module context by set!
... and `#%variable-reference`, adding a special case for an identifier
that is bound in the encloding module.
2014-05-17 07:20:04 +01:00
Robby Findler
39195bd04f add generator for (and/c real? (not/c negative?)) and (and/c rational? (not/c negative?))
and fix -> generator for mandatory keyword arguments
2014-05-16 22:43:57 -05:00
Robby Findler
3f5ca73338 added a real? generator 2014-05-16 22:43:56 -05:00
Robby Findler
541582cbc6 improve ->i's printing so it saves some of the source text of the dependent contracts 2014-05-16 17:13:16 -05:00
Robby Findler
0e90d6449f improve contract-exercise so that it can take multiple arguments
(and can use one to generate values that might break another)
2014-05-15 22:32:48 -05:00
Robby Findler
ae298ae353 make contract-stronger? recognize that predicates are stronger than
values that they accept (for certain, well-known predicates, anyway)
2014-05-15 22:30:21 -05:00
Robby Findler
cd4dde5865 add an implementation of stronger to cons/c 2014-05-15 22:30:19 -05:00
Robby Findler
e1bd6bab6a improve new or/c's stronger predicate 2014-05-15 22:30:17 -05:00
Asumu Takikawa
7bc88336f5 Add Dr. Chang to acks. 2014-05-14 22:11:39 -04:00
Ryan Culpepper
95d1bacf15 template: pre-allocate local env vectors for nested ellipses 2014-05-14 15:51:37 -04:00
Ryan Culpepper
217dc89f5c template: fix checking of ellipsis-driving variables
closes PR 14497
2014-05-14 15:51:37 -04:00
Matthew Flatt
a7ad0e3a01 default module name resolver: fix cache
The cache was keyed on `current-library-collection-paths`, but
not other parameters such as `current-library-collection-links`,
so it was too "sticky" in the case that some parameters changed.
Adjust the cache to be specific to loaded module in a namespace's
module registry.
2014-05-14 06:10:50 -06:00
Robby Findler
5ed9b65ae5 add a random generator for struct/c
This is actually done by adding a generator for struct/dc in the case
that there are no dependencies, so it'll also work for such contracts.
2014-05-13 22:49:02 -05:00
Robby Findler
c64d70abc6 contract improvements
- add a generator for cons/c
- make flat-rec-contract not just build the predicate, meaning:
  - it has a better name
  - it can do random generation
- make the procedures that come from any/c random generation indicate that from their names
- make or/c with one argument just (check and) return that argument, so
  (or/c (or/c number?)) has the name 'number?'
2014-05-13 22:49:02 -05:00
Robby Findler
cfd1f46fa2 fix bug in flat struct/dc predicate implementation 2014-05-13 22:49:01 -05:00
Matthew Flatt
d96bfb6e29 setup/dirs et al.: thread-safe promises
Use `delay/sync` instead of `delay`.
2014-05-13 16:27:11 -06:00
Robby Findler
8b0e23d15a fix struct/dc's flat-contract mode predicate 2014-05-12 10:05:54 -05:00
Robby Findler
a1fd690201 add random generation for polymorphic contracts 2014-05-12 09:49:15 -05:00
Robby Findler
318130b716 fix positive integer generator to not generate zero 2014-05-12 09:49:15 -05:00
Matthew Flatt
be04593a31 fix bug in insertion of guards to prevent use before definition 2014-05-12 08:09:23 -06:00
Matthew Flatt
1d87c95bf0 reduce calls to current-process-milliseconds on thread swap
Call `current-process-milliseconds` once per swap, instead of twice.
2014-05-12 04:57:44 -06:00
Matthew Flatt
98b91a11e4 faster path for TCP input
Avoid polling a file descriptor to determine whether it has bytes;
just try to read, and then go to epoll/kevent mode when available,
skipping a poll/select.
2014-05-12 04:57:44 -06:00
Matthew Flatt
97da48ab67 remove/adjust obsolete C preprocessor cases
Mac OS Classic and Palm ae long since unsupported.

TCP support implies sockets (since old Mac TCP is gone).

For what it's worth, make the build work without TCP support, although
no one ever builds that way.
2014-05-12 04:57:44 -06:00
Robby Findler
6df33ab08c make new-∀/c and new-∃/c figure our their own names and have a better printing 2014-05-11 22:30:14 -05:00
Matthew Flatt
b15aea28c2 fix accidental disabling of thread-specific process-milliseconds 2014-05-10 19:29:54 -06:00
Robby Findler
9d87fe5079 cleanups to old, broken test suite and some bug fixes it uncovered
also, fix any/c generator
2014-05-10 10:01:29 -05:00
Matthew Flatt
7987740d18 file/gzip: compensate for too-far lookahead 2014-05-09 15:47:01 -06:00
Jay McCarthy
723fae213c changing valid char to XML 1.1 rather than 1.0 and reverting changes from recent PR 2014-05-09 10:39:35 -06:00
Jay McCarthy
fc8075245a protect against errors in chunking or gunziping... without this there can be hangs 2014-05-09 10:39:34 -06:00
Matthew Flatt
d5b42f8c50 add plumbers, remove custodian-tidy-all
In v6.0.1.7, I tried to give a port-flushing job to custodians. They
turned out to be unqualified, so let's try employing specialists.

Thanks to Eli for pointing out the problem with the v6.0.1.7 design:
attaching callbacks to custodians allows a sandboxed task to escape
through the custodian hierarchy. Plumbers avoid this problem by
having no hierarchy.
2014-05-09 07:06:27 -06:00
Matthew Flatt
fdf06e461a add raco pkg catalog-archive
The `catalog-archive` command not only copies a catalog, but also copies
all package sources referenced by the catalog to create a snapshot that
doesn't depend on any external pieces.

One reason you might want to do that is to download all packages on a
machine with general network access, and then building packages on a
(virtual) machine whose network access is limited.

This commit also adds support for relative package sources in the
catalog protocol, where a client converts a relative package source to
an absolute one.  Since the relative-to-absolute conversion happens on
clients, relative sources will be of limited use until v6.0 and v6.0.1
become deprecated.

A new `current-pkg-lookup-version` parameter corrects the misuse of
`current-pkg-scope-version` for package-catalog queries.
2014-05-08 11:03:31 -06:00
Robby Findler
ce3f891209 improve any/c's random generation
by using the environment sometimes and making up (simple) functions
sometimes
2014-05-07 21:29:32 -05:00
Robby Findler
05def2ddf5 unbreak or/c opter
(the missing require meant that the wrong "or/c" was being registered in the table)
2014-05-07 21:29:32 -05:00
Robby Findler
d812d171f9 add generator for any/c and improve generator for or/c
also improve test cases a little bit and minor Rackety
2014-05-07 19:25:22 -05:00
Robby Findler
7ec9cb0274 fix generator for or/c 2014-05-07 19:25:22 -05:00
Jay McCarthy
7740733c05 Fixing PR14478 2014-05-07 15:42:52 -06:00
Matthew Flatt
903e82731e fix vector-map! to not mutate immutable vectors 2014-05-07 07:41:13 -06:00
Matthew Flatt
c33707329c racket/port: add a flushing tidy callback for reencode-output-port
This change solves a long-standing problem that reencoded output
was not flushed on exit, especially in the case that the
current output port is reencoded.
2014-05-07 07:41:13 -06:00
Matthew Flatt
1bd604073a add custodian-tidy-all 2014-05-07 07:41:13 -06:00
Robby Findler
0f16f31db9 clean up and export support for exercising values with contracts 2014-05-06 21:29:19 -05:00
Robby Findler
9a6970043a fix contract-random-generate so it picks the generation method
randomly during generation, not randomly up-front, before
generation
2014-05-06 21:29:18 -05:00
Robby Findler
4de1583c68 make or/c and contract-stronger? collaborate
in order to make contract-stronger? work better when given the result of or/c
2014-05-06 16:33:20 -05:00
Matthew Flatt
5e8e2771b5 raco setup: fix default package version
The default is "0.0", not "1.0".
2014-05-05 10:37:09 -06:00
Robby Findler
1f212a2fe4 fix struct/dc chaperone/flat/impersonator-ness when #:inv is used 2014-05-05 11:27:52 -05:00
Robby Findler
90053d7d40 fix random generation environment usage
closes PR 14484
2014-05-04 14:34:55 -05:00
Matthew Flatt
2e284cc783 enable DWARF-based stack unwind for x86
Newer versions of gcc seem to use -fno-frame-pointer by
default for x86, which disables Racket's stack traces.
Use DWARF information to get them back.
2014-05-04 11:47:31 -06:00
Matthew Flatt
51614ab0b2 raco pkg config: add doc-open-url key 2014-05-04 09:32:00 -06:00
Matthew Flatt
33ad485081 setup/unixstyle-install: preserve all other config entries
Preserve any configuration entry that is not explicitly set,
as opposed to keeping only entries that are known to the
script.
2014-05-04 09:32:00 -06:00
Matthew Flatt
a8105dc0e3 config: add doc-open-url configuration
This configuration option is a better way to redirect documentation
access (at a place like NEU) than patching "search.rkt".
2014-05-04 09:31:59 -06:00
Robby Findler
974ee9df75 fix contract-stronger for struct/dc with #:inv clauses 2014-05-03 22:22:10 -05:00
Matthew Flatt
9cd528ca08 racket/base: add #:for-module? argument to open-input-file
Exposes a feature that is used by the default load handler to
raise `exn:fail:{syntax,filesystem}:missing-module` exceptions.
2014-05-03 20:05:59 -06:00
Matthew Flatt
cb322e939a pkg/lib: add #:catalogs & #:set-catalogs? args to pkg-catalog-update-local
These additions allow the GUI package manager to use `pkg-catalog-upload-local`
instead of having a its own copy of the same opertation. Not surprisingly,
with two copies of the code, the `pkg/lib` copy was missing support for tags.
2014-05-03 17:39:06 -06:00
Robby Findler
e51ba9b565 add invariant clauses to struct/dc (keyword #:inv) 2014-05-03 10:31:09 -05:00
Matthew Flatt
18531772e3 setup/getinfo: shortcut for simple modules
When an "info.rkt" module is simple enough, build a hash table
directly instead of compiling and loading the module.
2014-05-02 12:30:31 -06:00
Matthew Flatt
573c127002 make pkg-links: shortcut for no-change case
Taking a shortcut skips dependency and module-declaration checks, but
that job is now covered by `raco setup`.
2014-05-02 12:30:31 -06:00
Matthew Flatt
b25e9fd0d4 raco setup: check package version deps and multiple module declarations
The package dependency checking process was already gathering all the
reelvant information, or nearly all of it, so it's relatively cheap to
add the checks.
2014-05-02 12:30:31 -06:00
Matthew Flatt
33547d554a pkg/lib: add #:versions? argument to extract-pkg-dependencies 2014-05-02 12:30:31 -06:00
Matthew Flatt
68421f05dd places: improve comments on msg_chain treatment 2014-05-01 19:13:55 -06:00
Matthew Flatt
6d4c25a322 places: fix gc of place channels containing place channels
The bug was a kind of typo: using `&` where `%` was intended to
implement a counter wraparound.

This bug is an even more likely candidate to be resopnsible for the
occassional crashes from the DrRacket easter-egg test.
2014-05-01 19:13:55 -06:00
Vincent St-Amour
fc512ba78d Instrument pattern matching for feature-specific profiling. 2014-05-01 11:54:09 -04:00
Vincent St-Amour
584e494d5a Instrument send dispatch for feature-specific profiling. 2014-05-01 11:54:09 -04:00
Vincent St-Amour
b474ba765e Add instrumentation to profile generic sequence overhead. 2014-05-01 11:54:08 -04:00
Vincent St-Amour
9d7b6a1c89 Instrument the opt/kw protocol for feature-specific profiling.
That code is only executed for higher-order uses of these functions,
otherwise protocol gets optimized away.
2014-05-01 11:54:08 -04:00
Matthew Flatt
61d717fd07 file/unzip: change to call-with-unzip and call-with-unzip-entry
Use `call-with-` instead of `with-`, since it's a function instead
of a syntactic form. (This is a weak convention, but one to try to
follow with new functions and forms.)

Fix up the contracts and change the documentation to match the
usual style.

Create the temporary directory in `(find-system-path 'temp-dir)`
instead of the current directory.
2014-05-01 06:18:24 -06:00
simmone
f592cf6e35 file/unzip: add help func with-unzip with-unzip-entry 2014-05-01 06:18:24 -06:00
Robby Findler
a628bf4040 Rackety
bring down below 102 columns
2014-04-30 21:58:14 -05:00
Matthew Flatt
5c909cca0d raco dist: preserve relative location of runtime files only within a package
Previously, relative locations were preserved for all files with the same
root, but that tends to keep too much information about the original
filesystem layout, especially when runtime files are pulled both from
the installation and a user-specific area. Since packages can be installed
at different relative locations, it makes sense to preserve relative
locations only up to package boundaries.
2014-04-30 14:59:16 -06:00
Matthew Flatt
0c9685d136 raco exe: normalize runtime-file paths
Normalization is needed to ensure that `raco dist` doesn't generate
longer paths (by converting a "/" to "\\", for example) in its
path manipulations.
2014-04-30 14:23:46 -06:00
Matthew Flatt
04a60d713b fix sync on inaccessible place channel
Commit 5ea4c2ab68 broke GCing of a thread that is blocked
via `sync` (as opposed to `place-channel-get`) on a place
channel whose write end is inaccessible.
2014-04-29 12:56:19 -06:00
Matthew Flatt
f2335ae4dc fix performance bug in equal? on vectors 2014-04-29 06:58:36 -06:00
Matthew Flatt
07e390302c raco exe: attempt to fix problem with room made for runtime-paths table 2014-04-29 06:18:55 -06:00
Matthew Flatt
dee331e3b1 raco setup: fix info-domain cleanup of unlinked planet packages 2014-04-28 19:03:39 -06:00
Matthew Flatt
afb75c7cfe linux: close "/proc/self/maps" after finding the stack base 2014-04-28 17:50:50 -06:00
Matthew Flatt
acf250891f fix wrong size for memset
Probably the assignments cover the structure, anyway.
2014-04-28 17:42:17 -06:00
Matthew Flatt
2ff4802a14 configure: for BSDs, enable pthreads by default, but don't force enabled 2014-04-28 13:07:26 -06:00
Matthew Flatt
bc871b904e need CAS only for futures or places 2014-04-28 13:07:26 -06:00
Robby Findler
d4c60e8608 generalize the random contract generation so that it can exercise
a function to get more interesting values and then use those values
to guarantee it can generate things it couldn't before

For example, it can now generate a function with this contract:

  (-> (-> is-eleven?) is-eleven?)

without knowing what the is-eleven? predicate does -- instead it can
figure out to call the argument thunk and then pipe that result around
2014-04-28 12:22:01 -05:00
Matthew Flatt
04c4538f44 speed up inexact->exact
Parse IEEE floating-point numbers directly.

Thanks to Neil T.!
2014-04-27 16:51:23 -06:00
Matthew Flatt
d682c940bd repairs to precision of exact->inexact et al.
Thanks to Neil T.!
2014-04-27 16:51:23 -06:00
Matthew Flatt
da600ad291 file/zip: recognize string ports as seekable 2014-04-27 10:25:06 -06:00
Matthew Flatt
64bfb58dad racket/base: add string-port? 2014-04-27 10:25:06 -06:00
Matthew Flatt
83dcf446a3 fix clean-up handling for the main thread of a terminated place
This bug might be reposnible for the occassional crashes seen in
DrDr for the easter-egg test.

Merge to v6.0.1
2014-04-27 09:15:18 -06:00
Matthew Flatt
5232b099a2 revise error printed for kernel-/debugger-sent SIGSEGVs 2014-04-27 09:15:17 -06:00
Robby Findler
9e9b291d4a improve or/c random generation and get rid of old, not-working
generation for the old-style -> contracts
2014-04-27 07:34:44 -05:00
Robby Findler
76c6a1b7b0 improve random contract generation
notably enable the generator to actually use things from the
environment but currently only when they are directly in the
environment so, eg:

   (-> (-> is-eleven?) is-eleven?)

can't be generated (since the contract system doesn't know
about is-eleven? and also doesn't yet know that it can call
the argument thunk)
2014-04-27 07:10:50 -05:00
Matthew Flatt
cdd6bf438a no getprotobyname on Android 2014-04-26 20:10:52 -06:00
Matthew Flatt
ffb0dd52c5 ARM JIT: fix software floating-point
I broke uses of LDRD and STRD when compacting the set of registers
used by the JIT. The LDRD and STRD instructions are given one
register explicitly, but they implicitly use the next regsister, too,
and the specified register must be even-numbered. Lining up a pair of
registers requires a little shuffling before and after the operation.

Also, the LDRDI and STRD encodings were broken, and the inlined
fl->fx conversion was not right.

Closes PR 14470
2014-04-26 20:10:51 -06:00
Matthew Flatt
b88f391c1c configure: add --enable-sysroot
The `--enable-sysroot` flag simplifies an Android cross-compilation,
for example.
2014-04-26 20:10:51 -06:00
Jay Kominek
70802ce217 Avoid feeding inexact numbers to random while generating contract-satisfying values.
Also fix a minor doc error.
2014-04-24 22:55:15 -06:00
Matthew Flatt
4d2b24b325 clean-ups to commit 4fde0e9901 2014-04-24 10:21:52 -06:00
Neil Toronto
85deab7cb8 Added ExtFlonum (and subtypes) and ExtFlVector to the base type environment 2014-04-22 10:45:40 -06:00
Matthew Flatt
4fde0e9901 avoid write-barrier memory protection for 'atomic-interior allocation
Split 'atomic-interior allocation to separate pages from other 'interior
allocation, and do not page-protect 'atomic-interior memory. Otherwise,
atomic-interior memory passed from one place to another --- especially
via the `#:in-original-place?` option on foreign functions --- can crash
due to triggering a write barrier in the wrong place.

Commit c18f6e8d6d, which changed some cross-place arguments to Pango and
Cairo to be 'atomic-interior, exposed the problem.

Merge to v6.0.1
2014-04-22 09:36:37 -06:00
Matthew Flatt
6856e5253f fix incorrect sharing of submodule-declaration tables
Cuts the peak memory use of

 racket -c -l match

from 1.2 GB to 400 MB on a 64-bit machine.
2014-04-21 15:41:59 -06:00
Matthew Flatt
7f8f8c0b59 dump-memory-stats: add mode to return a tag count 2014-04-21 15:41:59 -06:00
Matthew Flatt
0985bcda66 minor allocation speedup for immutable hash tables 2014-04-21 15:41:58 -06:00
Matthew Flatt
d7ad3955a5 in-directory: keep subdirectory content in order
The content produced by `directory-list` was reversed by an
accumulator loop.
2014-04-21 15:41:58 -06:00
Matthew Flatt
4e3ff69798 fix taint-transparent syntax to lose lexical context
When submodules were introduced, the handling of taint-transparent
syntax changed to keep its lexical context. Restore the original
behavior, which is necessary to protect bindings, and fix taint
handling on submodules.
2014-04-20 20:20:33 -06:00
Matthew Flatt
7bccae1ce0 fix type mismatch in JIT 2014-04-19 15:21:26 -06:00
Matthew Flatt
3fa9f99e2c racket/unsafe/undefined: add chaperone-struct-unsafe-undefined 2014-04-19 11:14:37 -06:00