Git Product home page Git Product logo

libetebase's People

Contributors

loqs avatar shashwatjolly avatar skycoder42 avatar tasn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

libetebase's Issues

libetebase fails to build with OpenSSL 3.0

libetebase 0.5.1
openssl 3.0.2
Built as follows:

cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
env CARGO_INCREMENTAL=0 SODIUM_USE_PKG_CONFIG= cargo build --release --locked --offline
   Compiling libc v0.2.73
   Compiling proc-macro2 v1.0.19
   Compiling autocfg v1.0.0
   Compiling unicode-xid v0.2.1
   Compiling syn v1.0.36
   Compiling log v0.4.11
   Compiling cfg-if v0.1.10
   Compiling serde_derive v1.0.114
   Compiling cc v1.0.58
   Compiling serde v1.0.114
   Compiling pkg-config v0.3.18
   Compiling bitflags v1.2.1
   Compiling lazy_static v1.4.0
   Compiling memchr v2.3.3
   Compiling bytes v0.5.6
   Compiling fnv v1.0.7
   Compiling slab v0.4.2
   Compiling version_check v0.9.2
   Compiling futures-core v0.3.5
   Compiling getrandom v0.1.14
   Compiling pin-project-internal v0.4.23
   Compiling itoa v0.4.6
   Compiling pin-project-lite v0.1.7
   Compiling foreign-types-shared v0.1.1
   Compiling openssl v0.10.30
   Compiling once_cell v1.4.0
   Compiling matches v0.1.8
   Compiling futures-io v0.3.5
   Compiling futures-sink v0.3.5
   Compiling same-file v1.0.6
   Compiling tinyvec v0.3.3
   Compiling pin-utils v0.1.0
   Compiling ppv-lite86 v0.2.8
   Compiling httparse v1.3.4
   Compiling native-tls v0.2.4
   Compiling ryu v1.0.5
   Compiling serde_json v1.0.57
   Compiling byteorder v1.3.4
   Compiling openssl-probe v0.1.2
   Compiling unicode-width v0.1.8
   Compiling try-lock v0.2.3
   Compiling cbindgen v0.14.4
   Compiling ansi_term v0.11.0
   Compiling unicode-segmentation v1.6.0
   Compiling tower-service v0.3.0
   Compiling percent-encoding v2.1.0
   Compiling encoding_rs v0.8.23
   Compiling strsim v0.8.0
   Compiling vec_map v0.8.2
   Compiling remove_dir_all v0.5.3
   Compiling dtoa v0.4.6
   Compiling mime v0.3.16
   Compiling signature v1.5.0
   Compiling ipnet v2.3.0
   Compiling base64 v0.12.3
   Compiling remove_dir_all v0.6.0
   Compiling foreign-types v0.3.2
   Compiling tracing-core v0.1.11
   Compiling unicode-bidi v0.3.4
   Compiling futures-channel v0.3.5
   Compiling walkdir v2.3.2
   Compiling futures-task v0.3.5
   Compiling textwrap v0.11.0
   Compiling unicode-normalization v0.1.13
   Compiling ed25519 v1.3.0
   Compiling unicase v2.6.0
   Compiling hashbrown v0.8.1
   Compiling indexmap v1.5.0
   Compiling num-traits v0.2.12
   Compiling http v0.2.1
   Compiling want v0.3.0
   Compiling heck v0.3.1
   Compiling tracing v0.1.17
   Compiling quote v1.0.7
   Compiling mime_guess v2.0.3
   Compiling openssl-sys v0.9.58
   Compiling libsodium-sys v0.2.7
   Compiling iovec v0.1.4
   Compiling net2 v0.2.34
   Compiling num_cpus v1.13.0
   Compiling socket2 v0.3.12
   Compiling time v0.1.43
   Compiling atty v0.2.14
   Compiling idna v0.2.0
   Compiling clap v2.33.3
   Compiling rand_core v0.5.1
   Compiling mio v0.6.22
   Compiling rand_chacha v0.2.2
The following warnings were emitted during compilation:

