1. 12 Jan, 2019 1 commit
    • Michael Pyne's avatar
      Fix cxxflags being set to a space when globally empty. · b01505be
      Michael Pyne authored
      When cxxflags is globally set to an empty value, the getOption magic
      that appends module values to global values for cxxflags causes it the
      result to equal ' ' (i.e. one space). This is because the space is a
      separator between two empty values.
      This causes code testing against cxxflags to think it's actually been
      set to a value and to add it in the cmake calls.
      I fix this and add a test case, but also add some insurance by trimming
      leading/trailing white space so that the existing check for empty
      cxxflags would have had a chance to catch this.
      Differential Revision: https://phabricator.kde.org/D18165
  2. 21 Oct, 2018 1 commit
    • Michael Pyne's avatar
      first-run: Reduce use of ksb::Util, remove dead code. · 8f5daca9
      Michael Pyne authored
      Some minimal versions of popular Linux distros have Docker images that
      provide a stripped-down Perl install to save space. You cannot rely on
      "core" modules being present in this case.
      kdesrc-build should be able to at least spit out a message of which
      packages are required on the distribution. This means that
      ksb::OSSupport and ksb::FirstRun must be loadable in this distros, and
      kdesrc-build must not load "full fat" Perl modules until after checking
      whether to handle initial setup.
      Making this happen leads me to refactor exception code out of ksb::Util.
      While doing so I noticed that download_file is no longer needed
      (kde_projects.xml support drove that need), so that is removed as well
      to eliminate a dependency on HTTP::Tiny (a core module, but not
      available in minimal distros).
  3. 22 Aug, 2018 1 commit
  4. 15 Aug, 2018 1 commit
    • Michael Pyne's avatar
      logs: Postpone log dir mutable setup until a log is to be generated. · 685e68ea
      Michael Pyne authored
      The logfiles generated for each module are stored in a log directory (again for
      each module). The converse is also supposed to apply, a log directory should
      only exist for a module if it has logs.
      kdesrc-build enforced this in the past by taking extreme care not to call
      "getLogDir" unless needed. At some point I missed that nuance and used that
      call elsewhere, even when no log was to be generated.
      This had the effect of creating a new log directory for the module that had its
      log directory looked up, but without ever adding logs to it. kdesrc-build would
      also move the latest symlink to point to this empty directory, and then later
      remove the directory containing the actual set of latest logs during cleanup.
      Even worse, this would happen for every module (since we forced a call to
      "getLogDir" so that later code in new async processes would all resolve to the
      same log directory)
      I fix this by splitting up the "getLogDir" functionality into a read-only part
      (creates the base log directory but not the module log directory and does not
      move latest symlinks), and a read-write part for log_command.
  5. 01 Jul, 2018 1 commit
  6. 17 Dec, 2017 1 commit
  7. 10 Oct, 2016 1 commit
  8. 08 Oct, 2016 1 commit
  9. 12 Sep, 2015 1 commit
  10. 25 Aug, 2015 1 commit
    • Michael Pyne's avatar
      Fix --debug mode. · 347e6dce
      Michael Pyne authored
      The chomp doesn't return the chomp'ed value (rather '1' to reflect
      number of characters removed), and fixing that revealed another bug with
      my recent change to this code where I forgot to `tee' debug output to
      the tty.
  11. 09 Aug, 2015 2 commits
  12. 04 Jun, 2015 1 commit
    • Michael Pyne's avatar
      Remove LWP requirement. · 3b658d12
      Michael Pyne authored
      Perl core includes a "HTTP::Tiny" module that does what little we need,
      and has had it since 5.14 or so, so prefer that instead and remove the
      requirement to install libwww-perl.
      This also required removing the one minor instance of the URI module,
      which is not technically in Perl core but was installed due to LWP.
      Instead we just use a regexp 'blessed' by the URI module author.
  13. 20 May, 2015 1 commit
  14. 17 May, 2015 1 commit
  15. 25 Mar, 2015 1 commit
    • Michael Pyne's avatar
      util: Add resilience to check for missing programs. · b6853bea
      Michael Pyne authored
      My last commit checked for missing executables before trying to execute
      them, but still left open the possibility that it would be impossible to
      call exec(2) on an executable that had just been found (for whatever
      Closer inspection in 'perldoc perlipc', and 'perldoc -f open' has helped
      illustrate how to catch that condition. E.g. it turns out that calling
      'close' on a pipe-opened filehandle will automatically call waitpid,
      plus I'd forgotten to exit in that error case in the child proc. (This
      is why it would take 2-3 seconds after failing for the parent process to
      The more interesting question is what error policy to use in this case.
      Errors are expected in pretend mode (this function actually runs
      processes even during pretend mode since otherwise it can be impossible
      to determine whether to clone or update, switch branches, etc.), but on
      the other hand during execution errors should be unexpected and
  16. 24 Mar, 2015 1 commit
    • Michael Pyne's avatar
      util: Check that an executable exists before pipe-reading from it. · 3337c9e6
      Michael Pyne authored
      Perl's "open '-|' $program" feature, which is used to pipe the output of
      a process to a filehandle variable, is implemented internally using
      pipes along with a fork/exec construct. The pipes are created, your
      process automatically forks, and the child exec(2)'s the command you
      wished to run.
      This is all documented, and I thought I had a handle on this, but Perl's
      open() function's error checking is based only on whether fork(2)
      succeeded, not on whether exec(2) succeeded.
      What I think we get when we don't check for errors is some kind of
      raised signal (e.g. SIGPIPE) which is then duly received by the existing
      async-IPC code (which is already doing multi-proc), which then kills the
      IPC procs due to the 'impossible SIGPIPE' happening and crashes
      This fix, to check for an executable before trying to run, should at
      least make this kind of error more apparent (this isn't perfect yet
      either since 'bzr' failing to exist during pretend mode should be listed
      as an update failure, not update success). I would still need to find a
      better way to handle this since this is still a race condition.
  17. 22 Feb, 2015 1 commit
  18. 24 Mar, 2014 2 commits
    • Michael Pyne's avatar
      async: Improve signal handling. · b765b5d6
      Michael Pyne authored
      I was noticing that sometimes Ctrl-C at the TTY doing a kdesrc-build -p
      left a monitor process hanging at 100% CPU, not to mention all the
      kdesrc-build processes spamming goodbye messages.
      It didn't help that I was doing waitpid on an updater PID when that
      updater PID had to be 0 by definition.
      Either way, I've verified that the forking going on here shouldn't start
      a different process group for the shell session, so ^C is already going
      to all of the relevant processes. We just need to make sure to catch the
      signal and do the right thing (i.e. exit the child process).
    • Michael Pyne's avatar
  19. 13 Feb, 2014 1 commit
  20. 30 Sep, 2013 2 commits
    • Michael Pyne's avatar
    • Michael Pyne's avatar
      refactor: Move execution-phase code into Application class. · 83e358d3
      Michael Pyne authored
      By moving this code and associated utility methods into Application we
      nearly complete the long-in-progress refactoring of the monolithic
      kdesrc-build script into proper classes/objects.
      The kdesrc-build script itself is nearly bare, but there's still a bit
      more to do.
      At least it should be easier to make individual test scripts to test
      different bugs instead of having a monstrosity of a kdesrc-build-test
      script that has to maintain a common state.
      I've tested this in each way that I'm able (run needing to make a new
      source dir, build dir, new install and log dir, run updating existing
      checkouts, bzr/svn/git/kde-projects all tested, etc.). But this was a
      large move so let me know if I've missed anything.
  21. 26 Aug, 2013 1 commit
    • Michael Pyne's avatar
      Make exception class an actual class. · 56d1e7c2
      Michael Pyne authored
      This is a long-overdue change that allows for overloading the
      stringification operator to produce better error messages.
      BuildException was previously not an actual module since kdesrc-build
      itself was just a single script file. Now that we allow modules on disk
      there is no reason to leave the exception class as a figment of Perl's
  22. 18 Feb, 2013 1 commit
  23. 11 Feb, 2013 1 commit
  24. 10 Feb, 2013 1 commit
  25. 30 Dec, 2012 1 commit
  26. 15 Dec, 2012 1 commit
  27. 25 Nov, 2012 2 commits