1.13.0
·
1102 commits
to master
since this release
1.13.0 (2024-07-09)
Features
lang
- Allow rescuing exceptions that include a module (#14553, thanks @Blacksmoke16)
- (macros) Allow assignment to
_inside macro expressions (#14452, thanks @HertzDevil)
stdlib
- (collection) Add
Array#insert_all(#14486, thanks @summer-alice) - (collection) Improve compile time error for
#sort(&block : T, T -> U)(#14693, thanks @beta-ziliani) - (concurrency) Add
WaitGroupsynchronization primitive (#14167, thanks @ysbaddaden) - (concurrency) Allow
Atomics of pointer types (#14401, thanks @HertzDevil) - (concurrency) Add
Thread.newyields itself (#14543, thanks @ysbaddaden) - (concurrency) Add support for
Atomic(Bool)(#14532, thanks @ysbaddaden) - (concurrency) Add
Thread.sleep(Time::Span)(#14715, thanks @ysbaddaden) - (files) Implement
IO#tty?in Win32 (#14421, thanks @HertzDevil) - (files) Implement
File.readable?and.writable?in Win32 (#14420, thanks @HertzDevil) - (files) Make
File.readable?and.writable?follow symlinks on Windows (#14514, thanks @HertzDevil) - (llvm) Add some missing
LLVM::Contextbindings (#14612, thanks @ysbaddaden) - (llvm) Do not strip the macOS target triple (#14466, thanks @hovsater)
- (log) Support
UInt32andUInt64in Log Context (#14459, thanks @toddsundsted) - (macros) Add AST node methods for macro-related nodes (#14492, thanks @HertzDevil)
- (macros) Support short blocks in
#[]operator call's macro interpolation (#14523, thanks @HertzDevil) - (macros) Add macro methods for
Select(#14600, thanks @HertzDevil) - (macros) Add
TypeNode#private?,#public?and#visibility(#11696, thanks @Hadeweka) - (macros) Add
StringLiteral#to_utf16(#14676, thanks @ysbaddaden) - (networking) Relax type restriction of handlers in
HTTP::Server.newtoIndexable(HTTP::Handler)(#14413, thanks @hugopl) - (networking) [security] OpenSSL: don't change default cipher suites (#14655, thanks @ysbaddaden)
- (networking) Allow parsing cookies with space in the value (#14455, thanks @anton7c3)
- (runtime) Add
EventLoop::Socketmodule (#14643, thanks @straight-shoota) - (runtime) Add
EventLoop::FileDescriptormodule (#14639, thanks @straight-shoota) - (runtime) Add
Crystal::Tracingfor runtime tracing (#14659, thanks @ysbaddaden) - (system) [security] [breaking] Disable implicit execution of batch files on Windows (#14557, thanks @straight-shoota)
- (system) Add
EventLoop#run(blocking)andEventLoop#interrupt(#14568, thanks @ysbaddaden) - (system) Add
Crystal::System::Time.ticks(#14620, thanks @ysbaddaden) - (system) Add
Crystal::System::Thread.current_thread?,#scheduler?(#14660, thanks @ysbaddaden) - (system) Protect fork/exec on targets that don't support atomic CLOEXEC (#14674, thanks @ysbaddaden)
- (system) Add
Crystal::System.panic(#14733, thanks @ysbaddaden) - (text) Add
Regex::MatchOptionsoverload forString#index!(#14462, thanks @HertzDevil) - (text) Add
StringPool#get?(#14508, thanks @HertzDevil) - (text) Add
pkg_confignames forpcre2andpcre(#14584, thanks @straight-shoota) - (text) Add UUID v7 (#14732, thanks @jgaskins)
- (time) Add
Time::Error(#14743, thanks @Blacksmoke16)
compiler
- (codegen) Add compiler flags
-Osand-Ozto optimize binary size (#14463, thanks @ysbaddaden) - (codegen) Add compiler support for AVR architecture (Arduino) (#14393, thanks @ysbaddaden)
tools
- (formatter) Allow new formatter styles for trailing comma and whitespace around proc literal (#14726, thanks @Blacksmoke16)
Bugfixes
lang
- (macros) Fix parsing of non-trailing
ifbodies inside macro expressions (#14505, thanks @HertzDevil) - (macros) Drop parentheses around
->inside certain comma-separated lists (#14506, thanks @HertzDevil) - (macros) Fix indentation of
Selectnodes' macro interpolation (#14510, thanks @HertzDevil) - (macros) Fix indentation of parenthesized
Expressions#to_s(#14511, thanks @HertzDevil)
stdlib
- (collection) [regression] Ensure
Enumerable#to_aandEnumerable#tallyproperly retain return type ofT(#14447, thanks @Blacksmoke16) - (collection) [breaking] Never raise
IndexErrorin#[]?(Range)(#14444, thanks @HertzDevil) - (collection) [breaking] Fix
Set#to_a(&)(#14519, thanks @meatball133) - (collection) Fix
Hash#rehashto reset@first(#14606, thanks @straight-shoota) - (collection) Fix macro interpolation in
NamedTuple#from(#14790, thanks @HertzDevil) - (collection) [regression] Fix regression with
NamedTuple.newwhen using key with a hyphen (#14785, thanks @Blacksmoke16) - (files) Allow
#fsyncand#flock_*onIO::FileDescriptor(#14432, thanks @HertzDevil) - (files) Make
IO::FileDescriptor#tty?return false for NUL on Windows (#14509, thanks @HertzDevil) - (files) Fix blockless
IO::FileDescriptorecho and raw mode methods (#14529, thanks @HertzDevil) - (files) Remove target path's forward slashes in
File.symlinkon Windows (#14522, thanks @HertzDevil) - (files) Fix
IO#same_content?accepting prefix on second stream (#14664, thanks @straight-shoota) - (files) Fix overflow in
File#read_atfor large offsets on Windows (#14708, thanks @HertzDevil) - (files) Fix
IO::FileDescriptor.newfor closed fd (#14697, thanks @straight-shoota) - (files) Fix
IO::Delimitedreading into limited slice with peek (#14772, thanks @straight-shoota) - (files) Fix
Compress::Gzipextra field (#14550, thanks @kojix2) - (log) delete source from builder cache when finalize (#14475, thanks @ysbaddaden)
- (networking) Fix
Socket#closeerror handling on Windows (#14517, thanks @HertzDevil) - (networking) Set UTF-8 charset on directory listing in
HTTP::StaticFileHandler(#14546, thanks @alexkutsan) - (networking) Don't pass socket file descriptors to subprocesses on Unix (
SOCK_CLOEXEC) (#14632, thanks @carlhoerberg) - (networking) [security] OpenSSL: don't set default ECDH curve (#14656, thanks @ysbaddaden)
- (networking) [security] OpenSSL: deprecate Mozilla's TLS Server recommendation (#14657, thanks @ysbaddaden)
- (networking) use
SOCK_CLOEXECwithFD_CLOEXECfallback (#14672, thanks @ysbaddaden) - (networking) [regression] Fix regression on
Socket#connecttimeout type restriction (#14755, thanks @straight-shoota) - (networking) Drop default timeout for
Socket#connecton Windows (#14756, thanks @straight-shoota) - (networking) don't hardcode alpn protocol byte size (OpenSSL) (#14769, thanks @ysbaddaden)
- (numeric) Fix
BigRational#format(#14525, thanks @meatball133) - (numeric) [regression] Restore leading zero in exponent for
printf("%e")andprintf("%g")(#14695, thanks @straight-shoota) - (runtime) Fix enable docs for builtin constants (#14571, thanks @straight-shoota)
- (runtime) Fix
GC.mallocforgc_noneto clear memory (#14746, thanks @straight-shoota) - (serialization) Fix JSON discriminator for Bool
falsevalue (#14779, thanks @dammer) - (specs) Fix relative file paths in spec output (#14725, thanks @straight-shoota)
- (system) Fix using
System.retry_with_bufferwith stack buffer (#14615, thanks @straight-shoota) - (system) Harmonize close on exec for
Socket&FileDescriptoron Windows (#14634, thanks @ysbaddaden) - (system) Use
dup3andpipe2to setO_CLOEXECwhen available (#14673, thanks @ysbaddaden) - (system) Fix calls to
retry_with_bufferwhen big buffer is necessary (#14622, thanks @BlobCodes) - (system) Fix
Process.runwith closed IO (#14698, thanks @straight-shoota) - (system) Prefer
strerror_roverstrerrorfor thread-safe errno (#14764, thanks @ysbaddaden) - (text) Make
String#subraiseIndexErrorif index is equal to size (#14458, thanks @HertzDevil) - (text) Fix
libpcre2version detection not working for-RC{N}versions (#14478, thanks @Frityet) - (text) Fix
Regex#inspectwith non-literal-compatible options (#14575, thanks @straight-shoota) - (text) Fix ECR escape sequences containing
-(#14739, thanks @HertzDevil)
compiler
- (codegen) Fix create new
target_machinefor every program (#14694, thanks @straight-shoota) - (codegen) Make
ReferenceStorage(T)non-atomic ifTis non-atomic (#14730, thanks @HertzDevil) - (codegen) Detect and error on failed codegen process (#14762, thanks @ysbaddaden)
- (codegen) Fix stats and progress issues in codegen (#14763, thanks @ysbaddaden)
- (debugger) Fix LLDB
crystal_formatters.pyfor Python 3 (#14665, thanks @zw963) - (parser) Disallow assignments to calls with parentheses (#14527, thanks @HertzDevil)
- (parser) Fix parser validate UTF-8 on first input byte (#14750, thanks @straight-shoota)
- (semantic) Fix type def reopening type from parent namespace (#11208, thanks @straight-shoota)
- (semantic) Fix
Crystal::Path#to_macro_idfor global path (#14490, thanks @straight-shoota) - (semantic) Fix
Class#===on metaclass (#11162, thanks @makenowjust)
tools
- (docs-generator) Fix generate docs for builtins
HOST_TRIPLEandTARGET_TRIPLE(#14570, thanks @straight-shoota) - (docs-generator) Decode URI component for search functionality in docs (#14645, thanks @nobodywasishere)
- (formatter) Fix formatting for short block inside
#[]operator call (#14526, thanks @HertzDevil) - (formatter) Fix formatter to skip trailing comma for single-line parameters (#14713, thanks @Blacksmoke16)
Chores
stdlib
- (collection) Drop obsolete workaround in
Range#reverse_each(#14709, thanks @yxhuvud) - (concurrency) Add
WaitGrouptodocs_main.cr(#14624, thanks @straight-shoota) - (files) [deprecation] Move
File.readable?,.writable?,.executable?toFile::Info(#14484, thanks @straight-shoota) - (networking) Drop
Crystal::System::Socket#system_send(#14637, thanks @straight-shoota) - (networking) Add type restriction
host : StringinTCPSocketandAddrinfo(#14703, thanks @straight-shoota) - (runtime) Fix abstract def parameter name in
LibEvent::EventLoop#send_to(#14658, thanks @straight-shoota) - (runtime) [breaking] Drop unused methods in
IO::Evented(#14666, thanks @straight-shoota) - (runtime) Drop
IO::Overlapped(#14704, thanks @straight-shoota)
compiler
- (codegen) [breaking] Remove
CRYSTAL_LIBRARY_RPATHand delay-load helper (#14598, thanks @HertzDevil)
Performance
stdlib
- (collection) Optimize
Hashfor repeated removals and insertions (#14539, thanks @HertzDevil) - (runtime) Remove unnecessary explicit memory barriers on ARM (#14567, thanks @ysbaddaden)
- (serialization) Optimize JSON parsing a bit (#14366, thanks @asterite)
- (text) Use wrapping arithmetic for
Int::Primitive#unsafe_chr(#14443, thanks @HertzDevil) - (text) Optimize
String#index(Char)and#rindex(Char)for invalid UTF-8 (#14461, thanks @HertzDevil) - (text) Optimize
String#to_utf16(#14671, thanks @straight-shoota)
Refactor
stdlib
- Remove unnecessary calls to
#unsafe_as(UInt64)etc. (#14686, thanks @straight-shoota) - (crypto) Replace calls to
StaticArray(UInt8, 1)#unsafe_as(UInt8)(#14685, thanks @straight-shoota) - (files) Remove calls to
LibC._setmode(#14419, thanks @HertzDevil) - (files) Use file handles directly instead of C file descriptors on Win32 (#14501, thanks @HertzDevil)
- (files) Refactor win32
System::FileDescriptor#unbuffered_{read,write}(#14607, thanks @straight-shoota) - (files) Extract
#system_readand#system_writeforFileDescriptorandSocket(#14626, thanks @straight-shoota) - (files) Drop unused slice parameters of
#evented_*methods (#14627, thanks @straight-shoota) - (networking) Refactor use
IO#read_byteinstead of#read_charinHTTP::ChunkedContent(#14548, thanks @straight-shoota) - (runtime)
Threadowns its current fiber (instead ofCrystal::Scheduler) (#14554, thanks @ysbaddaden) - (runtime) Use
Fiber#enqueue(#14561, thanks @ysbaddaden) - (runtime) Add
Crystal::EventLoop.current(#14559, thanks @ysbaddaden) - (runtime) Add
Fiber.suspend(#14560, thanks @ysbaddaden) - (runtime) Remove
OverlappedOperation#synchronous(#14663, thanks @straight-shoota) - (runtime) Rename
Crystal::IocptoCrystal::IOCP(#14662, thanks @straight-shoota) - (runtime) Unify
EventLoop.create(#14661, thanks @straight-shoota) - (serialization) Replace
typedeclarations for void pointers withaliasinlibxml2(#14494, thanks @straight-shoota) - (serialization) Refactor
JSON::Any#sizeto use two branches instead of three (#14533, thanks @meatball133) - (specs) Move
Speccontext state intoSpec::CLI(#14259, thanks @HertzDevil) - (system) Update
WinError#to_errno(#14515, thanks @HertzDevil) - (system) Rename
Crystal::System.print_error(fmt, *args, &)toprintf(#14617, thanks @ysbaddaden) - (system) Refactor
Crystal::System.retry_with_buffercalling#to_slice(#14614, thanks @straight-shoota) - (system) Extract system implementation of
UNIXSocket.pairasCrystal::System::Socket.socketpair(#14675, thanks @ysbaddaden) - (system) Remove calls to
Pointer.new(Int)(#14683, thanks @straight-shoota) - (system) Cleanup for
IOCP::OverlappedOperation(#14723, thanks @straight-shoota) - (system) Refactor
IOCP::OverlappedOperationinternalizehandleandwait_for_completion(#14724, thanks @straight-shoota)
compiler
- (codegen) Add
Program#size_tandTarget#size_bit_width(#14442, thanks @ysbaddaden) - (parser) Replace
Crystal::Select::WhenwithCrystal::When(#14497, thanks @HertzDevil)
Documentation
stdlib
- (collection) Fix doc for
Set#proper_superset_of?(#14516, thanks @meatball133) - (collection) Fix result formatting in code example for
Indexable#[]?(#14721, thanks @meatball133) - (concurrency) Fix example for
WeakRefby removingref.valuecall (#10846, thanks @hugopl) - (networking) Improve API docs for
Socket#send(#14638, thanks @straight-shoota) - (networking) Add documentation for
HTTP::WebSocket#stream(#14537, thanks @meatball133) - (numeric) Add documentation for complex methods inside Number (#14538, thanks @meatball133)
- (runtime) Add documentation for standard streams blocking behaviour (#14577, thanks @straight-shoota)
- (serialization) Fix docs for
CSV::Builder#row(&)(#14736, thanks @philipp-classen) - (system) [breaking] Undocument
IO::Evented(#14749, thanks @straight-shoota) - (system) Fix code example for
Process.on_terminate(#14798, thanks @philipp-classen) - (text) Fix docs for
Char#ascii_number?stating wrong minium base (#14521, thanks @meatball133) - (text) Enhance documentation for regex options
NO_UTF_CHECK(#14542, thanks @straight-shoota)
Specs
stdlib
- Remove incorrect uses of
describe(#14757, thanks @HertzDevil) - (files) Add spec for
Compress::Gzip::Writerwithextra(#14788, thanks @straight-shoota) - (runtime) Add specs for
Pointer::Appender(#14719, thanks @straight-shoota) - (text) Add test helper for
normalize/regex_spec(#14545, thanks @straight-shoota)
Infrastructure
- Changelog for 1.13.0 (#14712, thanks @straight-shoota)
- Update previous Crystal release 1.12.1 (#14480, thanks @straight-shoota)
- Highlight regression bugfixes in changelog (#14474, thanks @straight-shoota)
- Write release version to
src/VERSIONinupdate-changelogandrelease-update(#14547, thanks @straight-shoota) - Fix
shell.nixusellvmPackages.bintoolswith wrapper for rpath config (#14583, thanks @straight-shoota) - Add
src/SOURCE_DATE_EPOCHto release tree (#14574, thanks @straight-shoota) - Update distribution-scripts (#14562, thanks @straight-shoota)
- Update distribution-scripts (#14594, thanks @straight-shoota)
- Use
boehmgcpackage from nixpkgs inshell.nix(#14591, thanks @straight-shoota) - Simplify LLVM dependency in
shell.nix(#14590, thanks @straight-shoota) - Fix nixpkgs
pkg-configname inshell.nix(#14593, thanks @straight-shoota) - Update previous Crystal release 1.12.2 (#14647, thanks @straight-shoota)
- Update distribution-scripts (#14648, thanks @straight-shoota)
- Update distribution-scripts (#14714, thanks @straight-shoota)
- Update distribution-scripts (#14776, thanks @straight-shoota)
- Fix changelog generator increase topic priority for
infrastructure(#14781, thanks @straight-shoota) - Remove
SetShouldExitin Powershell wrapper (#13769, thanks @straight-shoota) - (ci) Run
primitives_specwith the interpreter on CI (#14438, thanks @HertzDevil) - (ci) Add LLVM 18 to LLVM CI (#14565, thanks @HertzDevil)
- (ci) Update to Ruby 3 in macOS circleCI runner (#14777, thanks @straight-shoota)
- (ci) Distribute
shards.pdbon Windows (#14415, thanks @HertzDevil) - (ci) Drop Windows CI workaround for 1.12.0-dev (#14483, thanks @HertzDevil)