Releases: crystal-lang/crystal
Releases · crystal-lang/crystal
Release list
1.21.0
Breaking changes
stdlib
- (runtime) Release: Execution Contexts (#17100, #17104, thanks @ysbaddaden)
- (text) Disable automatic fallback to legacy
PCRE(#16924, thanks @straight-shoota)
Features
lang
- Add
%Wpercent string array literals with interpolation (#16919, thanks @straight-shoota) - (macros) Add
TypeNode#all_methodsthat includes the type's ancestor's methods (#16902, thanks @Blacksmoke16)
stdlib
- (cli) Align long-only options in OptionParser help (#16914, thanks @kojix2)
- (collection) Make
Channel(T)anIterator(T)(#16916, thanks @jgaskins) - (crypto) Add support for OpenSSL 4.0 (#16839, thanks @straight-shoota)
- (crypto) Support OpenSSL 4.x DLLs on Windows MSVC (#17116, thanks @HertzDevil)
- (networking) [experimental] Add
Socket#sendfile(andCrystal::EventLoop::Socket#sendfile) (#16665, #17133, thanks @ysbaddaden, @straight-shoota) - (networking) Add
HTTP::WebSocket#receiveas a synchronous call (#16689, thanks @jgaskins) - (runtime) Add
Crystal::EventLoop::FileDescriptor#pread(#17068, thanks @ysbaddaden) - (runtime) Add
without_mainflag (#17074, thanks @kojix2) - (runtime) OpenBSD: use kqueue event loop by default (#17123, thanks @ysbaddaden)
- (serialization) Support nested
rootproperties inJSON::Field(#17016, thanks @tcoatswo) - (serialization) Add
URI::Params::Field(ignore:),ignore_serialize,ignore_deserialize(#17029, thanks @trypsynth) - (specs) Allow chaining
#should,#should_notexpectations (#17020, thanks @straight-shoota) - (system) Expose
Path#kind(#16917, thanks @Sija) - (system) Add splat overloads for
Process.capture,.runand.new(#16975, thanks @straight-shoota) - (system) Add
Process::Status.[]constructor (#17003, thanks @straight-shoota) - (text) Add
String#present?(#16930, thanks @Sija) - (text) Add
UUID.v6and.v8generators (#17010, thanks @trypsynth)
compiler
- (cli) Classify compiler exit reasons (#17028, thanks @straight-shoota)
- (debugger) Improve proc debug metadata (#16830, thanks @skuznetsov)
- (debugger) Emit debug metadata for constants and class vars (#16831, thanks @skuznetsov)
- (debugger) Improve LLDB collection formatters (#16832, thanks @skuznetsov)
- (parser) Add
ASTNode#inspect(#16699, thanks @straight-shoota) - (parser) Parse
MacroVarwith empty expressions:%var{}(#16772, thanks @straight-shoota) - (semantic) Split branches on
when Bar, Baz(#17072, thanks @straight-shoota)
tools
- (docs-generator) Improve wording in warning about doc generator without LibXML2 (#16926, thanks @kojix2)
Bugfixes
stdlib
- (cli) Fix summary wrapping condition in OptionParser (#16915, thanks @kojix2)
- (cli) Avoid
Process.execon Windows and explicitly spawn subprocess (#17049, thanks @straight-shoota) - (collection) Fix
Iterator#compact_mapwithEmptyIterator(#16928, thanks @straight-shoota) - (collection) Fix
Iterator#compact_mapwith non-nilable compactor proc (#16927, thanks @straight-shoota) - (concurrency) Fix swapped atomic orderings in
Sync::MUfast paths (#17063, thanks @stevegeek) - (llvm) Fix use line 0 for unknown debug location (#17013, thanks @straight-shoota)
- (networking) Fix
HTTP::Request.form_params?to recognizeContent-Typeandcharset(#16934, #16971, thanks @swsch, @straight-shoota) - (networking) Fix
HTTP::Clientto retry for connection recovery only (#16981, thanks @straight-shoota) - (networking) Disable transport read-ahead for Kernel TLS sockets (#17053, thanks @jage)
- (runtime)
Fiber::ExecutionContext::Monitorcompat with old Crystal releases (#17007, thanks @ysbaddaden) - (runtime)
EventLoop::IoUring#openmusn't setO_NONBLOCKwhen blocking (#17035, thanks @ysbaddaden) - (runtime) underperforming unlock conditions in
Sync::MU(#17070, thanks @ysbaddaden) - (runtime)
fdlock#try_close?must release ref after yielding to the block (#17089, thanks @ysbaddaden) - (runtime)
Fiber::ExecutionContext.current?(#17092, thanks @ysbaddaden) - (runtime) Refactor Win32 iocp evloop (#17101, thanks @ysbaddaden)
- (serialization) memory leak in
XML::Node#each_namespace(#17038, thanks @ysbaddaden) - (system) skip Windows registry MIME entries with an invalid Content Type (#17106, thanks @SAY-5)
- (text) Fix
IO::Encoder#writewhen operating on long strings (#16797, thanks @jgaskins)
compiler
- (cli) Remedy short-flag conflict for
crystal spec -p([#17062], thanks @straight-shoota) - (codegen) Fix codegen treating distinct lib
typealiases as the same type ([#16961], thanks @stakach) - (interpreter) Add interpreter
upcast_distinctforPointertoPointer([#16962], thanks @stakach) - (interpreter:repl) Fix auto-indentation in the REPL when typing classes. ([#16910], thanks @I3oris)
- (interpreter:repl) Fix interpreter multidispatch cache collision ([#16958], thanks @stakach)
- (parser) Fix lexing
MacroVarsyntax in literal (#16779, thanks @straight-shoota) - (parser) Fix parsing macro var without exps followed by macro expression ([#16879], thanks @straight-shoota)
- (parser) Fix parse parenthesized expression in block arg assignment ([#16894], thanks @straight-shoota)
- (parser) Do not merge nested
ExpressionandExceptionHandler([#16852], thanks @straight-shoota) - (parser) Fix parser silently ignoring
&(...),&[...],&{...}in assignment ([#16960], thanks @stakach) - (parser) Fix parser allow
/and//immediately afterself,nil,true,false([#16942], thanks @stakach) - (parser) Fix short block setter call end location ([#17039], thanks @Sija)
- (semantic) Fix freeze type of variable declared with
out([#16870], thanks @straight-shoota) - (semantic) Fix
lookup_matches_in_typeto reject partial matches ([#16867], thanks @straight-shoota) - (semantic) Fix location of double splat named tuple typenode entry locations ([#16889], thanks @Blacksmoke16)
- (semantic) Fix
sizeof,offsetofas generic type argument in inferred ivar type ([#16811], thanks @kojix2) - (semantic) Fix macro argument errors for path receiver calls ([#16923], thanks @kojix2)
- (semantic) Detect uninitialized ancestor ivars through macro_def initializers ([#16959], thanks @stakach)
- (semantic) Preserve
nil_if_read?across while cond filters ([#16963], thanks @stakach) - (semantic) Keep wider subclass observer when call owner narrows (#16947) ([#16990], thanks @stakach)
- (semantic) Symmetric
common_descendentfor two generic class types (#10831) ([#16999], thanks @stakach)
1.20.3
Bugfixes
stdlib
- (serialization) [security] add
max_nestingtoYAML::PullParser(#17107, thanks @ysbaddaden) - (serialization) [security] add alias vs anchor ratio check to
YAML::PullParser(#17109, thanks @ysbaddaden)
Refactor
stdlib
- (serialization)
YAML::PullParser: memoize anchor name (#17108, thanks @ysbaddaden)
Infrastructure
- Add changelog for 1.20.3 (#17110, thanks @ysbaddaden)
1.20.2
Bugfixes
stdlib
- (concurrency) [regression] Simplify
Sync::Mutex#synchronizeproc type constraints (#16904, #16937, thanks @ysbaddaden) - (runtime)
Range#sampleeventually loses randomness (#16909, thanks @ysbaddaden)
Infrastructure
- Changelog for 1.20.2 (#16945, thanks @straight-shoota)
1.20.1
Bugfixes
stdlib
- (crypto) Fix issues in OpenSSL Kernel TLS (#16888, thanks @ysbaddaden)
- (crypto) OpenSSL Kernel TLS support should be opt-in (#16897, thanks @ysbaddaden)
- (networking) [regression] Add
HTTP::Headers#to_jsonand#to_yaml(#16890, thanks @straight-shoota) - (runtime) [regression]
Range#sampleeventually loses randomness (#16853, thanks @ysbaddaden) - (runtime) don't parse debug sections from bare threads (#16877, thanks @ysbaddaden)
compiler
- (parser) [regression] Fix lexing macro delimiter state inside literals (#16892, thanks @straight-shoota)
tools
- (formatter) [regression] Revert "Refactor
Formattercode for simplification" (#16885, thanks @straight-shoota)
Refactor
stdlib
- (runtime) Refactor
Exception::CallStackfor better boundaries (#16896, thanks @straight-shoota)
Infrastructure
- Changelog for 1.20.1 (#16898, thanks @straight-shoota)
1.19.2
Security
stdlib
- (networking)
HTTP::Serveris no longer vulnerable to request smuggling (#16862, thanks @ysbaddaden)
Bugfixes
stdlib
- [regression]
Range#sampleeventually loses randomness (#16866, thanks @straight-shoota, @ysbaddaden)
Infrastructure
- Changelog for 1.19.2 (#16893, thanks @ysbaddaden)
- (ci) Drop
update: truefrommsys2/setup-msys(#16868, thanks @straight-shoota)
1.20.0
Security
stdlib
- (networking) Fix
HTTP::Serveris no longer vulnerable to request smuggling (GHSA-wqh5-7w63-pm68)
Features
lang
- (macros) Add
#selectand#rejecttoHashLiteralandNamedTupleLiteral(#16558, thanks @Blacksmoke16) - (macros) Refine error message for unsupported named arguments in macros (#16576, thanks @hahwul)
stdlib
- (cli) Add short option bundling for
OptionParser(#16770, thanks @Qard) - (crypto) Add Kernel TLS support to custom
OpenSSL::BIO(#16646, thanks @ysbaddaden) - (files) Add
IO#read_greedy(#16535, thanks @BlobCodes) - (files) Add
FileUtils#rm_f(#12832, thanks @zw963) - (files) Add
IO::PrefixSuffixBufferfor capturing truncated streams (#16774, thanks @straight-shoota) - (llvm) Support LLVM 22.1 and 23.0 (#16631, thanks @HertzDevil)
- (networking) Add
Sec-WebSocket-Protocolchecks toHTTP::WebSocket::Protocol(#16600, #16671, thanks @antondalgren, @straight-shoota) - (networking) Add support for
Sec-WebSocket-ProtocoltoHTTP::WebSocketHandler(#16574, thanks @antondalgren) - (networking) Add
HTTP::Response#content_typeand#content_lengthas convenient accessors (#16712, thanks @CTC97) - (networking) Detect
OAutherror in payload (#16634, #16828, thanks @jgaskins, @Sija) - (runtime) Add
Fiber::ExecutionContext::ThreadPool(#15885, #16750, thanks @ysbaddaden) - (runtime) Add
Pointer#align_upand#align_down(#16585, thanks @BlobCodes) - (runtime) Detach execution context scheduler from running thread during blocking syscall (#15871, #16679, thanks @ysbaddaden)
- (runtime) Forward API docs for properties in
recordmacro (#16172, #16834, thanks @Vici37, @ysbaddaden) - (runtime) Add
Crystal::Lock(#16768, thanks @ysbaddaden) - (runtime) Add io_uring event loop (linux) (#16264, thanks @ysbaddaden)
- (system) Use
FdLockon all targets (#16569, thanks @ysbaddaden) - (system) Add
Process.newwithargsinstead ofcommand, args(#16681, thanks @straight-shoota) - (system) Add
Process.run(args)withoutcommand(#16739, thanks @straight-shoota) - (system) Add
Process.run?(#16738, thanks @straight-shoota) - (system) Add
Process.capture(#16773, thanks @straight-shoota) - (text) Add
StringScanner#scan,#check, and#skipoverloads forInt(#16557, thanks @jneen) - (text) Add
StringScanner#peek_behind(#16593, thanks @jneen) - (text) Add convenience methods to
StringScanner(#16595, thanks @jneen) - (text) Improve cursor window format in
StringScanner#inspect(#16594, thanks @jneen)
compiler
- (cli) Prefer modern linker (
moldorlld) (#16696, thanks @straight-shoota) - (codegen) Add
@[TargetFeature]annotation (#16717, #16835, thanks @stakach, @ysbaddaden) - (parser) Parse
ProcNotationwith empty arg parenthesis:() ->(#16741, thanks @straight-shoota)
tools
- (docs-generator) Add
--base-pathforcrystal docs(#16091, thanks @matiasgarciaisaia)
Bugfixes
stdlib
- (compress) Fix decode gzip MTIME as
UInt32(#16730, thanks @kojix2) - (crypto) [breaking] OpenSSL sockets shouldn't flush on read (#16650, thanks @ysbaddaden)
- (crypto) Fix typo in digest.cr (#16808, thanks @kojix2)
- (files) Fix MIME.parse_media_type invalid character check (#16793, thanks @cuiweixie)
- (networking) [regression] Fix
HTTP::Headers#merge!to not wrap key (#16624, thanks @straight-shoota) - (networking) Fix
forward_missing_toinHTTP::Headers(#16637, thanks @straight-shoota) - (networking) Fix
Socket::IPAddressIPv4 address in IPv6 with zone identifier (#16813, thanks @straight-shoota) - (numeric) Fix
Indexable#range_to_index_and_countwith unsigned integers (#16597, thanks @jneen) - (numeric) [regression] Fix
Float32#absto returnFloat32(#16655, thanks @straight-shoota) - (numeric) Fix signedness in GMP FFI bindings (#16799, thanks @kojix2)
- (runtime) Rename filename to path in WASI
EventLoop#open(#16636, thanks @kojix2) - (runtime)
Thread.sleepis invalid when duration >= 1 minute (#16629, thanks @ysbaddaden) - (runtime) Fix typos in ELF reader (#16668, thanks @kojix2)
- (runtime) don't terminate thread on Windows/IOCP (#16680, thanks @ysbaddaden)
- (runtime)
Sync::ConditionVariablecan hang forever (#16677, thanks @ysbaddaden) - (runtime) Fix
Pointer#to_swith lib typedefs (#16687, thanks @straight-shoota) - (runtime) Fix race condition in
Process#waiton Windows (#16766, thanks @ysbaddaden) - (serialization) call
xmlFreefor string pointer fromxmlNodeGetContent(#16688, thanks @toddsundsted) - (serialization) Fix sequence_end_event_initialize return type (#16803, thanks @kojix2)
- (system) Fix
Dir.globmatching wildcard with dot directory (#16604, thanks @straight-shoota) - (system) Lenient
Fiber.currentaccess on segfault handler (#16612, thanks @bcardiff) - (system) [breaking] Fix
Process#waitto not close@inputbefore waiting (#16620, #16638, thanks @straight-shoota, @ysbaddaden) - (system) Fix
System.cpu_countreturnsInt32(#16648, thanks @straight-shoota) - (system) Fix
Process.new(args)etc. supportEnumerable(String)args (#16784, thanks @straight-shoota) - (text) Fix
String#scanzero-width matches with multibyte characters (#16684, thanks @error256) - (text) Fix PCRE2 FFI type declarations (#16804, thanks @kojix2)
- (text) Fix blink_fast reset code (#16806, thanks @kojix2)
compiler
1.19.1
Bugfixes
stdlib
- (concurrency) [regression] Fix kqueue timer duration calculation (#16581, thanks @skuznetsov)
- (concurrency) [regression] time calculations in IOCP and Monitor thread (#16583, thanks @ysbaddaden)
Infrastructure
- Changelog for 1.19.1 (#16590, thanks @ysbaddaden)
1.19.0
Breaking changes
stdlib
- (crypto) Require OpenSSL 1.1.1+ or LibreSSL 3+ (#16480, thanks @ysbaddaden)
Features
lang
- (macros) [breaking] Add compiler flag values (#16310, thanks @straight-shoota)
- (macros) Add yielding variant of
StringLiteral#gsub(#16378, thanks @Blacksmoke16) - (macros) Support
StringLiteral#split(RegexLiteral)(#16423, thanks @HertzDevil) - (macros) Add
StringLiteral#match(#16464, thanks @HertzDevil) - (macros) Make all overloads of
ArrayLiteral#[]returnnilon out of bounds (#16453, thanks @HertzDevil)
stdlib
- (collection) Add
NamedTuple#reverse_merge(#16229, thanks @andrykonchin) - (collection) Pad
Hash#inspect,Tuple#inspectbefore{from first element (#16245, thanks @andrykonchin) - (collection) Add
Set#map!(#16271, thanks @andrykonchin) - (collection) Add
Hash#transform_keys!(#16280, thanks @andrykonchin) - (collection) Enhance error message for
Hash#[]when key is wrong type for default block (#16442, thanks @Blacksmoke16) - (concurrency) Add
Sync::MutexandSync::RWLock(#16399, thanks @ysbaddaden) - (concurrency) Add
Sync::ConditionVariable(#16440, thanks @ysbaddaden) - (concurrency) Import
Sync::ExclusiveandSync::Shared(#16487, thanks @ysbaddaden) - (crypto) Add
OpenSSL::SSL::Context::Server#on_server_namefor SNI (#16452, #16525, thanks @carlhoerberg, @straight-shoota) - (networking) Loosen type restrictions in
StaticFileHandlerhelper methods fromFiletoIO(#16238, thanks @andrykonchin) - (networking) Add
IPSocket#ipv6_only(#16347, thanks @stakach) - (networking) Expose
flagshint forgetaddrinfo(#16528, thanks @stakach) - (numeric) Add
Int.from_digitsas inverse ofInt#digits(#16237, #16566, thanks @andrykonchin, @ysbaddaden) - (numeric) Add
BigInt.from_digits(#16259, thanks @HertzDevil) - (numeric) Add
Int#tdivmod(#16258, thanks @andrykonchin) - (runtime) Add
Proc#[]as alias to#call(#16220, thanks @andrykonchin) - (runtime) Add
#unshift,#popand#pop?toCrystal::PointerLinkedList(#16287, thanks @ysbaddaden) - (runtime) Add
Random.next_booland.next_int(#16297, thanks @ysbaddaden) - (runtime) Add
Random#splitand#split_internalAPI for splittable PRNGs (#16342, #16495, thanks @ysbaddaden) - (runtime) Add
Pointer#fill(#16338, thanks @straight-shoota) - (runtime) Add
Crystal::PointerLinkedList#first?(#16400, thanks @ysbaddaden) - (runtime) Ensure single reader and writer to system fd on Unix (#16209, thanks @ysbaddaden)
- (runtime) Protect
Box.unboxfrom dereferencing null pointer (#16514, thanks @straight-shoota) - (runtime) Register execution context schedulers with the event loop (#16519, thanks @ysbaddaden)
- (runtime) Add
Fiber::ExecutionContext::Scheduler.current?(#16521, thanks @ysbaddaden) - (runtime) Move execution context event loop lock to each event loop (#16520, thanks @ysbaddaden)
- (serialization) Support deserialization of YAML anchors of value types (#16186, thanks @HertzDevil)
- (serialization) Add end locations to scalars and aliases in
YAML::Nodes.parse(#16187, thanks @HertzDevil) - (serialization) Set
JSON::SerializableError#attributewhen appropriate (#16158, thanks @spuun) - (serialization) Support large JSON files (#16211, thanks @RX14)
- (serialization) Add
YAML::Nodes.parse_all(#16247, thanks @HertzDevil) - (specs) Rescale execution context in spec runner with
CRYSTAL_WORKERS(#16444, #16471, thanks @straight-shoota, @ysbaddaden) - (system) Add
Process.debugger_present?for Windows and Linux (#16248, thanks @HertzDevil) - (system) Implement
execvpe_impl(#16322, #16344, thanks @straight-shoota) - (system) Add
::exit(Process::Status)(#16436, thanks @straight-shoota) - (system) Standardize system error codes for
File::Error(#16024, thanks @straight-shoota) - (system) Add
Path#relative?(#16473, thanks @Sija) - (text) PCRE2: use thread local for jit stack and match data (#16175, thanks @ysbaddaden)
- (text) Support 0X, 0O, 0B prefixes in string to integer conversion (#16226, thanks @andrykonchin)
- (text) Add
String#each_lineparameterremove_empty(#16232, thanks @andrykonchin) - (time) Add
weeksparameter toTime::Span.new(#16208, thanks @Sija) - (time) Treat GMT as a legacy alias of UTC (#16292, thanks @straight-shoota)
- (time) Add
/etc/zoneinfoto zoneinfo lookup paths (#16463, thanks @straight-shoota) - (time) Add support for
$TZDIR(#16466, thanks @straight-shoota) - (time) Add
Time::Instant(#16490, thanks @straight-shoota) - (time) [breaking] Adjust monotonic clocks to include suspended time with precision (#16516, thanks @straight-shoota)
compiler
- (codegen) Build compiler with
-Dexecution_context(#16447, #16502, thanks @ysbaddaden, @straight-shoota) - (interpreter) Support
->LibX.fun_namein the interpreter (#16194, thanks @ysbaddaden) - (semantic) Add error message to
CrystalPath::NotFoundError(#16365, thanks @willhbr) - (semantic) Retain original location for errors in
included,extendedhooks (#13261, thanks @Blacksmoke16)
tools
- (docs-generator) Add optional sanitizer to docs generator (#14646, #16251, thanks @nobodywasishere, @straight-shoota)
Bugfixes
lang
- (macros) Fix nested sigil delimiter parsing inside macros (#16266, thanks @HertzDevil)
stdlib
- Fix
OptionParsersubcommand help to respect customsummary_indent([#16334], thanks @kojix2) - (collection) Fix
Hashmethods to retaincompare_by_identityflag ([#16356], thanks @andrykonchin) - (collection) Fix Hash methods and retaining default value ([...
1.18.2
Bugfixes
stdlib
- (files) [regression] Revert type restriction for
IO#read_bytes(#16231, thanks @straight-shoota) - (runtime) Fix
Fiber::ExecutionContext.default_workers_countto avoid taking into account unsupported values (#16227, thanks @Sija)
Infrastructure
- Changelog for 1.18.2 (#16243, thanks @matiasgarciaisaia)
1.18.1
Bugfixes
stdlib
- (networking) [regression] Revert adding type restrictions on
HTTP::WebSocket#sendetc. (#16218, thanks @straight-shoota)
compiler
- (parser) [regression] Fix allow space after base type in enum def (#16217, thanks @straight-shoota)
Infrastructure
- Changelog for 1.18.1 (#16224, thanks @matiasgarciaisaia)