Skip to content

Move runtime script to separate file #151

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

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

Conversation

milahu
Copy link

@milahu milahu commented Apr 24, 2025

fix #35

also:
remove packStaticBin = upx -9 -o $out/bin/${binName} ${binPath}
upx has no effect on static bins

$ man upx
The UPX stub is a statically linked ELF executable and does
the following at program startup:

   1) decompress the overlay to a temporary location in /tmp
   2) open the temporary file for reading
   3) try to delete the temporary file and start (execve)
      the uncompressed program in /tmp using /proc/<pid>/fd/X as
      attained by step 2)
   4) if that fails, fork off a subprocess to clean up and
      start the program in /tmp in the meantime

upx does not convert bins from dynamic to static
then why is upx used here?

fixme: reduce diff noise

fixme: reduce binary size of nix-portable from 188 back to 65 MB

todo: fix nix-portable nix-build --help

@milahu milahu force-pushed the move-runtimeScript-to-separate-file branch from d04198e to 25b8206 Compare April 24, 2025 14:28
@milahu milahu force-pushed the move-runtimeScript-to-separate-file branch from d30d100 to e564a22 Compare April 24, 2025 14:56
@milahu milahu force-pushed the move-runtimeScript-to-separate-file branch from 90bca06 to 4e2a717 Compare April 24, 2025 19:19
@milahu milahu force-pushed the move-runtimeScript-to-separate-file branch from f4ca387 to 46d1214 Compare April 27, 2025 14:22
@DavHau
Copy link
Owner

DavHau commented May 5, 2025

Amazing that you work on this!

then why is upx used here?

Because it decreases the binary size. UPX compresses the binary and then unpacks it in memory.

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.

refactor: move runtimeScript to separate file
2 participants