riir runCommand2 and remove environ crimes #284

Open
opened 2024-05-08 23:05:29 +00:00 by jade · 0 comments
Owner

we have extremely suspect uses of extern char **environ, with weak symbols, evil repetition and more. these may cause some build breakage on freebsd if -Wl,-z,defs is present. also runCommand2 is just generally not very good API. Fixing that API is probably a reasonable second step, but can be done as a first step if in fact required.

rust tends to have reasonable implementations of wrapping the truly horrible Unix APIs, and we can use CommandExt for pretty much everything it does.

Action items:

  • Figure out how to get rust-analyzer and meson to like each other
  • Add a rust file that exports a replacement for runCommand2 that takes a struct which is bindgen'd back into c++ land, as well as a replacement for getEnvs
  • Write runCommand2 in terms of this new more-declarative primitive.

Commit suggestions:

  • Can even just link a nop into the C++ as the first commit, that gets all the stuff setup
  • Maybe put bindgen in there, maybe in a second commit
  • Last commit implements it
we have extremely suspect uses of `extern char **environ`, with weak symbols, evil repetition and more. these may cause some build breakage on freebsd if `-Wl,-z,defs` is present. also runCommand2 is just generally not very good API. Fixing that API is probably a reasonable second step, but can be done as a first step if in fact required. rust tends to have reasonable implementations of wrapping the truly horrible Unix APIs, and we can use `CommandExt` for pretty much everything it does. Action items: - Figure out how to get rust-analyzer and meson to like each other - Add a rust file that exports a replacement for runCommand2 that takes a struct which is bindgen'd back into c++ land, as well as a replacement for `getEnvs` - Write `runCommand2` in terms of this new more-declarative primitive. Commit suggestions: - Can even just link a nop into the C++ as the first commit, that gets all the stuff setup - Maybe put bindgen in there, maybe in a second commit - Last commit implements it
jade added the
devx
label 2024-05-08 23:05:29 +00:00
artemist was assigned by jade 2024-05-08 23:44:08 +00:00
jade added
stability
and removed
devx
labels 2024-05-09 05:01:40 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#284
No description provided.