Skip to content

[BUG] Incompatible with bp3d crates #822

@Yuri6037

Description

@Yuri6037

Describe the bug
This crate causes compile errors when used with bp3d crates.

To Reproduce
Add the following to a Cargo.toml:

bp3d-lua = { version = "1.0.0-rc.2.1.0", path = "../core", features = ["root-vm", "util-module", "libs", "dynamic", "interrupt"] }
bp3d-debug = "1.0.0-rc.6.2.0"
cursive = "0.21.1"

Expected behavior
No build error.

Environment

  • macOS
  • Backend used: ncurses
  • Current locale en_US.UTF-8
  • Cursive version crate.io latest

Additional context
The main problem is this crate requires cursive-core which requires log and time/local-time. The time/local-time feature is banned in any bp3d based tool as that:

  1. may throw errors in the presence of threads in older versions of time.
  2. depends on environment variables rather than directly using OS time zone.
  3. exposes functions which override/hide functions present in bp3d-os/time, obviously the functions in bp3d-os/time do not have the same signature and obviously NOT the same semantics.

The log crate should be avoided as much as possible in the presence of bp3d. When needed the log crate must never be attached to a backend as bp3d forces its own log backend as a redirect to bp3d-debug. If a backend must be provided, it should hook into bp3d-debog rather than log as that ultimately conflict with bp3d. Unfortunately your crate has a log backend which is not behind a feature.

I believe you could just put your logger behind a feature, of course disabled by default and that should fix build with bp3d crates.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions