Skip to content

Conversation

m-hilgendorf
Copy link
Contributor

Example:

import * as std from "../packages2/packages/std";
import { $ } from "../packages2/packages/std";

export default async () => {
	// Dump argv, envp, etc etc
	const mainC = tg.file(`
		#include <stdio.h>
		int main(int argc, const char** argv) {
			const char** string = argv + 1;
			for(; *string; string++) {
				printf("arg: %s\\n", *string);
			}
			string++;
			for(; *string; string++) {
				printf("envp: %s\\n", *string);
			}
			return 0;
		}
	`);
	const source = tg.directory({
		"main.c": mainC
	});

	// Compile the file.
	return $`
		gcc ${source}/main.c -o $OUTPUT
	`
	.env(
		std.sdk(), 
		{ 
			"TANGRAM_LINKER_EMBED_WRAPPER": "1" // Enable embedded wrapers
		}
	)
	.then(tg.File.expect);
};

@m-hilgendorf m-hilgendorf force-pushed the feat/embedded-wrappers branch from 46702ac to 6454ddb Compare September 8, 2025 17:46
@m-hilgendorf m-hilgendorf force-pushed the feat/embedded-wrappers branch 2 times, most recently from b2a58ff to cf64226 Compare September 17, 2025 20:11
@m-hilgendorf m-hilgendorf force-pushed the feat/embedded-wrappers branch 2 times, most recently from 84f569f to 5a8ab09 Compare October 1, 2025 20:47
@m-hilgendorf m-hilgendorf marked this pull request as ready for review October 2, 2025 18:19
@m-hilgendorf m-hilgendorf force-pushed the feat/embedded-wrappers branch from 8c650b5 to 4ceacde Compare October 10, 2025 20:30
// tg.assert(
// actualInterpreter.includes(expectedInterpreter),
// `Expected interpreter named ${expectedInterpreter} but got ${actualInterpreter}.`,
// );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be removed/updated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea - embedded wrappers have no interpreter.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This patch may need to be duplicated into the bash package post-std

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants