Commit Graph

1758 Commits

Author SHA1 Message Date
Matthew Flatt
469763ca37 Adjust use of readtable argument in read/recursive
Use the given readtable more consistently to parse
delimiters in the top-level form. This change particularly
addresses problems with trying to restore the original
`(` when parsing a hash table, but allowing nested
forms to still use a different `(` mapping.
2015-04-15 13:01:58 -06:00
Matthew Flatt
16ce8fd90d fix an optimizer bug
Optimization of an identifier in a test position passed a
pre-optimization offset to a function that expects a
post-optimization offset.
2015-04-12 06:48:07 -06:00
Juan Francisco Cantero Hurtado
667b9e9b71 Clarify the minimum CPU requirements in README
The JIT needs SSE2, not just SSE.
2015-04-10 14:12:54 -06:00
Matthew Flatt
be1a63cf50 fix SSE detection to detect SSE2
SSE isn't enough, because the JIT needs SSE2
2015-04-10 14:03:44 -06:00
Eric Dobson
29b1ac70df Make for raise better error message if binding clauses are bad.
Closes PR 13272.
2015-04-10 13:56:42 -06:00
Matthew Flatt
8e22b22630 fix string-titlecase based on case-ignoreable chars
Fix extraction of case-ignorable characters from the Unicode
database.
2015-04-10 13:30:58 -06:00
Robby Findler
7e089f3d7f make sequence/c preserve streamness 2015-04-07 11:52:18 -05:00
Matthew Flatt
23ec573e51 repair chaperone handling in current-command-line-arguments 2015-04-06 12:44:47 -05:00
Matthew Flatt
af1b96849c raco setup: ignore prefetch message for PLaneT paths
A "prefetch" message is an attempt to trigger parallel builds for
multiple requires in a module. It doesn't work right with `(planet
...)` paths, probably because it doesn't work right with loading
`planet/resolver`.
2015-04-03 21:13:05 -05:00
Matthew Flatt
f9ffdeeb20 avoid redundant syntax-property propagation
Insteda of propagating a property manually, allow the
`syntax-track-origin` operation in macro expansion to do it.
Otherwise, properties turn into pairs of duplicate values.
2015-04-03 18:23:09 -05:00
Matthew Flatt
50ff92b784 defend against strage inferred-name property call with keyword args 2015-04-03 18:23:08 -05:00
Matthew Flatt
79bb6531df update version in HITSORY for v6.2 2015-04-03 17:24:15 -05:00
Sam Tobin-Hochstadt
e37b0b6361 Load dependencies more lazily. 2015-04-03 12:04:55 -04:00
Matthew Flatt
9481e3956d fix use of the wrong blame in struct/dc 2015-03-31 17:42:50 -06:00
Matthew Flatt
f7d4f7b234 MinGW build repairs and improvements 2015-03-28 09:50:01 -06:00
Matthew Flatt
5fff8e2056 internal hooks to build "Racket.exe" without "libracket3m.dll"
For now, setting `libracket-dll?` to #f in
  racket/src/worksp/gc2/make.rkt
enables that build mode.
2015-03-28 09:50:01 -06:00
Matthew Flatt
cae162685f make _hfun retry automatically
Extend `_hfun` to allow specified exceptions through, and
use it consistently for anything that returns an HRESULT
and might need a retry.
2015-03-27 15:19:19 -06:00
Matthew Flatt
3a75630ea4 add COM enumeration support 2015-03-27 14:43:44 -06:00
Matthew Flatt
d22082f7e5 add #:retry option to _fun 2015-03-27 13:03:20 -06:00
Robby Findler
df9cd3342a check duplicate identifiers in parametric->/c
closes PR 15017
2015-03-27 07:42:09 -05:00
Matthew Flatt
1a5e3e5953 _enum: allow negative integers
Corrects a problem with ad899173b9
2015-03-26 20:15:25 -06:00
Eric Dobson
ad899173b9 Add more error checking to _enum.
This also fixes some tests which were not running.
2015-03-26 11:33:20 -06:00
Eric Dobson
9fd9a42c61 Make enum work in non first order cases.
Closes PR 13323.
2015-03-26 11:33:20 -06:00
Jay Kominek
3ad60aa67a fix integer-length overflow (PR14986) improve performance on integer-length of negative bignums 2015-03-26 11:20:40 -06:00
Matthew Flatt
2dd29f7e3d fix pessimism in optimizer reordering
When determing whether expressions can be reordered, a reference to a
module-defined variable was considered unreorderable when it is
known to have a value and no further mutation, but the value isn't
constant across all runs.
2015-03-26 09:15:13 -06:00
Matthew Flatt
21d925d1f0 GC backtrace: add limited support for distinguishing new and old objects 2015-03-26 09:15:13 -06:00
Sam Tobin-Hochstadt
04c89b5ea2 Provide a submodule for begin-encourage-inline.
As suggested in a comment in the file.
2015-03-19 21:01:49 -04:00
Sam Tobin-Hochstadt
585f29cf0d Reduce contract dependencies from racket/set. 2015-03-19 21:01:49 -04:00
Matthew Flatt
d7cea5a1db GC atexit: report total GC msecs 2015-03-19 10:01:10 -06:00
Matthew Flatt
6752534da8 Revert "fix double-expansion in class"
This reverts commit 005b3f720f.

The expander's definition of "same context" is not flexible
enough, and introducing an extra `#%expression` wrapper
breaks TR's recognition of expanded classes. Revisit in the
near future.
2015-03-18 08:03:38 -06:00
Sam Tobin-Hochstadt
f73b4066a7 Add prop:object-name. 2015-03-18 09:55:27 -04:00
Matthew Flatt
3c4ed61a42 fix no-extflonum build
Repairs over-eager commit 9c9e922b4a
2015-03-18 06:44:41 -06:00
Matthew Flatt
eb95960e7c fix memory-management bug in syntax-object lexical info 2015-03-18 04:44:57 -06:00
Eric Dobson
cb67ea3edf Raise error message if _fun is used incorrectly.
Closes PR 11323.
2015-03-18 04:19:57 -06:00
Eric Dobson
408d86f1c7 Make provide expansion respect disappeared uses on expanded syntax. 2015-03-17 19:35:26 -06:00
Matthew Flatt
9c9e922b4a support extflonum optimizations even without extflonum support
As suggested by Gustavo
2015-03-17 19:33:10 -06:00
Gustavo Massaccesi
7981513b95 More redutions of predicates
The optimizer had some reductions of predicates applications, like (pair? X),
only when X was very simple and the type of X was obvious.
Use expr_implies_predicate and make_discarding_sequence to allow
the reduction of more complex expressions.

