Commit Graph

42879 Commits

Author SHA1 Message Date
Bogdan Popa
f4cd7ab8a0 pkg: improve CI template for new packages
Related to #1500.

This improves the following aspects of the CI config:

* The config now tracks the current stable version of Racket so
package authors don't have to remember to upgrade the config on new
releases.  This is a double-edged sword, because it makes it easy to
use features of new Racket version and potentially break
backwards-compatibility by accident.  Running CI against a set of
static Racket versions doesn't have this problem since any such change
would end up failing.  Maybe a better change here would be to
interpolate the current `(version)` into the CI file instead.

* The job is now set to fail on the first error it encounters on the
assumption that most packages fail due to internal issues and not due
to mismatches between Racket versions.  The intent with this change is
to use fewer resources overall when possible.  Additionally, the
packages' dependencies are now validated during the setup step.

* Lastly, the install step now avoids building documentation for
dependencies, which can shave off significant amounts of time.
2020-12-23 10:25:24 -05:00
Stephen De Gabrielle
1ad448e19e added links with #:url 2020-12-23 08:21:45 -07:00
David Van Horn
c93837c2ce Fix rationalize with +nan.0 tolerance
Calling `rationalize` with `+nan.0` as the second argument was causing
a "no exact representation error."  This commit changes it to produce
`+nan.0`.

There was an unexercised set of tests for `rationalize` in the test
suite which, once called, demonstrate the bug.

Those tests also specify that `rationalize` should produce an exact
result when the first argument is exact and the second is an infinity.
That's not what the implementation does; it coerces the result to
inexact.  I changed the test cases to match the implementation, which
is consistent with other Schemes (Chez, MIT) and standards (R6RS).
2020-12-23 08:20:31 -07:00
Stefan Schwarzer
4fa48182c0 docs: fix upper ASCII limit for control characters
Character 32 is space, which isn't a control character.
2020-12-23 08:02:23 -07:00
Sam Tobin-Hochstadt
6369646116 Order keys when writing JSON output.
More significant on Racket CS because ordering is often different
than creation order.

Closes #3537.
2020-12-23 10:01:08 -05:00
Matthew Flatt
3577cb0e4d ffi/vector: more complete tests 2020-12-23 07:58:34 -07:00
David Van Horn
72a852ca43 cs: fix {u,s}16vector-{ref,set!} when memory is not bytes?
When a {u,s}16vector points to memory that's not bytes (e.g. from ffi)
then referencing or setting the memory results in a Chez error:

```
foreign-set!: unrecognized type 'int16
```

The fix is to change the type argument to `'integer-16` and
`'unsigned-16`.
2020-12-23 07:49:23 -07:00
Matthias Felleisen
bff1a3c012 test for ordered jsexpr->string 2020-12-23 09:45:09 -05:00
Matthew Flatt
cc9fc20a07 raco dist: signing repairs for ARM Mac OS 2020-12-22 15:55:47 -07:00
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