remove exec() from the codebase #1651
Labels
No Label
0.2.0
0.3.0
0.4.0
0.5.0
0.5.1
0.6.0
0.6.1
0.7.0
0.8.0
0.9.0
1.0.0
1.1.0
1.10.0
1.10.1
1.10.2
1.10a2
1.11.0
1.12.0
1.12.1
1.13.0
1.14.0
1.15.0
1.15.1
1.2.0
1.3.0
1.4.1
1.5.0
1.6.0
1.6.1
1.7.0
1.7.1
1.7β
1.8.0
1.8.1
1.8.2
1.8.3
1.8β
1.9.0
1.9.0-s3branch
1.9.0a1
1.9.0a2
1.9.0b1
1.9.1
1.9.2
1.9.2a1
LeastAuthority.com automation
blocker
cannot reproduce
cloud-branch
code
code-dirnodes
code-encoding
code-frontend
code-frontend-cli
code-frontend-ftp-sftp
code-frontend-magic-folder
code-frontend-web
code-mutable
code-network
code-nodeadmin
code-peerselection
code-storage
contrib
critical
defect
dev-infrastructure
documentation
duplicate
enhancement
fixed
invalid
major
minor
n/a
normal
operational
packaging
somebody else's problem
supercritical
task
trivial
unknown
was already fixed
website
wontfix
worksforme
No Milestone
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Reference: tahoe-lafs/trac-2024-07-25#1651
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
We've had a number of "what version of the code are we running anyways?" problems, provoking tremendous heroics in the setuptools-based dependency-version-management code, that could go away entirely if we got rid of the use of
exec()
in the codebase (reducing the use offork()
would be good too, but not as critical).As I remember, fork+exec came up as a way to make
tahoe start
cleanly daemonize, by executingtwistd
as a child process. Since then, I've figured out ways to use twistd's own code for this purpose, starting with an import and ending with a function call (which never returns, because the twistd code invokes fork and thenos._exit()
the parent).To keep
tahoe start
from killing off the trial process during unit tests, we can do afork()
insidetahoe start
before calling twistd. We should investigate how well this works on windows (I think we might skip that test on windows anyways).I think this would let us get rid of a lot of code, followed by removing a lot of setuptools-ish code (the stuff that touches
os.environPYTHONPATH
andos.environPATH
, and the tests that assert things about the version of code found by thetahoe start
child). And that might let us reduce our dependency on setuptools and versioning stuff in general, at least a little bit.Replying to warner:
It's not as simple as that; if we don't set PYTHONPATH then we need to munge sys.path instead. As far as I can see this doesn't by itself do anything to solve any of the related bugs.
It does make it possible to then munge sys.path differently, and more correctly, to how setuptools does it. But don't underestimate the amount of work needed to do that right.
No, almost all of the subprocess tests work on Windows (and there are a lot of them).
I don't see the advantage of not creating subprocesses in tests. It doesn't simplify anything as far as I can see, and if it means we are doing something different on Unix than on Windows, it just makes things more complicated. (It might improve the speed of the relevant tests slightly, but I'm not sure that would be a significant proportion of the total time.)
tahoe start
is deprecated and I'm not sure what otherexec
-family (execv, execl, etc) function usage this ticket is aimed at (note: this is not about built-in Python exec).Closing. New tickets can be opened if people come across specific remaining uses of
exec
-family functions.