-
Notifications
You must be signed in to change notification settings - Fork 253
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare for this crate to go into libstd
This commit is a preparation of this crate to be included as a submodule into the standard library. I'm not 100% sold on this yet but I'm somewhat convinced that this is going to happen this way. This is progress on #328 and a preview of what it might look like to implement this strategy. Currently I don't plan to merge this to the `master` branch unless it's decided to move forward with this integration strategy of the gimli feature of the backtrace crate.
- Loading branch information
1 parent
00052ca
commit cc5d40c
Showing
21 changed files
with
149 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
set -ex | ||
|
||
cargo test --target $TARGET | ||
cargo build --target $TARGET --manifest-path crates/as-if-std/Cargo.toml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
[package] | ||
name = "as-if-std" | ||
version = "0.1.0" | ||
authors = ["Alex Crichton <[email protected]>"] | ||
edition = "2018" | ||
publish = false | ||
|
||
[lib] | ||
test = false | ||
doc = false | ||
doctest = false | ||
bench = false | ||
|
||
[dependencies] | ||
cfg-if = "0.1.10" | ||
rustc-demangle = "0.1.4" | ||
libc = { version = "0.2.45", default-features = false } | ||
addr2line = { version = "0.12.0", default-features = false } | ||
miniz_oxide = { version = "0.3.7" } | ||
|
||
[dependencies.object] | ||
version = "0.20.0" | ||
default-features = false | ||
features = ['read_core', 'elf', 'macho', 'pe', 'unaligned'] | ||
|
||
[features] | ||
default = ['gimli-symbolize'] | ||
gimli-symbolize = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
println!("cargo:rustc-cfg=backtrace_in_libstd"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// A crate which builds the `backtrace` crate as-if it's included as a | ||
// submodule into the standard library. We try to set this crate up similarly | ||
// to the standard library itself to minimize the likelihood of issues when | ||
// updating the `backtrace` crate. | ||
|
||
#![no_std] | ||
|
||
extern crate alloc; | ||
|
||
// We want to `pub use std::*` in the root but we don't want `std` available in | ||
// the root namespace, so do this in a funky inner module. | ||
mod __internal { | ||
extern crate std; | ||
pub use std::*; | ||
} | ||
|
||
pub use __internal::*; | ||
|
||
// This is the magical part which we hope works. | ||
#[path = "../../../src/lib.rs"] | ||
mod the_backtrace_crate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.