Commit Graph

42620 Commits

Author SHA1 Message Date
Matthew Flatt
d7e9628caf clean up some debugging leftovers 2020-12-22 13:07:15 -07:00
Matthew Flatt
a450246ee7 mach-o: infer machine type instead of depending on cross information
Directly inferring the machine type works more easily for some Racket
CS build steps.
2020-12-22 12:58:17 -07:00
Matthew Flatt
15ab674ef8 ffi/unsafe/objc: repair use of objc_msgSendSuper_stret
TTo keep stack alignment correct, the `objc_msgSendSuper_stret`
function needs to be used with a structure return type on i386,
instead of making the implicit return-pointer argument explicit.
(For BC, libffi apparently makes the wrong style work anyway.)
2020-12-22 10:51:54 -07:00
Matthew Flatt
b8f0c96756 Chez Scheme: repair i386 Mac OS __collect_safe ABI
A wrapper to align the stack during activation was dropped if the
return type was `void` for a foreign callable, and a callee-popped
argument was not handled right for a foreign call.
2020-12-22 10:51:45 -07:00
yjqww6
153569894c fix a contract test 2020-12-22 06:51:02 -05:00
Matthew Flatt
33fd201947 Chez Scheme: revert incorrect cp0 simplification
It's not necessarily ok to inline a function wrapper by
`make-wrapper-procedure`, because the wrapper might get mutated. We
could add immutable wrapper procedures, but we can also just revert to
a previous approach for code that needed the optimization.
2020-12-21 16:46:21 -07:00
shhyou
50f373f4d6 Fixes of the core tests for testing on Windows
* Initialize the environment variables with paths to
  MSVC toolchain before running the racket-test-core,
  since the foreign library tests need a C compiler.

* Fix a bug in foreign-test.rktl that deletes the existing
  content of environment variables (PATH, INCLUDE, LIB, etc)

* Let a test in date.rktl fail more gracefully.
2020-12-21 15:18:07 -06:00
Matthew Flatt
0041354e1f fix some uses of peek-bytes-avail! that do not expect specials
Closes #3572
2020-12-21 08:06:43 -07:00
Matthew Flatt
c93e4f1328 cs: repair ctype alignment
Currently, this repair matters only for PPC32 Mac OS, which is the
only place where alignment of some primitive atomic type is not the
same as its size.
2020-12-21 07:31:09 -07:00
Matthew Flatt
8cd96ec5df bc: repair for foreign callbacks
Fix an array whose size needs to be connected to the number of
arguments to `ffi-callback-maker`.
2020-12-20 20:35:49 -07:00
shhyou
344f2c9713 Split the testing steps in the Windows CI workflow
* cmd.exe only returns the error level of the last
  executed command and does not support fail-fast.
  So testing should be done in individual steps.

  See <https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions> for more information.

* Also installs db-test dependencies.
2020-12-20 22:11:10 -05:00
Matthew Flatt
763c5465f6 revert argument change in #%foreign exports
The changed functions are documented and turn out to be used by the
`gui` package.
2020-12-20 16:51:22 -07:00
Matthew Flatt
c006fa902f ffi/unsafe: add #:varargs-after to function-type options
Needed on ARM Mac OS to call a function like `fcntl`.
2020-12-20 13:32:36 -07:00
Matthew Flatt
6033237ed6 Chez Scheme: generalize __varargs to (__varargs_after <n>)
The non-standard ARM Mac OS ABI doesn't just use a different
convention if the function has varargs: it puts each vararg in a
different place than a non-vararg argument of the same type and
position. So, `foreign-procedure` and `foreign-callable` need to know
where varargs start. A `__varargs` declaration is shorthand for
`(__varargs_after 1)`.

For PPC32 Mac OS, we retain the trick that makes varargs foreign calls
work without a `__varargs` declaration, but `(__varargs_after <n>)`
fixes up callable support --- in the extremely unlikely case that
someone needs general varargs callables on PPC32 Mac OS.
2020-12-20 11:21:20 -07:00
Matthew Flatt
0ce89f53c4 Chez Scheme: repair for call-with-values ... values cp0 conversion
Closes #3576
2020-12-20 09:09:54 -07:00
Matthew Flatt
72d278cb84 cs: take advantage of new lifting in Chez Scheme
Since Chez Scheme now performs the kind of closure conversion that
Racket does --- ensuring that a closure is not allocated if it is
bound to an identifier that is used only in application positions ---
the variant in schemify is not longer run. The hacky macro-based
lifter in the "rumble" layer can also go.

