1. 17 Aug, 2021 1 commit
    • Jérome Perrin's avatar
      test: fix tests on python2 · 9c0113de
      Jérome Perrin authored
      1dc49d3e (tests: ignore CryptographyDeprecationWarning on python2, 2021-08-13)
      was wrong, because this warning includes the path of the software, which
      also has a md5sum hash, so the normalization has to be done before the
      md5sum normalization, otherwise this consumes an md5sum and they become
      off by one, with errors like:
      
          Expected:
              package: shared at /shared/package/<MD5SUM:0>
              Uninstalling package.
              Installing package.
              package: Checking whether package is installed at shared path: /shared/package/<MD5SUM:0>
              package: [ENV] FOO = bar
              package: Command 'set -e;./configure --prefix=/shared/package/<MD5SUM:0>"' returned non-zero exit status 127.
              package: Compilation error. The package is left as is at /shared/package/<MD5SUM:0>__compile__ where you can inspect what went wrong.
              A shell script slapos.recipe.build.env.sh has been generated. You can source it in your shell to reproduce build environment.
              /bin/sh: 1: ./configure: not found
              While:
                Installing package.
              Error: System error
          Got:
              package: shared at /shared/package/<MD5SUM:1>
              Uninstalling package.
              Installing package.
              package: Checking whether package is installed at shared path: /shared/package/<MD5SUM:1>
              package: [ENV] FOO = bar
              package: Command 'set -e;./configure --prefix=/shared/package/<MD5SUM:1>"' returned non-zero exit status 127.
              package: Compilation error. The package is left as is at /shared/package/<MD5SUM:1>__compile__ where you can inspect what went wrong.
              A shell script slapos.recipe.build.env.sh has been generated. You can source it in your shell to reproduce build environment.
              <BLANKLINE>
              /bin/sh: 1: ./configure: not found
              While:
                Installing package.
              Error: System error
              <BLANKLINE>
      9c0113de
  2. 13 Aug, 2021 2 commits
  3. 26 Feb, 2021 2 commits
  4. 08 May, 2020 1 commit
  5. 04 May, 2020 1 commit
    • Dmitry Blinov's avatar
      propagate strip_top_level_dir option to slapos.recipe.build:downloadunpacked · f672573a
      Dmitry Blinov authored
      Don't force strip_top_level_dir option to be false when calling for slapos.recipe.build:downloadunpacked - let the user decide.
      
      Effectively adds strip_top_level_dir option to the script which allows for shorter and more consistent paths.
      Also it can help mitigating the variability of path length between archives downloaded for branch, commit hash and release.
      f672573a
  6. 01 May, 2020 1 commit
    • Jérome Perrin's avatar
      tests: cover slapos usage · 2563fc98
      Jérome Perrin authored
      Add some doctests to describe the use cases of shared parts with slapos,
      including the need for our `${:_profile_base_location_}` buildout patch
      and the need to save signature files.
      2563fc98
  7. 26 Apr, 2020 1 commit
  8. 23 Apr, 2020 4 commits
  9. 22 Apr, 2020 5 commits
  10. 15 Apr, 2020 1 commit
  11. 31 Mar, 2020 1 commit
  12. 30 Mar, 2020 1 commit
    • Dmitry Blinov's avatar
      set -e for shell commands · 2f92b674
      Dmitry Blinov authored
      If not set, the commands in the middle of custom configure-command,
      pre-build, post-build etc can fail without resulting in SystemError
      for user and without stopping cmmi process, which thus can formally
      succeed despite being misconfigured or in some cases with the code
      not even built.
      This is because when executing a multiline command, only the exit
      status of the last one actually gets caught by check_call().
      
      Setting -e makes debugging easier by allowing shell to terminate
      mid-way if errors (non-zero exit status) occur.
      
      -e only covers 'simple commands', and does not affect 'if' tests
      and more complex cases where non-zero exit status is expected to
      occur normally.
      Detailed description of -e effects can be seen in the POSIX
      standard:
      
      https://pubs.opengroup.org/onlinepubs/009695399/utilities/set.html
      2f92b674
  13. 12 Dec, 2019 1 commit
  14. 10 Dec, 2019 1 commit
    • Jérome Perrin's avatar
      shared: Fix recovery after an interrupted build · 0bb65331
      Jérome Perrin authored
      When build process is interrupted (like when the buildout process
      terminated by SIGKILL), building with shared leave the system in a state
      that looks like installation succeeded, so next execution will assume
      the part was properly installed.
      
      
      The behavior was something like this:
      
      
          if isSharedPartSignatureOK():
            useThisAlreadyInstalledPart()
          else:
            writeSignatureInSharedPart()
            try:
              build()
            except:
              removeSharedPart()
              raise
      
      
      and when program is terminated during build step, the signature is
      there.
      
      The fix is to write signature later, algorithm becomes:
      
      
          if isSharedPartSignatureOK():
            useThisAlreadyInstalledPart()
          else:
            try:
              build()
            except:
              removeSharedPart()
              raise
            writeSignatureInSharedPart()
      
      /reviewed-on nexedi/slapos.recipe.cmmi!10
      0bb65331
  15. 05 Dec, 2019 1 commit
  16. 02 Oct, 2019 4 commits
  17. 01 Oct, 2019 1 commit
  18. 30 Sep, 2019 1 commit
    • Jérome Perrin's avatar
      Support multiple paths for shared · 3cd08544
      Jérome Perrin authored
      This will allow nested slapos where the inner slapos can re-use shared
      parts from outer slapos, but not write into the outer shared parts.
      
      For compatibility reasons, the syntax of the buildout option changed,
      instead of the old ${buildout:shared-parts} that use to be one path, we
      now use ${buildout:shared-part-list} as a \n separated list of paths.
      All paths can be used to lookup existing parts, only the last one can be
      used to install new parts.
      There is no compatibility with the old option as it was not used much,
      only in profiles which were not really compatible with shared options.
      3cd08544
  19. 26 Sep, 2019 3 commits
  20. 25 Sep, 2019 1 commit
  21. 30 Nov, 2018 3 commits
  22. 29 Oct, 2018 2 commits
  23. 16 Oct, 2018 1 commit
    • Jérome Perrin's avatar
      Do not set any TMP environment variables · 9ca803bb
      Jérome Perrin authored
      This reverts daa833ea ( !3 ) and extend it to not set `$TMP` either.
      
      De facto, setting only `$TMP` was never effective ( see also [#20120530-132221B](https://nexedi.erp5.net/bug_module/20120530-132221B) ) and as we saw in !3 (comment 67059) it causes more harm than good.
      
      The conclusion so far is that environment variables related to temporary files should be handled by the parent process. The parent process is responsible for providing a directory short enough so that we can create unix sockets in `$TMPDIR`  and to clean up this directory afterwards.
      
      
      In a pure buildout it could be:
      
      ```bash
      tmpdir=$(mktemp -d)
      trap 'rm -rf $tmpdir' SIGINT SIGTERM
      TEMP=$tmpdir TMPDIR=$tmpdir TMP=$tmpdir buildout
      rm -rf $tmpdir
      ```
      
      /reviewed-on !8
      9ca803bb