Repository navigation
Abla 0.2.68
Behaviour changes and migration (read first)
- Dependencies no longer get your compile-time grants. Before, a program's
compile-time grants were one set: what any module asked for with
#compilerGrant, limited by the root manifest'scompileCapabilities. A
dependency could therefore read the compiler's environment, files or network,
or run native code in the compiler, whenever the root granted that to its own
code. Now each package gets only what it asks for, what its ownabla.toml
declares and what the root allows it.trusted.nativereaches a dependency
only through a line in the root's[dependencyCompileCapabilities]table, and
only whileabla.lockpins that package's digest. New errors:
E_COMPILE_CAPABILITY_UNDECLARED,E_PACKAGE_CAPABILITY_UNPINNED. A module
imported by path from outside your tree counts as your code; a copy of a
dependency (the package cache,.abla/packages/,vendor/<name>/) counts as
that dependency's. This closes v0.2.67's known issue "dependencies inherit
compile-time grants". (71ade34, #1142 F1)- If a dependency's compile-time code now fails with
E_COMPILE_CAPABILITY_UNDECLARED, the dependency must declare the
capability in its ownabla.toml; fortrusted.native,process.io,
network, orfilesystem.readof absolute paths, also add it to your
[dependencyCompileCapabilities]and lock the package. process.ioandnetworkare named-only too, liketrusted.native: a
dependency that declares them runs processes or opens connections in the
compiler only with a line for it in[dependencyCompileCapabilities]. A
dependency'sfilesystem.readwithout a name reads only inside its own
tree; an absolute path outside it isE_BUILD_PATH_OUTSIDEunless the root
namesfilesystem.readfor that package. (49486f8)
- If a dependency's compile-time code now fails with
- JWT tokens without
expare refused.JwtKeySet.verifycheckedexp
only when a token had one, so a signed token without it never expired. Now
it fails with "expiration not found in token"; pass
JwtOptions(requireExpiration = false)for issuers that bound tokens another
way. (c4ce4bd) - Vendored packages are checked against the lock.
vendor/<name>/was
trusted by its.abla-revision/.abla-digestmarker files alone, so an
edited vendored file built unnoticed. Its file tree must now hash to the
digestabla.lockrecords; otherwiseE_PACKAGE_VENDOR_DIGEST_MISMATCH
names the package. This closes v0.2.67's known issue "vendored packages are
trusted by their markers". (6899170)
Known issue
await task { ... }orawait thread { ... }, with the task or thread written directly afterawait, doesn't keep it alive while it runs: a garbage collection inside its body can free it, and the program crashes or uses freed memory. Until v0.2.77, bind the task or thread to avalfirst (val t = task { ... }; await t). Fixed in v0.2.77.- Reading a very long number as a floating-point value (
parseFloat, JSON'sasF64orreadNumber,strtod) takes time quadratic in its digits, so one request carrying a JSON number of about a megabyte can keep a server busy for minutes. Until v0.2.77, reject or truncate numbers longer than a few hundred digits before converting them, or keep request bodies small. Fixed in v0.2.77. - A dependency's compile-time transform, or its custom
$syntax handler, can run compile-time code with your project's own compile-time grants (process, environment, file writes, network, native code), not the dependency's. Until v0.2.74, don't authorize those capabilities for your own project when you build with dependencies you don't trust. Fixed in v0.2.74, except for the case below. - A compile-time
#site that a dependency's custom$syntax handler builds into your file runs with your project's own compile-time grants (process, environment, file writes, network, native code), not the dependency's. Until v0.2.78, don't authorize those capabilities in a file that uses$syntax from a dependency you don't trust. Fixed in v0.2.78. ablac package updatecan run a dependency's compile-time import-provider code with your project's own compile-time grants (process, file writes, network), before the dependency is locked. Until v0.2.74, don't authorize those capabilities for your own project while you update dependencies you don't trust. Fixed in v0.2.74.- Ordinary code can write fields that the standard library's native buffers and cells rely on (
closedof aNativeByteBuffer,NativeI64CellorNativePointerCell), so safe code can reach memory it doesn't own. Until v0.2.79, don't write those fields outside the standard library, and check that your dependencies don't. Fixed in v0.2.79. - A dependency's custom
$syntax handler can have code of its own run at compile time with the grants of your file that uses the syntax (process, environment, file writes, network, native code). Until v0.2.79, don't authorize those capabilities in a file that uses$syntax from a dependency you don't trust. Fixed in v0.2.79. - A dependency's prepared copy in
.abla/packages/is trusted by its marker files without checking its contents againstabla.lockin single-file builds, and in project builds that also have a vendored copy, so a changed copy (from a restored CI cache, or committed next to a reviewed lock) is built as is. Until v0.2.79, delete.abla/packages/before building when it may come from somewhere you don't control (it is fetched again and checked), and don't cache or commit it. Fixed in v0.2.79. - The HTTP clients (
HttpClient.send,HttpAsyncClient, and the WebSocket TLS client's upgrade request) write the method, path and header values they are given without checking them, so a line break in a value that came from user input can add headers or a second request. Until v0.2.79, percent-encode user input in paths and queries (percentEncode) and refuse CR, LF and other control bytes in header values before passing them to a client. Fixed in v0.2.79. - The static Linux compiler's own hardening was weaker than a glibc build's: its stack-protector canary was a fixed value on AArch64, its
_FORTIFY_SOURCEbuffer checks did nothing, andrealpathcould overrun its caller's buffer with a very deep working directory plus a long relative path. None of these is reachable alone; each makes a separate overflow bug in LLVM or lld easier to exploit when compiling code you don't trust. On AArch64 itsprintffamily also read arguments from the wrong place, so text that LLVM formats could show stack contents or crash the compiler. Until v0.2.79, on x86-64 Linux the dynamic compiler asset (ablac-dynamic-x86_64-linux, built on glibc) avoids them; elsewhere, build code you don't trust from a shallow directory. Fixed in v0.2.79.
Known issue (v0.2.67 and v0.2.68): compile-time remove() and moveTo() on a symbolic link act on its target. In compile-time code with filesystem.write, p.remove() on a link deletes the file it points to (and returns true), p.moveTo() moves that file, and p.isSymbolicLink() reports on the target, so it is false for a link to a file. The target must still be inside your project; nothing outside it is affected. Until v0.2.69, don't remove or move links from compile-time code. Run-time abla/fs is not affected.
- On macOS (arm64 and x86-64),
ablac analyze --stdioas driven by abla-lsp and editor integrations ends with SIGBUS on the first parsed module. This affects v0.2.62 through v0.2.68. Workaround: setABLA_ANALYSIS_FREEZE=0in the language server's environment. Fixed in v0.2.69. - On Windows x64,
ablac buildwith the build cache on (the default) can stop with "unsupported Linux system call 326" (exit status 70) when it copies a cached object. Workaround: pass--no-cache. Fixed in v0.2.70. - Programs built for Windows that use network sockets can crash, or read memory past a buffer, when a connection is reset or a socket read fails or times out. A remote peer can cause this. There is no workaround; rebuild with v0.2.70.
- On Windows, a program (including the Windows compiler) that starts another program by a bare name could run a file of that name from the current directory, so building an untrusted project with the Windows compiler could run code from it. Starting a .bat or .cmd file with untrusted arguments could run other commands, and very long directory paths or process arguments could corrupt memory. Fixed in v0.2.70.
- On Linux and macOS, building an untrusted project can run a program from that project when a tool the compiler starts (a linker, a C compiler or an LLVM tool) is not on
PATH, or whenPATHhas an empty,.or relative entry. Keep everyPATHentry absolute and the tools installed when you build code you do not trust, or update to v0.2.71. Fixed in v0.2.71. - Android libraries built with the release (static) Linux compiler are generated as if for plain Linux on arm64, not for Android. They use native ELF thread-local storage instead of emulated TLS, so on Android 7 to 9 (API levels below 29) loading such a library can fail. They also use register x18, which Android reserves (on Android 9 and later it holds the shadow call stack), so a library may crash on any Android version. To work around it, set
ABLA_CODEGEN_INPROCESS=0and have LLVM'soptandllconPATH(or setABLA_LLVM_TOOLS): the compiler then runs them instead of its own code generation, and the library is built for Android. This affects v0.2.66 and later. Fixed in v0.2.71. - On Windows on ARM64 (aarch64-windows) only, a program that uses AES-GCM ends on its first call with "fatal signal: Windows exception 0xc000001d". That includes every TLS client and server, and anything using abla/crypto/aes: the CPU feature check reads a register Windows does not let programs read. There is no workaround in the program. Rebuild with v0.2.72. x86-64 Windows, Linux and macOS are not affected. (Found by the Windows ARM64 CI lane; no user has reported it.) Fixed in v0.2.72.
Highlights
- Browser compiler. The compiler's front end builds as a wasm32 module
without LLVM (compile-time code is interpreted), and runs in a page with the
project in/workand the standard library at/stdlib.make playground
(tools/build-playground.sh) builds it; each release ships it as a signed
asset,abla-playground-<version>.tar.gz, listed in SHA256SUMS. See
docs/playground.md. The page's compiler collects its garbage every 16 MiB of
growth (a test page holds 75 MB). (60e28d9..5f9010c, 1e746b5,
090a56f, #1138) $htmlattributes and serialization. Computed attributes
(name={value}), boolean attributes and{array<HtmlAttribute>}groups
(ablaHtmlAttribute,ablaHtmlBooleanAttribute);Html.render()escapes
text and dynamic attribute values, drops invalid attribute names, writes void
elements without a closing tag, and insertsablaHtmlRawmarkup verbatim. An
unquoted literal attribute value is a compile error. URL, CSS and script
policies stay with the application. See docs/subparsers.md. (958a3bf, #1166)- OCSP stapling in the TLS client (opt-in).
abla/crypto/ocspchecks a
stapled OCSP response:tlsClientConfigWithRevocation(config, policy, tlsOcspVerifier(...)). Policy 1 uses a staple when the server sends one (a
revoked certificate fails withcertificate_revoked, an invalid or stale
response withbad_certificate_status_response; no staple passes unless
the certificate is must-staple); policy 2 requires a good staple. TLS 1.3
per-certificate staples and TLS 1.2CertificateStatusare both read. The
default stays 0 (no check); there is no fetching, no CRLs and no server
side.ocspRequestDerbuilds the request an application can POST to a
responder itself. Limits are in docs/tls.md. (4419c3c, 249fa92) - Reading a dependency's files at compile time.
compilerReadDependencyFile(name, relativePath)(abla/compiler) returns
one file of a direct dependency's locked tree, under the calling site's
filesystem.readgrant;abla.lockmust pin the dependency by digest, and
the bytes come from that tree whichever copy (vendored or prepared) is on
disk. Nothing is fetched. A dependency's own compile-time code needs
filesystem.readnamed for it in[dependencyCompileCapabilities]to use
it. Before, projects copied such files (headers, schemas) into their own
tree. See docs/compile-time.md. (55371f2, c1a439e, 9f30ef6, #1175) --wasm-names.build --wasm-names(orABLA_WASM_NAMES=1) keeps a
name section with readable function names in a release WebAssembly module,
so stack traces and profilers show them. (9a97e12)- Releases are signed only after review. The signing key now lives only in
the GitHubreleaseenvironment: a release run must be dispatched from
master and approved by the maintainer before it can sign. (74a4c98) - Abla on Windows. Each release now ships
abla-toolchain-x86_64-windows.zip:bin/ablac.exewith
bin/llvm-objcopy.exe(for--backtrace) and the standard library, a
self-contained toolchain that needs no Visual Studio, SDK or C runtime DLL.
It builds and runs console programs and multi-module projects, with
--backtrace, from any install path; every release run checks that on a
GitHubwindows-latestrunner with only System32 on thePATH. Other
standard library areas (threads, files, sockets, child processes) are not
yet covered by release checks on Windows. The zip is inSHA256SUMS, the
signature and the attestation. A compile-time call that runs past its time
limit is stopped on Windows too, by a watchdog thread.
(3a3368e, 74721f6) - Regex search budget.
re.findWithin(text, maximumSteps, start = 0)
limits one search and returnsRegexSearchMatch,RegexSearchMissor
RegexSearchExhausted, so a pattern or text you don't control can't make a
search run for minutes. Ordinary searches are unchanged. See
docs/stdlib/regex.md. (af4aa4c, e735d3b, #1181)
Fixes
-
Packages: an import inside a dependency no longer follows a symbolic
link out of the package. A git dependency withleak.ab -> /abs/file(or
../../file) had that file of your machine read as Abla source and echoed
in diagnostics. Module resolution refuses a dependency module reached through
a link whose target is absolute or climbs above the package root, and names
the link; links inside the package still work. (806de3c) -
Packages: a vendored dependency's names are visible under strict imports
(they failed withE_NAME_NOT_IMPORTEDbecause its entry path was not
normalized), so vendored projects no longer needvisibility = "flat".
(e32125e) -
Packages (macOS): a fetched git dependency whose tree has two paths that
differ only in letter case collapsed them to one file on a case-insensitive
file system, yet its digest was locked as if the checkout matched the tree.
The fetch now requires the checkout to be the revision's exact tree, else
E_PACKAGE_DIGEST_MISMATCH. (1a710da) -
HTTP/1: the blocking reader (
serveHttp,serveHttpOnce) refuses a
request line that is not a request (empty or non-token method, no HTTP/1.x
version, a space in the target), as the event servers do. All servers now
require the method to be a token (RFC 9110 §9.1);]ETandPOS;Twere
accepted before. (de35852) -
Regions: a Mutex, task, thread or generator created inside a region is a
region object, so storing it in a variable that outlives the region is now
region.escapeat compile time. Before, the handle's memory was released at
the region's end while the variable still referred to it (use after free).
(cfae818) -
Compile-time evaluation: interpolating an object into a template through
anynow panics as compiled code does, instead of producing empty text.
(59981aa) -
Tar:
tarReadand the stream reader checked each new entry against
every earlier one, so an archive of many small entries took time growing
with the square of their count (16,000 empty files: 13 s; 128,000: about 15
minutes) within the caller's limits. Entries are now indexed; the same
conflicts are refused. (9393f98) -
Tar: an entry path with a backslash, a drive-letter component (
C:x,
a/b:c) or bytes that are not UTF-8 is refused asinvalid, as..is, so
joiningTarEntry.pathonto a directory can't escape it on Windows.
(0534e9c) -
X.509: e-mail name constraints (RFC 5280 §4.2.1.10: mailbox, host and
.domain) are checked. Before, every e-mail name under a name-constrained CA
was refused as uncheckable, so such client certificates could not be used.
(99ceda2) -
TLS server: a ClientHello with an empty
supported_versionsor ALPN
list, a body inearly_data, or a malformedstatus_requestis refused, as
OpenSSL and Go refuse it; they were read as absent before. (0899f7b) -
DNS (medium):
dnsExchangeand the async resolver accepted the first
datagram with a matching 16-bit ID from any source address, never checked
the question or the owner names of the answers, and used a fixed ID when the
random source failed. A reply now counts only from the queried server's
address and port and to the question asked (dnsReplyQuestionMatches);
other datagrams are ignored until a real reply or the timeout. Only records
owned by the query name or a CNAME chain from it are kept, and a failing
random source fails the exchange. (fd5a525) -
DNS: name decoding refuses a compression pointer loop, a pointer that
doesn't point backwards, a name without its terminating label, and a name
over 255 bytes. (fd5a525) -
WebSocket: the event server fails the connection (1002) when a data
frame starts a new message while a fragmented one is still open, as the
blocking reader does; before, the new frame silently replaced the partial
message. (e83fb87) -
WebSocket: the blocking reader no longer closes a connection when valid
frames arrive together in one read. (3e3327e) -
JWT: a JWKS RSA key whose
norehas a leading zero byte is refused
(RFC 7518 requires minimal length); a modulus of 250 zero bytes and a 64-bit
number passed the 256-byte size check and was usable as an RS256 key.
(056acbb) -
Docs:
regexCompileWithinbounds a pattern's size, not the time of a
search, which grows with pattern size times text length. (6c21495) -
package update: on Linux and macOS, Git reference lookups and fetches
have a 120-second deadline, so a server that accepts the connection and
never answers no longer hangs the update until Ctrl-C. Set
ABLA_PACKAGE_GIT_TIMEOUT_SECONDS(1 to 3600) to change it; a timeout is
E_PACKAGE_GIT_TIMEOUT, naming the operation, source and limit.
(289a92a, #1179) -
Compile-time paths: a project at the file system root (
/), or at a
Windows drive or share root, no longer refuses its own files; one helper now
decides every "is this path under that root" check. (8611638, #1160) -
Crypto: HMACs, RFC 6979 signatures (P-256, P-384) and Ed25519 wipe the
heap copies of a key they make (HMAC inputs and pads, RFC 6979's nonce
inputs, Ed25519's expansion); hashing public data costs the same as before.
Hash states in managed arrays and the caller's own copies are not covered
(docs/constant-time.md). (d484d43) -
Strict imports and markup subparsers: v0.2.67 could report
E_NAME_NOT_IMPORTEDfor plain text and tags inside a raw markup block
($mvcview,$html) after an earlier rewrite in the file shifted it, and
reported subparser spans at shifted positions. Fixed; spans and host uses are
reported in original file coordinates. (fd6b68a, fc6ef3b, #1178) -
Build cache: a warm cache could reuse output built with different
settings: compile-time evaluation limits and options, unused-import warnings,
or the Wasm code generation route and unit settings. A build that changed only
one of these could get the previous build's program or diagnostics. These
settings are now part of the cache key; a release object is also keyed by the
resolved LLVM tools that made it, and keeping the compiler's pre-optimization
bitcode always runs the front end.tools/test-build-cache-inputs.shchecks
every build flag andABLA_*setting against an uncached build.
(138d489, #1190) -
HTTP event servers (medium): the event servers joined each read to a
connection's buffer and framed all of it again, decoding a chunked body
from its start every time. A client sending a request in small pieces could
therefore cost CPU growing with the square of the request's size, stalling
the single-threaded server for every other connection. Reads now cost time
in proportion to their size inhttpEventServer,httpEventServerHandler,
httpEventServerNoEscapeHandlerand the HTTPS event server
(abla/http/event/tls, including the plain HTTP/1 connections it serves).
A chunk size line (with its extensions) or the trailers may no longer be
longer than the header limit. (8d24ca4, b4601e9, ea4d112, 98a5b12) -
WebSocket server (medium):
WebSocketServer(abla/websocket/server)
copied a connection's whole input on every read, so a frame sent in small
pieces could stall the server the same way. Reads that cannot complete the
frame being received are now held until they can. Theabla/websocket/event
server was not affected. (2f06b89)
Performance
- Parsed JSON objects with few fields allocate each field array and its backing storage together. The native JSON workload ran in 16.8% less time and made 4,096 fewer allocations per document. Its cold build took 5.8% more wall time. (a5213f7)
- Scalar table searches check the string bound once per search. The native FASTA benchmark at n=1,000,000 ran in 7.6% less wall time across eleven matched comparisons. (4d47fa4)
docs/performance.mdshows how to use allocation regions for short-lived trees. (a9eb1ae)- The front end looks up AST rewrites, STM conformance, and private generic templates through indexes. On a cold
--fastbuild of Abla One’s gallery, direct rewrite lookup cut median paired wall time 12.9% and peak RSS 23.7%. The generic-template index used 2.5% fewer instructions in a separate test of that build. (8195044, 78174af, de04d40) - IR lowering shares empty operand and text lists. When the compiler emitted LLVM IR for its own source with the default collector, its peak tracked heap fell from 578 MB to 510 MB. (773f439)
- The compiler releases its syntax trees and semantic tables after lowering, keeping the source locations needed for late errors. Across three self-compilation inputs, the peak heap retained after collection fell from 63–65 to about 49 bytes per source byte. (06519fd, #1182)
- Native
--emit-llvmstreams verified IR. On the compiler’s own source, three matched runs took a median 17.84 s, down from 19.06 s, and used 233 MiB less peak RSS. File and pipe output matched byte for byte. (d0b4e64, #1185) - The evaluator reuses uninitialized values and empty text. The forced-interpreter JSON-encoding run used to allocate about 8.9 million and 3.3 million of those objects, respectively. Table-based expression dispatch used 2.8% fewer instructions in a five-million-step playground Wasm replay of the same workload. (c2e0e4f, 1bfe572)
- Release WebAssembly builds start LTO at Clang O1 and skip Binaryen's optimizing inliner (Binaryen O3 and function ordering stay). A large game's full release build went from 119–153 s (depending on build order) to about 81 s. Skipping the inliner adds 3,383 bytes (0.04%); O1 removes about 22 KB. Frame times and the program's output are unchanged. (ad009aa, 4df39c6, #1189)
Toolchain
AndreBaltazar8/setup-abla@v1installs this release's Windows x64 toolchain on Windows x64 runners, and checks every download against the release's signed SHA256SUMS (releases from 0.2.67 on); a missing or bad signature fails the step. Windows ARM64 runners are not supported by the action yet.
Bootstrap convergence
Two fresh Linux builders bootstrapped the source of v0.2.68 (f9ec0852bfe3690a042ee9c95dfd00f5dbeab1d5) from different seeds and reached the same compiler:
- route A: v0.2.67 (
ablac-x86_64-linuxsha2561ad0c494de77596139c052b778bbafc3bfed329b801ef90a75b0a7f64808bc27) -> stage 1, 2, 3 - route B: v0.2.66 (sha256
1cc6b9f94dfcfed1c72f33c3e826c25f7bf251361308d11b9097b0cac9c7d8f6) -> the sources of v0.2.67 (36634a91818ab18a1173ef3ccfd1db0feef4fff1), twice -> stage 1, 2, 3 - canonical IR (raw, non-debug, pre-prune
--emit-llvm src/orc_main.abat/build/source): sha256c748ccb763b368fcabf9b97fc3c79a85dfa963c7ca6e76d97f4ab23ede946bd7 - stage 2 executable
fbe6ea8e9b389bc0c592185b030d86b45064a465de9bf7ba3ceddcc8d550b390, object7841654f1ef925c1e9a414a03d20175614506f8808e6c6c7bb4a28b6c8b496f8 - toolchain: environment
d00897b2d6cc51118a9495656126ec6b32b87504a2eb780e173bac4eec54f68b, closureb1872f918c677d4b376f11826949774047bafeac6c208592b89a05f2dc4640aa - run: https://github.com/AndreBaltazar8/ablac/actions/runs/45266819571
This is route convergence within one compiler lineage: it is not an independent implementation, and it does not exclude a seed compromise shared by both routes (docs/bootstrap.md).