Also, the reduction of procedure? and fixnum? were special cases in
optimize_application2. Move the checks to expr_implies_predicate
to take advantage of the reductions in more general cases.
2015-03-17 19:28:37 -06:00
Matthew Flatt
005b3f720f fix double-expansion in class
The `class` macro uses `synatx-local-expand-expression`, but it
discarded the result and used the original, which implies
re-expanding.
2015-03-17 19:15:21 -06:00
Ryan Culpepper
bb48859c9b Post-release version for the v6.2 release 2015-03-17 07:38:54 -04:00
Matthew Flatt
eca0c18730 fix at-exit close handling for non-main place
This bug has been causing problems since the change to the `math`
library to register mpfr_free_cache() only once per place.
2015-03-13 12:30:31 -06:00
Matthew Flatt
4af6770ed4 initialize stack variable to make Valgrind happier
Although failing to initialize probably isn't a bug, fulling
initializing a buffer passed to epoll_ctl() seems like a good
idea.
2015-03-13 12:30:31 -06:00
Matthew Flatt
2e813c2aee GC: fix test for old-page compaction
Missing indirection found via memcheck
2015-03-13 12:30:31 -06:00
Matthew Flatt
7f5ed17222 remove special-casing of OS X and Linux for thread stack size
There doesn't seem to be a reason for the special case other than
history.
2015-03-13 12:30:31 -06:00
Sam Tobin-Hochstadt
2ce9b40a54 Add match-letrec-values.
Implemented by J. Ian Johnson.

Closes #762.
2015-03-11 19:00:12 -04:00
J. Ian Johnson
af12f855ba Expose the mk-rhs function normalize-definition uses.
I found I wanted this to make a define/stub macro that errors giving the defined identifier:

