-
Couldn't load subscription status.
- Fork 5.2k
Remove environment variable usage for TPA, app_path, and search_paths in browserhost (WASM) #120598
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
base: main
Are you sure you want to change the base?
Conversation
|
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov |
…ents Modified BrowserHost_InitializeCoreCLR to accept three UTF-8 encoded string arguments instead of reading from environment variables. Updated TypeScript wrapper in run.ts to pass these values directly from the loader config. Removed ENV variable setting in libBrowserHost.footer.js for these properties. Co-authored-by: pavelsavara <[email protected]>
Added comprehensive comments to both C++ and TypeScript code explaining how TPA, app_path, and search_paths are now passed as UTF-8 encoded arguments from JavaScript instead of environment variables. Documented memory management approach using Emscripten's automatic string handling. Co-authored-by: pavelsavara <[email protected]>
|
@copilot build of runtime (Build browser-wasm linux Debug AllSubsets_CoreCLR) failed |
…run.ts The original approach tried to build TPA in run.ts but the assembly list wasn't complete at that point. Now we store the TPA, app_path, and search_paths in config.environmentVariables during early initialization in libBrowserHost.footer.js (where all assemblies are listed), then retrieve them in run.ts to pass as arguments to BrowserHost_InitializeCoreCLR. Co-authored-by: pavelsavara <[email protected]>
Fixed in commit f0e4c8f. The issue was that I was trying to build the TPA list in run.ts when not all assemblies were available yet. Now the values are prepared in libBrowserHost.footer.js during early initialization (where the complete assembly list exists) and stored in config.environmentVariables, then retrieved in run.ts to pass as arguments. |
Plan: Remove environment variable usage for TPA, app_path, and search_paths in browserhost
BrowserHost_InitializeCoreCLRsignature to accept TPA, app_path, and search_paths as UTF-8 argumentsrun.tsto pass these arguments from JS to C++libBrowserHost.footer.jsto store values in config instead of ENVChanges Summary
Modified Files
src/native/corehost/browserhost/browserhost.cpp
BrowserHost_InitializeCoreCLR()to accept threeconst char*parameterspal::getenv()calls for TPA, app_path, and search_pathssrc/native/corehost/browserhost/loader/run.ts
src/native/corehost/browserhost/libBrowserHost.footer.js
Key Design Decision
The values are stored in
config.environmentVariablesrather thanENVto maintain them in JavaScript scope while avoiding actual process environment pollution. They're then retrieved and passed as explicit arguments to the C++ function.Benefits
Original prompt
This pull request was created as a result of the following prompt from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.