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

WIP: use deno to compile to single binary #186

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

WIP: use deno to compile to single binary #186

wants to merge 3 commits into from

Conversation

6543
Copy link
Member

@6543 6543 commented Sep 29, 2024

 deno compile --allow-read --allow-write --allow-env --allow-net --allow-run src/run.ts

https://deno.com/blog/v1.46

@6543
Copy link
Member Author

6543 commented Sep 29, 2024

image

well now i just need to make sure the git impl. is working currectly and cant be broken by user input ...

... but for my 1/2h experiment, it should be doable

@6543
Copy link
Member Author

6543 commented Sep 29, 2024

image

push(args: string[]): Promise<void>;
}

export function simpleGit(): SimpleGit {
Copy link
Member Author

Choose a reason for hiding this comment

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

mostly untested & we should add tests for it anyway ...

@pat-s
Copy link
Contributor

pat-s commented Oct 2, 2024

Will this also reduce the image size? Could we even use a scratch image?

@6543
Copy link
Member Author

6543 commented Oct 3, 2024

not scratch jet as we need the git binary working

but yes that's a way to move towards it :)

@6543
Copy link
Member Author

6543 commented Oct 3, 2024

the image size would probably increase by ~50Mb but the image would be silli and dont contain any unessesary build-time deps and other unrelated stuff

PS: this here is just a POC if it would work at all

@6543
Copy link
Member Author

6543 commented Oct 3, 2024

tldr: if we have a static linked git binary + the deno binary we should be able to use FROM scratch

@pat-s
Copy link
Contributor

pat-s commented Oct 3, 2024

git clone [email protected]:git/git.git
mkdir git-static
cd git
make configure
./configure prefix=/path/to/git-static/ CFLAGS="${CFLAGS} -static"
make
make install

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