Skip to content
Snippets Groups Projects
  1. Feb 07, 2012
    • Nat Goodspeed's avatar
      Use os.path.normcase(os.path.normpath()) when comparing directories. · 32e11494
      Nat Goodspeed authored
      Once again we've been bitten by comparison failure between "c:\somepath" and
      "C:\somepath". Normalize paths in both Python helper scripts to make that
      comparison more robust.
      32e11494
    • Nat Goodspeed's avatar
      On Linux, #undef Status: we use that name for nested LLProcess struct. · 5d2bb536
      Nat Goodspeed authored
      Apparently something in the Linux system header chain #defines a macro Status
      as 'int'. That's just Bad in C++ land. It should at the very least be a
      typedef! #undefining it in llprocess.h permits the viewer to build.
      5d2bb536
    • Nat Goodspeed's avatar
    • Nat Goodspeed's avatar
      Convert LLProcess implementation from platform-specific to using APR. · aafb03b2
      Nat Goodspeed authored
      Include logic to engage Linden apr_procattr_autokill_set() extension: on
      Windows, magic CreateProcess() flag must be pushed down into apr_proc_create()
      level. When using an APR package without that extension, present
      implementation should lock (e.g.) SLVoice.exe lifespan to viewer's on Windows
      XP but probably won't on Windows 7: need magic flag on CreateProcess().
      Using APR child-termination callback requires us to define state (e.g.
      LLProcess::RUNNING). Take the opportunity to present Status, capturing state
      and (if terminated) rc or signal number; but since most of the time all caller
      really wants is to log the outcome, also present status string, encapsulating
      logic to examine state and describe exited-with-rc vs. killed-by-signal.
      New Status logic may report clearer results in the case of a Windows child
      process killed by exception.
      Clarify that static LLProcess::isRunning(handle) overload is only for use when
      the original LLProcess object has been destroyed: really only for unit tests.
      We necessarily retain our original platform-specific implementations for just
      that one method. (Nonstatic isRunning() no longer calls static method.)
      Clarify log output from llprocess_test.cpp in a couple places.
      aafb03b2
  2. Jan 30, 2012
  3. Jan 27, 2012
    • Nat Goodspeed's avatar
      On Windows, only quote LLProcess arguments if they seem to need it. · 27df0a84
      Nat Goodspeed authored
      On Posix platforms, the OS argument mechanism makes quoting/reparsing
      unnecessary anyway, so this only affects Windows.
      Add optional 'triggers' parameter to LLStringUtils::quote() (default: space
      and double-quote). Only if the passed string contains a character in
      'triggers' will it be double-quoted.
      This is observed to fix a Windows-specific problem in which plugin child
      process would fail to start because it wasn't expecting a quoted number.
      Use LLStringUtils::quote() more consistently in LLProcess implementation for
      logging.
      27df0a84
  4. Jan 23, 2012
  5. Jan 22, 2012
  6. Jan 21, 2012
    • Nat Goodspeed's avatar
      Convert LLProcess consumers from LLSD to LLProcess::Params block. · 47d94757
      Nat Goodspeed authored
      Using a Params block gives compile-time checking against attribute typos. One
      might inadvertently set myLLSD["autofill"] = false and only discover it when
      things behave strangely at runtime; but trying to set myParams.autofill will
      produce a compile error.
      However, it's excellent that the same LLProcess::create() method can accept
      either LLProcess::Params or a properly-constructed LLSD block.
      47d94757
  7. Jan 20, 2012
    • Nat Goodspeed's avatar
      Define LLProcess::Params; accept create(const LLSDParamAdapter<Params>&). · 6e214960
      Nat Goodspeed authored
      This allows callers to pass either LLSD formatted as before -- which all
      callers still do -- or an actual LLProcess::Params block.
      6e214960
    • Nat Goodspeed's avatar
      Per Richard, replace LLProcessLauncher with LLProcess. · f0dbb878
      Nat Goodspeed authored
      LLProcessLauncher had the somewhat fuzzy mandate of (1) accumulating
      parameters with which to launch a child process and (2) sometimes tracking the
      lifespan of the ensuing child process. But a valid LLProcessLauncher object
      might or might not have ever been associated with an actual child process.
      LLProcess specifically tracks a child process. In effect, it's a fairly thin
      wrapper around a process HANDLE (on Windows) or pid_t (elsewhere), with
      lifespan management thrown in. A static LLProcess::create() method launches a
      new child; create() accepts an LLSD bundle with child parameters. So building
      up a parameter bundle is deferred to LLSD rather than conflated with the
      process management object.
      Reconcile all known LLProcessLauncher consumers in the viewer code base,
      notably the class unit tests.
      f0dbb878
    • Richard Linden's avatar
    • Richard Linden's avatar
      removed LLXUIXML library · 057da807
      Richard Linden authored
      moved LLInitParam, and LLRegistry to llcommon
      moved LLUIColor, LLTrans, and LLXUIParser to llui
      reviewed by Nat
      057da807
  8. Jan 19, 2012
  9. Jan 18, 2012
  10. Jan 17, 2012
    • Nat Goodspeed's avatar
    • Nat Goodspeed's avatar
      Refactor llprocesslauncher_test.cpp for better code reuse. · 2ae9f921
      Nat Goodspeed authored
      Instead of free python() and python_out() functions containing a local
      temporary LLProcessLauncher instance, with a 'tweak' callback param to
      "do stuff" to that inaccessible object, change to a PythonProcessLauncher
      class that sets up a (public) LLProcessLauncher member, then allows you to
      run() or run() and then readfile() the output. Now you can construct an
      instance and tweak to your heart's content -- without funky callback syntax --
      before running the script.
      Move all such helpers from TUT fixture struct to namespace scope. While
      fixture-struct methods can freely call one another, introducing a nested class
      gets awkward: constructor must explicitly require and bind a fixture-struct
      pointer or reference. Namespace scope solves this.
      (Truthfully, I only put them in the fixture struct originally because I
      thought it necessary for calling ensure() et al. But ensure() and friends are
      free functions; need only qualify them with tut:: namespace.)
      2ae9f921
    • Nat Goodspeed's avatar
      Add first couple of LLProcessLauncher tests. · 74fbd318
      Nat Goodspeed authored
      Run INTEGRATION_TEST_llprocesslauncher using setpython.py so we can find the
      Python interpreter of interest.
      Introduce python() function to run a Python script specified using
      NamedTempFile conventions.
      Introduce a convention by which we can read output from a Python script using
      only the limited pre-January-2012 LLProcessLauncher API. Introduce
      python_out() function to leverage that convention.
      Exercise a couple of LLProcessLauncher methods using all the above.
      74fbd318
    • Nat Goodspeed's avatar
      Add log message if LLProcessLauncher child fails to execv(). · c0731c1c
      Nat Goodspeed authored
      On a Posix platform (vfork()/execv() implementation), if for any reason the
      execv() failed (e.g. executable not on PATH), the viewer would never know, nor
      the user: the vfork() child produced no output, and terminated with rc 0! Add
      logging, make child terminate with nonzero rc.
      Remove pointless addArgument(const char*) overload: this does nothing for you
      that the compiler won't do implicitly.
      In llupdateinstaller.cpp, remove pointless c_str() call in addArgument() arg:
      we were starting with a std::string, then extracting its c_str(), only to
      construct a whole new std::string from it!
      c0731c1c
  11. Jan 13, 2012
    • Nat Goodspeed's avatar
      Extract APR and temp-fixture-file helper code to indra/test. · b6a08ad0
      Nat Goodspeed authored
      Specifically:
      Introduce ManageAPR class in indra/test/manageapr.h. This is useful for a
      simple test program without lots of static constructors.
      Extract NamedTempFile from llsdserialize_test.cpp to indra/test/
      namedtempfile.h. Refactor to use APR file operations rather than platform-
      dependent APIs.
      Use NamedTempFile for llprocesslauncher_test.cpp.
      b6a08ad0
  12. Jan 12, 2012
  13. Jan 05, 2012
  14. Dec 23, 2011
  15. Dec 22, 2011
    • Nat Goodspeed's avatar
      Comment out lookup table used only by commented-out code. · 29273ffb
      Nat Goodspeed authored
      Otherwise the unreferenced declaration causes a fatal warning.
      29273ffb
    • Nat Goodspeed's avatar
      Never call apr_proc_wait() inside child_status_callback(). · 6ccba881
      Nat Goodspeed authored
      Quiet the temporary child_status_callback() output.
      Add a bit of diagnostic info if apr_proc_wait() returns anything but
      APR_CHILD_DONE.
      6ccba881
    • Nat Goodspeed's avatar
      Add child_status_callback() function and arrange to call periodically. · 39c3efbd
      Nat Goodspeed authored
      At least on OS X 10.7, a call to apr_proc_wait(APR_NOWAIT) in fact seems to
      block the caller. So instead of polling apr_proc_wait(), use APR callback
      mechanism (apr_proc_other_child_register() et al.) and poll that using
      apr_proc_other_child_refresh_all().
      Evidently this polls the underlying system waitpid(), but the internal call
      seems to better support nonblocking. On arrival in the
      child_status_callback(APR_OC_REASON_DEATH) call, though, apr_proc_wait()
      produces ECHILD: the child process in question has already been reaped.
      The OS-encoded wait() status does get passed to the callback, but then we have
      to use OS-dependent macros to tease apart voluntary termination vs. killed by
      signal... a bit of a hole in APR's abstraction layer.
      Wrap ensure_equals() calls with a macro to explain which comparison failed.
      39c3efbd
  16. Dec 21, 2011
Loading