sos-os / alarm

ALARM: Another Library for Allocating and Releasing Memory
Apache License 2.0
8 stars 6 forks source link

error: no #[default_lib_allocator] found but one is required; is libstd not linked? #48

Open amanjeev opened 6 years ago

amanjeev commented 6 years ago

Running cargo test gives the following error.

   Doc-tests alarm_base
error: no #[default_lib_allocator] found but one is required; is libstd not linked?

Not sure if this is any important but even if it is a minor issue, I believe it is worth documenting here.

amanjeev commented 6 years ago

I believe since this library is a memory allocator itself, we do not need this but how to suppress this error?

hawkw commented 6 years ago

I believe since this library is a memory allocator itself, we do not need this

That's correct.

how to suppress this error?

It looks like something in the alarm-base crate is inadvertently depending on allocation, i suspect only when running tests. I'll take a look!

hawkw commented 6 years ago

Hmm, looks like a similar issue (rust-lang/rust#46821) has been reported for the Rust standard library's alloc_system crate as well.

I'm fairly certain that this error message is spurious. Since the test task still appears to exit with 0, this shouldn't break our CI builds. I'll continue trying to figure out if there's an easy way to suppress this, but as we're not failing builds due to it, it's not super high priority. For the meantime I think it would be fine to add a note somewhere that if you see this error, don't worry about it.

amanjeev commented 6 years ago

How about adding a "Running test" section in README.md?

There is already Building ALARM section. https://github.com/sos-os/alarm/blob/master/README.md#building-alarm