Commit Graph

32 Commits

Author SHA1 Message Date
agra
f66cda6d11 android target + APK pipeline; LSP imports honor stdlib paths
Android (toolchain):
  --target android / --target android-arm64 → aarch64-linux-android21.
  target.zig discovers $ANDROID_NDK_HOME (or scans
  ~/Library/Android/sdk/ndk/* for the newest), invokes the NDK clang
  with -shared -fPIC and links libsxhello.so against -llog -landroid
  -lEGL -lGLESv3 -lm -ldl. native_app_glue.c from the NDK is compiled
  and linked alongside the sx .o so apps can use the conventional
  android_main(struct android_app*) shape; -u ANativeActivity_onCreate
  keeps glue's symbol live.

Android (APK):
  --apk <out> wraps the .so into a debug-signed installable APK.
  target.zig discovers the SDK at $ANDROID_HOME (or
  ~/Library/Android/sdk), picks the newest build-tools + platforms,
  generates a NativeActivity AndroidManifest.xml from --bundle-id,
  packages via aapt2 link, appends the lib/ tree, zipalign, then
  apksigner against ~/.android/debug.keystore (auto-generated via
  keytool on first use). One command end-to-end:
      sx build --target android --apk out.apk \\
          --bundle-id co.swipelab.foo main.sx
  Verified on Pixel 7 Pro: install + launch reaches android_main.

Compiler (entry-point linkage):
  Top-level fn defs default to LLVM internal linkage and are lazily
  lowered (only `main` was eagerly lowered before). Added
  isExportedEntryName() — a small allowlist for names the OS loader
  calls: `main`, `android_main`, `ANativeActivity_onCreate`,
  `JNI_OnLoad`. These get eagerly lowered AND keep external linkage,
  so they actually land in .dynsym.

LSP (imports):
  DocumentStore now takes the install-discovered stdlib_paths and
  forwards them into resolveImportPath, mirroring the compiler. Before
  this, every `#import "modules/..."` resolved through the stdlib path
  failed silently inside the LSP and identifiers from those modules
  showed as `undefined variable`. Repro on label.sx: 1 false positive
  before, 0 after.
2026-05-18 23:09:55 +03:00
agra
c027e1969b stdlib: relocate modules under library/
- examples/modules/ -> library/modules/ (top-level, no more
  symlink hacks in consumer projects)
- compiler discovers stdlib via _NSGetExecutablePath / readlink
  /proc/self/exe; searches dev layout (../../library), install
  layout (../library), and alongside-binary fallback
- SX_STDLIB_PATH env var overrides for tests / dev convenience
- SX_DEBUG_STDLIB env var dumps the discovery results
- build.zig installs library/ alongside the binary
- Compilation gains stdlib_paths field threaded through resolveImports
- 50 tests pass; consumer projects can now build from any cwd
2026-05-17 13:49:25 +03:00
agra
1c32d54e01 ios + ir cleanup
- ios: --target ios/ios-sim shorthands, iOS SDK auto-discovery,
  #framework directive + BuildOptions.add_framework hook,
  .app bundle + Info.plist + codesign (ad-hoc and real),
  --codesign-identity/--provisioning-profile/--entitlements flags,
  modules/std/{objc,uikit}.sx, dynamic class registration,
  typed objc_msgSend cast pattern, UIApplicationMain handoff,
  UIWindow scene attach. Runs on iPhone hardware.
- ir: silent .s64 defaults → loud diagnostics,
  resolveReturnType infers from body, sub-byte int sizes match LLVM,
  tuple type interning includes names, compile errors exit 1
- issue-NNNN convention: resolved bugs rename to focused features
- 50 regression tests passing
2026-05-17 13:19:08 +03:00
agra
f9dda972d2 fixes 2026-03-05 16:20:36 +02:00
agra
03074472e5 build options #compiler 2026-03-03 09:35:50 +02:00
agra
2f4f898d54 asm... 2026-03-02 17:19:41 +02:00
agra
7209e8e69d ... 2026-02-26 00:18:36 +02:00
agra
bfc784734c lsp import 2026-02-24 20:05:24 +02:00
agra
566121c45a more forward declarations 2026-02-24 17:37:52 +02:00
agra
170e236764 vtables, protocol 2026-02-24 06:20:38 +02:00
agra
1cc67f9b5a optionals 2026-02-22 22:16:30 +02:00
agra
d3e574eae5 import c 2026-02-22 17:24:04 +02:00
agra
b02fe37a87 ... 2026-02-21 02:25:21 +02:00
agra
2f95810f9d ... 2026-02-20 18:22:42 +02:00
agra
6f927361aa pipes 2026-02-20 13:28:38 +02:00
agra
1ecac79642 bit ops 2026-02-20 12:12:51 +02:00
agra
e0e655cd36 tuples 2026-02-19 01:26:04 +02:00
agra
188ffed5af arena 2026-02-18 15:59:49 +02:00
agra
4aff004118 http server 2026-02-17 19:49:01 +02:00
agra
4fd87309d9 http server 2026-02-17 16:57:12 +02:00
agra
e7d2abdf0c layout 2026-02-14 21:28:49 +02:00
agra
0e777e9d2e ... 2026-02-14 19:33:33 +02:00
agra
d61c6488f3 @ enum type 2026-02-14 14:52:39 +02:00
agra
fe7efeadb0 flags 2026-02-14 14:03:22 +02:00
agra
025b790411 enum, union 2026-02-14 13:17:22 +02:00
agra
dab162bfe4 strings 2026-02-12 16:23:42 +02:00
agra
9a2501f662 cross 2026-02-11 21:22:03 +02:00
agra
9d96f05d3b graphics 2026-02-11 20:41:43 +02:00
agra
94b0296fd5 cleanup 2026-02-11 14:22:25 +02:00
agra
7bb4fe0c5f ufcs 2026-02-11 02:22:00 +02:00
agra
70435d3c85 pointers 2026-02-10 22:47:43 +02:00
agra
55fc5790e4 so... jai :D 2026-02-09 18:07:41 +02:00