warning: build/expando.c:4:24: error: pasting "RUST_VERSION_OPENSSL_" and "(" does not give a valid preprocessing token
warning:     4 | #define VERSION2(n, v) RUST_VERSION_##n##_##v
warning:       |                        ^~~~~~~~~~~~~
warning: build/expando.c:5:23: note: in expansion of macro ‘VERSION2’
warning:     5 | #define VERSION(n, v) VERSION2(n, v)
warning:       |                       ^~~~~~~~
warning: build/expando.c:10:1: note: in expansion of macro ‘VERSION’
warning:    10 | VERSION(OPENSSL, OPENSSL_VERSION_NUMBER)
warning:       | ^~~~~~~

error: failed to run custom build command for `openssl-sys v0.9.58`

Caused by:
  process didn't exit successfully: `/build/libetebase/src/libetebase-0.5.1/target/release/build/openssl-sys-57be104769787e05/build-script-main` (exit status: 101)
  --- stdout
  cargo:rustc-cfg=const_fn
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR
  X86_64_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_LIB_DIR
  OPENSSL_LIB_DIR unset
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR
  X86_64_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_INCLUDE_DIR
  OPENSSL_INCLUDE_DIR unset
  cargo:rerun-if-env-changed=X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR
  X86_64_UNKNOWN_LINUX_GNU_OPENSSL_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_DIR
  OPENSSL_DIR unset
  cargo:rerun-if-env-changed=OPENSSL_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=OPENSSL_STATIC
  cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=OPENSSL_STATIC
  cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rustc-link-lib=ssl
  cargo:rustc-link-lib=crypto
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=OPENSSL_STATIC
  cargo:rerun-if-env-changed=OPENSSL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-linux-gnu
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_linux_gnu
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR
  OPT_LEVEL = Some("3")
  TARGET = Some("x86_64-unknown-linux-gnu")
  HOST = Some("x86_64-unknown-linux-gnu")
  CC_x86_64-unknown-linux-gnu = None
  CC_x86_64_unknown_linux_gnu = None
  HOST_CC = None
  CC = None
  CFLAGS_x86_64-unknown-linux-gnu = None
  CFLAGS_x86_64_unknown_linux_gnu = None
  HOST_CFLAGS = None
  CFLAGS = Some("-march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions         -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security         -fstack-clash-protection -fcf-protection -flto=auto")
  CRATE_CC_NO_DEFAULTS = None
  DEBUG = Some("false")
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  running: "cc" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-march=x86-64" "-mtune=generic" "-O2" "-pipe" "-fno-plt" "-fexceptions" "-Wp,-D_FORTIFY_SOURCE=2" "-Wformat" "-Werror=format-security" "-fstack-clash-protection" "-fcf-protection" "-flto=auto" "-I" "/usr/include" "-E" "build/expando.c"
  cargo:warning=build/expando.c:4:24: error: pasting "RUST_VERSION_OPENSSL_" and "(" does not give a valid preprocessing token
  cargo:warning=    4 | #define VERSION2(n, v) RUST_VERSION_##n##_##v
  cargo:warning=      |                        ^~~~~~~~~~~~~
  cargo:warning=build/expando.c:5:23: note: in expansion of macro ‘VERSION2’
  cargo:warning=    5 | #define VERSION(n, v) VERSION2(n, v)
  cargo:warning=      |                       ^~~~~~~~
  cargo:warning=build/expando.c:10:1: note: in expansion of macro ‘VERSION’
  cargo:warning=   10 | VERSION(OPENSSL, OPENSSL_VERSION_NUMBER)
  cargo:warning=      | ^~~~~~~
  exit status: 1

  --- stderr
  thread 'main' panicked at '
  Header expansion error:
  Error { kind: ToolExecError, message: "Command \"cc\" \"-O3\" \"-ffunction-sections\" \"-fdata-sections\" \"-fPIC\" \"-m64\" \"-march=x86-64\" \"-mtune=generic\" \"-O2\" \"-pipe\" \"-fno-plt\" \"-fexceptions\" \"-Wp,-D_FORTIFY_SOURCE=2\" \"-Wformat\" \"-Werror=format-security\" \"-fstack-clash-protection\" \"-fcf-protection\" \"-flto=auto\" \"-I\" \"/usr/include\" \"-E\" \"build/expando.c\" with args \"cc\" did not execute successfully (status code exit status: 1)." }

  Failed to find OpenSSL development headers.

  You can try fixing this setting the `OPENSSL_DIR` environment variable
  pointing to your OpenSSL installation or installing OpenSSL headers package
  specific to your distribution:

      # On Ubuntu
      sudo apt-get install libssl-dev
      # On Arch Linux
      sudo pacman -S openssl
      # On Fedora
      sudo dnf install openssl-devel

  See rust-openssl README for more information:

      https://github.com/sfackler/rust-openssl#linux
  ', /build/.cargo/registry/src/github.com-1ecc6299db9ec823/openssl-sys-0.9.58/build/main.rs:140:13
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: build failed

Updating the Rust crates openssl-sys to 0.9.72 and openssl to 0.10.38 allowed the build to succeed.

ETEBASE_UTILS_PRETTY_FINGERPRINT_SIZE holds wrong value

In the current implementation, the value of ETEBASE_UTILS_PRETTY_FINGERPRINT_SIZE is wrong. If you look at
https://github.com/etesync/libetebase/blob/master/src/lib.rs#L224, you can see that the size is defined as:

#[no_mangle]
pub static ETEBASE_UTILS_PRETTY_FINGERPRINT_SIZE: usize =
    1 + // Null
    4 + // Newlines
    (3 * 12) + // Spacing
    (5 * 16); // Digits
// sums up to be: 121

However, a few lines below, the fingerprint is document to have the following format:

45680   71497   88570   93128
19189   84243   25687   20837
47924   46071   54113   18789

Which means there are 2 instead of 4 newlines, only 9 spacing- and 12 digit-blocks. So, the size should actually be
calculated as:

#[no_mangle]
pub static ETEBASE_UTILS_PRETTY_FINGERPRINT_SIZE: usize =
    1 + // Null
    2 + // Newlines
    (3 * 9) + // Spacing
    (5 * 12); // Digits
// sums up to be: 90

`etebase_client_new` throw `ETEBASE_ERROR_CODE_MSG_PACK`

I trying to implement Etebase on my application but I'm getting stuck on etebase_client_new function which throws ETEBASE_ERROR_CODE_MSG_PACK.
I would know in which case this exception is thrown ?
Also, I would know what is the purpose of the first argument const char *client_name of the function ?

Here is my code :

EtebaseErrorCode EteSync::createClient(std::string &customServerUrl, EtebaseClient **client) {
    const char *serverUrl = serverUrl.empty() ? etebase_get_default_server_url() : customServerUrl.c_str();

    *client = etebase_client_new("client", serverUrl);
    EtebaseErrorCode err = etebase_error_get_code();
    if (err != ETEBASE_ERROR_CODE_NO_ERROR) {
        return err;
    }

    ...

    return ETEBASE_ERROR_CODE_NO_ERROR;
}

Thank you

Release a new version with the recent bugfixes

I think with the recent PRs merged, you should release a new version. Especially the fact that rejecting an invitation instead accept it is kinda a security problem, so I think releasing it as soon as possible is a good idea.

Choose correct libdir in Makefile, pkgconfig etc

The Makefile should let the user configure the libdir path to allow installing the library to for instance /usr/lib64 instead of /usr/lib. This should also set the correct path in the etebase.pc file.

This makes it easier and less hacky to package libetebase for distros.

I think we've already discussed this, but creating an issue to track this until we've had the time to fix this and make a new version.

etebase_error_get_message() crash application

call of etebase_error_get_message() seems to crash the application.

step to reproduce

#include <iostream>
#include <etebase/etebase.h>

int main() {
	EtebaseClient *client = etebase_client_new("a", "https://example.com");
	std::cout << "error: " << etebase_error_get_message() << std::endl;
	std::cout << "test" << std::endl;

	return 0;
}
  • run the above code
  • you should see error: but not the test

Use SO version and create appropriate symlinks

I am currently packaging libetebase for Alpine, and it seems that libetebase is currently not using versioning for its shared object; so currently we have to create symlinks manually: https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/23675#3d7890f078f0c91507ca805d810f5e1141c6c189_0_22. Without them, software like evolution-etesync doesn't work properly as (at least on Alpine's build system) it automatically links against libetebase.so.0.
Do you want to consider using proper SO names with API versions, or should distributions patch it on their own?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.