Commit Graph

3535 Commits

Author SHA1 Message Date
Matthew Flatt
d673ad79c0 note upgrade to SQLite for native-package builds 2017-11-09 06:13:27 -07:00
Huma Zafar
4e864a5387 Adds optional keyword argument to check-duplicates to determine returned value when no duplicate found. 2017-11-08 18:47:19 -06:00
Vincent St-Amour
f214ea761a Make sample build matrix more reasonable.
After discussion with Leif, who wrote the original code.
2017-11-07 18:16:00 -06:00
Robby Findler
afde639ec5 add contract check to shuffle 2017-11-07 12:30:24 -06:00
Milo Turner
27ec348a62 curry checks that a single argument is a procedure (notified by #1839) 2017-11-04 23:49:30 -04:00
Vincent St-Amour
4258c3bfe6 Update raco pkg new for v6.11.
(cherry picked from commit 5fbf3f94b3f0fb0f7a9eae813b65534aa3a83f3d)
2017-10-30 18:00:31 -05:00
Matthew Flatt
512910c83f expander: fix 'module-begin expansion with definition contexts
Using `(local-expand <expr> 'module-begin <stops> def-ctx)` didn't
work right, because definitions added to `def-ctx` were not visible.
(While adding definitions before `module-begin` expansion is an unusual
thing to do, there's no reason that it has to fail.)
2017-10-28 10:15:39 -06:00
Jay McCarthy
033cd43b8f Better fix for git checkout problem 2017-10-28 07:23:36 -04:00
Jay McCarthy
9b1c71a381 Catch all errors so credentials are tried 2017-10-27 16:20:11 -04:00
Robby Findler
259e3a6fe1 use the right identifier
closes #1845
2017-10-26 16:48:12 -05:00
Matthew Flatt
5f1b707881 unbreak no-futures/no-places build 2017-10-26 07:12:24 -06:00
Matthew Flatt
dfa5d48092 unbreak JIT and check limits
Repairs a problem with ce9894c8bf, where a large "inlined" vector
allocation is not actually inlined, but other parts of the JIT
assume that it will behave as inlined --- which implies that the
runstack will be left unchanged after the call.

Closes #1868
2017-10-25 17:48:31 -06:00
Matthew Flatt
55c1685526 JIT: inline vector and struct CAS primitives 2017-10-25 17:36:03 -06:00
Matthew Flatt
c52bd91c54 add unsafe-struct*-cas! 2017-10-25 17:36:03 -06:00
Daniel Mendler
bc26d29bf8 add vector-cas! and unsafe-vector*-cas! 2017-10-25 17:36:03 -06:00
Matthew Flatt
d8e2192145 Revert "Revert "JIT: fix inline allocation for large vectors""
This reverts commit f7b3d3f4b4.
2017-10-25 17:34:54 -06:00
Matthew Flatt
f7b3d3f4b4 Revert "JIT: fix inline allocation for large vectors"
This reverts commit ce9894c8bf.

I don't immediately see what has gone wrong, so reverting for now.
2017-10-25 17:18:32 -06:00
Matthew Flatt
ce9894c8bf JIT: fix inline allocation for large vectors
Cloaes #1800
2017-10-25 09:55:41 -07:00
Matthew Flatt
22e8af32f3 Windows: avoid loop on reparse-point cycles
In Windows 10 Fall Creators Update, a OneDrive mount looks to Racket like
a reparse point that refers to itself. Make Racket stop trying to resolve
the path further in that case.

Relevant to #1671
2017-10-24 08:26:26 -06:00
Matthew Flatt
ae4e85a6a7 evt:struct with unsafe-poller: skip sleep if poll reports ready
Intended to fix racket/gui#80
2017-10-23 06:03:25 -07:00
Matthew Flatt
e03ec08736 history notes for 6.11 2017-10-20 14:29:46 -06:00
Jay McCarthy
06e3205787 Fix PR1859 2017-10-20 11:34:40 -04:00
Matthew Flatt
e255c737b5 rktio: fix bug in 'text mode on Windows
If a #\return lined up in just the wrong way with a file-read
request, then the #\return could get mishandled.
2017-10-19 19:55:38 -06:00
Matthew Flatt
b6b9d0d409 repair unmarshling fix
Fixes a problem with 78fdee6b6b
2017-10-19 14:52:26 -06:00
Matthew Flatt
78fdee6b6b fix unmarshaling of module-namespace information
Avoids errors that sometimes appear as "cannot redefine lifted.0".

Merge to 6.11.
2017-10-19 07:45:51 -06:00
Andrew Kent
9e16d3f9c9 add #:result clause to for/fold forms 2017-10-18 07:15:15 -04:00
Andrew Kent
3119c5b732 better stx errs for/fold and for*/fold 2017-10-18 07:15:15 -04:00
Alexis King
1e38918aa9 Improve how splicing-syntax-parameterize interacts with module* forms
Commit 00d438cfbe made an attempt at this,
but this commit does it in a much more careful way, based on manually
emulating how the macroexpander expands module* forms in order to allow
splicing-syntax-parameterize to apply even within #%module-begin forms
introduced by the expander.
2017-10-17 14:57:09 -07:00
Matthew Flatt
dd585e7ff7 fix environment -> resolved path -> module path index 2017-10-17 08:23:02 -06:00
Matthew Flatt
d64961cdba improve an error message from the expander
Mostly, fix "compiled" versus "expanded" in an error message,
but this variant of the message copied from the new expander
implementation seems better overall.
2017-10-16 10:00:15 -06:00
Matthew Flatt
2454fd6931 Fix hashing on lists containing self-references
The hashing function was bounded, but with an accidental backtrack
so it could take time exponential in the intended bound.

Closes #1842
2017-10-16 09:27:50 -06:00
Robby Findler
f24273d7ef bring down below 102 columns 2017-10-15 21:25:46 -05:00
Robby Findler
4354488453 add some more popular keys, based on TR's contract generation 2017-10-15 17:50:05 -05:00
Alexis King
00d438cfbe Make splicing-syntax-parameterize recur into module* without a mod-path 2017-10-15 15:53:59 -06:00
Matthew Flatt
402bf2173d subprocess: fix problems with adding subprocess to a group 2017-10-12 14:40:23 -06:00
Matthew Flatt
1cc55f30fe subprocess: support adding to an existing subprocess group 2017-10-12 12:37:21 -06:00
Matthew Flatt
afc5f919f1 ffi/unsafe/schedule: expose some scheduler internals
These internals are needed for `racket/gui`, which currently
accesses them via C functions.
2017-10-12 12:37:15 -06:00
Vincent St-Amour
fadf0d4a7d Post-release version for the v6.11 release 2017-10-12 13:15:45 -05:00
Justin Slepak
3935824922 Fix bug in hash-table key-value match pattern (#1532)
Match pattern allowed `(hash-table)' to match on non-empty hashes
2017-10-12 01:11:00 -04:00
Robby Findler
404539c894 only do the in-tail-position contract elimination with chaperone (or flat)
contracts

closes #1829
2017-10-06 13:30:05 -05:00
Matthew Flatt
c7c8f6da7e fix expand corner to be consistent with eval
Repairs a problem reported by Laurent Orseau, where running the
following program with errotrace enabled reports an error:

 #lang racket/base
 (require racket/class)
 (new object%)
 (define-namespace-anchor nsa)
 (define ns (namespace-anchor->namespace nsa))
 (eval '(new object%) ns)

I haven't been able to make a standalone test, yet, but I'll keep
trying.
2017-10-05 10:41:19 -06:00
Daniel Feltey
3b56866fc1 Fix object/c contract-stronger? 2017-10-02 15:12:17 -05:00
Ben Greenman
c02d91d174 contract-stronger: swap order of cases
Check that the input to the default `contract-stronger?` is
 not an impersonator before calling `equal?` on it
2017-10-02 02:11:52 -04:00
Daniel Feltey
ed5911e531 make contract-stronger? return #f for impersonator contracts that don't implement stronger 2017-09-29 15:57:56 -05:00
Robby Findler
39dea70732 fix promise/c in the case of multiple values coming out of the promise
closes #1821
2017-09-29 07:11:48 -05:00
Vincent St-Amour
23fb09a806 Fix error message for takef-right and co. 2017-09-25 14:06:49 -05:00
Matthew Flatt
d4f2f01c80 ffi/unsafe: add void/reference-sink 2017-09-24 08:27:48 -06:00
Matthew Flatt
fb312df90e openssl: remove 'sslv2 from supported-protocols list
The 'sslv2 mode shouldn't be used and it seems available but fails on
modern OpenSSL builds, so just never claim that it's available.
2017-09-23 17:12:32 -06:00
Leif Andersen
5e3a23886a Make compute-offsets public. (#1814)
Make compute-offsets public.
2017-09-22 23:15:28 -04:00
Vincent St-Amour
c68f42a1ef Update raco pkg new for v6.10.1.
(cherry picked from commit 006ec1bfc993c4b59657882c8a07aae3d896c81d)
2017-09-12 16:38:33 -05:00
Matthew Flatt
e819b58461 raco setup: fix dependency checking for extensions like ".a60" 2017-09-09 19:48:20 -06:00
Vincent St-Amour
bc3e661181 Post-release version for the v6.10.1 release 2017-09-08 13:45:54 -05:00
Matthew Flatt
425d08c8e2 optimizer: improve hashing of variables during inlining
When creating a copy of a variable in the process of inlining, make
sure the copy has its own `eq?` hash code.
2017-09-07 17:54:11 +01:00
Matthew Flatt
1f02cf226e fix eq[v]? hashing with many collisions
Normally, it's impossible to generate lots of `eq?`-hashing
collisions, but when the compiler inlines a function, it can duplicate
variables in a way that gives each copy the same `eq?` hash code. The
immutable-hash tree implementation failed when more than 32 collisions
occurred (which triggers a subtree in the collision node).

It's similarly very difficult to generate > 32 values that collide on
`eqv?` hashes but are not `eqv?` (although it must be possible using
exact rationals or complex numbers).
2017-09-07 17:42:29 +01:00
Matthew Flatt
94cee519e1 re-unbreak handling of symlinks on Windows
The repair from commit 046503de88 was lost in 98a78add9f.
2017-09-07 09:01:07 +01:00
Royall Spence
e991dd5ccb Move rackunit-lib to build-deps instead of deps
This should only needed for development purposes and not at runtime for the typical package.
2017-09-01 00:17:25 -04:00
Ryan Culpepper
e9f2c084eb db/sqlite3: use {start,end}-atomic instead of call-as-atomic
On my machine, this reduces the running time of the sqlite3
tests by about 1/4 (~3.2s to ~2.4s).

Other things I tried that didn't make as big a difference:
- coalesce A regions
- fast path for call-with-lock
2017-08-23 12:30:48 -04:00
Ryan Culpepper
2df51c4d19 db: add strict dependency on prepared-statement module
Otherwise, lazy-require can make the finalizer thread
get the wrong initial custodian.
2017-08-23 02:39:19 -04:00
Ryan Culpepper
09e90c65dc db: remove custodian registration on disconnect 2017-08-23 02:39:12 -04:00
Ryan Culpepper
532b322896 syntax/parse template: add datum-template 2017-08-23 02:01:27 -04:00
Ryan Culpepper
5fba2ee9c7 syntax/parse template: move quasitemplate support to pre-pass
Note: quasisyntax has a bug: #`(... (1 2 #,@(list 3) 4)).
Within an escape, no way to express splicing desugaring.
So add a private variant of ?@ that is interpreted even escaped.
2017-08-23 02:01:27 -04:00
Ryan Culpepper
a3511fbafb syntax/parse template: separate guide for re-syntax
Make datum->syntax explicit in guide rather than combined with
constructors like t-cons/x and t-dots (conditional).
This will make datum support easier, later.
For now, it makes it easier to do relocate correctly.

Also, make t-metafun, h-splice inlinable.
2017-08-23 02:01:27 -04:00
Ryan Culpepper
723140720e syntax/parse template: add simple ellipsis special case 2017-08-23 02:01:27 -04:00
Ryan Culpepper
50cb7fbaf7 syntax/parse template: compile = datum->syntax
Change guide reps to coincide with expressions for template compilation.
2017-08-23 02:01:27 -04:00
Ryan Culpepper
affe32e148 syntax/parse template: reorganize code, update comments 2017-08-23 02:01:27 -04:00
Ryan Culpepper
5005a26901 syntax/parse template: encourage inlining of template combinators
With inlining, the optimizer can turn templates into mostly
first-order code.
2017-08-23 02:01:27 -04:00
Ryan Culpepper
916ebf403e syntax/parse template: track syntax vs non-syntax pairs in template
Allows generation of more specialized code (hopefully smaller
and faster).

Also clean up some other guide reps.
2017-08-23 02:01:27 -04:00
Ryan Culpepper
ca38b89ae6 syntax/parse template: change run-time strategy
Instead of doing run-time interpretation of a "guide" tree,
generate code for procedure (using stx -> stx combinators).
2017-08-23 02:01:27 -04:00
Ryan Culpepper
eb65a859cd syntax/parse template: remove syntax-property handling
Since template was written, Racket has added a notion of preserved
syntax properties.
2017-08-23 02:01:27 -04:00
Matthew Flatt
ff1ec66c7f pkg catalog operations: store and propagate ring number
Although `raco pkg` doesn't use a package's ring number, it's useful
to preserve for other tools (like the pkg-build service). Adjust `raco
pkg catalog-copy` and `raco pkg catalog-info` to recognize and store a
ring number.
2017-08-22 16:55:10 -06:00
Matthew Flatt
8257a592a0 avoid unnecessary security-guard invocations in ffi-lib
Relevant to racket/sandbox-lib#1
2017-08-21 19:19:57 -06:00
Robby Findler
67ac06e6ed fix some issues surrounding the #:list-contract? argument to various contract combinator utilities
closes #1756
2017-08-21 14:39:52 -05:00
Matthew Flatt
98a78add9f rktio: move dlopen/dlsym/etc. adapter to rktio
Also, sync header-annotation improvements from the racket7 branch.
2017-08-20 15:32:47 -06:00
Matthew Flatt
93ea42d7b7 tcp-addresses: fix result for a connection peer
In the rktio conversion, the peer-address results were incorrectly
wired to the local-address function.
2017-08-18 09:27:23 -06:00
Matthew Flatt
046503de88 unbreak handling of symlinks on Windows
A mistake in the rktio conversion causes a crash if certain functions,
such as `directory-exists?`, are used before certain other functions,
such as `resolve-path`.

Thanks to Alex Harsanyi for the report.
2017-08-16 08:31:46 -06:00
Matthew Flatt
1a9dee59da deregister semaphore for a blocking file descriptor
The rktio conversion lost the deregistration of file descriptors in an
internal fd-to-semaphore table building on kqueue/epoll, causing the
wrong semaphore to be checked for a later recycling of the file
descriptor. This bug mainly affects Linux and ports created by
`subprocess`, since kqueue is not used for pipes on Mac OS and BSD
variants. The bug does not affect network sockets (which are the
primary intended clients of epoll/kqueue support), since the relevant
semaphore is deregistered when a socket is closed.

Thanks to James Bornholt for discovering the problem and providing the
repair.

Closes #1769
2017-08-10 19:54:04 -06:00
Matthew Flatt
664bec2040 repair a problem with module->namespace
Fix a problem with compile-time bindings added to a
namespace created by `module->namespace` for a module
that does not have a source file.

Possibly, there's a different fault that should be fixed that caused a
binding to use the module's instantiation-time module path index
instead of its compile-time module path index (which is what happens
when a file is involved). This repair fixes the problem in a general
way, though, and leaves further improvement to the reimplementation of
the expander in Racket (which already does not suffer from the bug).

Thanks to Alexis for providing the example.
2017-08-10 18:33:49 -06:00
Leif Andersen
f88704858a
Fix the contract for with-intercepted-logging
The contract was missing the required log-level/c. This commit
adds it.
2017-08-08 12:20:13 -04:00
Ryan Culpepper
4a71936f23 syntax/parse: improve stxclass arity mismatch error messages 2017-08-04 12:24:13 -04:00
Matthew Flatt
2092deab28 more corrections for unquoted-printing string addition
More repairs to cbfcc904ab. Thanks to Ryan for noticing
the problems.
2017-08-04 10:16:41 -06:00
Matthew Flatt
d062212ebc future: fix problem related to continuation marks
Capturing, restoring, then capturing again a future's continuation
marks did not work right.
2017-08-04 10:13:52 -06:00
Matthew Flatt
f6e863a4dd fix GC handling of unquoted-printing strings
Adds missing change to cbfcc904ab.
2017-08-04 09:18:15 -06:00
Matthew Flatt
05c5c4fa3e fix space-safety of JIT-generated apply
In a non-tail position, a JIT-generated application of `apply`
retained the argument list until the called function returned.
Fix it to drop the reference to the list before the function
is called.
2017-08-04 07:23:50 -06:00
Matthew Flatt
cbfcc904ab add unquted-printing strings
And unquoted-printing string contains a string to `display` in all
print modes. Although it could be implemented with a structure type
that has a printing function, `raise-arguments-error` further treats
unquoted-printing strings specially by not using the error value
conversion handler, so it reliably produces literal text in the error
message; that way, `raise-arguments-error` can be used to construct
more error messages.
2017-08-04 06:13:19 -06:00
Matthew Flatt
04138340eb Unix: unbreak gracketcgc build 2017-08-01 10:05:10 -06:00
Matthew Flatt
34afef1c38 fix an error message 2017-07-31 17:33:21 -06:00
Vincent St-Amour
029132e4c3 Update raco pkg new for v6.10.
(cherry picked from commit f75eced6f7c5cd452c2343c93b5ff71b96a909ae)
2017-07-31 15:54:24 -05:00
rain
8ee5d18107 support 1-byte numbers in integer->integer-bytes and integer-bytes->integer 2017-07-28 09:39:49 -06:00
Matthew Flatt
2cf38ecad7 ffi/unsafe: attempt to improve _union
The hack to implement `_union` without help from libffi failed when
the total size of the variants is too large. Try a different approach,
which involves a bet that the total size plus whether the content is
all floating-point numbers will be enough information for most cases.

Relevant to #1351
2017-07-28 09:05:24 -06:00
Matthew Flatt
45940f69a9 fix error-message typo 2017-07-25 08:12:11 -06:00
Matthew Flatt
9c48ee003a add missing lock on chaperoned/impersonated hash-table operations
For `equal?`-based hash tables, various operations are supposed to
take a lock on the table, but the lock was missing.
2017-07-24 19:25:17 -06:00
Matthew Flatt
e13d40c5ef vector-{ref,set!}: fix chaperone error for JIT-generated check 2017-07-23 08:27:14 -06:00
Matthew Flatt
e98cfeae5b chaperone-vector: adjust contract-error reporting
The convention is to check argumen contracts indpendently
first, then raise an eror there's a mismatch among pairs
of objects.
2017-07-23 08:21:33 -06:00
Matthew Flatt
c54e671a14 change sigset() and signal() to sigaction()
The sigaction() API is the more modern, more portable one.
2017-07-22 06:41:56 -06:00
Matthew Flatt
d818e8d996 rktio: fix SIGCHLD signal-handler installation on Solaris
The switch to rktio swapped the sense of "signal" and "sigset"
incompletely, and "signal" on Solaris is the one that resets
the signal handler to SIG_DFL.
2017-07-21 07:40:35 -06:00
Matthew Flatt
1d74c214a1 racket/HISTORY.txt: update for v6.10
Merge to v6.10
2017-07-19 08:00:32 -06:00
Matthew Flatt
808bd1b897 raco setup: adjust --clean mode
Make `raco setup` propagate the original value of
`use-compiled-file-paths` in case it's reset to avoid loading bytecode
files. Then, `--clean` mode can remove bytecode relevant to that
setting, instead of always clearing "compiled" subdirectories.

There's no external way to initialize `use-compiled-file-paths` right
now, other than forcing it to `null` with the `-c` flag at the
`racket` level, but the current "racket7" implementation uses
different `use-compiled-file-paths` settings for different build
modes, and it seems to make sense in general.

Also, make `--clean` sensitive to `-D` and `-d`, so that it's easy to
clean just bytecode.
2017-07-17 14:45:43 -06:00
Robby Findler
5ecbc54fff fix recursive-contract's name patch up code 2017-07-16 16:52:14 -05:00
Matthew Flatt
ac43a93a13 fix arg order in errors for JIT-inlined {string,bytes}=?
Closes #1741
2017-07-14 09:16:39 -06:00
Matthew Flatt
d081586959 fix immutability of some syntax-e results
Internally, when scopes are propagated to nested syntax objects,
vectors and boxes were not reconstructed as immutable.

Closes #1745
2017-07-14 07:37:55 -06:00
Matthew Flatt
2e77279be0 syntax: fix guard for multiple pattern variables under ...
Fix the part of `syntax`/`datum` that determines whether an exception
handler is needed to convert an error from `map` to one from
`syntax`/`datum`.
2017-07-14 06:58:58 -06:00
Matthew Flatt
a22a3852c6 remove unused code in "foreign.c" 2017-07-14 06:58:58 -06:00
Vincent St-Amour
73e08a2aa9 Post-release version for the v6.10 release 2017-07-07 14:19:46 -05:00
Matthew Flatt
f0fe0a4635 remove copy of startup code in racket/private/collect
The copy was made in c1c427a281 to help get "racket7" started, but
it's no longer needed. Using the copy had an unintended consequence of
duplicating the collection-search cache for phases other than phase 0,
so this change repairs that consequence.
2017-07-05 07:36:03 -06:00
Matthew Flatt
6d58b11af9 add racket/private/check
The `racket/private/check` module is dead code in this repo, but
having it simplifies the "racket7" bootstrap when "racket7" goes so
wrong that it can't rebuild itself.
2017-07-05 07:36:03 -06:00
Matthew Flatt
c082d77c97 raco exe: fix stripping of signature from Mach-O executables
To strip a signature, the old implementation effectively guessed
at the padding that was added to the original linkedit segment
to acommodate 16-byte alignment of the signature. The repaired
stripping works out the actual end of the linkedit segment based
on the various load commands that refer to it.
2017-07-03 09:33:17 -06:00
Matthew Flatt
340b878981 udp-send-to: fix deallocation bug related to rktio refactoring
The bug caused an attempt to free NULL as an addrinfo, which is
apparently ok on many OSes, but not all.
2017-07-02 14:27:59 -06:00
Matthew Flatt
af7a520102 rktio: header and extraction improvements for FFI 2017-06-29 14:36:43 -06:00
Matthew Flatt
63146e5451 ffi/unsafe/custodian: handle already-shutdown custodians 2017-06-29 14:36:42 -06:00
Daniel Feltey
e289750b03 Fix box/c typo/bug
Previously non-flat box/c contracts would always use the `write` contract to
check the contents of the box rather than the `read` contract.
2017-06-28 14:48:35 -05:00
Ben Greenman
04c1c15d89 bug: add guard against string-paths in 'find-relative-path'
Add guard, if first argument to `find-relative-path` is not a path,
 then don't call `path-convention-type` on it.

Thanks to Jack Firth for reporting:
https://github.com/racket/rackunit/pull/46
2017-06-28 10:19:50 -04:00
Matthew Flatt
76711dfb50 net/git-checkout: adjust ADLER32 check to work with streaming
Don't for an inflated stream to be held completely in memory.
2017-06-26 13:49:18 -06:00
Lehi Toskin
d7db2aff59 net/git-chckout: check ADLER32 after inflate
Check ADLER32 after inflate, instead of assuming that the inflated bytes
are correct.
2017-06-26 13:48:10 -06:00
Matthew Flatt
06a6d290fd rktio: fix bug merging fd sets when poll() is not available 2017-06-25 11:08:53 -06:00
Matthew Flatt
3e8ad02334 rktio: add some missing #includes in some configurations 2017-06-25 08:39:05 -06:00
Matthew Flatt
7a8145875c rktio: configure adjustment intended to fix OpenIndiana build 2017-06-24 17:07:33 -06:00
Ryan Culpepper
44eb5532ad syntax/parse: add ~or* and ~alt, like ~or{S,H} and ~or{EH}, respectively 2017-06-24 17:07:55 -04:00
Alexander McLin
113049607a Changed the code to pass through the prep-status to the outer HANDLE so
error reporting is uniformly handled and any SQL_BUSY errors are properly identified.
2017-06-24 17:06:42 -04:00
Alexander McLin
ed481865cf Based on PR #1704 feedback, rename copy-buffer to trim-and-copy-buffer and
adjust `string-trim` to only perform right-wise trimming of the buffer.
2017-06-24 17:06:42 -04:00
Alexander McLin
dfd585db33 Any well-formed single statement query which is terminated by a semi-colon and has extra space after the semi-colon raises 'multiple statements given' error.
The cause is any extra space after a terminating semi-colon in a SQL string passed to sqlite3_prepare_v2 procedure in the prepare1* method of `db` Sqlite3 connection% implementation will result in non-false tail and zero prep-status values being returned. The checking code sees the non-false tail value and raises the "multiple statements given" exception.

The easy fix is to trim any trailing whitespace by calling string-trim on the buffer string before its converted to a byte string in the copy-buffer procedure used by sqlite3_prepare_v2 to initialize the sql-buffer.

See Issue #1702
2017-06-24 17:06:42 -04:00
Alexander McLin
31d7dd0317 Certain malformed queries such as "SELECT ,* FROM SomeTable" (which has an incorrect extra comma) raise "multiple statements given" error while Sqlite3 actually generates a syntax error that doesn't get returned as a raised exception.
The same problem is encountered when executing a DDL statement such as "Create Table" more than once after the table had already been created by the first execution.

The cause is when sqlite3_prepare_v2 encounters a bad statement, it aborts the preparation, sets prep-status flag to non-zero and also sets tail? to be non-false.

The previous code ignored the prep-status flag and only checked tail? and raises "multiple statements given" exception when tail? is non-false.

The new code takes prep-status into account and extracts the actual Sqlite3 error message by evaluating get-error-message and raising it as an exception.

See Issue #1702
2017-06-24 17:06:42 -04:00
Matthew Flatt
5dbeb39a01 rktio: fix configure detection of iconv 2017-06-24 07:37:40 -06:00
Matthew Flatt
c5022c5d4f rktio: fix small header problems 2017-06-24 07:35:07 -06:00
Matthew Flatt
990a1d7154 rktio: further improve header declarations
Also, add variants of `rktio_read` and `rktio_write` that can be more
convenient to use through an FFI.
2017-06-23 19:50:19 -06:00
Matthew Flatt
316df0af7a rktio: add standalone build mode
Also, add a script to extract the "rktio.h" header information to an
S-expression form suitable for FFI use, and refine the "rktio.h"
information to improve that output.
2017-06-23 13:08:02 -06:00
Matthew Flatt
3c07250db4 fix printer for (unquote @d)
Avoid printing `(unquote @d)` or `(unsyntax @d)` as `,@d` or `#,@d`,
which would mean `(unquote-splicing @d)` or `(unsyntax-splicing @d)`
to the reader, by adding an extra space before the `@`.
2017-06-22 15:00:00 -06:00
Matthew Flatt
8473c1d4a8 raco pkg install: error message improvement
When a package to be installed has a module that conflicts with an
existing installed module, but the existing module isn't in a package,
then say so explicitly in the error message. Also report the current
collection and links paths.

Error reporting could do even more work to figure out which path is
relevant, but reporting a list of paths is relatively easy. Listing
paths also seems likely to give a user enough hints for this rare
case, especially if the user just needs to be reminded that collection
links exist.
2017-06-22 12:40:09 -06:00
Daniel Feltey
87e4bdbec8 Fix segfault on accessing non-present impersonator properties of property-only vector chaperones
Additionally this adds macros that distinguish between the chaperone redirects of prop-only vector
chaperones, function chaperones, and structure chaperones since each of these may store a vector
in the redirects field.
2017-06-22 12:46:58 -05:00
Matthew Flatt
f8c7feaf88 fix problem with prefabs, auto fields, and construction via a key
Auto fields were incorrectly recorded as immutable in a structure type
that is first generated from the prefab struct key instead of
`make-struct-type`.

Thanks to Deren Dohoda for the report.
2017-06-22 10:46:49 -06:00
Matthew Flatt
a7d161cfac raco pkg update: fix --update-deps and cross-scope deps
When `--update-deps` (which is implied by `--all`) was used on
user-scope packages that depend on installation-scope packages, the
installation-scope dependencies were treated as missing, which forced
an update of the user-scope packages. Check both scopes for
dependencies.

Closes #1730
2017-06-22 07:33:08 -06:00
Matthew Flatt
cfa1d7c54c add more information to copy-file error message
The `file/cache` relies on matching the text of a message, and the
text had changed to have less information on Unix, including whether
the problem was with the source or destination file. Add a notion of
error step to rktio and use it to improve the `copy-file` message.
2017-06-21 16:51:02 -06:00
Matthew Flatt
7152cc1ba6 rktio: add <sys/types.h> to reliably get u_char 2017-06-21 16:22:46 -06:00
Matthew Flatt
58dea081c6 fix memory-management bugs in rktio on Windows 2017-06-21 16:19:14 -06:00
Matthew Flatt
a15b16cfd9 repair expand-user-path 2017-06-21 16:19:14 -06:00
Matthew Flatt
6a543f4783 rktio: add iconv 2017-06-21 16:19:14 -06:00
Matthew Flatt
db7c242983 rktio: add syslog 2017-06-21 15:01:45 -06:00
Matthew Flatt
4de2ff4cbd fix make-file-or-directory-link 2017-06-21 05:23:53 -06:00
Matthew Flatt
69a208eb21 rktio: add Windows path conversion functions 2017-06-21 05:23:53 -06:00
Matthew Flatt
898b9ffe10 rktio: add ShellExecute 2017-06-21 05:23:53 -06:00
Matthew Flatt
d70cb9aec0 use "errno" in error messages only for Posix errors
Use "win_err" for Windows errors, and so on. Otherwise, the error
number can be misleading, especially if it's a rktio-level error.
2017-06-21 05:23:53 -06:00
Matthew Flatt
c3da23209b rktio: replace Windows invalid-decoding hack
Report a proper error when path decoding fails, instead of
synthesizing a path hat shouldn't exist. The rktio conversion
made it much easier to report the error at the Racket level
like other filesystem errors.
2017-06-21 05:23:53 -06:00
Matthew Flatt
83cb1a0d00 repair and tests for Windows path handling
In the process of extracting minimal Windows path encoding for rktio,
I noticed a decoding issue with a path that ends with an unpaired
high-surrogate value. Add a suitable tests and fix the old decoder
(although it will probably go away).
2017-06-21 05:23:53 -06:00
Matthew Flatt
d4742a0618 fix bytes-convert-end
The `bytes-convert-end` function didn't set up a proper decoding.
Make sure that it at least does nothing for encodings where
there's nothing to do.
2017-06-21 05:23:53 -06:00
Matthew Flatt
d90976f865 rktio: repair to listen failure handling 2017-06-20 12:33:09 -06:00
Matthew Flatt
a7ab538403 fix timer handling in subprocess
This bug was introduced with the rktio conversion.
2017-06-20 11:57:43 -06:00
Matthew Flatt
a5b28c453a rktio: fix init of accepted socket 2017-06-20 09:06:06 -06:00
Matthew Flatt
20f1f146c7 raco exe: fix incorrect shortcut in submodule checking
Closes #1712
2017-06-20 08:28:54 -06:00
Matthew Flatt
51bf69e356 switch for/list back to a loop plus reverse
Closes #1721, which points out that the `for/list` expansion
introduced in commit 5e94a906cd interacts badly with a body
that captures a continuation plus Racket's current implemenation
of continuations.

When Racket one day gets a better implementation of continuations,
this change could be considered again, but the general question is
whether programs can detect or be affected by the size of the
continuation (when the programs don't directly control the
continuation creation --- otherwise continuation marks obviously
expose the size).
2017-06-20 08:28:53 -06:00
Matthew Flatt
23d2a4c58f restore scheme_fd exports
Provide a compatibility layer to bridge the old (not completely
documented) `scheme_fd` interface and rktio. The old interface is
used by the Gtk implementation of `racket/gui`, for example.
2017-06-19 18:30:21 -06:00
Matthew Flatt
9279b96d9e fix connection-failure error message 2017-06-19 11:06:26 -06:00
Matthew Flatt
9bf68adbb0 fix configure wrt places/futures vs. pthreads enabled state 2017-06-19 10:55:44 -06:00
Matthew Flatt
68f55f5b85 rktio: fix success check for connect 2017-06-19 09:47:10 -06:00
Matthew Flatt
54f16758a5 bump version number to reflect rktio refactoring 2017-06-19 06:45:54 -06:00
Matthew Flatt
19ee6d2a0c librktio: fix 32-bit Windows projects 2017-06-19 06:45:19 -06:00
Matthew Flatt
2e4518d08e rktio: makefile repair for --enable-racket= builds 2017-06-19 06:45:19 -06:00
Matthew Flatt
f741208b77 rktio: another Windows pipe repair 2017-06-19 06:45:19 -06:00
Matthew Flatt
cdf22f7cdd rktio: fix incorrect uses of errno
Using `errno` is not right for Winsock.
2017-06-19 06:45:19 -06:00
Matthew Flatt
8449470db4 rktio: restore early SIGCHLD blocking to support Linux
Process handling relies on SIGCHLD being blocked, but signals are
blocked per-thread in Linux, so SIGCHLD needs to be blocked before new
threads are created.
2017-06-19 06:45:19 -06:00
Matthew Flatt
8d857245a4 rktio: fix normalization of envvar names on Windows 2017-06-19 06:45:19 -06:00
Matthew Flatt
4250d51f08 rktio: more text-mode repairs 2017-06-19 06:45:18 -06:00
Matthew Flatt
b96fc45133 rktio: make append mode imply can-exist on Windows 2017-06-19 06:45:18 -06:00
Matthew Flatt
a13bfd25d0 rktio: reset non-blocking on sockets after dup
On Linux, is appears that duping a socket doesn't give the
new one the same non-blocking option as the original.
2017-06-19 06:45:18 -06:00
Matthew Flatt
c1416d07d6 rktio: fix Unix file copy to copy permissions 2017-06-19 06:45:18 -06:00
Matthew Flatt
c0275b37d5 rktio: fix text mode (for Windows) 2017-06-19 06:45:18 -06:00
Matthew Flatt
20e23902ba rktio: simplify Windoes 98 pipe writer
This code is unlikely to get used, but make sure it runs just
in case Racket otherwise works on Windows 95/98.
2017-06-19 06:45:18 -06:00
Matthew Flatt
dacdf64f59 rktio: fix eventmask handling (for Windows) 2017-06-19 06:45:18 -06:00
Matthew Flatt
36ca1361d9 rktio: normalize 'replace and 'truncate/replace behavior
For `open-output-file`:

Move 'replace mode handling out of rktio and into the client.
Formerly, on Windows, 'replace mode was just 'truncate with a fallback
for permission problems, so this change makes it delete an existing
file and replace it, which is more consistent with how 'replace has
always worked on Unix.

In 'truncate/replace mode, if a truncating open fails due to a
permission error and the file exists, then try again as a 'replace.
That's how it worked on Windows before, and now it's how Unix works.
2017-06-19 06:45:18 -06:00
Matthew Flatt
5d68ec297a rktio: repair for Windows fs-change
Also, add stress mode to rktio demo.
2017-06-19 06:45:18 -06:00
Matthew Flatt
ffc749f29e rktio: repairs for Windows 2017-06-19 06:45:18 -06:00
Matthew Flatt
6123b31064 rktio: fix non-Windows date timezone 2017-06-19 06:45:18 -06:00
Matthew Flatt
193e6cb518 librktio: more Windoes fixes
Now passes rktio tests and builds Racket 3m, but crashes with places.
2017-06-19 06:45:18 -06:00
Matthew Flatt
1e0a55cc8f rktio: repairs for Windows
Might break other systems...
2017-06-19 06:45:18 -06:00
Matthew Flatt
773050805b rktio: switch demo to use rktio_pipe 2017-06-19 06:45:18 -06:00
Matthew Flatt
e445051790 rktio: update some source notes 2017-06-19 06:45:18 -06:00
Matthew Flatt
38a5e7aacd rktio: repairs for SOME_FDS_ARE_NOT_SELECTABLE
... as set for Solaris, but no idea whether it's
still needed there.
2017-06-19 06:45:18 -06:00
Matthew Flatt
7fe2c1cadf rktio: repair for --enable-shared 2017-06-19 06:45:18 -06:00
Matthew Flatt
a3725374ca rktio: repair for UDP disconnect 2017-06-19 06:45:18 -06:00
Matthew Flatt
58f463ee1d rktio: repairs for non-places, non-futures build 2017-06-19 06:45:18 -06:00
Matthew Flatt
46908c377c rktio: fix MinGW compilation 2017-06-19 06:45:18 -06:00
Matthew Flatt
c02eacd5d2 rktio: repairs to kqueue-based fs-change events 2017-06-19 06:45:18 -06:00
Matthew Flatt
a1cf37eb0f rktio: repairs 2017-06-19 06:45:18 -06:00
Matthew Flatt
d34fcc31db rktio: repairs for various configurations 2017-06-19 06:45:18 -06:00
Matthew Flatt
35d47f89f6 rktio: repairs for Linux 2017-06-19 06:45:18 -06:00
Matthew Flatt
8a426eb086 rktio: configure fixes 2017-06-19 06:45:18 -06:00
Matthew Flatt
dff32444ea rktio: remove migrated configure elements 2017-06-19 06:45:18 -06:00
Matthew Flatt
d72a04285d rktio: remove obsolete preprocessor definitions
Many have moved to rktio, and others became irrelevant
over the decades.
2017-06-19 06:45:17 -06:00
Matthew Flatt
c4b3b19c1e rktio: repairs
All tests now pass for MacOS.
2017-06-19 06:45:17 -06:00
Matthew Flatt
463862d793 rktio: repairs
More tests pass.
2017-06-19 06:45:17 -06:00
Matthew Flatt
99c3643033 rktio: repairs
Builds and starts on MacOS.
2017-06-19 06:45:17 -06:00
Matthew Flatt
f0a644990c rktio: repairs
Compiles ons MacOS, but doesn't quite link.
2017-06-19 06:45:17 -06:00
Matthew Flatt
93834adc99 rktio: move udp over to rktio
Still doesn't work...
2017-06-19 06:45:17 -06:00
Matthew Flatt
2b439fc554 rktio: most of switch to rktio fd
Doesn't work, yet...
2017-06-19 06:45:17 -06:00
Matthew Flatt
63505d3e16 rktio: switch to rktio envvars 2017-06-19 06:45:17 -06:00
Matthew Flatt
49e30ea6fb rktio: better file size and timestamp types 2017-06-19 06:45:17 -06:00
Matthew Flatt
d9d8c7758d rktio: fix MzCOM projects 2017-06-19 06:45:17 -06:00
Matthew Flatt
2d21523b2d rktio: fixes for Windows build 2017-06-19 06:45:17 -06:00
Matthew Flatt
75e835351a rktio: add MSVC projects 2017-06-19 06:45:17 -06:00
Matthew Flatt
6e06329c61 rktio: fix scheme_os_getcwd() wrapper 2017-06-19 06:45:17 -06:00
Matthew Flatt
0402075f2b rktio: repairs to file & directory operations 2017-06-19 06:45:17 -06:00
Matthew Flatt
6268cd7ce9 rktio: switch file & directory operations to rktio 2017-06-19 06:45:17 -06:00
Matthew Flatt
425fe36fa5 rktio: initial import of librktio to racket 2017-06-19 06:45:16 -06:00
Matthew Flatt
636b1637b4 rktio: add date & time 2017-06-19 06:45:16 -06:00
Matthew Flatt
c006e951f4 rktio: add file locking 2017-06-19 06:45:16 -06:00
Matthew Flatt
03c3655b1f rktio: more repairs exposed by warnings 2017-06-19 06:45:16 -06:00
Matthew Flatt
2f5797f1d5 rktio: use -Wall and fix warnings 2017-06-19 06:45:16 -06:00
Matthew Flatt
a929c58712 rktio: compiles for Windows using MinGW 2017-06-19 06:45:16 -06:00
Matthew Flatt
9bfaaf3ab3 rktio: wide-string handling for Windows 2017-06-19 06:45:16 -06:00
Matthew Flatt
4ffb01c6fa rktio: more configure for rktio 2017-06-19 06:45:16 -06:00
Matthew Flatt
2187e77e65 rktio: add filesystem-change events 2017-06-19 06:45:16 -06:00
Matthew Flatt
19776f6bb9 rktio: fix some leaks 2017-06-19 06:45:16 -06:00
Matthew Flatt
b5e88e70c2 rktio: environment variables 2017-06-19 06:45:16 -06:00
Matthew Flatt
a767ea38fc rktio: improve organization 2017-06-19 06:45:16 -06:00
Matthew Flatt
c5ddf79721 rktio: small repairs 2017-06-19 06:45:16 -06:00
Matthew Flatt
9e68886b26 rktio: processes 2017-06-19 06:45:16 -06:00
Matthew Flatt
6c2f71bf80 rktio: UDP 2017-06-19 06:45:16 -06:00
Matthew Flatt
e9d5260295 rktio: dup and socket addresses 2017-06-19 06:45:16 -06:00
Matthew Flatt
9461c0e72a rktio: repairs for dynamic fd_set support 2017-06-19 06:45:16 -06:00
Matthew Flatt
72b0351331 rktio: repairs for Linux 2017-06-19 06:45:16 -06:00
Matthew Flatt
6e1d519711 rktio: fix network problems 2017-06-19 06:45:16 -06:00
Matthew Flatt
3065773b31 rktio: add networking 2017-06-19 06:45:16 -06:00
Matthew Flatt
adedf861b2 rktio: finish epoll/kqueue layer 2017-06-19 06:45:16 -06:00
Matthew Flatt
04130638fc rktio: add kqueue/epoll layer 2017-06-19 06:45:16 -06:00
Matthew Flatt
09703b94f7 rktio: put "globals" in an rktio_t
Avoid thread-local state by threading a `rktio_t`
record through everything.
2017-06-19 06:45:16 -06:00
Matthew Flatt
68352ef86a rktio: more progress 2017-06-19 06:45:16 -06:00
Matthew Flatt
64146e94dc rktio: first cut at moving Racket OS wrappers to a library
The world doesn't need yet another cross-platform I/O library, but
it's getting one. This one has exactly the things that Racket needs,
and pulling it out will make it reusable from other VMs while
improving the Racket code organization.

This first step just gets started.
2017-06-19 06:45:16 -06:00
Matthew Flatt
dc14a68162 fix performance problem in expander
For a term

 (lambda (arg-id ...) (define def-id _rhs) ... (arg-id def-id) ...)

the expander could take quadratic time in the number of `def-id`s
due to walking an environment to remove use-site scopes. (The
variant of the expander rewritten in Racket didn't have this
problem.)
2017-06-08 07:01:31 -06:00
Matthew Flatt
ff26c2f29b fix complexity of type merging in bytecode optimizer
Merge a smaller table into a larger one to avoid an overall
quadratic-time computation.
2017-06-08 07:01:30 -06:00
Leif Andersen
5c27f5550c Add mzrt_sema_trywait to the mzrt library.
This commit add mzrt_sema_try_wait to the functions that operate
on semaphores. The existing ones are:

* int mzrt_sema_create(mzrt_sema **sema, int init);
* int mzrt_sema_post(mzrt_sema *sema);
* int mzrt_sema_wait(mzrt_sema *sema);
* int mzrt_sema_destroy(mzrt_sema *sema);
2017-06-05 10:46:24 -04:00
Leif Andersen
5510a76dca
scheme_add_atexit_closer now uses scheme_atexit.
This is because calling atexit is not correct in all
situations, namely on old operating systems.
2017-06-04 08:56:07 -04:00
Leif Andersen
a8fa5d4ebb
Add scheme_atexit c function.
This way programs can actually call atexit. (Otherwise atexit
is frequently not provided in libc as a symbol.)
2017-06-03 20:47:34 -04:00
Leif Andersen
2f6c42f3c1 Add a #:make-c-id flag to define-ffi-definer
This make-c-id allows an author to specify a convention for how
to connect and identifier defined with define-ffi-definer and
the actual symbol in the file.

* Adds docs.
* Adds tests.
* Adds history.
2017-06-02 10:26:57 -04:00
Matthew Flatt
f459dd9eb7 make collapse-module-path-index work on a "self" modidx 2017-06-01 19:37:18 -06:00
Matthew Butterick
4c5f66ff4a fix typo
`that do` → `that does`
2017-05-30 11:05:40 -04:00
Matthew Flatt
06b69c625f repair chainges to ffi/file
Bring back the exported `_file/guard`, `_file/r`, and `_file/rw`;
restore/move tests in "file.rktl" test suite; and add docs for new
functions.
2017-05-27 07:29:47 -06:00
Matthew Flatt
87c0ca84a8 add ffi/unsafe/global and switch openssl to use it
Continues the move away from using the FFI to access unsafe Racket
functionality.
2017-05-26 17:49:16 -06:00
Matthew Flatt
bf83d1126d add some unsafe operations as an alternative to FFI access
Accessing unsafe functionality through the FFI seemed like a good way
to avoid writing C code, but it made things more complicated instead
of easier, and it interacts badly with a more agressive shift away
from C (such as porting to Chez Scheme). So, add functions to the
primitive `#%unsafe` module, instead.
2017-05-26 16:26:06 -06:00
Matthew Flatt
7f1ab90806 raco exe on Mac OS: ensure that "PkgInfo" is writable
Relevant to #1680
2017-05-25 13:01:12 -06:00
Matthew Flatt
f27be30c15 fix error message 2017-05-25 13:01:08 -06:00
Jay McCarthy
07f35d248c Abort if munmap or protect_pages fails
On Linux, munmap can fail when you run out of mappable regions.

If protect_pages fails, then you can't install a write barrier
2017-05-25 13:38:33 -04:00
Milo Turner
cc25a27f87 fix id-set-symmetric-difference, same as 4716a6e fixed for sets 2017-05-24 15:55:03 -04:00
Stephen Chang
7620bfcb7c fix and actually run id-set tests 2017-05-24 13:25:15 -04:00
Stephen Chang
42152ed31c add neg-party arg to id-set-contract-check 2017-05-24 10:01:43 -04:00
Robby Findler
6a145244d6 add missing adjust-location call 2017-05-23 09:05:30 -05:00
Ben Greenman
b36c35ac7e typo: 'an mutable' => 'a mutable' 2017-05-21 02:00:00 -04:00
Ryan Culpepper
c082f130cb support string, bytes (bindings from racket) as stxclass refs
add compile-time table as alternative to stxclass binding
2017-05-18 12:54:26 -04:00
Daniel Feltey
1bdaf0b231 Fix typo for chaperone-vector* error messages 2017-05-17 12:50:05 -05:00
Daniel Feltey
8bc9cef7a9 Fix typo in vector contract implementation leading to wrong error message 2017-05-15 17:33:24 -05:00
Robby Findler
f2a29515d1 adjust invariant-assertion error message to avoid blame
closes #1681
2017-05-13 11:12:25 -05:00
Matthew Flatt
f43234e1cb add prop:authentic and (struct .... #:authentic ....)
An authentic structure type is one whose instances cannot be
impersonated or chaperoned. The intended use of `prop:authentic` is to
annotate a library-private data structure where impersonators are
never needed internally for the data structure, and the declaration
lets the compiler produce less code and fewer branches by omitting
impersonator support.
2017-05-12 12:40:57 -06:00
Robby Findler
65beb4de4c fix cons/dc's predicate 2017-05-12 11:26:49 -05:00
Robby Findler
8f34b702ab improve flat-contract test suite so that it checks
the predicate-ness of the contracts
2017-05-12 11:26:49 -05:00
Matthew Flatt
e6793c4598 fix variable-reference->module-path-index on primitive refs 2017-05-09 20:28:25 -06:00
Matthew Flatt
26c4dd6909 add #%unsafe exports to implement ffi/unsafe/atomic
Export functions through the usual `#%unsafe` primitive module,
instead of using the FFI to get at unsafe operations.
2017-05-09 09:32:34 -06:00
Matthew Flatt
e68e4bd6f6 minor configure --help format repairs 2017-05-09 09:32:34 -06:00
Robby Findler
79cef0a96e clean up a bunch of contract names 2017-05-06 22:10:41 -05:00
Matthew Flatt
de0d84f7b3 racket/serialize: repairs for structs that have auto fields
Closes #1650
2017-04-29 13:20:25 -07:00
Vincent St-Amour
13443dec92 Add chaperone-vector*, unsafe-chaperone-vector, and property-only vector chaperones.
By analogy with the procedure chaperone equivalents.
2017-04-28 14:27:53 -05:00
Vincent St-Amour
541015ba3b Update raco pkg new for v6.9.
(cherry picked from commit 351dcfe14d0f3aa7f7b5b1491d882c887a971c24)
2017-04-27 11:50:13 -05:00
Matthew Flatt
d469265a6e Makefile: support both cross-platform and non-cross installers
In non-cross mode, `-C` needs to go after `-G` and `-X` when setting
up a "bundle" directory to turn into an installer, because that mode
needs to use foreign libraries (such as SQLite) at build time, and it
can use the instances that are being set up for the installer.

Meanwhile, improve the advice for setting `PLAIN_RACKET` to use `-C`
for a cross-platform build mode, even though things tend to work
anyway without it.
2017-04-26 15:59:04 -06:00
Matthew Flatt
6de3659664 repair for hash-keys-subset?
When comparing a part of a hamt that is a collision node versus a
subtree node, a "hash code" was extracted from the collision node ---
but that's really a code for an integer key is that used for the
collision element. The comparison should instead use a code extracted
from the reference to the collision node (which is the code that is
common to all colliding keys).
2017-04-26 15:27:39 -06:00
Matthew Flatt
f8aeed279b Windows: fix 64-bit mzdyn.exp
Also, make the `raco exe` tests more accommodating to uncooperative
Windows configurations.
2017-04-25 16:31:51 -07:00
Matthew Flatt
c917434a86 improve cross-platform support
Detangle the target and host DLL and library directories by
making `get-lib-search-dirs` and `get-dll-dir` report the
host system's directories, and add `get-cross-lib-search-dirs`
and `get-cross-dll-dir`.

A new `-C`/`--cross` flag causes `racket` to save a host config and
collection directory and make them available via `(find-system-path
'host-{config,collects}-dir)`, while plus `(system-type 'cross)`
reports whether `-C` mode is in effect. Besides making the host paths
available, this change allows a same-platform build to run in
corss-platform mode.

The immediate problem to solve was the creation of Windows installers
on Windows, where recent changes to support 'gui-bin-dir configuration
need a clear distinction between the host Racket and the target Racket
being built, even if they're the same platform. (The "GRacket.exe"
executable didn't work, for example.)

The changes in this commit are more than needed for the immediate
problem, but they naturally build on the necessary `-C` flag, and they
support cross-platform package setup where native libraries are needed
during setup.
2017-04-25 08:31:26 -06:00
Matthew Flatt
83bf0e49ff add more auto-detected Visual Studio versions 2017-04-24 13:05:17 -06:00
Matthew Flatt
a71d87c5a9 optimizer: remove incorrect assertion 2017-04-21 14:28:57 -06:00
Matthew Flatt
9cb8c8fdd9 avoid O(n^2) GC time with ephemeron chains
Avoid the well-known possibility of quadratic handling of ephemeron
chains, where all ephemerons are immediately known, no keys are
immediately known, and each link in the chain has a value that refers
to the next link's key.

To aviod quadratic behior, attach a list of ephemerons to each page of
allocated objecst, where marking any object on the page triggers a
rescan of the ephemerons without waiting to rescan all ephemerons.
2017-04-20 20:48:55 -06:00
Matthew Flatt
3bc3fe9e26 fix dynamic-wind matching for continuation jumps
Thanks to Gustavo and Robby for tracking down the relevant feature
of a complex example that was found by random testing.
2017-04-19 07:00:34 -06:00
Matthew Flatt
fae55e83e2 history note for v6.9 2017-04-17 13:12:07 -06:00
Matthew Flatt
803d8ff0d5 fix launcher creation for gracket[-text] on Mac OS
The repair in 71a43f34c8 fixed the creation of some launchers, but it
broke GUI launchers with a relative reference on Mac OS.
2017-04-16 15:51:28 -06:00
Ryan Culpepper
995f320918 fix in-query result checks with grouping
closes racket/db#8

merge to release branch
2017-04-15 12:19:31 -04:00
Leif Andersen
922b5f06e9 Make log also accept a base. (#1667)
Make `log` in `racket/base` optionally accept a second argument.

The second argument is the log `base`. The docs also recommend
`fllogb` when precision is important.

* Error message when base is 1
* Added docs.
* Add tests.
2017-04-15 10:40:41 -04:00
Robby Findler
6492226411 add a #:name argument to flat-contract-with-explanation 2017-04-13 10:19:20 -05:00
Ben Greenman
1e29362dad typo: error message in parse-command-line 2017-04-12 14:51:32 -04:00
Matthew Flatt
662fd84eda raco: fix command name selection by prefix
Repairs a problem with 409321c03b.

Merge to v6.9
2017-04-10 08:22:49 -06:00
Matthew Flatt
016b8009c5 repair "info-cache.rktd" assumption of relative paths
Fix for 459a74455c to handle the case that a path
to record is not relative. The `raco pkg` tests
exposed the problem.
2017-04-09 10:53:05 -06:00
Matthew Flatt
459a74455c avoid platform-specific path conventions in "info-cache.rktd"
Store relative paths in "info-cache.rktd" (which corresponds,
roughly, to packages) in a platform-independent form, instead
of using the current platform's convention.

Using the current platform's covention works badly when
cross-compiling for Windows on Unix, since relative paths are used as
keys in the "info-cache.rktd" table. For example, updating a
pre-installed package on Windows mangles the mapping if the installer
is created from a cross-compiled installation.
2017-04-09 08:16:56 -06:00
Ben Greenman
3bb131ecb2 add #:generate keyword to build-flat-contract-property
the public function was missing the `#:generate` keyword,
 added this and documented why `#:exercise` is missing
2017-04-08 21:37:39 -04:00
Sam Tobin-Hochstadt
9d26d675a7 Provide srcloc when constructing define in define/contract. (#1660) 2017-04-08 14:38:59 -04:00
Vincent St-Amour
73d28d88d2 Post-release version for the v6.9 release 2017-04-07 13:30:52 -05:00
Matthew Flatt
5fb86dc55e fix ad-hoc hash-ref optimizaiton
Optimization to convert `(hash-ref <ht> <key> (lambda () <constant>))`
to `(hash-ref <ht> <key> <constant>)` didn't check that the `lambda`
for had zero argument.

Closes #1648
2017-03-30 18:45:26 -04:00
Matthew Flatt
92a0dcbcb0 fix problems with chaperoning/impersonating keyword functions 2017-03-29 12:26:48 -06:00
Ben Greenman
30aa951db8 gzip: use path-add-extension as default
instead of `string-append`-ing the extension,
 because that doesn't work for all path strings
2017-03-26 20:58:59 -04:00
Ben Greenman
2cbd44d64d add optional 'sep' argument to path-add-extension
New optional argument to 'path-add-extension',
 a byte string to replace for the '.' in the argument path.
2017-03-26 20:58:53 -04:00
Matthew Flatt
e22a5da06c find-relative-path: case-normalize for comparison by default
This change affects programs only on Windows. For example, `C:\a\b`
relative to `c:\A\c` is `..\b`, instead of not relative.

Closes #1603
2017-03-24 20:00:03 -06:00
Matthew Flatt
41e3deab97 racket/cmdline: fix table filtering when #:ps is used 2017-03-24 17:28:22 -06:00
Alex Knauth
7163c6ad98 generics: optional scope argument for private macros (#1644)
* generics: optional scope arg for private macros

To make them more friendly to macros that expand to generics

* add tests for generic-method-table macro
2017-03-24 15:52:44 -07:00
Gustavo Massaccesi
409321c03b raco: show all the matching commands for an ambiguous prefix 2017-03-24 13:16:36 -06:00
Matthew Flatt
424906af0a ffi/com: fix unsigned-int test
Closes #1633
2017-03-22 12:26:02 -06:00
Marc Burns
1309cf1649 Add procedures like port->X but close the port (#1634) 2017-03-16 15:52:43 -04:00
Robby Findler
9b987800fb adjust things so that integer-in contracts can have other names 2017-03-08 09:31:33 -06:00
Robby Findler
f5c5db3b3d fix a bug in recent and/c improvements and add proper printing for integer-in 2017-03-07 20:40:26 -06:00
Robby Findler
3a639d7794 improve interaction between natural?, exact-positive-integer?, exact-integer?,
and/c, and between/c (which implies <=/c and >=/c) so that they turn
themselves into integer-in when appropriate

for example, (contract-stronger? (integer-in 0 4) (and/c natural? (<=/c 4)))
returns #t
2017-03-07 16:38:35 -06:00
Robby Findler
87e024d55c allow #f as arguments to integer-in 2017-03-07 16:27:18 -06:00
Robby Findler
7c3412957a add the same fast path to contract? and chaperone-contract? that is already in flat-contract? 2017-03-07 16:27:18 -06:00
Robby Findler
36368628af adjust -> expansion to make it more friendly to possible inlining 2017-03-07 16:27:17 -06:00
Benjamin Greenman
6e746891ef clarify error message for take and drop (#1582) 2017-03-06 18:45:09 -05:00
Benjamin Greenman
d8b78e823e relax contract for (random min max [rand-gen]) (#1626)
Relax contract for `(random min max [rand-gen])` to accept any pair of
integers such that:
- `(< min max)`
- `(- max min)` is between 1 and 4294967087
2017-03-06 18:43:04 -05:00
Robby Findler
dbddb3785e add natural? to the known predicates with generators 2017-03-05 21:35:20 -06:00
Leif Andersen
1cbd75436b Eta expand natural?
Doing this eta expansion has the advantage that error messages
will point to `natural?` rather than `exact-nonnegative-integer?`
2017-03-03 09:58:19 -05:00
Matthew Flatt
1d61d9b752 add 'vm mode to system-type 2017-03-03 06:56:09 -07:00
Leif Andersen
1ebb3d5ef3 nonnegative-integer -> exact-nonnegative-integer 2017-03-02 19:24:12 -05:00
Leif Andersen
1ac2e77d00 Add natural? as an alias for nonnegative-integer? 2017-03-02 19:24:12 -05:00
Leif Andersen
c911e4b52d Add the following predicates to racket/math:
- positive-integer?
- negative-integer?
- nonpositive-integer?
- nonnegative-integer?

These are like their exact-* counterparts provided by racket/base,
but they work for inexact numbers, and not just exact ones.
2017-03-02 19:24:12 -05:00
Matthew Flatt
d08a4cddfb fix stack-overflow handing lin the compiler's letrec-check pass
Closes #1621
2017-02-27 09:43:59 -07:00
Matthew Flatt
f19d655cbc fix optimizer bug related to single-use functions
Fix problem with once-use tracking and delayed variable-use marking
that is performed for local function bodies. A delayed variable-use
registration might happen after a once-used variable is replaced by
its use.

This scenario is difficult to provoke, because the optimizer has to
first decide not to move a once-use function, and in a latter pass
decide to move it after all. There's not enough information to
retract the tentative use plus its transitive implications.

The solution is to avoid the generic once-use layer for `lambda` forms
whose uses are delayed (and that likely has a good effect on inlining
anyway). The other half of the solution is to avoid transitive use
marking on a once-used variable whose expression has been moved (and
there are no transitive things to skip, because that expression isn't
a `lambda` form).
2017-02-26 08:58:36 -07:00
Matthew Flatt
a7ac75f15d use RTLD_LOCAL when loading extensions on Mac OS
It appears that Mac OS wants `RTLD_LOCAL` in the dlopen() call,
otherwise dlsym() searches through all previously open shared objects
– even though dlopen() is given a specific library handle.
2017-02-25 13:57:48 -07:00
Matthew Flatt
3c563484c6 fix memory-management bug in struct->vector
Closes PR 15410
2017-02-25 08:32:08 -07:00
Matthew Flatt
481dc9b0e8 fix port line, col, and pos to stay at #f when set to #f 2017-02-23 19:56:21 -07:00
Matthew Flatt
39b2a61700 fix mutability checking in impersonator-struct
Thanks to Scott Moore for the repair.
2017-02-23 19:56:21 -07:00
Jay McCarthy
fafa9c2bbd Merge pull request #1618 from leafac/fix-git-checkout
Fix “git-checkout”
2017-02-13 10:29:51 -05:00
Leandro Facchinetti
7ae83ba1e6 Fix “git-checkout” by adding HTTP auto-reconnect 2017-02-11 08:55:41 -05:00
Robby Findler
0ace11ddcd fix bug in build-source-location
closes #1605
2017-02-10 20:43:11 -06:00
Alexis King
6632beeca9 Fix wrap-expr/c and expr/c to reflect the intended use
The expr/c syntax class, as well as its underlying implementation
function, wrap-expr/c, previously produced misleading error messages.
The main purpose of these tools is to ensure a user-provided expression
conforms to a macro-provided contract. However, contract errors produced
by these forms were consistent with situations where both value and
contract were provided by the same party.

This fixes the discrepancy by changing how these forms assign blame to
emulate contract errors that arise from improper function arguments,
since most expressions provided to macros are semantically similar to
function arguments. All examples within the documentation itself
reflect this use case.

These changes alter the contents of error messages raised by expr/c and
wrap-expr/c, which could theoretically break some test suites, but it’s
extremely unlikely that any non-test code would depend on the precise
wording of contract error messages, and the interface is otherwise
completely backwards-compatible.

fixes #1412
2017-02-08 11:04:04 -05:00
Matthew Flatt
a5e7972bde JIT: fix handling of index argument to bytes-set!
When the second argument to `bytes-set!` is a reference to a
module-level variable that is definitely defined but not a known
constant, then an incorrect reordering was used that would cause
the third argument value to get overwritten before the call.

Closes #1601
2017-02-08 07:52:52 -07:00
Matthew Flatt
b3223ad8d2 bytecode compiler: add missing stack check in SFS pass
C-implemented recursive pass needs stack-overflow
check and handling.

Closes #1607
2017-02-06 17:19:57 -07:00
Matthew Flatt
2333251a26 note OpenSSL upgrade for native libraries 2017-02-06 17:19:57 -07:00
Robby Findler
84048f6776 avoid call to coerce-contract when we know it is already a contract 2017-02-05 14:37:04 -06:00
Robby Findler
8c5c8da1a7 fix fast path to not ignore pre/post conditions and bail out appropriately 2017-02-05 14:36:43 -06:00
Sam Tobin-Hochstadt
71a43f34c8 Use correct base path for finding gracket. (#1609)
Fixes error in http://drdr.racket-lang.org/38697/pkgs/compiler-test/tests/compiler/embed/test.rkt#output1
2017-02-03 15:19:28 +00:00
Sam Tobin-Hochstadt
8a49a8e545 Fix for PLT_DELAY_FROM_ZO custodian. 2017-02-02 17:06:40 +00:00
Ryan Culpepper
2def574c3c syntax/parse: clean up "at"/"within"-term handling
Added comments and examples about "at" and "within" terms
Fixed ps->stx+index bugs related to struct and vector patterns
2017-02-02 01:06:14 -05:00
Ryan Culpepper
de60c00f56 syntax/parse: fix ps->stx+index; fixes #1602
Collapse CDR frames separated by ORD, POST, etc. For example,
(1 ORD 2 stx) should be same as (3 stx).
2017-02-02 00:25:20 -05:00
Stephen Chang
fe9f0e6e92 fix segfault when using preserved stx prop with non-interned-symbol key
closes #1594
2017-02-01 22:21:04 -05:00
Matthew Flatt
69d7636770 fix position counting with internal read shortcut
The primitive `read` uses a shortcut --- a private "ungetc"
implementation --- that did not count position correctly for
non-ASCII characters.

Closes #1599
2017-01-30 20:01:22 -07:00
Matthew Flatt
6c9dbea31f make pretty-print-newline work on any output port
The documentation says that it should work on any output port,
although there's special treatment of ports that originate
from `pretty-print` itself.

Closes #1579.
2017-01-30 05:41:49 -07:00
Matthew Flatt
572b96a6ef add 'gui-bin-dir as a separate configuration option
Allow the directory for GUI executables to be specified as different
from console executables. The defaults for those two are different
on Mac OS, and configuring them differently might be useful to
address #1575.

Although there is probably no demand on Windows or Unix for splitting
the console and GUI bin directories, this patch tries to make things
work sensible there. On Windows, there's a corner case where a
launcher that starts GRacket (especially with `-z`) is intended to be
a console executable. The launcher creator can be told that via a
`subsystem` option, but a new `#:console?` argument was needed for
`make-gracket-launcher-path` lets the path selector know.
2017-01-30 05:41:49 -07:00
Sam Tobin-Hochstadt
80abc0a020 Fix warning. 2017-01-30 12:40:23 +00:00
Gustavo Massaccesi
a21b33a760 mark struct operations as single valued and mark preserving
Also, the optimizer recognizes struct operations as procedures,
so it will reduce

  (procedure? my-struct?) ==> #t
2017-01-29 20:05:46 -03:00
Gustavo Massaccesi
601587c068 advance effect clocks after reductions
After some reductions, the new rator advance less the effect
clocks than the original rator. For example in

    (equal? x 7) ==> (eq? x 7)

    (my-struct? x) ==> #t or #f
2017-01-29 20:05:46 -03:00
Gustavo Massaccesi
b73e1dfd6c consider the flags of unclonable lambdas for reductions
The lambdas can be marked as single valued and/or mark preserving.
With this information is possible to remove unnecessary wrapping
like the `values` in

    (let ([f (lambda () '(1))])
      (display f f)
      (values (f)))

or in reductions like

   (car (list (f))) ==> (values (f)) ==> (f)

Moreover, this is useful to test that the optimizer has marked
correctly the function f as single valued and mark preserving.
2017-01-29 20:05:45 -03:00
Matthew Flatt
aa130df8b2 fix prop:custom-write printing on structure ports
When a `prop:custom-write` function prints to a given port for
recursive printing, don't reject a port that is a structure port.

Relevant to #1579
2017-01-27 18:04:20 -07:00
Matthew Flatt
03f2deeea9 fix module->namespace problem resoring bindings
If a module has any sort of complex bindings, such as a definition of
a macor-introduced identifiers, then `module->namespace` and variants
(like `variable-reference->namespace`) need to recreate suitable
bindings. Make sure that the module-path index for recreated bindings
is the run-time one, not the compile-time one.

Closes #1584
2017-01-27 17:30:35 -07:00
Gustavo Massaccesi
0a5c510b72 advance the vclock for a values with 0 or more than 1 argument
To avoid moving expressions that may have a side effect, the optimizer must
recognize that in this position this will cause an error and advance
the virtual clock.

Currently the only primitive that is flagged as SCHEME_PRIM_IS_OMITABLE and
may have multiple return values is `values`.

Thanks to Robby for finding the original version of the test.
2017-01-27 18:18:26 -03:00
Matthew Flatt
0e12201c4d fix bytecode writer for immediate compile-time values
When a hash table or other special value appears immediately on the
right-hand side of `define-values`, it needs to be protected by an
explicit quote when writing to bytecode.

Closes #1580
2017-01-27 09:07:53 -07:00
Matthew Flatt
89512edad9 fix JIT handling of struct type property predicates and accessors
When the JIT guesses that a rator will always be a struct type
property or accessor, the run-time check to confirm that guess
was broken.
2017-01-27 07:53:03 -07:00
Jay McCarthy
420330fef0 Protecting literal data, like vectors and hashes, from tagged paren styles 2017-01-25 17:47:39 -05:00
Vincent St-Amour
45bacf4917 Update raco pkg new for v6.8.
(cherry picked from commit 420f4795b6da2b8206ec9e2812d42123b8284fa1)
2017-01-24 14:50:13 -06:00
Georges Dupéron
e311d671de Applied changes requested by @rmculpepper for PR #1587 2017-01-23 20:32:40 -05:00
Georges Dupéron
6a07a3f986 Fixes several issues with syntax/parse, and adds some tests.
* byte-regexp? values should not be considered 3D syntax.
* hash? values are now allowed in serialized syntax properties with (template … #:properties (…))
* marshalling properties which were prefab structs called map on the result of struct->vector, changed it to struct->list as the struct "name" is always serializable.
2017-01-23 20:32:40 -05:00
Matthew Flatt
a9ae341105 in-bytes: use unsafe-bytes-ref
In the same way that `in-vector` uses `unsafe-vector-ref`,
make `in-bytes` expand to a use of `unsafe-bytes-ref`.
2017-01-22 07:57:46 -07:00
Matthew Flatt
aead07b5de bytecode compiler: fix misuse of "optimize" mode on a "resolved" form
Thanks to Robby for the test.
2017-01-20 21:35:09 -07:00
Matthew Flatt
736cdfb2c1 yet more repairs to the interaction of errors and let-values
Continuing the saga that includes 8190a7730d and d1ba9fbb6e, it turns
out that a 0-binding clause as the last one isn't so special after
all. A little later in the optimizer, now that we're sometimes moving
an error to the body, we can't assume that the body can be discard
if an error was detected.
2017-01-20 18:07:05 -07:00
Gustavo Massaccesi
d1ba9fbb6e fix wcm on error in let's
Repairs a problem with 8190a7730d, which can incorerctly
move an erroring experssion into tail position.
2017-01-20 15:04:11 -07:00
Matthew Flatt
8190a7730d fix optimizer bug related to errors and zero-values binding 2017-01-20 12:19:05 -07:00
Matthew Flatt
d0b5de398e fix internal function names 2017-01-20 10:44:25 -07:00
Matthew Flatt
80e8e0f9e0 fix a mismatch between the optimizer and validator
Thanks to Leif for the report and test case.
2017-01-18 15:39:38 -07:00
Matthew Flatt
ecaa14544f add v6.8 HISTORY note 2017-01-16 15:40:34 -07:00
Matthew Flatt
3f2de918d8 fix variable-reference->namespace for phase > 0
Set up bindings and shift phases as needed to make
`variable-reference->namespace` work in a run-time position when the
enclosing module is instantiated at a phase other than 0.

Thanks to Rohin Shah for the bug report.
2017-01-16 08:53:57 -07:00
Matthew Flatt
b138c340e1 fix extended {read,peek}-char-or-special
The changes in 08ca76b741 require the primitives to be reclassified
from non-CM to general.

Also, add an internal shortcut for checking arity.
2017-01-15 10:02:57 -07:00
Matthew Flatt
2cf6691439 expose read capabilities of string->number
Extend the `string->number` parser for use by readers, which need
error messages and/or extflonum results.
2017-01-13 08:09:19 -08:00
Matthew Flatt
08ca76b741 extend {read,peek}-char-or-special
Support an external implementation of `read-syntax` by exposing
functionality that is currently internal to `read-syntax`: a srcloc
argument to a "special"-producing port function and wrapping special
results to reliably distinguish them from characters.
2017-01-13 08:09:18 -08:00
Matthew Flatt
7ef20dd606 transplant-output-port: defend against weird ports
Avoid an error within `transplant-output-port` if the given output
port's position somehow goes down instead of up.

Merge to v6.8
2017-01-11 08:06:25 -07:00
Matthew Flatt
a860791d6f Windows: avoid using pipe code for file redirection
When Racket is run with stdout or stderr redirected to a file,
then it must be treated as a regular file, otherwise flushing
and position counting doesn't work right.

Merge to v6.8
2017-01-11 06:48:07 -08:00
Michael Myers
e2070b882d Replace arithmetic with bit operations
quotient/remainder is replaced with word-index and bit-index, expt with arithmetic-shift.
2017-01-10 21:59:22 -06:00
Gustavo Massaccesi
3eb86584c0 use flags of lambdas if they can't be inlined
Merge to 6.8 release.
2017-01-10 14:39:09 -03:00
Matthew Flatt
aa9d5e5614 expander: avoid misinterpreting unforced module context
Use the simple-scope shortcut only when the module context
is itself simple.

Merge to v6.8
2017-01-10 09:40:46 -07:00
Matthew Flatt
8ff011fc51 fix srcloc collapse for a path to a file in a root directory 2017-01-08 07:14:28 -06:00
Alexis King
dc9aa8a569 Fix source location in errors reported by define/match 2017-01-07 08:22:13 -08:00
Vincent St-Amour
57e787eec2 Post-release version for the v6.8 release 2017-01-07 07:40:13 -06:00
Robby Findler
ba060131d1 fix syntax error source location for define/contract
closes #1561
2017-01-04 16:53:26 -06:00
Robby Findler
057ab0c5ff fixed error messages to say struct/c when appropriate 2017-01-04 16:49:38 -06:00
Alexis King
597661fa4e Make range from racket/list act like in-range when used with for 2017-01-03 15:26:42 -08:00
Robby Findler
cff1c1dd4e fix interaction between real? and flat-named-contract
and fix opters, which were just broken for flat-named-contract and names

closes #1559
2017-01-03 17:06:42 -06:00
Matthew Flatt
78bbcec963 avoid trying to load Foundation framework on non-Mac OS
Relevant to #1549
2017-01-03 12:48:38 -07:00
Alexander Hedges
f1d853eeac Use JIT on powerpc 2017-01-03 11:39:40 -07:00
Alexander Hedges
d031f30d2a Add support for PowerPC on FreeBSD 2017-01-03 11:39:40 -07:00
Robby Findler
efb96c97b5 add #:name-for-blame to define-module-boundary-contract 2017-01-03 07:10:30 -06:00
Matthew Flatt
ada002616e fix Win64 native stack trace
Fix Win64-specific bug in 7812c604f4.
2017-01-02 12:42:02 -07:00
James Bornholt
ae21f8f875 Make PLTDISABLEGC work again
In e59f888, new GCs no longer inherit the `avoid_collection` value set by
PLTDISABLEGC, and so that setting is lost as soon as the master place spawns
(due to `GC_switch_out_master_gc`).
2017-01-02 11:24:11 -07:00
Matthew Flatt
e041d0f32f fix optimizer bug related to detected arity errors
When multiple-binding `let-values` form is split into a single-binding
form on the grounds that the right-hand side will definitely error,
the optimizer's effect clocks were advance incorrectly.

Closes #1552
2017-01-02 07:00:22 -07:00
Matthew Butterick
fc194d7337 update copyright year to 2017 2017-01-02 06:42:31 -07:00
Matthew Flatt
869d48b784 error context printing: show repeat counts
Instead of duplicating a context line, show "[repeats <n> times]".
This improvement particularly helps avoid showing less context
now that `for/list` creates a non-tail recursion to build up
the result list.
2017-01-02 06:42:31 -07:00
Robby Findler
66b199307c Adjust and/c so that it cooperates with between/c
Specifically, when it sees these contracts:

  (and/c real? negative?)
  (and/c real? positive?)
  (and/c real? (not/c positive?))
  (and/c real? (not/c negative?))

it generates the corresponding use of >=/c, <=/c, </c, or >/c, but
those contracts have also been adjusted to report their names as
(and/c real? ...).

This mostly is an improvement for contract-stronger, but also make it
so that (between/c -inf.0 +inf.0) just uses the real? predicate
directly, instead of a more complex function
2016-12-29 09:30:39 -06:00
Robby Findler
9019e8b318 make real? and (between/c -inf.0 +inf.0) be the same contract
mostly this just makes contract-stronger? work (slightly) better
2016-12-28 18:56:30 -06:00
Matthew Flatt
710320e3dc "Mac OS X" -> "Mac OS"
Although "macOS" is the correct name for Apple's current desktop OS,
we've decided to go with "Mac OS" to cover all of Apple's Unix-like
desktop OS versions. The label "Mac OS" is more readable, clear in
context (i.e., unlikely to be confused with the Mac OSes that
proceeded Mac OS X), and as likely to match Apple's future OS names
as anything.
2016-12-23 12:18:36 -07:00
Matthew Flatt
5cc5bb7c55 fix GRacket makefile to detect ".icns" change 2016-12-23 11:40:09 -07:00
Matthew Flatt
88aa7fdeff don't reorder some unsafe expressions that can depend on an effect
For example, an `unsafe-unbox` call should not be moved past the
call to an unknown function that might change a box's content.

Thanks to Sergey Pinaev for the report.
2016-12-23 08:01:30 -07:00
Matthew Flatt
5a4391dd90 don't share "gmp.c" compilation between CGC and 3m
Using `--disable-jit` causes futures to be disabled, and places are
always disabled for CGC; in that case thread-local variables are
not needed. Meanwhile, the 3m build still has places, so a "gmp.c"
compiled without thread-local support is broken.
2016-12-22 19:40:08 -07:00
Gustavo Massaccesi
992f990860 optimizer: merge lookup_constant_proc and optimize_for_inline
The objective of lookup_constant_proc and the first part of
optimize_for_inline was to find out if the value of an expression was a
procedure and get it to analyze its properties or try to inline it. Both
were called together in a few places, because each one had some special
cases that were missing in the other.

So, move the lookup and special cases from optimize_for_inline to
lookup_constant_proc, and keep only the code relevant to inlinig in
optimize_for_inline.
2016-12-22 23:34:27 -03:00
Matthew Flatt
d4ec96e35c recognize EROFS for file-or-directory-permissions
Closes #1478
2016-12-22 18:10:19 -07:00
Matthew Flatt
4bff048fb3 update app icons to new Racket logo 2016-12-22 13:36:52 -07:00
Matthew Flatt
eaa486db11 unbreak no-places, no-futures build 2016-12-22 10:50:27 -07:00
Matthew Flatt
cefb3aec2a make glib logging hook work with extra threads
If an OS-level thread other than a Racket thread logs a message, then
the message needs to be queued instead of handled immediately.

If multiple places are running, then the right handler thread is not
clear, so just queue to the main place's thread.

Closes racket/gui#66
Closes racket/drracket#77
2016-12-22 09:35:04 -07:00
Matthew Flatt
00171a3c2c file/[un]tar: support for long paths
Implement POSIX.1-2001/pax and GNU extensions for long paths and links
in `untar` and `tar`. Add a `#:format` argument to `tar` to select
among POSIX.1-2001/pax, GNU, or error encoding for long paths.
2016-12-21 16:00:12 -07:00
Matthew Flatt
9eb7d6b84e fix uses of namespace context without ensuring prepared
Closes #1530
2016-12-21 16:00:12 -07:00
Robby Findler
deaf48ae30 add #:use-wrapper-proc to racket/surrogate 2016-12-21 15:12:15 -06:00
Robby Findler
3e191fef04 misc small improvements to racket/surrogate
(generate less code in macro, add some basic test cases,
 small improvement to syntax errors, and small docs clarification)
2016-12-21 12:35:59 -06:00
Tony Garnock-Jones
b99639ff97 Detect and propagate errors from tar to result of tar-gzip. 2016-12-20 17:44:52 +13:00
Matthew Butterick
3e4a0353cf fix misuse of trace-printf 2016-12-19 19:17:00 -07:00
Robby Findler
98c3906059 missed a spot in b100f4b 2016-12-17 17:09:09 -06:00
Robby Findler
21cf407616 fix a bug in 003e8c7
closes #1539
2016-12-17 08:16:13 -06:00
Robby Findler
b100f4bb75 fix error in 003e8c7 2016-12-15 17:35:23 -06:00
Robby Findler
8918279b21 adjust ->i so that when it sees that it got a flat contract,
it doesn't apply it the second time (since we know that the
only difference for indy blame is in the negative position
and we know that flat contracts never assign negative blame)

This commit combined with the two previous (2b9d855 and 003e8c7) do
not seem to have a significant effect on the performance of ->i
contract checking. In particular, I see a 50% slowdown between the
version before and the version after these commits on the third `time`
expression below, but no significant difference on the first two.

(without the improvement to flat-contract?, these commits are
a significant slowdown to `g`)

 #lang racket
 (require profile)
 (define f
   (contract (->i ([y () integer?]
                   [x (y) integer?])
                  (values [a () integer?]
                          [b (a) integer?]))
             values
             'pos 'neg))

 (define g
   (contract (->i ([y () (<=/c 10)]
                   [x (y) (>=/c y)])
                  (values [a () (<=/c 10)]
                          [b (a) (>=/c a)]))
             values
             'pos 'neg))

 (define (slow-predicate n)
   (cond
     [(zero? n) #t]
     [else (slow-predicate (- n 1))]))

 (define h
   (contract (->i ([y () slow-predicate]
                   [x (y) slow-predicate])
                  (values [a () slow-predicate]
                          [b (a) slow-predicate]))
             values
             'pos 'neg))

 (time
  (for ([x (in-range 100000)])
    (f 1 2) (f 1 2) (f 1 2)
    (f 1 2) (f 1 2) (f 1 2)
    (f 1 2) (f 1 2) (f 1 2)))

 (time
  (for ([x (in-range 100000)])
    (g 1 2) (g 1 2) (g 1 2)
    (g 1 2) (g 1 2) (g 1 2)
    (g 1 2) (g 1 2) (g 1 2)))

 (time
  (for ([x (in-range 10000)])
    (h 50000 50000)))
2016-12-15 12:43:17 -06:00
Robby Findler
2b9d855231 special case the flat-contract? predicate to avoid having
to create the whole contract struct for values that get coerced to flat contracts
2016-12-15 12:42:48 -06:00
Robby Findler
003e8c7870 avoid evaluating the dependent contract expressions multiple times in ->i 2016-12-15 12:42:48 -06:00
Robby Findler
f1d6e8bfe8 bring down below 102 columns 2016-12-15 12:42:48 -06:00
Matthew Flatt
8a7852ebbf fix re-expansion of a simple #%module-body form with submodules
Closes #1538
2016-12-15 08:05:02 -07:00
Matthew Flatt
4683b023ab fix another space-safety issue in interpreter loop
When the main interpreter loop is called for an application where the
argument array coincides with the current runstack pointer, then the
protocol is that the callee gets to modify that space --- and it
should modify that space as arguments become unused. The interpreter
was always copying arguments to a fresh space, though.
2016-12-15 08:05:02 -07:00
Gustavo Massaccesi
f2be44dea4 optimizer: allow wcm with multiple return value in noncm_expression 2016-12-15 10:39:16 -03:00
Gustavo Massaccesi
22d61c41d5 optimizer: merge single_valued_expression and definitely_no_wcm_in_tail
Both function have a similar purpose and implementation, so merge them to consider
all the special cases for both uses.

In particular, detect that:
  (if x (error 'e) (void)) is single-valued
  (with-continuation-mark <chaperone-key> <val> <omittable>) is  not tail sensitive.

Also, as ensure_single_value was checking also that the expression was has not a
continuation mark in tail position, it added in some cases an unnecessary
wrapper. Now ensure_single_value checks only that the expression produces
a single vale and a new function ensure_single_value_noncm checks both
properties like the old function.
2016-12-14 20:18:21 -03:00
Gustavo Massaccesi
6d1018fbe8 optimizer: fix interaction of arithmetic reductions and wcm
Also fix a similar problem with branches reduction in a Boolean context.
2016-12-14 20:13:28 -03:00