Skip to content
Snippets Groups Projects
  1. Mar 15, 2019
  2. Feb 25, 2019
    • Alexander Turenko's avatar
      lua-yaml: fix strings literals encoding in yaml · 4095e305
      Alexander Turenko authored
      yaml.encode() now wraps a string literal whose content is equal to a
      null or a boolean value representation in YAML into single quotes. Those
      literals are: 'false', 'no', 'true', 'yes', '~', 'null'.
      
      Reverted the a2d7643c commit to use single quotes instead of multiline
      encoding for 'true' and 'false' string literals.
      
      Follows up #3476
      Closes #3662
      Closes #3583
      4095e305
    • AKhatskevich's avatar
      lua-yaml: verify args in a consistent manner · e925356e
      AKhatskevich authored
      Use lua_is*() functions instead of explicit lua_gettop() checks in
      yaml.encode() and yaml.decode() functions.
      
      Behaviour changes:
      
      * yaml.decode(object, nil) ignores nil (it is consistent with encode
        behaviour).
      * yaml.encode() gives an usage error instead of "unsupported Lua type
        'thread'".
      * yaml.encode('', {}, {}) ignores 3rd argument (it is consistent with
        decode behaviour).
      e925356e
  3. Nov 15, 2018
    • Yaroslav Dynnikov's avatar
      third-party: update luarocks submodule · 10f4db86
      Yaroslav Dynnikov authored
      I. Fixes tarantoolctl rocks install hanging in resctricted networks
      corner-case.
      
      A customer configured two rocks servers:
      1. offline (file:///path/to/rocks)
      2. and default online (rocks.tarantool.org)
      
      He tries to do `rocks install http 1.0.5-1`.
      
      Online server is unavailable due to his local network policy, but
      the rock is available offline. Despite anything, luarocks still
      tries to fetch manifest online, which results in 30 sec hang since
      network access is restricted.
      
      This change aborts scanning when exact match is found
      
      II. Remove cyclic dependencies
      
      This is required to embed luarocks into tarantool, as
      current tarantool preloader can't preload cyclic dependencies.
      There should be a unidirectional dependency graph and
      predictable order.
      
      Note: as a consequence of this patch, operating systems other that
      unix-compatible ones are no longer supported. This is because I
      had to manually resolve dependency graph for predictable require()
      order.
      
      III. Use digest.md5_hex to compute md5 digests instead of openssl
      
      luarocks has support for calculating md5 with 'md5' rock if it's
      present, but we don't have it in tarantool, and instead have the
      'digest' module. That's why luarocks falls back to 'openssl' binary
      to calculate md5 digests.
      
      This patch will allow luarocks to use our internal digests module.
      10f4db86
  4. Sep 13, 2018
    • Roman Khabibov's avatar
      json: add options to json.encode() · 1663bdc4
      Roman Khabibov authored
      Add an ability to pass options to json.encode()/decode().
      
      Closes: #2888.
      
      @TarantoolBot document
      Title: json.encode() json.decode()
      Add an ability to pass options to
      json.encode() and json.decode().
      These are the same options that
      are used globally in json.cfg().
      1663bdc4
  5. Sep 06, 2018
    • Georgy Kirichenko's avatar
      Tarantool static build ability · cb1c72da
      Georgy Kirichenko authored
      A possibility to build tarantool with included library dependencies.
      Use the flag -DBUILD_STATIC=ON to build statically against curl, readline,
      ncurses, icu and z.
      Use the flag -DOPENSSL_USE_STATIC_LIBS=ON to build with static
      openssl
      
      Changes:
        * Add FindOpenSSL.cmake because some distributions do not support the use of
        openssl static libraries.
        * Find libssl before curl because of build dependency.
        * Catch all bundled libraries API and export then it in case of static
        build.
        * Rename crc32 internal functions to avoid a name clash with linked libraries.
      
      Notes:
        * Bundled libyaml is not properly exported, use the system one.
        * Dockerfile to build static with docker is included
      
      Fixes #3445
      cb1c72da
  6. Jul 19, 2018
  7. Jul 13, 2018
  8. Jul 12, 2018
  9. Jul 10, 2018
    • Kirill Shcherbatov's avatar
      app: fix parsing integers with exponent in json · f9f89acb
      Kirill Shcherbatov authored
      Now it is possible to specify a number in exponential
      form via all formats allowed by json standard.
      json.decode('{"remained_amount":2.0e+3}')
      json.decode('{"remained_amount":2.0E+3}')
      json.decode('{"remained_amount":2e+3}')
      json.decode('{"remained_amount":2E+3}')     <-- fixed
      
      Closes #3514.
      f9f89acb
  10. May 31, 2018
    • Vladislav Shpilevoy's avatar
      console: use Lua C API to do formatting for console · ac715203
      Vladislav Shpilevoy authored
      YAML formatting C API is needed for #2677, where it will be used
      to send text pushes and prints as tagged YAML documents.
      
      Push in the next patches is implemented as a virtual C method of
      struct session, so it is necessary to be able format YAML from C.
      
      Needed for #2677
      ac715203
    • Vladislav Shpilevoy's avatar
      yaml: introduce yaml.decode tag_only option · 567769d0
      Vladislav Shpilevoy authored
      Yaml.decode tag_only option allows to decode a single tag of a
      YAML document. For #2677 it is needed to detect different push
      types in text console: print pushes via console.print, and actual
      pushes via box.session.push.
      
      To distinguish them YAML tags will be used. A client console for
      each message will try to find a tag. If a tag is absent, then the
      message is a simple response to a request.
      
      If a tag is !print!, then the document consists of a single
      string, that must be printed. Such a document must be decoded to
      get the printed string. So the calls sequence is
      yaml.decode(tag_only) + yaml.decode. The reason why a print
      message must be decoded is that a print() result on a server side
      can be not well-formatted YAML, and must be encoded into it to be
      correctly sent. For example, when I do on a server side something
      like this:
      
      console.print('very bad YAML string')
      
      The result of a print() is not a YAML document, and to be sent it
      must be encoded into YAML on a server side.
      
      If a tag is !push!, then the document is sent via
      box.session.push, and must not be decoded. It can be just printed
      or ignored or something.
      
      Needed for #2677
      567769d0
    • Vladislav Shpilevoy's avatar
      lua: merge encode_tagged into encode options · b2da28f8
      Vladislav Shpilevoy authored
      Encode_tagged is a workaround to be able to pass options to
      yaml.encode().
      
      Before the patch yaml.encode() in fact has this signature:
      yaml.encode(...). So it was impossible to add any options to this
      function - all of them would be treated as the parameters. But
      documentation says: https://tarantool.io/en/doc/1.9/reference/reference_lua/yaml.html?highlight=yaml#lua-function.yaml.encode
      that the function has this signature: yaml.encode(value).
      
      I hope if anyone uses yaml.encode(), he does it according to the
      documentation. And I can add the {tag_prefix, tag_handle} options
      to yaml.encode() and remove yaml.encode_tagged() workaround.
      b2da28f8
  11. May 30, 2018
    • Vladislav Shpilevoy's avatar
      yaml: introduce yaml.encode_tagged · ddcd95a0
      Vladislav Shpilevoy authored
      Encode_tagged allows to define one global YAML tag for a
      document. Tagged YAML documents are going to be used for
      console text pushes to distinguish actual box.session.push() from
      console.print(). The first will have tag !push, and the
      second - !print.
      ddcd95a0
  12. May 07, 2018
    • Vladislav Shpilevoy's avatar
      yaml: don't throw OOM on any error in yaml encoding · fcba4a1a
      Vladislav Shpilevoy authored
      OOM is not single possible error. Yaml library during dump can
      raise such errors as YAML_MEMORY_ERROR, YAML_WRITER_ERROR,
      YAML_EMITTER_ERROR. And each of them can contain any error
      message that is skipped now, because Tarantool YAML does not
      provide such API, that can lead to a non-OOM error.
      
      But it is changed in next commits.
      fcba4a1a
  13. May 03, 2018
  14. Mar 30, 2018
    • Vladimir Davydov's avatar
      Update LuaRocks · 3171288c
      Vladimir Davydov authored
      Closes #3148
      3171288c
    • Vladimir Davydov's avatar
      libev: use clock_gettime on OS X if available · 10af1cb1
      Vladimir Davydov authored
      EV_USE_REALTIME and EV_USE_MONOTONIC, which force libev to use
      clock_gettime, are enabled automatically on Linux, but not on OS X. We
      used to forcefully enable them for performance reasons, but this broke
      compilation on certain OS X versions and so was disabled by commit
      d36ba279 ("Fix gh-1777: clock_gettime detected but unavailable in
      macos"). Today we need these features enabled not just because of
      performance, but also to avoid crashes when time changes on the host -
      see issue #2527 and commit a6c87bf9 ("Use ev_monotonic_now/time
      instead of ev_now/time for timeouts"). Fortunately, we have this cmake
      defined macro HAVE_CLOCKGETTIME_DECL, which is set if clock_gettime is
      available. Let's enable EV_USE_REALTIME and EV_USE_MONOTONIC if this
      macro is defined.
      
      Closes #3299
      10af1cb1
  15. Feb 26, 2018
  16. Jan 27, 2018
  17. Oct 05, 2017
  18. Sep 26, 2017
    • Vladislav Shpilevoy's avatar
      Introduce base64_encode options · cd4e26d4
      Vladislav Shpilevoy authored
      * no-wrap: do not wrap each 72 result symbols on a new line;
      * no-pad:  do not add padding at the end of a result;
      * urlsafe: no-wrap + no-pad + replace '+' -> '-' and '/' -> '_'.
      
      Closes #2777
      Closes #2478
      Closes #2479
      cd4e26d4
  19. Sep 18, 2017
  20. Sep 12, 2017
    • Roman Tsisyk's avatar
      Add FALLTHROUGH macro · 3ce62ef8
      Roman Tsisyk authored
      The fallthrough attribute with a null statement serves as a fallthrough
      statement. It hints to the compiler that a statement that falls through
      to another case label, or user-defined label in a switch statement is
      intentional and thus the -Wimplicit-fallthrough warning must not trigger.
      The fallthrough attribute may appear at most once in each attribute list,
      and may not be mixed with other attributes. It can only be used in a switch
      statement (the compiler will issue an error otherwise), after a preceding
      statement and before a logically succeeding case label, or user-defined
      label.
      
      https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/
      3ce62ef8
  21. Aug 22, 2017
    • Vladimir Davydov's avatar
      libev: export ev_monotonic_now() and ev_monotonic_time() · 230cef34
      Vladimir Davydov authored
      ev_now()/ev_time() are affected by system time changes, which makes them
      impractical for calculating timeouts. Introduce ev_monotonic_now() and
      ev_monotonic_time() which work exactly as ev_now()/ev_time(), but use
      monotonic clock instead of realtime.
      
      Needed for #2527
      230cef34
    • Roman Tsisyk's avatar
      Replace gopt with getopt_long() · f6370335
      Roman Tsisyk authored
      getopt_long() is available on all supported platforms.
      Get rid of legacy gopt and use getopt_long().
      
      Incompatible changes:
      
       * `tarantool --version --no-such-option` printed
          "unrecognized option '--no-such-option'", now it displays version.
          `tarantool --no-such-option --version` still prints an error message.
      
      Needed for #1265
      f6370335
    • Vladimir Davydov's avatar
      Update libev to version 4.24 · fb85c1da
      Vladimir Davydov authored
      fb85c1da
  22. Aug 18, 2017
  23. Aug 16, 2017
  24. Aug 03, 2017
  25. Jul 28, 2017
  26. Jul 24, 2017
  27. Jul 14, 2017
    • Roman Tsisyk's avatar
      Add minimal viable package manager based on LuaRocks · 9e7c4217
      Roman Tsisyk authored
      Usage:
      
          tarantoolctl rocks install ROCK - install a rock
          tarantoolctl rocks remove ROCK - remove a rock
          tarantoolctl rocks show ROCK - show information about an installed rock
          tarantoolctl rocks search PATTERN - search repository for rocks
          tarantoolctl rocks list - list all installed rocks
      
      There are no other commands, options, configuration files. Our official
      repository (http://rocks.tarantool.org) works out of the box. All rocks
      are installed to ${PWD}/.rocks directory to support separate rocks trees
      per project, as proposed by #2067. Rockspec can use "tarantool >= 1.7.x"
      inside dependencies = {} block to depend on a specific Tarantool version.
      
      LuaRocks has been slightly hacked to support custom configuration
      via site_config.lua. There are no other changes in the upstream code.
      It is not a fork and it isn't going to be a fork. All formats, layouts
      and rockspecs are 100% compatible with the upstream LuaRocks 2017-07-10.
      
      This feature intentionally doesn't have CMake option to disable it,
      because it should be provided on all available platforms out of the box.
      
      Other changes:
      
       * Add ${PWD}/.rocks to default package.path/package.cpath
       * Hack tarantoolctl to display subcommands in --help.
         Currently command line arguments handling are not perfect, but
         it can be fixed only by a new argparse implementation.
      
      Closes #2067
      9e7c4217
  28. Jul 10, 2017
    • alyapunov's avatar
      Use open MP sort optimisation only for huge arrays · 2e864b5a
      alyapunov authored
      Now open MP sort is used for any size of an array.
      For small arrays it's an overkill and even can cause overhead
      due to thread pool creation.
      
      Invoke open MP sort only for big arrays and use old good
      single-thread qsort for small arrays.
      
      Fix #2431
      2e864b5a
  29. Jun 20, 2017
  30. May 30, 2017
  31. May 04, 2017
    • Roman Tsisyk's avatar
      Fix severe slowdown on certain strings in LuaJIT · b8b102d5
      Roman Tsisyk authored
      Apply a patch from Yura Sokolov:
      
      The default "fast" string hash function samples only a few positions in
      a string, the remaining bytes don't affect the function's result. The
      function performs well for short strings; however long strings can yield
      extremely high collision rates.
      
      An adaptive schema was implemented. Two hash functions are used
      simultaneously. A bucket is picked based on the output of the fast hash
      function. If an item is to be inserted in a collision chain longer than
      a certain threshold, another bucket is picked based on the stronger hash
      function. Since two hash functions are used simultaneously, insert
      should consider two buckets. The second bucket is often NOT considered
      thanks to the bloom filter. The filter is rebuilt during GC cycle.
      b8b102d5
    • Roman Tsisyk's avatar
      Update LuaJIT to 2.1.0-beta3 · cef07700
      Roman Tsisyk authored
      Highlights from Mike Pall [1]:
      
      The major addition over beta2 is the LJ_GC64 mode JIT compiler
      backend contributed by Peter Cawley. Previously, only the x64 and
      ARM64 interpreters could be built in this mode. This mode removes
      the 32 bit limitation for garbage collected memory on 64 bit systems.
      
      LuaJIT for x64 can optionally be built for LJ_GC64 mode by
      enabling the -DLUAJIT_ENABLE_GC64 line in src/Makefile or via
      'msvcbuild.bat gc64'.
      
      Cisco Systems, Inc. and Linaro have sponsored the development of
      the JIT compiler backend for ARM64. Contributors are Djordje
      Kovacevic and Stefan Pejic from RT-RK, Charles Baylis from Linaro
      and Zheng Xu from ARM. ARM64 big endian mode is now supported, too.
      
      Cisco Systems, Inc. has sponsored the development of the MIPS64
      interpreter and JIT compiler backend. Contributors are Djordje
      Kovacevic and Stefan Pejic from RT-RK.
      
      Peter Cawley has contributed the changes for full exception
      interoperability on Windows/x86 (32 bit).
      
      François Perrad has contributed various extensions from Lua 5.2 and
      Lua 5.3. Note: some left-over compatibility defines for Lua 5.0
      have been removed from the header files.
      
      [1]: https://www.freelists.org/post/luajit/LuaJIT210beta3
      
      In context of #2396
      cef07700
Loading