Opened 15 years ago

Last modified 22 months ago

#1949 enhancement new

can't run trial with Python that requires LD_LIBRARY_PATH set

Reported by: Glyph Owned by:
Priority: high Milestone:
Component: core Keywords:
Cc: Branch:


It's currently impossible to get a clean trial twisted run from a user-installed python if your user installation mechanism requires any environment variables to be able to run local executables.

I wish we had a buildbot for this.

All of the required changes are in test code, though; I've attached a patch.

Attachments (1)

run-user-installed.diff (4.7 KB) - added by Glyph 15 years ago.

Download all attachments as: .zip

Change History (7)

Changed 15 years ago by Glyph

Attachment: run-user-installed.diff added

comment:1 Changed 15 years ago by Jean-Paul Calderone

I prefer an inclusive environment setup. It should not be necessary to pass your entire environment on when spawning a child environment. There used to be helper methods for launching a Python child process but someone deleted them. At the time, I think they only set up PYTHONPATH, but they would have been a reasonable place to set LD_LIBRARY_PATH as well.

The ultimate point is that one should not need to be aware of these ridiculous platform requirements when launching a process. It just results in buggy, non-portable code.

comment:2 Changed 15 years ago by Glyph

I agree, and my patch was a bit of a straw man, I just uploaded what I had to do a trial run for the amp branch. These tests should obviously be using a utility function.

Unfortunately I think that inclusive environment setups (at least for test cases) are likely to be a lost cause in the long term, because the ridiculousness that the platform can get up to with environment variables is unbounded. A feature added to combinator to track the current environment is a case in point: it sets COMBINATOR_PATHS and COMBINATOR_PROJECTS and then expects every invocation of Python to look for those variables.

comment:3 Changed 15 years ago by Glyph

Priority: normalhigh

comment:4 Changed 11 years ago by <automation>

Owner: Glyph deleted

comment:5 Changed 22 months ago by Heather White

I don't believe this is still an issue? I used the following steps, set no environment variables, and successfully ran the tests:

  • create a python 3.6 virtual environment ("python3.6 -m venv whatever")
  • clone & install 19.10
  • from the repo root, run "python -m twisted.trial twisted"

comment:6 Changed 22 months ago by Glyph

Does your Python require an LD_LIBRARY_PATH, or some other environment variable set to a specific value, in order to function? This is about needing to run the test suite in situations where the absence of a required env var will cause your Python build to crash on startup.

Note: See TracTickets for help on using tickets.