Code Monkey home page Code Monkey logo

environmental's Introduction

Environmental

Summary
link:Cargo.toml[]
Description
link:src/lib.rs[]

environmental's People

Contributors

adoerr avatar bkchr avatar gavofyork avatar rphmeier avatar stanislav-tkach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

cheme ideal-lab5

environmental's Issues

Can environmental support rust generic?

for now, environmental can like this:

environmental!(counter: u32);

but I wanna use environmental like this:

struct A<C:Config> {
//...
}
environmental!(counter: A<C: Config>);

thus the environmental! need to support rust generic.

Can you guys support this? Thanks!

cannot find macro `thread_local` in this scope

Hey, I'm trying to import and use the environmental crate on a substrate chain, but it will not allow me to enable feature flags(?)

[dependencies]
environmental = { version = "1.1.3", features=["std"], git = "https://github.com/paritytech/environmental/" }

https://github.com/edgeware-network/edgeware-node/blob/erup-5-latest/primitives/rpc/evm-tracing-events/Cargo.toml#L11

//#[macro_use] //extern crate environmental;
environmental::environmental!(listener: dyn Listener + 'static);

pub fn using<R, F: FnOnce() -> R>(l: &mut (dyn Listener + 'static), f: F) -> R {
	listener::using(l, f)
}

https://github.com/edgeware-network/edgeware-node/blob/erup-5-latest/primitives/rpc/evm-tracing-events/src/lib.rs#L53

That throws me an error:

error: cannot find macro `thread_local` in this scope
    --> /home/runner/work/edgeware-node/edgeware-node/primitives/rpc/evm-tracing-events/src/lib.rs:53:1
     |
  53 | environmental::environmental!(listener: dyn Listener + 'static);
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: `thread_local` is in scope, but it is an attribute: `#[thread_local]`
     = note: this error originates in the macro `$crate::thread_local_impl` (in Nightly builds, run with -Z macro-backtrace for more info)

  error[E0425]: cannot find value `GLOBAL` in this scope
    --> /home/runner/work/edgeware-node/edgeware-node/primitives/rpc/evm-tracing-events/src/lib.rs:53:1
     |
  53 | environmental::environmental!(listener: dyn Listener + 'static);
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
     |
     = note: this error originates in the macro `environmental::environmental` (in Nightly builds, run with -Z macro-backtrace for more info)


Detailed debug log:
https://github.com/edgeware-network/edgeware-node/runs/6611632907?check_suite_focus=true#step:8:1494

panicked at `already borrowed: BorrowMutError`

When running benchmarks, we are getting the following error, and we have problems finding the issue, we never had any problems under normal load. The potential causes coming to my mind is a potentially deep nesting of with calls due to access from different threads. This is how we use it: https://github.com/integritee-network/sgx-runtime/blob/7249cad5f43f73f2fc8f676a6a2435f057962b73/substrate-sgx/sp-io/src/lib.rs#L109

thread '' panicked at 'already borrowed: BorrowMutError', /home/sproll/.cargo/registry/src/github.com-1ecc6299db9ec823/environmental-1.1.3/src/lib.rs:142:41
note: Call backtrace::enable_backtrace with 'PrintFormat::Short/Full' for a backtrace.
fatal runtime error: failed to initiate panic, error 5

Do you have any idea, what it could be?

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.