Skip to content

Commit b51662f

Browse files
bors[bot]adamgreig
andauthored
Merge #315
315: Add forwards-compatible v0.6.5 r=thalesfragoso a=adamgreig This PR creates a new v0.6.5 on the v0.6.x branch, which depends on v0.7 and re-exports many of its types. Notable changes: * The `links` field is removed from Cargo.toml to permit linking to v0.7 series * The `#[no_mangle] CORE_PERIPHERALS` static is removed to permit linking to v0.7 series * The `TAKEN` static is removed: sadly we can't access the 0.7 static because it's not pub, so instead this version calls `take()` and `steal()` from v0.7 to ensure only one version of `PERIPHERALS` (from either 0.6 or 0.7) can exist at once. * As in v0.5.10, we transmute a unit tuple into `PERIPHERALS` as we can no longer construct many of its types. * I've removed the old Travis config and copied the GHA CI/clippy runs back into this branch so hopefully they run (and pass!) here. Types that are *not* exported from 0.7: * ITM, MPU, NVIC, SCB all have breaking changes, though some smaller types within those modules are re-exported. * in `register`, we keep `basepri`, `basepri_max`, `lr`, `pc`, `apsr` only for the targets which 0.7 no longer exports them for. I've tested that using this version builds on several projects that currently use 0.6.4, including using RTIC, various STM32 PACs, etc, and including changing those projects to use c-m 0.7 at the top level but continue to depend on other crates (PACs, RTIC, etc) that use 0.6.4. They all build. Nevertheless I'd definitely appreciate more testing on this. We could even do a prerelease on crates.io? Co-authored-by: Adam Greig <[email protected]>
2 parents 30d9d19 + 942eab1 commit b51662f

29 files changed

+131
-2303
lines changed

.github/bors.toml

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
block_labels = ["needs-decision"]
22
delete_merged_branches = true
33
required_approvals = 1
4-
status = ["continuous-integration/travis-ci/push"]
4+
status = [
5+
"ci-linux (stable)",
6+
"ci-linux (1.38.0)",
7+
"clippy",
8+
]

.github/workflows/ci.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
on:
2+
push:
3+
branches: [ staging, trying, master ]
4+
pull_request:
5+
6+
name: CI
7+
8+
jobs:
9+
ci-linux:
10+
runs-on: ubuntu-latest
11+
continue-on-error: ${{ matrix.experimental || false }}
12+
strategy:
13+
matrix:
14+
# All generated code should be running on stable now
15+
rust: [stable]
16+
17+
include:
18+
# Test MSRV
19+
- rust: 1.38.0
20+
21+
# Test nightly but don't fail
22+
- rust: nightly
23+
experimental: true
24+
steps:
25+
- uses: actions/checkout@v2
26+
- uses: actions-rs/toolchain@v1
27+
with:
28+
profile: minimal
29+
toolchain: ${{ matrix.rust }}
30+
override: true
31+
- name: Run tests
32+
run: cargo test --all
33+
34+
# FIXME: test on macOS and Windows

.github/workflows/clippy.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
on:
2+
push:
3+
branches: [ staging, trying, master ]
4+
pull_request_target:
5+
6+
name: Clippy check
7+
jobs:
8+
clippy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
if: github.event_name == 'pull_request_target'
13+
with:
14+
ref: refs/pull/${{ github.event.number }}/head
15+
- uses: actions/checkout@v2
16+
if: github.event_name != 'pull_request_target'
17+
- uses: actions-rs/toolchain@v1
18+
with:
19+
profile: minimal
20+
toolchain: stable
21+
override: true
22+
components: clippy
23+
- uses: actions-rs/clippy-check@v1
24+
with:
25+
token: ${{ secrets.GITHUB_TOKEN }}

.travis.yml

-96
This file was deleted.

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
77

88
## [Unreleased]
99

10+
## [v0.6.5] - 2021-01-13
11+
12+
### Changed
13+
14+
- This release is forwards-compatible with cortex-m 0.7, and depends on and
15+
re-exports many types from that version. Both 0.6.5 and 0.7 may co-exist
16+
in a build.
17+
1018
## [v0.6.4] - 2020-10-26
1119

1220
### Changed

Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ license = "MIT OR Apache-2.0"
1111
name = "cortex-m"
1212
readme = "README.md"
1313
repository = "https://github.com/rust-embedded/cortex-m"
14-
version = "0.6.4"
14+
version = "0.6.5-alpha"
1515
edition = "2018"
16-
links = "cortex-m" # prevent multiple versions of this crate to be linked together
1716

1817
[dependencies]
1918
aligned = "0.3.1"
2019
bare-metal = { version = "0.2.0", features = ["const-fn"] }
2120
volatile-register = "0.2.0"
2221
bitfield = "0.13.2"
22+
cortex_m_0_7 = { package = "cortex-m", version = "0.7.0" }
2323

2424
[features]
2525
const-fn = []
26-
cm7-r0p1 = []
27-
inline-asm = []
26+
cm7-r0p1 = ["cortex_m_0_7/cm7-r0p1"]
27+
inline-asm = ["cortex_m_0_7/inline-asm"]

build.rs

+1-14
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,7 @@
1-
use std::path::PathBuf;
2-
use std::{env, fs};
1+
use std::env;
32

43
fn main() {
54
let target = env::var("TARGET").unwrap();
6-
let out_dir = PathBuf::from(env::var("OUT_DIR").unwrap());
7-
let name = env::var("CARGO_PKG_NAME").unwrap();
8-
9-
if target.starts_with("thumb") {
10-
fs::copy(
11-
format!("bin/{}.a", target),
12-
out_dir.join(format!("lib{}.a", name)),
13-
).unwrap();
14-
15-
println!("cargo:rustc-link-lib=static={}", name);
16-
println!("cargo:rustc-link-search={}", out_dir.display());
17-
}
185

196
if target.starts_with("thumbv6m-") {
207
println!("cargo:rustc-cfg=cortex_m");

0 commit comments

Comments
 (0)