Skip to content

Commit

Permalink
cmake: hide tarantool symbols back
Browse files Browse the repository at this point in the history
After unhiding all internal symbols([1]) we experience a bunch of
problems ([2], [3]). The second one (clash of symbols from different version
of the "small" library) still have no good solution.
You can find more on the topic [4].

The situation for tarantool executable is the same as for any other library.
A library should expose only its public API and should not increase probability
of hard to debug problems due to clash of a user's code with an internal name
from the library.

Let's hide all symbols by default and create a list of exported symbols.
(In fact, this patch is a revert of the patch
03790ac ([5]) taking into account the changes
made to the code)

Explanation of adding some controversial symbols to the export list:

* The following symbols are used in shared libraries used in tests
  ("cfunc*.so", "sql_uuid.so", "gh-6024-funcs-return-bin.so", "function1.so",
  "gh-5938-wrong-string-length.so", "module_api.so")

    mp_check
    mp_encode_array
    mp_encode_bin
    mp_encode_bool
    mp_encode_int
    mp_encode_map
    mp_encode_nil
    mp_encode_str
    mp_encode_uint
    mp_decode_array_slowpath
    mp_decode_str
    mp_next_slowpath
    mp_load_u8
    mp_next
    mp_sizeof_array
    mp_sizeof_str
    mp_type_hint
    decimal_from_string

* These symbols are used in "crypto.lua" and, if absent, will lead to the
  failure of the "static_build_cmake_linux" on CI (the crypto prefix was
  used to avoid the clashes of names)

    crypto_ERR_error_string
    crypto_ERR_get_error
    crypto_EVP_DigestInit_ex
    crypto_EVP_DigestUpdate
    crypto_EVP_DigestFinal_ex
    crypto_EVP_get_digestbyname
    crypto_HMAC_Init_ex
    crypto_HMAC_Update
    crypto_HMAC_Final

* For correct work of "schema.lua" in the "static_build_cmake_linux"

    rl_get_screen_size

* The following symbols are used in "ssl-cert-paths-discover.test.lua"
  (I think these symbols will have to be wrapped in the to avoid clashes
  problems)

    X509_get_default_cert_dir_env
    X509_get_default_cert_file_env
    ssl_cert_paths_discover

From "exports.test.lua" have been removed ZSTD symbols checking (see [6]) and
"tt_uuid_str" (see [7]).

1. #2971
2. #5001
3. tarantool/memcached#59
4. https://lists.tarantool.org/pipermail/tarantool-discussions/2020-September/000095.html
5. 03790ac
6. #4225
7. acf8745

Part of #5932
  • Loading branch information
LeonidVas authored and yanshtunder committed Oct 4, 2021
1 parent 4a4ea13 commit d2b825e
Show file tree
Hide file tree
Showing 15 changed files with 756 additions and 746 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -60,6 +60,7 @@ extra/dist/tarantool.logrotate
extra/dist/tarantool@.service
extra/dist/tarantool.tmpfiles.conf
extra/dist/tarantool-generator
extra/exports.*
cmake_install.cmake
config.mk
config.guess
Expand Down

0 comments on commit d2b825e

Please sign in to comment.