Skip to content

Build issues #49

@DrMaxNix

Description

@DrMaxNix

While trying to install etebase-py, I encountered multiple issues. I am neither a python dev nor do I know a lot of the rust language. I am putting this here in the hopes that it may be useful to other users, and maybe these problems can be fixed in the build system of this repo.

Using pip install etebase

I get following error and did not yet find out how to fix it:

Compiling etebase-python v0.31.5 (/tmp/pip-install-73h90nkk/etebase_5307997261814e209c1f23030d63b756)
           Running `rustc --crate-name etebase_python --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type cdylib --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no --crate-type cdylib -C metadata=58282d333476a2ad --out-dir /tmp/pip-install-73h90nkk/etebase_5307997261814e209c1f23030d63b756/target/release/deps -L dependency=/tmp/pip-install-73h90nkk/etebase_5307997261814e209c1f23030d63b756/target/release/deps --extern cpython=/tmp/pip-install-73h90nkk/etebase_5307997261814e209c1f23030d63b756/target/release/deps/libcpython-0b548ee2a58844cb.rlib --extern etebase=/tmp/pip-install-73h90nkk/etebase_5307997261814e209c1f23030d63b756/target/release/deps/libetebase-0b086b231abf20d4.rlib --extern openssl=/tmp/pip-install-73h90nkk/etebase_5307997261814e209c1f23030d63b756/target/release/deps/libopenssl-fed3fb6e0a5b2602.rlib -L native=/tmp/pip-install-73h90nkk/etebase_5307997261814e209c1f23030d63b756/target/release/build/libsodium-sys-49c0bca48661c149/out/installed/lib -L native=/tmp/pip-install-73h90nkk/etebase_5307997261814e209c1f23030d63b756/target/release/build/openssl-sys-e780c3570d2f74dc/out/openssl-build/install/lib`
      error: environment variable `OUT_DIR` not defined
        --> src/lib.rs:62:18
         |
      62 | include!(concat!(env!("OUT_DIR"), "/glue.rs"));
         |                  ^^^^^^^^^^^^^^^
         |
         = note: this error originates in the macro `env` (in Nightly builds, run with -Z macro-backtrace for more info)
      
      error: could not compile `etebase-python` due to previous error
      
      Caused by:
        process didn't exit successfully: `rustc --crate-name etebase_python --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type cdylib --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no --crate-type cdylib -C metadata=58282d333476a2ad --out-dir /tmp/pip-install-73h90nkk/etebase_5307997261814e209c1f23030d63b756/target/release/deps -L dependency=/tmp/pip-install-73h90nkk/etebase_5307997261814e209c1f23030d63b756/target/release/deps --extern cpython=/tmp/pip-install-73h90nkk/etebase_5307997261814e209c1f23030d63b756/target/release/deps/libcpython-0b548ee2a58844cb.rlib --extern etebase=/tmp/pip-install-73h90nkk/etebase_5307997261814e209c1f23030d63b756/target/release/deps/libetebase-0b086b231abf20d4.rlib --extern openssl=/tmp/pip-install-73h90nkk/etebase_5307997261814e209c1f23030d63b756/target/release/deps/libopenssl-fed3fb6e0a5b2602.rlib -L native=/tmp/pip-install-73h90nkk/etebase_5307997261814e209c1f23030d63b756/target/release/build/libsodium-sys-49c0bca48661c149/out/installed/lib -L native=/tmp/pip-install-73h90nkk/etebase_5307997261814e209c1f23030d63b756/target/release/build/openssl-sys-e780c3570d2f74dc/out/openssl-build/install/lib` (exit status: 1)
      error: `cargo rustc --lib --message-format=json-render-diagnostics --manifest-path Cargo.toml --release -v --features 'cpython/python3-sys cpython/extension-module' -- --crate-type cdylib` failed with code 101
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for etebase
Failed to build etebase
ERROR: Could not build wheels for etebase, which is required to install pyproject.toml-based projects

I tested this on different devices and different CPU architectures; I always get the same result.

Using python setup.py bdist_wheel

I stumbled upon following problem:

     Running `/opt/etegrab/test/etebase-py/target/release/build/etebase-python-158055b683d88e12/build-script-build`
error: failed to run custom build command for `etebase-python v0.31.6 (/opt/etegrab/test/etebase-py)`

Caused by:
  process didn't exit successfully: `/opt/etegrab/test/etebase-py/target/release/build/etebase-python-158055b683d88e12/build-script-build` (exit status: 101)
  --- stderr
  thread 'main' panicked at 'Error during running of rustfmt: Cannot find binary path', /home/etegrab/.cargo/git/checkouts/flapigen-rs-d05dfb13e7b0b455/2bf1533/macroslib/src/lib.rs:702:21
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: `cargo rustc --lib --message-format=json-render-diagnostics --manifest-path Cargo.toml --release -v --features 'cpython/python3-sys cpython/extension-module' -- --crate-type cdylib` failed with code 101

This (as the error message states) was caused by a missing rustfmt binary. A quick apt install rustfmt did the trick.
Maybe the rustfmt dependency could be added to the build system itself. If not, I think a notice about this in the README would also do the trick.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions