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

Optimize two-pass build process #101

Open
hach-que opened this issue Dec 23, 2024 · 0 comments
Open

Optimize two-pass build process #101

hach-que opened this issue Dec 23, 2024 · 0 comments
Labels
back burner No ETA on resolution

Comments

@hach-que
Copy link
Member

hach-que commented Dec 23, 2024

Currently we build UET, and then we build UET again with the embedded binaries of all the other platforms. This is necessary so that running uet build -x gitlab on Windows is able to extract UET for macOS for builds that need to run on macOS agents.

However, this effectively means we build the entirety of UET twice, which makes for a slow build.

Instead, I think we can:

  • Have a uet.chain executable which contains the embedded binaries of UET (including for the current platform). This executable would be tiny in code like uet.shim.
  • When uet.chain runs, it checks if the first and only argument is of the form extract=<platform>=<path>, in which case it simply extracts the embedded UET for that platform to that path and then exits with exit code 0.
  • In all other cases, it extracts UET for the current platform to the temporary directory, and executes it with the arguments it was passed and the additional environment variable UET_CHAIN_PATH=<path to self>.
  • When UET wants to extract a UET binary for another platform, it looks for the UET_CHAIN_PATH environment variable and calls the executable at that path with extract=<platform>=<path> to do the extraction.
  • The uet.chain executable is what gets published as the full "uet" binaries on GitHub.

This eliminates the two-pass build process entirely. My only concern here would be non-Windows-Defender AV programs complaining about the extract-executable-and-run flow, since they can be quite sensitive to this sort of behaviour.

@hach-que hach-que added the back burner No ETA on resolution label Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
back burner No ETA on resolution
Projects
None yet
Development

No branches or pull requests

1 participant