on_build is now the sole post-build callback mechanism. Migrated the 9 callers (0602/0603/1611/1614/1615/1616 + the platform bundle_main) from opts.set_post_link_callback(cb) to on_build(cb), giving each callback the (opt: BuildOptions) param. Deleted set_post_link_callback from build.sx, compiler_lib (bound_fns + handleSetPostLinkCallback), and the VM arm. Reworked the P5 smoke tests for the new semantics: an on_build override REPLACES the build (must emit+link or delegate), unlike the old post-link callback which ran after the auto-link. 1662 (queries) + 1664 (override+List-grow) now delegate to default_pipeline for the real build; deleted 1661/1663 (the primitives are now exercised by every AOT build). bundle_main invoked with pass_options=true. Benign 37-.ir churn (build.sx shrank). 703/0 both gates.
19 lines
592 B
Plaintext
19 lines
592 B
Plaintext
#import "modules/std.sx";
|
|
#import "modules/build.sx";
|
|
#import "modules/platform/bundle.sx";
|
|
|
|
// Register the sx-side `.app` bundler. Under `sx build` on macOS, the
|
|
// post-link callback runs and writes a real `.app` next to the
|
|
// binary. Under `sx run` (JIT) the callback is registered but never
|
|
// fires — so the test runner only sees `runtime main`.
|
|
|
|
configure :: () abi(.compiler) {
|
|
opts := build_options();
|
|
opts.set_bundle_path("HelloApp.app");
|
|
opts.set_bundle_id("co.example.hello");
|
|
on_build(bundle_main);
|
|
}
|
|
#run configure();
|
|
|
|
main :: () { print("runtime main\n"); }
|