Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mc-sgx-panic crate for common panic handling #30

Merged
merged 1 commit into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ members = [
"alloc",
"io",
"io/untrusted",
"panic"
]
exclude = [
"panic/abort",
Expand Down
14 changes: 14 additions & 0 deletions panic/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[package]
name = "mc-sgx-panic"
version = "0.1.0"
edition = "2021"
authors = ["MobileCoin"]
rust-version = "1.62.1"
license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/mobilecoinfoundation/sgx-std"
description = "Common panic handling behavior for SGX enclaves"
categories = ["hardware-support", "no-std"]
keywords = ["sgx", "no-std", "panic"]

[dependencies]
21 changes: 21 additions & 0 deletions panic/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# MobileCoin: Common panic handling behavior for SGX enclaves

[![Project Chat][chat-image]][chat-link]<!--
-->![License][license-image]<!--
-->![Target][target-image]<!--
-->[![Crates.io][crate-image]][crate-link]<!--
-->[![Docs Status][docs-image]][docs-link]<!--
-->[![Dependency Status][deps-image]][deps-link]

Common panic handling behavior for SGX enclaves

[chat-image]: https://img.shields.io/discord/844353360348971068?style=flat-square
[chat-link]: https://mobilecoin.chat
[license-image]: https://img.shields.io/crates/l/mc-sgx-panic?style=flat-square
[target-image]: https://img.shields.io/badge/target-sgx-red?style=flat-square
[crate-image]: https://img.shields.io/crates/v/mc-sgx-panic.svg?style=flat-square
[crate-link]: https://crates.io/crates/mc-sgx-panic
[docs-image]: https://img.shields.io/docsrs/mc-sgx-panic?style=flat-square
[docs-link]: https://docs.rs/crate/mc-sgx-panic
[deps-image]: https://deps.rs/crate/mc-sgx-panic/0.1.0/status.svg?style=flat-square
[deps-link]: https://deps.rs/crate/mc-sgx-panic/0.1.0
3 changes: 2 additions & 1 deletion panic/abort/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ description = "Panic handler for SGX enclaves that aborts"
categories = ["hardware-support", "no-std"]
keywords = ["sgx", "no-std", "panic"]

[workspace]

[dependencies]
# To get link in the abort() function
mc-sgx-trts-sys = "0.4.0"
Expand All @@ -32,4 +34,3 @@ tag-name = "v{{version}}"
pre-release-replacements = [
{file="README.md", search="mc-[a-z-]+/[0-9.]+", replace="{{crate_name}}/{{version}}"},
]

20 changes: 20 additions & 0 deletions panic/log/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,25 @@ description = "Panic handler for an SGX enclave that logs to the untrusted (host
categories = ["hardware-support", "no-std"]
keywords = ["sgx", "no-std", "panic"]

[workspace]

[dependencies]
mc-sgx-io = { path = "../../io", version = "0.1.0" }

# This is a crate that can only be built for an SGX target, so it's not part of
# the root workspace. Because of this limitation we must re-iterate the
# `cargo release` settings here
[package.metadata.release]
shared-version = true
dev-version-ext = "beta.0"
consolidate-commits = true
consolidate-pushes = true
tag-name = "v{{version}}"

# The file names in this key are relative to the each crate that gets released.
# So we only need one `README.md` entry if all the README's follow a
# common format and are always next to the Cargo.toml for their respective
# package.
pre-release-replacements = [
{file="README.md", search="mc-[a-z-]+/[0-9.]+", replace="{{crate_name}}/{{version}}"},
]
4 changes: 4 additions & 0 deletions panic/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// Copyright (c) 2023 The MobileCoin Foundation
#![doc = include_str!("../README.md")]
#![deny(missing_docs, missing_debug_implementations, unsafe_code)]
#![no_std]