(define-syntax (define/stub stx)
  (syntax-case stx ()
    [(_ header)
     (let-values ([(id mk-rhs body) (normalize-definition/mk-rhs stx #'lambda #t #t #f)])
       #`(define #,id #,(mk-rhs #`(error '#,id "TODO: stub"))))]))

Closes #508.
2015-03-11 17:44:20 -04:00
Evgeny Odegov
7767ac64fd Remove forgotten parse-id identifier
Looks like, it should be removed, because there is no
such identifier exported from racket/match/gen-match
(a parameter of `define-forms` now).

Closes #808.
2015-03-11 17:23:16 -04:00
Robby Findler
33d653113d remove some old name-management code from contracts made obsolete by chaperones
closes PR 11222
2015-03-09 21:23:03 -05:00
Matthew Flatt
332b380ca2 repair impersonator-porperty predicate and accessor
Repair for b923269569, helpfully reported again by Scott
2015-03-09 15:33:41 -06:00
Matthew Flatt
5749d4080c add tracking of require and provide subforms
Use `syntax-track-origin` and 'disappeared-use properties to
communicate `require` and `provide` form bindings to tools such as
Check Syntax.

Relevant to PR 13186
2015-03-09 15:28:08 -06:00
Matthew Flatt
59777ca17a increase time thread's stack size
On 64-bit FreeBSD 10.1, 4k is too small.
2015-03-09 13:33:19 -06:00
Eric Dobson
9c014b61e6 Make for/fold/derived check the values in the body in the last clause.
Closes PR 13285.
2015-03-09 12:48:49 -06:00
Eric Dobson
acd1fe7f8d Make define-cpointer-type declare its function with an inferred-name.
Closes PR 12296.
2015-03-09 12:45:35 -06:00
Eric Dobson
5895eabad1 Add break-parameterization?.
Closes PR 11966.
2015-03-09 12:40:08 -06:00
Matthew Flatt
b923269569 make impersonator properties sensitive to prop:impersonator-of
When a structure type has `prop:inpersonator-of`, follow it
when attemptng to access imperonator properties.

This change fixes a problem with `impersonate-procedure` as
reported by Scott Moore.
2015-03-08 19:27:11 -06:00
Matthew Flatt
092f6bb7e1 add object-or-false=? 2015-03-05 14:27:17 -07:00
Matthew Flatt
c458cd9799 remove over-eager namespace cleanup in the compiler/expander
The compiler/expander attempted to clear out references in a namespace
used only during macro expansion, but it's possible for references to
be retained (via unusual macros), so get rid of the broken attempt to
help the GC.
2015-03-05 11:21:25 -07:00
Alexis King
30610babe3 Make sequence/c first-order check more specific
closes PR 14983
2015-03-05 07:36:38 -06:00
Asumu Takikawa
ab68a4dc38 Add option to ignore local names in opaque class/c 2015-03-04 11:54:56 -05:00
Asumu Takikawa
0fce958268 Reduce space usage for object/c like instanceof/c
Reuse the instanceof/c projection for object/c to get
the space saving higher-order wrapping behavior. Also
implement a stronger check for object/c.
2015-03-04 11:54:56 -05:00
Matthew Flatt
6b81275af4 fix use of the wrong val in contract optimization 2015-03-03 08:07:01 -07:00
Robby Findler
efee5c4581 move sequence/c into racket/sequence 2015-03-02 22:14:32 -06:00
Matthew Flatt
16a9f86f90 raco exe: preserve lib form of runtime submodule references
Otherwise, executable creation can fail because a module is referenced
both through a `lib` path and through a filesystem path.
2015-02-27 12:27:27 -07:00
Matthew Flatt
e345e44e00 define-runtime-module-path-index: delay resolution of module path
Since a module path index is being generated, a module path index
for the referencing module can be used, too, preserving relative
references for as long as possible.
2015-02-27 12:26:19 -07:00
Matthew Flatt
04ce921e8f fix optimize problem
Gustavo's tests in de3fa9a855 illustrate the problem. The solution
is simply passing 1 for `optimized_rator` to optimize_for_inline().
Additional changes generalize optimize_for_inline() a little (although
that generality doesn't seem to be useful at the moment) and collapse
some variables that represent the same value.
2015-02-27 10:01:09 -07:00
Matthew Flatt
6cf28d55cd fix memory-management problem in putenv
Problem reported by Sergey Pinaev: free(oldbuffer) should be called
AFTER putenv(buffer).

Also, respond correctly to an (unlikely) putenv() failure.
2015-02-27 08:18:13 -07:00
Asumu Takikawa
f43096b123 Export an alternative object/c constructor
This functional constructor allows runtime construction
of object contracts in extension libraries.
2015-02-24 17:18:40 -05:00
Asumu Takikawa
5dc6be1a17 Allow chaperones on class methods
This allows libraries to add metadata to methods in the form
of chaperone properties which can be read by contracts on
methods.
2015-02-24 17:17:32 -05:00
Matthew Flatt
c5e9f42cee adjust use of TARGET_OS_IPHONE in C preprocessing
Some Mac headers `#define` it as 0, so depend on its value instead
of its definedness.
2015-02-23 08:29:27 -07:00
Ryan Culpepper
80e4894597 fix mandatory-after-optional checking
Also fix tests for attribute change.
2015-02-22 21:51:49 -05:00
Leif Andersen
2a583988cb Use #f for no default or keyword (opposed to #'#f) 2015-02-22 21:51:48 -05:00
Leif Andersen
3d567f643c Puts following limitations on args:
* no duplicate names
* no duplicate keywords
* no mandatory argument after optional argument
2015-02-22 21:00:10 -05:00
Leif Andersen
2e9065e610 Use function-header library in racket/match. 2015-02-22 21:00:10 -05:00
Leif Andersen
ca365d17c1 Add syntax/parse/lib/function-header library. 2015-02-22 21:00:10 -05:00
Matthew Flatt
af6c39611d configure: initial support for an iOS build
A new `--enable-ios=<sdk-path>` flag in combination with `--host=...`
sets up the right compiler options for compiling the Racket runtime
system as a framework to use in an iOS application.

I don't know whether the resulting framework actually works, but
compiling and linking is a step forward.
2015-02-22 08:45:40 -07:00
Tobias Grelsson
a5d506a3a4 add http method "options" 2015-02-19 10:30:19 -07:00
Matthew Flatt
aae35ea3ac fix stream/c using generics chaperone property support 2015-02-19 09:56:50 -07:00
Matthew Flatt
d69af6af30 add property support to chaperone-generic, etc. 2015-02-19 09:56:50 -07:00
Matthew Flatt
a40afcd782 fix problem with _list-struct
Repairs a mistake in d747f8f806.
2015-02-17 16:01:03 -07:00
Matthew Flatt
b37eab0621 raco pkg update: add --skip-uninstalled flag 2015-02-17 15:43:15 -07:00
Matthew Flatt
8aa16faa6d raco pkg {install,update}: add --pull option 2015-02-17 13:05:20 -07:00
Gustavo Massaccesi
4b8517b27c Recognize more procedures in scheme_optimize_apply_values
scheme_optimize_apply_values reduces (call-with-values gen proc)
to (#%apply-values proc gen) when recognizes proc as a procedure.
This extends the expressions that are recognized as procedures.
2015-02-16 10:06:52 -07:00
Gustavo Massaccesi
0c5944d64a Reduce (procedure? <inlineable>) => #t 2015-02-16 10:06:51 -07:00
Matthew Flatt
a8026824dd adjust optimizer to improve intra-module inlining
Instead of delaying the registration of some constants until a
group of expressions is re-optimized, add constant information as
it is discovered, which can expose some additional optimizations.

The old grouping was probably aimed at avoiding excessive code growth,
but I think that other and better controls are now in place. The
overall size of ".zo" files in an installation did not grow
significantly with this change.

Closes PR 14978
2015-02-16 10:01:16 -07:00
Matthew Flatt
17275b946a raco setup: improve and normalize error reporting
When repoting an error during compilation, always show the path to the
module being compiled. That path was sometimes available in the error
message anyway, due to source locations for syntax errors, but often
there would be no path due to run-time errors in macros, a lack of
source locations on macro-introduced forms, etc.

The `raco setup` improvements rely on new machinery in `compiler/cm`,
and `raco make` inherits that machinery.

The parallel and non-parallel variants of `raco setup` reported
excpetions in slightly different formats, and now they're consistent.
The initial report of an exception now always shows an evaluation
context, while the summary's repeat of the error omits the context.
2015-02-15 09:49:40 -07:00
Matthew Flatt
1c4c76dd57 fix printing of ellipses in long error context 2015-02-15 08:10:27 -07:00
Matthew Flatt
d747f8f806 require a #:offset keyword before a field offset in define-cstruct
Also, allow `#:offset` specifications on individual fields, instead
of all or node.
2015-02-14 18:40:20 -07:00
BartAdv
7dfa02cc5f Add field offsets specification for define-cstruct
This allows to define the offsets for each field instead
of relying on the calculated ones - useful when struct might
be defined differently across platforms.
2015-02-14 18:40:20 -07:00
Gustavo Massaccesi
9c67f8be6a Ignore fuel in optimize_for_inline when it's used just to get a known procedure
Fix 7f61a6
2015-02-14 18:40:20 -07:00
Alexis King
714b7684fe Add stream/c contract for adding contracts on stream contents 2015-02-13 20:14:03 -06:00
Matthew Flatt
abe1233734 make hash-table order invertible at build time
For detecting and debugging accidental dependencies on hash-table
order, it might be helpful to invert the order at the lowest level. To
do that, uncomment `#define REVERSE_HASH_TABLE_ORDER` in "hash.c".
2015-02-13 18:28:48 -07:00
Matthew Flatt
0b82125ce9 remove misleading call
The `extractors` array is allocated on start-up (which is why it's
ok for places).
2015-02-13 06:59:27 -07:00
Matthew Flatt
f5da16b56d fix interaction of nack-guard-evt and choice-evt
If the result of `nack-guard-evt` is a `choice-evt`, then chosing any
of the combined events should avoid the NACK.
2015-02-12 15:24:45 -07:00
BartAdv
3a123ca85c Fix a typo in define-cstruct 2015-02-12 10:14:52 -07:00
Gustavo Massaccesi
84543217f9 Add flexpt to is_inline_unboxable_op list 2015-02-12 10:14:51 -07:00
Sam Tobin-Hochstadt
d3b018b7cb Re-do projections for struct fields in chaperone handlers.
If the selector is itself a chaperone, then doing the access once
will mean that the saved result is not `chaperone-of?` the result
of doing the access a second time, at least in some cases (such as
when the accessor uses vector contracts).

Thanks to Neil T for initial spotting, and to Robby for actually
finding the bug and suggesting the fix.
2015-02-12 09:50:57 -05:00
Matthew Flatt
1409ff1d24 fix position of lifted requires in expansion
The macro expander formerly put all lifted requires at the start of a
module, but that doesn't work with re-expansion if a module has
submodules and lifted requires that refer to submodules. Put lifted
submodules in the right place, instead: just before the form whose
expansion added the lifted require.
2015-02-10 17:53:08 -07:00
Alexis King
62e52bf41d Add writeln and println functions to complement displayln 2015-02-10 09:46:06 -05:00
Matthew Flatt
bc6670c8e0 fix marshaling of module language info
Language info needs to be quote-protected in case it contains
a hash table or graph structure.
2015-02-09 17:26:05 -07:00
Matthew Flatt
9c7d0b8794 Unicode 7.0
Closes PR 14971
2015-02-09 11:33:13 -07:00
Matthew Flatt
2ada651dd3 {chaperone,impersonate}-struct: allow structure type as a witness
Also, do not allow `struct-type` as a wrapped operation in
`chaperone-stuct` without a witness.

Related to PR 14970
2015-02-08 06:52:24 -07:00
Matthew Flatt
8e8c9842fa raco {pkg,planet} <subcommand>: improve error for ambiguous <subcommand>
Report a user error instead of an internal error.

Closes PR 14969
2015-02-08 06:07:09 -07:00
Matthew Flatt
be8f70fffb racket/unit: static checking of initialization dependencies
When using `compound-unit/infer` and similar, check the `link` clause
against each unit's static information for initialization dependencies.
Also, propagate dependency information in `define-compount-unit`.
2015-02-06 09:22:01 +01:00
Matthew Flatt
53fb33144e add unit-static-init-dependencies 2015-02-06 08:55:58 +01:00
Leif Andersen
5e04ec431f Update .travis.yml for raco pkg new. 2015-02-05 17:30:32 -05:00
Ryan Culpepper
991340e0b0 db/sqlite3: fix custodian shutdown wrt locking 2015-02-04 20:19:13 -05:00
Matthew Flatt
acdb0b0e90 fix prefab-key? for inferred field count
Instead of inferring a field count of 0, accept a key that
works with some number of fields.

Closes PR 14964
2015-02-03 10:48:18 +01:00
Robby Findler
ffd77693ee fix a bug in random contract generation that could cause
nested structure to have contract-random-generate-fail stuck
into it

and clean up some confusing structure in the random generator
2015-02-02 22:15:05 -06:00
vraid
68074f7fd7 fix typo 2015-02-02 17:27:42 -05:00
Matthew Flatt
8265c968fc openssl: recognize version "1.0.1j"
Closes PR 14954
2015-01-30 13:29:36 -07:00
Matthew Flatt
8d49a91dce pretty-print: fix for a current inspector that sees through internals
If the current inspector can inspect the internal `unquoted` structure
type, then `unquoted?` must come before `struct?`.
2015-01-29 19:33:36 -07:00
Ryan Culpepper
3029867e9f fix reified-syntax-class-curry (missing role argument) 2015-01-29 20:37:50 -05:00
Matthew Flatt
b7e86ef6c9 syntax/modcollapse: fix to new collapse-module-path-index variant 2015-01-28 16:21:43 -07:00
Matthew Flatt
83974a42ee native-libs script: build MPFR for Windows as thread-safe 2015-01-27 20:07:49 -07:00
Matthew Flatt
60704c9198 Windows: fix reparsing with UNC targets 2015-01-27 18:07:46 -07:00
Matthew Flatt
f30b3a50fd Windows: fix problems with junctions and symlinks
Racket wasn't reparsing correctly; the strategy worked ok
for links created by `mklink`, but not with other tools that
leave the "printed name" field blank.

A consequence of various fixes is that reparse points like
"My Documents" (in a typical configuration) correctly resolve
to actual paths like "Documents".

Finally, `directory-exists?` didn't handle root directories like
"C:/" correctly. The query would actually report properties of
the OS-level current working directory, and when junctions are
involved, the current directory can be a link instead of a directory.

Relevant to PR 14950 and PR 14912
2015-01-27 17:48:52 -07:00
Matthew Flatt
d3383e3e35 dynamic-require: fix re-export shortcut 2015-01-27 13:46:33 -07:00
Matthew Flatt
a72ef3ec05 syntax-local-lift-require: fix problems for meta-compile-time use
Various repairs correct problems with `local-require` in a
phase-1 context.
2015-01-27 09:49:28 -07:00
Matthew Flatt
7bee7bbadc collapse-module-path-index: support relative module path flattening
Unlike `collapse-module-path`, it makes sense for
`collapse-module-path-index` to convert a relative module path index
to a plain module path. In other words, `collapse-module-path-index`
can convert a module path index to a module path.
2015-01-27 08:40:10 -07:00
Robby Findler
d74b0a6bf4 between/c (unlike integer-in) can actually just disappear
when the arguments are = to each other
2015-01-25 19:23:38 -06:00
Robby Findler
6551cc00d6 make (integer-in x x) produce (and/c x exact?)
fix bug in 9f59d57ee
2015-01-25 15:31:04 -06:00
Robby Findler
87a231b792 fix a bug in the way that an old style projection
was created when a val-first-projection was needed
2015-01-25 15:08:12 -06:00
Robby Findler
ffbf01ad4e more trickyness for = and numbers in random generation 2015-01-25 15:08:12 -06:00
Gustavo Massaccesi
e36382d500 Add SCHEME_PRIM_WANTS_FLONUM_SECOND flag to flexpt 2015-01-25 07:51:45 -07:00
Gustavo Massaccesi
6ab68eb97d Add SCHEME_PRIM_PRODUCES_FIXNUM flag to unsafe-fxvector-ref 2015-01-25 07:51:45 -07:00
Matthew Flatt
68c5d3d1d6 fix error message for inexact->exact on +inf.f 2015-01-24 10:12:35 -07:00
Matthew Flatt
bac11bf8f5 db/sqlite3: fix recur for busy db 2015-01-24 10:12:35 -07:00
Robby Findler
eb7c6653f3 make the contract random generator sometimes
generate inexact/exact variants of numbers
when the exact/inexact one was originally
present in the contract
2015-01-23 22:40:54 -06:00
Robby Findler
cc642c3382 change +nan.0 and +nan.f, when viewed as contracts, to
be equal?-based contracts instead of = based contracts.

Before this change, the contract (or/c 1 2 +nan.0) was the same
contract as (or/c 1 2), because +nan.0 was the same contract as
the predicate (lambda (x) (= x +nan.0)), which is the same as
(lambda (x) #f). Now, +nan.0 and +nan.f are the only numbers
that are treated as equal?-based contracts, but this means that
(or/c 1 2 +nan.0) actually accepts +nan.0.
2015-01-23 21:57:51 -06:00
Matthew Flatt
778a95294c fix requested stack depth as needed by on-demand JITting
Found by stack-overflow checking added in 3408209f66.
2015-01-23 12:10:04 -07:00
Robby Findler
6bf6f4d392 add a generator for exact-integer 2015-01-22 20:04:36 -06:00
Matthew Flatt
2ffb546c95 fix vector-set-performance-stats! for CGC
Also, fix the build for a no-futures, no-places configuration.
2015-01-22 13:03:00 -07:00
Matthew Flatt
db40c2f4ce corrections to GC out-of-memory handling 2015-01-22 10:16:32 -07:00
Matthew Flatt
cffb63be56 correction to recent repair to places
Corrects 5b20690876
2015-01-22 10:16:32 -07:00
Matthew Flatt
7196dc0e74 add peak memory use to vector-set-performance-stats! 2015-01-22 10:16:32 -07:00
Robby Findler
9f59d57ee4 make (integer-in n n) produce just n 2015-01-21 21:53:31 -06:00
Markus Bertheau
f2bacdc6f3 Correct 'german time format
We separate hour and minute with a colon, not with a period.
2015-01-21 08:39:46 -06:00
Matthew Flatt
0c13a4a1f1 places: avoid redundant atexit() registrations
Register only in the original place.
2015-01-21 06:11:05 -07:00
Matthew Flatt
1893f73fac fix GC peak-memory logging 2015-01-21 05:10:51 -07:00
Matthew Flatt
5b20690876 places: no allocation while low-level locks are held 2015-01-20 19:26:42 -07:00
Matthew Flatt
5a8a0aff02 db: fix finalization problems
A `this%` expression used in a finalization callback implicitly
referred to `this`, since it's a dynamic reference to the object's
class. As a result, the finalizer for `this` refers to `this`, so
`this` never becomes collectable. The problem is fixed by
lifting the `this%` out of the `lambda`.

Less significantly, the finalizer thread in "prepared.rkt" captured
various parameters on creation, including the current namespace. If a
prepared statement is bound to a module-level variable, then the
finalizer thread refers through the namespace to the prepared
statement, so the prepared statement can never be finalized. Setting
the current namespace to a fresh empty one while creating the thread
avoids that specific problem. (Other parameters could cause similar
problems, but solving the namespace one works well enough for now.)
2015-01-20 13:04:23 -07:00
Matthew Flatt
857950a2b2 fix prefix-use flags on a closure that ignores its captured prefix
Optimization can cause a `lambda` that was going to refer to a
top-level variable or syntax object to not refer to it after all.
Ideally, the prefix should be dropped from the closure, but
the change here is more conservative: it fixes the `lambda`s
annotation that's used by the GC to indicate that nothing will
be used from the prefix.
2015-01-20 12:58:51 -07:00
Matthew Flatt
e42bf573e1 JIT: clear tail-call rator when handling directly
Clearing is needed for space safety.
2015-01-20 11:37:04 -07:00
Matthew Flatt
cca2ee5e68 fix --disable-jit build
Also, avoid a compiler warning.
2015-01-20 07:50:17 -07:00
Matthew Flatt
5ac22ef3b8 another GC backtrace repair
Special treatment of a "prefix" in a closure needs special
backtrace support.
2015-01-19 21:29:55 -07:00
Matthew Flatt
3eef017911 track whether a closure uses syntax objects
For GC purposes, if a "prefix" (a closure frame that caprues
top-level or module-level bindings) may refer to syntax objects
that are not used by any reachable closure, in which case the
syntax object can be dropped. This pruning of syntax objects
uses the infrastructure already in place to prune variables.

Syntax objects were not included in the original pruning
implementation, because they are unlikely to create
finalization cycles in the way that global-variable
references can. A syntax object can retain a namespace's
table of module imports, however, which can be substantial
and worth releasing of a closure is only held, say, for
a low-level finalization action.
2015-01-19 21:29:55 -07:00
Matthew Flatt
df88e0dd8a fix clearing of JIT's code-name table
Although names were cleared correctly, the trie used for
the mapping was not pruned correctly, so lots of empty
branches could accumulate (especially in 64-bit mode).
2015-01-19 21:29:54 -07:00
Matthew Flatt
7f5a834fdb allow weak hash tables to shrink 2015-01-19 21:29:54 -07:00
Matthew Flatt
e3591d30b9 fix bugs in GC backtrace support
Lots of problems have made GC backtrace support unreliable (as
enabled for debugging via `configure --enable-backtrace`).
2015-01-19 21:29:54 -07:00
Matthew Flatt
57832309ef bump version number 2015-01-19 21:29:54 -07:00
Matthew Flatt
676109f638 compiler: never retain namespace for constantness-test argument
Even when `(variable-reference-constant? (#%variable-reference ....))`
cannot be optimized to a boolean, the expression should not retain a
reference to the enclosing namespace. That space guarantee is
important for the compilation of calls to keyword-accepting functions.
2015-01-19 21:29:54 -07:00
Matthew Flatt
ab5baca97c optimizer: fix variable-reference-constant? on module-level identifier
Allow optimization when the reference variable is known to have
a fixed value, not only when it's a constant value.
2015-01-19 21:29:54 -07:00
Alexis King
6aad952b20 Improve blame context message 2015-01-19 19:58:51 -06:00
Alexis King
3ab1ad8c93 Implement chaperones, impersonators, and contracts for async-channels 2015-01-19 19:58:51 -06:00
Robby Findler
9971858fc2 small clean up to list contract error messages (grammar and abstraction) 2015-01-19 16:37:15 -06:00
Robby Findler
b6000de2f7 fix ->i dependency check 2015-01-19 10:23:59 -06:00
Matthew Flatt
2d4b4527c0 defer require and provide expansion to module body
Closes PR 14936
2015-01-18 11:35:19 -07:00
Matthew Flatt
c6802ed107 namespace-attach-module: fix handling of for-template
The handling of `for-template` imports by `namespace-attach-module`
didn't match the docs. The actual handling was to refrain from
attaching instances of a phase-0 module if the instance was reachable
only through a `for-template`. The rationale had to do with such
modules instances being created only through instantiation of
phase-1 modules, and phase-1 module instances aren't attached;
it doesn't work well that way, though, when different modules
are attached with intervening `namespace-require`s on the target
namespace.

The change includes a documentation correction. Previously and still,
only modules at the same phase as the attached module (as opposed to
the same phase or less) are instantiated in the target namespace.

Closes PR 14938
2015-01-18 11:19:49 -07:00
Matthew Flatt
825af972db log GC's peak memory use on exit 2015-01-18 10:03:26 -07:00
Matthew Flatt
2b8acb368a raco pkg: another attempt to fix git commands for an update
Document and and exploit that any fragment in the Git or GitHub URL
for a package source must name a branch or tag (as opposed to a
commit) to work with clone linking.
2015-01-16 09:28:31 -07:00
Matthew Flatt
5e6debf854 make: DESTDIR must be an absolute path
Clarify in the installation notes, and add a check in the makefile.

Closes PR 14935
2015-01-15 06:09:21 -07:00
Matthew Flatt
dbba480ad3 raco pkg: adjust the way a local clone is made for updates
When a clone-linked package is updated, a temporary extra clone
is created to checkout the target commit for dependency and conflict
checking.

The current strategy for cloning a repository doesn't work for some
Git versions. The problem is that the target commit is unlikely to
be reachable from any current branch or tag, and so it might not
get carried along in the clone (depending on the Git version).
Originally, a `git fetch <commit>` compensated for that problem,
but fetching a particular commit doesn't work for all Git versions,
either.

The new strategy is to clone with `--shared`, which ensures that
just-fetched commits are all available in the temporary clone (and
it also avoids a little unnecessary copying work).
2015-01-15 05:30:41 -07:00
Matthew Flatt
9f3c82c30a Windows: change delete-{file,directory} to attempt permission correction
If a file or directory delete fails, try adjusting the file or directory
permissions to allow writes, then try deleting again. This process should
provide a more Unix-like experience and make programs behave more
consistently.

A new `current-force-delete-permissions` parameter provides access to
the raw native behavior.
2015-01-13 11:58:36 -07:00
Matthew Flatt
33da6564a1 fix handling of empty paths in PATH on Windows
Check for an empty path after dropping `"`s, instead of before.
Otherwise, a bad PATH setting interferes with functions like
`find-executable-path`, which in turn can prevent DrRacket from
starting up.

Closes PR 14930
2015-01-13 06:48:40 -07:00
Matthew Flatt
719917f812 compiler: fix inlining of #%variable-reference 2015-01-13 06:45:59 -07:00
Matthew Flatt
486debd704 repair to recent JIT repair
Fix a jump-mode bug introduced with 3408209f66. The bug is most
visible on PPC.
2015-01-10 19:15:49 -07:00
Matthew Flatt
ece9126656 compiler/cm-accomplice: adjust protocol for extra options
Instead of introducing a subtype of `file-dependency` to imply one new
option, add a subtype that has an options table for easier
extensibility. (Thanks to Sam for pointing out that I shouldn't make
this mistake again.)
2015-01-09 11:31:35 -07:00
Matthew Flatt
805cd95049 repair for indrect dependencies
Fixes a problem with 95e85ec5bd that broke `raco setup -c`
2015-01-09 11:31:35 -07:00
Matthew Flatt
f2a8c31d9f avoid ambigious else
even though another `else` currently resolves the ambiguity
2015-01-09 08:54:44 -07:00
Gustavo Massaccesi
7f61a68552 Ignore fuel in optimize_for_inline when it's used just to get a known procedure 2015-01-09 08:54:13 -07:00
Gustavo Massaccesi
1b3949c233 Add flags to application in finish_optimize_application3
(finish_optimize_application and finish_optimize_application2 already do this.)
2015-01-09 08:54:13 -07:00
Gustavo Massaccesi
feb8f10165 Mark error in expression when an arity mismatch is detected during optimization
This enables further reductions, for example (begin (car x x) z) => (car x x)
2015-01-09 08:54:13 -07:00
Gustavo Massaccesi
6d8ba1fd67 Mark errors in expression when a wrong type is detected during optimization
This enables further reductions,
for example (begin (car x) (unbox x) z)  => (begin (car x) (unbox x))
2015-01-09 08:54:13 -07:00
Matthew Flatt
34c2c2ebdd raco pkg: doc improvements for command-line tool 2015-01-09 07:51:43 -07:00
Matthew Flatt
95e85ec5bd add support for indirect CM dependencies; use in lazy-require
If module M in package P imports module N from package Q,
and if N has a `lazy-require` for a module in R that is
triggered during the compilation of M, then P doesn't really
depend on R; P depends on Q, and Q depends on R, and P
shoudn't necessarily know anything about Q. At the same time,
a change to the file in R means that M must be recompiled.
So, continue to track the compilation dependency, but mark
it as "indirect" so that the package-dependency checker can
ignore the dependency.
2015-01-08 09:59:37 -07:00
Matthew Flatt
c56c9250f1 fix JIT-inlined make-rectangular combining single and double
The single must be coernced to a double in that case.
2015-01-07 14:44:02 -07:00
Matthew Flatt
f27d9e9df5 raco pkg: report inferences to user
Make `raco pkg` more verbose when it infers a package name from
`--clone`, which updating a package based on the current directory,
etc.
2015-01-07 14:44:01 -07:00
Matthew Flatt
7242d7ed38 raco pkg: fix for old-format catalog entries 2015-01-07 10:43:42 -07:00
Matthew Flatt
e82487429b fix bad case-lambda sharing that breaks let-depth tracking 2015-01-06 12:58:52 -07:00
Matthew Flatt
3408209f66 fix potential stack overflow with JIT-inlined apply
If the slow path has to be taken because the number of
list elements is greater than the stack size, then the
old implementation would copy all the arguments --- which
still might be too much for the available stack space.
Avoid that copy.

Also, add pad word to the end of the stack to help detect
overflow.
2015-01-06 12:58:52 -07:00
Robby Findler
2b07cc34f7 fix context for instanceof/c
also improve test suite to look for ellipses
(but not when using opt/c)
2015-01-04 15:10:58 -06:00
Robby Findler
2cd8e620d4 improve error message in certain tricky case when keywords are involved 2015-01-04 15:00:22 -06:00
Robby Findler
95dcee18c7 add a cons/dc generator
Not really sure about this one. The API kind of
forces my hand here and the way this works limits
the non-dep side of the dependent pair to always
be drawn from a fixed set. Not sure if that matters
in practice or not.
2015-01-03 19:25:25 -06:00
Robby Findler
e25575b16a improve contract random generation for null? and recursive-contract 2015-01-03 17:16:52 -06:00
Matthew Flatt
daf9415a98 ffi/unsafe: fix tauint handling in define-fun-syntax 2015-01-02 18:16:34 -07:00
Robby Findler
44073e31b4 add missing neg-party
closes PR 14915
2015-01-01 09:56:00 -06:00
Gustavo Massaccesi
25013320be Fix is_arity_list 2014-12-29 07:26:15 -07:00
Gustavo Massaccesi
17665d33a2 Remove dead code after errors
For example, reduce (begin x (error 'e) y) ==> (begin x (error 'e)) and
(f (error 'e) y ) ==> (begin f (error 'e)).

Also, reduce (if (error 'e) x y) ==> (error 'e) and propagate the type information
and clocks when only one branch produce an error.
2014-12-29 07:24:22 -07:00
Gustavo Massaccesi
92615049aa Fix make_discarding_first_sequence
Ensure that the first expression is single valued.
2014-12-29 07:24:09 -07:00
Robby Findler
94a450999a add stronger and random generation for integer-in 2014-12-25 22:07:05 -06:00
Robby Findler
fd99e57020 fix spacing bug in contract error messages 2014-12-23 16:37:55 -06:00
Robby Findler
1f7565fe47 fix bug and tweak length 2014-12-23 13:45:22 -06:00
Robby Findler
d5bb6030ec tweak the way ellipses are inserted into
contract names to avoid bottoming out with
an ellpisis when the ellipsis is replacing
a simple thing
2014-12-23 13:15:37 -06:00
Robby Findler
94d80f0171 add #:pre/desc and #:post/desc to ->i 2014-12-22 22:31:17 -06:00
Robby Findler
9d58a067e3 add #:pre/desc to ->* 2014-12-22 14:53:25 -06:00
Robby Findler
3d48ef78f6 attempt to more closely follow the Reference's
"Error Message Conventions" in the contract error messages
2014-12-22 13:26:20 -06:00
Robby Findler
aabe9d7bad added dynamic->* 2014-12-20 22:48:26 -06:00
Matthew Flatt
7b8707e576 raco pkg: adjust staging of Git clone installs and updates
If the clone directory's checkout includes a target commit, then
use the clone directory directly for staging (i.e., for checking
dependencies and collisions). That way, changes made locally are
used for metadata checks.
2014-12-20 12:25:58 -07:00
Matthew Flatt
805c5d1d13 raco setup: continue checking when a package is missing 2014-12-20 09:16:35 -07:00
Matthew Flatt
dc8f864a3c raco setup: use cache for pkg-directory in dep checking 2014-12-20 09:06:30 -07:00
Matthew Flatt
e21f75fa1b Win64: fix stack-trace imprecision
Propagates repairs of 71e0bdfcff to Win64 stack handling.
2014-12-19 20:31:07 -07:00
Matthew Flatt
31ebe213cc reject prefab specs with bad mutability indices
Closes PR 14887
2014-12-19 20:12:44 -07:00
Matthew Flatt
9419bf42a1 fix enforcement of size limit in prefab struct descriptions
Closes PR 14888
2014-12-19 20:12:44 -07:00
Robby Findler
a8ba4eca35 adjust hash/c so that it always copies immutable hashes
before this commit it would copy them only when the weren't
already impersonated/chaperoned, leading to different
contract checking that can be confusing in that case

it did this because the chaperone-of? check wasn't general
enough to cope with copying always, but since commit
b05d07ad10 it now is
2014-12-19 10:58:53 -06:00
Juan Francisco Cantero Hurtado
26c4607c3b Add various changes to sconfig and configure.
- Modify the features used by OpenBSD (not everything was
  tested). Mostly copied from Linux, FreeBSD and NetBSD.
- Add support for Bitrig, a fork of OpenBSD. Eventually
  they will differ more and more from OpenBSD.
- Typos and extra trailing spaces.
- Update config.guess and config.sub from GNU.
2014-12-19 05:22:58 -07:00
Robby Findler
9e9dcf2f50 added hash/dc 2014-12-18 22:31:20 -06:00
Matthew Flatt
95617a200b fix UDP receive on Windows
When the received message is larger than the space available, it's
still received.
2014-12-18 10:51:50 -07:00
Matthew Flatt
e7d29dee61 raco setup: repair clean-up of PLaneT info-domain cache
Unintentional shadowing caused the info-domain clean-up code to reject
all PLaneT path registrations. As a result, installing a PLaneT
package removes all info-domain mappings (used to find documentation,
`raco` commands, etc.) for other PLaneT packages. Running `raco setup`
repairs the problem, because it re-adds all entries after
(incorrectly) clearing them out.
2014-12-18 09:14:46 -07:00
Matthew Flatt
b05d07ad10 generalize {impersonator,chaperone}-of? on immutable hash tables 2014-12-18 06:49:10 -07:00
Matthew Flatt
edf562be5e raco pkg update: fix conflict checking vs. installed being updated 2014-12-17 07:51:04 -07:00
Matthew Flatt
9b9546c0bf raco pkg update: adjust --update-deps handling, again
Still trying to get the dependencies-have-changed-for-a-link case
right without breaking other cases.
2014-12-16 13:37:48 -07:00
Matthew Flatt
ebd817f278 raco pkg update: avoid duplicate updates of a single package
A table was incorrectly used to track both the checksum and
update status of packages; fix that, so that `raco pkg update --all`
doesn't generate a plan with multiple updates of a single package.
Meanwhile, also protect against multiple and inconsistent planned
updates of a package (by collapsing multiple consistent plans into
one).
2014-12-16 10:35:54 -07:00
Matthew Flatt
2b62ffe90b raco pkg show: mention auto-installed when no non-auto are installed
In the case that packages are only auto-installed in a particular
scope, `raco pkg show` should just say "[none]", instead of adding the
note about auto-installed packages that are not being shown.
2014-12-16 08:26:09 -07:00
Matthew Flatt
f8c6090d37 raco pkg: more information for an ill-formed path error 2014-12-16 06:40:54 -07:00
Matthew Flatt
71e0bdfcff more repairs to stack trace and caching
Fixes problems with d15fda9d6b, but also fixes a problem that
could show up in non-libunwind mode and cause lost frames.
2014-12-15 13:38:59 -07:00
Matthew Flatt
e22242df56 raco pkg: default --deps to search-ask in interactive mode
The implemented default for `raco pkg update` actually depended on the
way that a package is installed, and it's difficult to reason about or
to implement the default that is suggested by the documentation.
Meanwhile, `search-ask` seems the most sensible always in interactive
mode (now that we have a way to specify batch mode).
2014-12-15 09:13:24 -07:00
Matthew Flatt
0f6e0e83e0 raco pkg update: better handling of a missing dependency
When updating a linked package whose dependencies have changed,
and when a dependency is missing, then effectively reinstall
the link to get updates as requested by the user.
2014-12-15 09:13:24 -07:00
Matthew Flatt
ae3b59475a raco pkg clone: avoid fetching by commit id
A commit id apparently doesn't work in place of a <refexp> in some
versions of Git.
2014-12-15 08:57:02 -07:00
Matthew Flatt
6f5ab2851d avoid a compiler warning 2014-12-14 08:52:26 -07:00
Matthew Flatt
d15fda9d6b fix native-stack caching with libunwind
The implementation of caching stack-trace information in the
stack didn't work right in libunwind mode, with the result that
`(current-continuatiom-marks)` took O(N) time for a continuation
of size N, when it should be amortized constant time.
2014-12-14 08:46:14 -07:00
Gustavo Massaccesi
58ef3fdaa8 Mark immutable? as omitable 2014-12-14 08:46:14 -07:00
Gustavo Massaccesi
ababa86c44 Increase SCHEME_PRIM_OPT_TYPE_SHIFT
Otherwise, two optimization flags collide:

 SCHEME_PRIM_ALWAYS_ESCAPES = SCHEME_PRIM_PRODUCES_FLONUM = 8192
2014-12-14 08:46:14 -07:00
Matthew Flatt
58bee1419b raco pkg update: change printout to avoid alarming "Removing..."
Changed "Removing" to "Uninstalling to prepare re-install of".
2014-12-14 08:46:14 -07:00
Matthew Flatt
c2fcb10470 raco pkg update: fix reoprting for --all in a scope without packages 2014-12-14 05:59:12 -07:00
Robby Findler
c3e92093f6 improve the way '() is treated as a constant
so it fits in with stronger and whatnot and
the other list contracts
2014-12-13 14:55:13 -06:00
Matthew Flatt
63f7cf1568 raco setup: try harder to delete files such as DLLs
If "sqlite3.dll" is installed as a foreign library but shouldn't
be, then `raco setup` cannot simply deleet the file, because
starting `raco setup` opened the DLL. To avoid that problem,
rename the file to start with "raco-setup-delete-", then attempt to
delete the renamed file; the delete won't work, but the file
will be moved out of the way, and a future `raco setup` can
clean up.

The prefix "raco-setup-delete-" thus becomes special on Windows for
the directories that hold foreign libraries, shared files, and
man pages, because `raco setup` will try to delete any file
that starts with "raco-setup-delete-".

It's all very ugly, but I don't have a better idea for the
problems that I keep hitting.
2014-12-13 09:16:52 -07:00
Matthew Flatt
9beca2bdee make: fix bootstrap for native libraries
Restore (but in a hopefully better way) a step that installs native
libraries before trying a full `raco setup`, since the libraries
may be needed for the setup proces --- especially on Windows.
2014-12-13 09:16:51 -07:00
Robby Findler
6f09e7c619 add cons/dc 2014-12-12 23:41:09 -06:00
Sam Tobin-Hochstadt
f7a300199a Improve formatting in raco pkg show, and add single-package show.
* `raco pkg show typed-racket` now shows just the "typed-racket" pkg.

* `raco pkg show --rx typed-racket` shows all packages that match the
  regular expression "typed-racket".

* `raco pkg show` now only shows the first 8 characters of checksums
  unless you provide the `--full-checksum` argument.
2014-12-12 12:59:52 -05:00
Matthew Flatt
66733944d3 net/http-client: add a #:method argument to http-conn-recv!
Supplying a 'HEAD method is necessary to receive the response
to a 'HEAD request, since the response will not include data.
2014-12-12 09:28:49 -07:00
Matthew Flatt
d6c26f9742 fix PLT_DELAY_FROM_ZO
Fetching bytecode from a previously read file was broken in the case
of a bytecode file with submodules.

Closes PR 14878
2014-12-12 07:59:17 -07:00
Matthew Flatt
d780930056 fix syntax-disarm with a #f second argument 2014-12-12 07:59:16 -07:00
Ryan Culpepper
8f4575eeec db: make sqlite connections managed by custodians 2014-12-12 00:27:30 -05:00
Ryan Culpepper
6039d6cc0b added register-finalizer-and-custodian-shutdown 2014-12-12 00:25:31 -05:00
Robby Findler
cd2898675f add #:name argument to {transplant,relocate}-{input,output}-port 2014-12-11 14:43:34 -06:00
Matthew Flatt
b2add2994c raco pkg: less noisy about consulting local catalogs
The "Resolving..." status reports are meant mainly to indicate when
network access is happening. Don't print in advance when a local
catalog is being used, but do print when a local catalog provided the
answer.
2014-12-09 14:19:53 -07:00
Matthew Flatt
885d2125b9 pkg/path: fix problems with path->pkg and case or nonexistent
The `path->pkg` funciton shouldn't return the name of a package that
isn't installed, including a case-folded version of a package that is
installed. On Windows, where we match case-normalized paths, we have
to work a little harder to map a case-normalized path element to the
installed package name, given that package names are case-sensitive.

Closes PR 14861
2014-12-09 14:09:53 -07:00
Matthew Flatt
195a46a23e fix problem with truncated value printing and stack overflow
A value-printing truncation discovered after a stack-overflow handle
and return could go badly, because the truncation escape wasn't
reset correctly after overflow handling (in contrast to truncation
discovered during the overflow handling, which was handled correctly).

Closes PR 14870
2014-12-09 09:22:12 -07:00
Matthew Flatt
3eac913a78 fix thread-based place implementation
There are some limitations to the places implementation when
`(place-enabled?)` returns #f, but mostly it can work.
2014-12-08 16:45:54 -07:00
Matthew Flatt
06c82877db raco pkg: add trash directory for removed/updated package installations
Packages that are installed as other than a link are not meant to be
edited, but work can get lost if a package is edited and then removed
or updated. Avoid that work loss by moving removed or updated packages
to a trash folder.

By default, the trash folder holds up to 512 packages for up to 48
hours. To disable the trash folder (for a given scope), use

 raco pkg config --set max-trash-packages 0

(I expect that some variant of Greenspun's rule predicted the eventual
inclusion of "backup" management in the package system.)
2014-12-08 16:44:31 -07:00
Matthew Flatt
8e3ea24b48 get-pkg-context: add #:use-cache? and #:quiet? arguments 2014-12-08 08:57:54 -07:00
Matthew Flatt
99c6f529e5 add makefile step to adjust for movements within "pkgs"
The step doesn't currently adapt to additionals or removals
from "pkgs", so further support may be needed in the future.
2014-12-08 06:36:17 -07:00
Matthew Flatt
4b36a8e9b5 fix handling of "links.rktd" errors 2014-12-08 05:33:09 -07:00
Matthew Flatt
d6b4523336 pkg/dirs-catalog added
This utility that is needed by `make` turns out to be useful in other
scripts.
2014-12-07 11:19:29 -07:00
Matthew Flatt
25023835b9 adjust status reporting for raco pkg update
Reduce a little noise that was recently introduced.
2014-12-07 10:09:12 -07:00
Matthew Flatt
39a9526f35 raco pkg update: recognize a directory that coresponds to a clone link
For example,

 raco pkg update --clone my/clone/test-pkg
 raco pkg update my/clone/test-pkg

will check for updates in the second case, not change the installation
to a directory link.
2014-12-07 10:01:57 -07:00
Matthew Flatt
9c75238cf2 raco pkg: fix path problems with updating a clone-linked package 2014-12-07 09:08:11 -07:00
Matthew Flatt
1cf985031d raco pkg update: allow --update-deps with a linked package
The linked package cannot be updated, but maybe its dependencies
can, so just alert the user that the linked package is skipped
instead of rejecting the request.
2014-12-07 09:08:11 -07:00
Matthew Flatt
8d2e32855e raco pkg: change default answer on clone-sharing conversion to "Y" 2014-12-07 09:08:11 -07:00
Matthew Flatt
2c3f13fe26 raco pkg update: make update to non-clone suggest more non-clone conversions
In other words, suggestion conversions in the non-clone direction the
same as conversions in the clone direction. As a way of disambiguation
the right direction, the non-clone direction is only suggested for
sharing that is immediately discovered from the command-line arguments
(as opposed to sharing that becomes apparent as other packages are
updated or installed via dependencies).
2014-12-07 09:08:11 -07:00
Matthew Flatt
5af2611704 pkg-directory: add #:cache argument
The cache enables multiple calls to `pkg-directory` to load
installed-package information only once.
2014-12-05 16:57:36 -07:00
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