Skip to content

NaCl process launching cleanup - #2037

Merged
slipher merged 2 commits into
DaemonEngine:masterfrom
slipher:nacl-merge
Nov 10, 2026
Merged

slipher merged 2 commits into
DaemonEngine:masterfrom
slipher:nacl-merge

Conversation

@slipher

@slipher slipher commented Nov 8, 2026

Copy link
Copy Markdown
Member

More fixing of the unreviewed code merged in #2018:

  • Remove the inoperative attempt to detect armhf multi-arch availability (on arm64) with process exit codes and fall back to box64. This was part of the bootstrap bootstrap thing which I specifically complained about as making Rebasing slipher's work on my CMake and VirtualMachine code #2018 unreviewable. I was told the bootstrap bootstrap stuff would be removed in the final state of the PR, but this turned out to be not entirely true.

I will add a working version of armhf->box64 fallback later. I'm thinking to make the NaCl architecture an argument to CreateNaClVM, loop over calling that with possible more than one value, and throw an exception (instead of Sys::Error) if a special failure case corresponding to architecture incompatibility is detected.

On arm64 Linux there is a half-attempt to fall back to box64 if the
armhf loader can't start. This was merged by mistake; it depends on the
double bootstrap loader which does not exist in the final version of
DaemonEngine#2018. The process exit code
detection junk which depended on that must be removed.

I will add a working version of armhf->box64 fallback later.
Handle all setup of the NaCl bootstrap loader in a single block of code,
instead of spraying little pieces and ifdefs all over the place.

This was supposed to be merged as part of the "Don't use
nacl_helper_bootstrap with x86-64 loader" commit in
DaemonEngine#2001.
@illwieckz

Copy link
Copy Markdown
Member

Hmmm, it looks like I forgot a commit when merging the rebase.

@illwieckz

Copy link
Copy Markdown
Member

I read the code in master and I don't see where the bootstrap would be used on amd64.

If the armhf compatibility detection is failing, then only this part has to be edited.

@illwieckz

Copy link
Copy Markdown
Member

This simplifies and unscatters the bootstrap code while keeping the loader command line construction properly deduplicated:

illwieckz
illwieckz previously approved these changes Nov 10, 2026

@illwieckz illwieckz left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not LGTM.

std::string box64Path = ResolveBox64Path(naclPath);
Log::Notice("Using Box64 emulator: %s", box64Path);
args.push_back(box64Path.c_str());
inheritEnvironment = true;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This will use box64 unconditionally even if another architecture is supported and preferred, and will even attempt to run the armhf nexe with box64.

@illwieckz illwieckz Nov 10, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Sorry for the approval noise, GitHub switched me to some new interface that is messed up and I don't even know how to dismiss the approval neither how to return to the good old interface.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This will use box64 unconditionally even if another architecture is supported and preferred, and will even attempt to run the armhf nexe with box64.

There is currently no possibility in CMake to have more than one supported NaCl runtime for any Linux platform. armhf_usage and box64_usage do not intersect. If box64 is enabled, it is the only way.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Everything is fully implemented since maybe 6 months, and what is not merged yet is just waiting in line to be.

There is no reason to re-introduce limitations that were already removed, and to reintroduce incompatibilities that were already solved.

@illwieckz
illwieckz self-requested a review November 10, 2026 00:46
@illwieckz
illwieckz dismissed their stale review November 10, 2026 00:49

bad overview UI nonsense

@slipher

slipher commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

I read the code in master and I don't see where the bootstrap would be used on amd64.

Not claiming that it's broken in this way. The code is just an unreadable mess.

@illwieckz

Copy link
Copy Markdown
Member

There are good reasons why I spent several weeks six months ago untangling all this code and carefully removing all duplicate instances of command construction, I certainly didn’t do that just to reintroduce new duplication.

@slipher

slipher commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

If broken code can be pushed to master without review, it is only fair that it can be fixed without review too. So I'll go ahead and merge this. I'll make a working version of the multiple NaCl runtimes concept in a bit.

@slipher
slipher merged commit 5803e2f into DaemonEngine:master Nov 10, 2026
8 checks passed
@slipher
slipher deleted the nacl-merge branch November 10, 2026 01:21
@illwieckz

Copy link
Copy Markdown
Member

So you just decided to break pending pull requests and re-introduce bugs.

@illwieckz

Copy link
Copy Markdown
Member

I'll make a working version of the multiple NaCl runtimes concept in a bit.

Someone has already invested months of work in that effort.

@slipher

slipher commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

I'll make a working version of the multiple NaCl runtimes concept in a bit.

Someone has already invested months of work in that effort.

Thanks for that. This could have been worded more humbly: I'll redo the final touches to the multi-NaCl-runtime effort in a bit, if you don't mind!

@illwieckz

Copy link
Copy Markdown
Member

I will never recover the time I spent working on this. At least when I merged the first bits of that effort I invested in, I rebased all your work so that you wouldn't waste your time doing so. And I was also making sure your effort wouldn't be wasted. I see this is not reciprocal.

@slipher

slipher commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

At least when I merged the first bits of that effort I invested in, I rebased all your work so that you wouldn't waste your time doing so.

Honestly I would prefer to do it myself, and observe the rule of developers with merge access merging their own code.

And I was also making sure your effort wouldn't be wasted. I see this is not reciprocal.

I'm sorry you feel that way. I'm happy to help by rebasing any remaining pieces if desired.

Unfortunately some of the code here does have to go to waste, since it was based on the superfluous helper process (#1336). The only way to avoid redoing it would be to bring back the useless process.

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