Commit Graph

1171 Commits

Author SHA1 Message Date
Matthew Flatt
8e34ef3a9d libffi: fix problems with gcc-4.0 on 32-bit Mac OS X
Based in part on https://trac.macports.org/changeset/122079
2014-10-28 08:06:13 -06:00
Matthew Flatt
35a762b556 remove internal sorted-dirlist function
The result of `directory-list` is now sorted by default, so the
extra function is not needed.
2014-10-27 16:01:49 -06:00
Matthew Flatt
9291726482 racket/file: add make-parent-directory*
Also, clarify behavior of `make-directory*` in the case of a relative
path when the current directory does not exist.
2014-10-27 16:01:49 -06:00
Matthew Flatt
2d85fdc02f libffi: restore some small patches
Also, revert file-permission changes.
2014-10-27 11:18:16 -06:00
Gustavo Frederico Temple Pedrosa
9832ad7750 Update libffi to 3.1
Update libffi to 3.1 to add support for new architectures.
2014-10-27 11:18:16 -06:00
Matthew Flatt
f31c6563e4 make read-line interruptable on a primitive port
Closes PR 14800

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

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

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

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

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

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

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

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

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

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

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

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

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

-------

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Stupid robby experiment
2014-09-29 12:06:47 -04:00