www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - [SAOC 2026] ImportC Weekly Update #1

reply Niyati Jain <niyati.jainn15 gmail.com> writes:
Hello everyone,

I'm Niyati, working on ImportC: Zero-Wrapper Integration for 
Production-Grade C Libraries for SAOC 2026, mentored by Nicholas 
Wilson. This is my first weekly update, covering the first week 
of Milestone 1. My proposal is at [1] and the finalized 
milestones at [2].


it's about `byte` being a D keyword, but that's wrong, it's a 
local or param not hiding a typedef of the same name, which is 
what actually breaks the parse on Windows. Also worked on the two 

and `__builtin___clear_cache`.

Bigger find while trying to package sljit for dub: `dmd -lib` on 
a C file produces a library that doesn't link, so static 
functions/vars in it become unreachable. It's not sljit-specific, 
but would hit any C library packaged for dub.

All three up as draft PRs:
https://github.com/dlang/dmd/pull/23902
https://github.com/dlang/dmd/pull/23903
https://github.com/dlang/dmd/pull/23904

Other findings: sljit's cpuid still needs GNU inline asm support 
on Linux, its Windows intrinsics need a couple more fixes, sqlite 

so stdint's `INT64_MAX`/`UINT64_MAX` don't work from D on Linux.

Best,
Niyati

[1] 
https://gist.github.com/niy-ati/9d2c587a818711f3fc2f59e962d50ebc
[2] 
https://gist.github.com/niy-ati/4d74f2d77bacc2f2f06f3c249c15d075
Sep 22
parent reply Niyati Jain <niyati.jainn15 gmail.com> writes:


This week I fixed the `-lib` static symbol linking bug and got 
the CI matrix for the zero-wrapper packages running end to end.

**`-lib` static symbol linking:** a C file built with `dmd -lib` 
couldn't link whenever a non-static function referenced a 
`static` variable or function elsewhere in the same file, 
`undefined reference`, despite both being in the same translation 
unit.
so fixed this with one condition: a C file no longer gets split 
into per-function object pieces under `-lib`, since it's one 
translation unit regardless. Added a dshell test that builds a 
library and links a consumer against it end to end.

**CI matrix for the zero-wrapper libraries:** forked 
Emmankoko/importC and added packages for sljit, zlib, curl, SDL3 
and a workflow that builds dmd from the fix branches and runs 
each package's example against it.

The real obstacle was SDL3. I'd built it locally and vendored the 
binary, but CI failed with:

 `undefined reference to '__isoc23_strtoul GLIBC_2.38'`
which turned out my machine's glibc is newer than the CI runner's, glibc 2.38 introduced versioned symbols for strtol/scanf to support C23's binary literals, and Ubuntu 22.04's glibc 2.35 predates that. SDL3 isn't in apt on 22.04 and upstream ships no Linux binaries at all, so it now builds from source inside the job instead of shipping a binary that only worked on my machine. zlib and curl are properly verified: a real byte-for-byte compress/decompress round trip for zlib, and a real libcurl version check with option set and readback for curl with both passing against the patched compiler. **Status:** - `-lib` fix: https://github.com/dlang/dmd/pull/23904 - CI matrix: https://github.com/niy-ati/importC/actions/runs/36693779094 - ImportC: https://github.com/niy-ati/importC Still blocked on publishing the sljit dub package as it needs since `dub add sljit` would otherwise break on a stock compiler.
Sep 30
parent reply Mike Shah <mshah.475 gmail.com> writes:
On Wednesday, 30 September 2026 at 12:46:12 UTC, Niyati Jain 
wrote:


 This week I fixed the `-lib` static symbol linking bug and got 
 the CI matrix for the zero-wrapper packages running end to end.

 [...]
Very cool to see the testsuite here getting extended with SDL3.4+ and other popular packages. I was also able to use importC most recently to download lua 5.5 (https://www.lua.org/download.html) and get it to work with importC on the first try! Thank you for continuing this work
Sep 30
next sibling parent Emmanuel <emmankoko519 gmail.com> writes:
On Thursday, 1 October 2026 at 02:20:03 UTC, Mike Shah wrote:
 On Wednesday, 30 September 2026 at 12:46:12 UTC, Niyati Jain 
 wrote:


 This week I fixed the `-lib` static symbol linking bug and got 
 the CI matrix for the zero-wrapper packages running end to end.

 [...]
Very cool to see the testsuite here getting extended with SDL3.4+ and other popular packages. I was also able to use importC most recently to download lua 5.5 (https://www.lua.org/download.html) and get it to work with importC on the first try! Thank you for continuing this work
Oh great to hear !!!!
Oct 01
prev sibling parent reply Niyati Jain <niyati.jainn15 gmail.com> writes:
On Thursday, 1 October 2026 at 02:20:03 UTC, Mike Shah wrote:
 Very cool to see the testsuite here getting extended with 
 SDL3.4+ and other popular packages. I was also able to use 
 importC most recently to download lua 5.5 
 (https://www.lua.org/download.html) and get it to work with 
 importC on the first try! Thank you for continuing this work
Thanks, I'm glad it's useful!
Oct 01
parent reply Emmanuel <emmankoko519 gmail.com> writes:
On Thursday, 1 October 2026 at 11:22:22 UTC, Niyati Jain wrote:
 On Thursday, 1 October 2026 at 02:20:03 UTC, Mike Shah wrote:
 Very cool to see the testsuite here getting extended with 
 SDL3.4+ and other popular packages. I was also able to use 
 importC most recently to download lua 5.5 
 (https://www.lua.org/download.html) and get it to work with 
 importC on the first try! Thank you for continuing this work
Thanks, I'm glad it's useful!
I have seen your fork and it’s progressing well. Do well to maybe get them request merge so we can see if can get it the Dlang repository!! When we have a lot of the libs tested.
Oct 01
parent Niyati Jain <niyati.jainn15 gmail.com> writes:
On Thursday, 1 October 2026 at 12:35:30 UTC, Emmanuel wrote:

 I have seen your fork and it’s progressing well. Do well to 
 maybe get them request merge so we can see if can get it the 
 Dlang repository!! When we have a lot of the libs tested.
Thanks Emmanuel, zlib, curl, and SDL3 are properly tested and passing in CI now. sljit works too but is Windows only for now (ImportC doesn't support the GNU inline asm its cpuid detection needs on Linux), and sqlite is still blocked on a couple of Milestone 2 issues. Once those are in better shape I'll open a PR back to your repo.
Oct 02