Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable defining custom entry points for LUAZIP apps at build time #553

Open
4 tasks
rdw-software opened this issue Aug 18, 2024 · 0 comments
Open
4 tasks

Comments

@rdw-software
Copy link
Member

No need to wait for an equivalent to package.lua when it can easily be stored as a new field in the LUAZIP signature.

Goals:

  • If no entry point is given, default to main.lua (current behavior)
  • If the LUAZIP version is not 1.0, expect a counted string (can be zero-length for "default")
  • In that case, decode the entry point and load it instead of the default one
  • Must ensure backwards-compatibility is guaranteed (can always load 1.0 AND new version)

Low priority as it complicates things and isn't really needed right now.

local vfs = {
	LUAZIP_MAGIC_VALUE = "LUAZIP",
	cdefs = [[
		#pragma pack(push, 0)
		typedef struct {
			char magicValue[6];
			uint8_t versionMajor;
			uint8_t versionMinor;
			size_t executableSize;
			size_t archiveSize;
			size_t customEntryPointLength;
			char* customEntryPoint; // Must interpret based on the previous field, if it's non-zero
		} lua_zip_signature_t;
		#pragma pack(pop)
	]],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Possibly some day (Undecided)
Development

No branches or pull requests

1 participant