The lifting pass is still preserved in schemify, because it is still
useful to cify. It's not clear whether interpreter mode (which is used
during macro expansion for compile-time code that doesn't cross a
module boundary) is better off with or without schemify's lift, but
it's gone for now.
2020-12-20 08:18:51 -07:00
yjqww6
97d9825801
ChezScheme: Add a pass to lift well-known closures 2020-12-20 08:00:52 -07:00
Matthew Flatt
f62e97d8b6 Chez Scheme: repair for 32-bit Windows makefile 2020-12-19 20:37:13 -07:00
shhyou
b71845512c Redirecting stderr to a temporary file
Avoid using (current-error-port) since it may not
be a file stream port.
2020-12-19 21:33:55 -06:00
Matthew Flatt
4d0aa443b1 cs & thread: fix problems with sync and breaks
This commit fixes two bugs:

 * `sync/enable-break` didn't implement the guarantee that an event is
   selected or a break exception raised, but not both; the problem was
   in the handling of making the break-enable state ignored after
   committing to an event

 * `sync` didn't cancel asynchronous pending commits when a break is
   received at certain points; the bug in `sync/enable-break` masked
   this bug for existing test cases

Closes #3574
2020-12-19 16:06:16 -07:00
Matthew Flatt
c05d0a6fa5 Chez Scheme: repair to support vfasl boot in Rosetta
When Rosetta 2 runs x86_64 code, it doesn't enforce W^X, but the
`read` system call still refuses to write into executable memory.
2020-12-19 10:53:47 -07:00
Matthew Flatt
ec064bee31 cs: improve error reporting for FFI conversions
Match the error messages from BC.
2020-12-19 08:28:15 -07:00
Matthew Flatt
585f9d8201 mach-o: fix linkedit vm length when ad hoc signing 2020-12-19 07:08:59 -07:00
Sam Tobin-Hochstadt
0e4f57f44c Enable inlining for define-inline calls as arguments.
A seemingly-unintentional choice made the following not behave
as expected:

    (define-inline (f x) (+ x 1))
    (f (f 2))

because the `(f 2)` was not inlined.

Reported by @mflatt and Liwei Chou.
2020-12-18 13:53:09 -05:00
shhyou
627c45e8d4 Fix temp-dir path in submodule tests for Windows.
The function make-temporary-file supplies a string
argument consisting of digits to the format function.
Therefore, if the template uses the ~s formatting
escape, make-temporary-file will attempt to create
a temporary directory with double quotes in the path.
Such paths are now allowed on Windows.
2020-12-18 09:43:53 -06:00
Matthew Flatt
b7c0130a75 cs: new vfasl writer to support cross compilation
Replace the vfasl writer (which was in C) with a new implementation
(in Scheme). The main result is that the vfasl writer can be used in
cross-build mode.

Racket uses the vfasl format for its boot images, because they can
load faster --- cutting the Chez Scheme plus boot files startup time
in half, which saves about 40msec on a typical machine. That's not
enough to matter for something like DrRacket, but it can matter for
small Racket scripts. Formerly, cross builds disabled vfasl
generation.

A vfasl file is roughly an image of code and data as it will appear in
memory, and a relatively fast linking step makes the image work in a
running process. The old implementation was in C because it reused GC
structures and code, treating fasl creation as copying objects into a
vfasl image instead of a new generation. The new implementation is
more like a fasl reader, loading objects into a vfasl image instead of
the live heap. The two implementations are about the same amount of
code and both involve a certain amount of repeated implementation
(i.e., imitating a collection or fasl load), but the Scheme
implementation is more flexible and works for cross compilation.
2020-12-18 07:36:25 -07:00
Ryan Culpepper
a08a6b4904 fix custodian-managed-list: omit custodian-boxes 2020-12-17 14:32:25 +01:00
Sorawee Porncharoenwase
52676db959 CI: prevent forks from running jobs for self-hosted 2020-12-16 19:23:53 -06:00
shhyou
196f72d756 Add syntax tests for other configurations.
racket#3078 adds syntax tests for (x86_linux-)test-cgc;
this commit adds syntax tests for other configurations.
2020-12-16 13:46:02 -05:00
shhyou
4dbe089615 Use build-path in collapse-module-path a test.
Fixes the test failure triggered in racket#3563.
The PR racket#3563 runs `tests/syntax` on Windows.
2020-12-16 13:45:42 -05:00
Matthew Flatt
bcfbf2249e cs: avoid race with GC in (current-memory-use 'cumulative)
Thanks to Alex Harsanyi for reporting the problem.
2020-12-15 19:09:56 -07:00
Matthew Flatt
4590c51d32 cs: declare a no-return call 2020-12-14 19:04:02 -07:00
Sorawee Porncharoenwase
eff84fa302 cs: kill accidentally added debugging print 2020-12-14 19:03:03 -07:00
Sorawee Porncharoenwase
e9c5d1535a cs: correct a result-arity error test 2020-12-14 19:03:03 -07:00
Matthew Flatt
0a28dd1064 cs: adjust result-arity error messages
Relevant to #3325
2020-12-14 16:10:14 -07:00
Matthew Flatt
f76b814dd7 cs: tweaks for mpairs 2020-12-14 15:10:38 -07:00
Matthew Flatt
e90c2a2138 openssl: doc clarification on supported TLS versions
Closes #3551
2020-12-14 13:41:51 -07:00
Matthew Flatt
0561d71e60 reader: fix imprecision reading some flonums
Reading `1.0e45` produced a different (and less precise) result than
`1e35`. The problem was in the reader's fast path for simple flonum
conversions, where it converts the mantissa and exponent separately
and then combines them. 10^44 is not represented exactly as a flonum,
so there's imprecision when multiplicy it by 10 versus multiplying
1e45 by 1.

Closes #3548
2020-12-14 13:41:11 -07:00
Matthew Flatt
986c73244e racket/port: fix spinning by peeking-input-port on blocked input 2020-12-14 10:13:18 -07:00
Matthew Flatt
a959c7f988 cs: enable GC during atomic callbacks
Callbacks from C generally need to be in atomic mode, but they don't
need to have interrupts disabled at the Chez Scheme level, because
that disables GC.

Without this change, dragging a scrollbar or resizing the window in
DrRacket would suspend GCs as long as the mouse button is pressed ---
which could allocate arbitrary amounts of memory fairly quickly
meanwhile.
2020-12-14 07:17:24 -07:00
Paulo Matos
131557a20f Add texlive to racketci image 2020-12-14 06:45:35 +01:00
Matthew Flatt
635005e882 Chez Scheme: unbreak $app/value rendering for expand/optimize 2020-12-13 19:59:19 -07:00
shuhung
2c26dc1e1a
Format the name of continuation prompt tags
This change recovers Racket-BC style formatting
of continuation prompt tags for Racket CS.
2020-12-13 16:29:14 -07:00
Matthew Flatt
b4a3c7d3da Chez Scheme: unbreak app rendering for expand/optimize
Also, fix some cp0 tests for interpret mode.
2020-12-13 11:06:53 -07:00
Matthew Flatt
1e19e660c9 expander: track core #%datum expansion in 'origin 2020-12-12 20:23:35 -07:00
Matthew Flatt
400f4fa4fb expander: 'implicit-made-explicit property on introduced #%app, etc. 2020-12-12 11:02:58 -07:00
Matthew Flatt
79ccd514c3 Chez Scheme: allow some extra inlining of system primitives
Cross-library inlining is willing to inline a procedure body that
refers to a system primitive, but wasn't willing to propagate a
system primitive directly. Enable that, and use it to simplify
`unsafe-struct` inlining.

Related to #3546
2020-12-12 10:30:40 -07:00
Matthew Flatt
e7cef677ad expander: attach original property to #%app made explicit
Copy any syntax-original property from the parentheses assodictaed
with a `#%app` made explicit, so that originalness is tracked in
the 'origin property.
2020-12-12 08:50:03 -07:00
Matthew Flatt
426b6adc79 bc: sync expanded expander 2020-12-12 08:50:03 -07:00
sorawee
5412211a7c CI: fixes a typo that causes CI to fail 2020-12-12 09:23:08 -05:00