diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d62203d..0aa5587 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -14,11 +14,10 @@ jobs: - uses: actions/checkout@v4 with: ref: stable - - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly + - name: Set up Rust toolchain + run: rustup toolchain install --no-self-update --profile minimal nightly - name: Build - run: cargo build --all + run: cargo +nightly build --all - name: Generate self-profile run: RUSTFLAGS="-Zself-profile" cargo +nightly build --bin crox - name: Check crox diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..6fdb27f --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,17 @@ +name: Publish +on: + release: + types: [created] + +jobs: + publish: + name: Publish to crates.io + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install Rust (rustup) + run: rustup update stable && rustup default stable + - name: Publish + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + run: cargo publish -p measureme diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 3f27c51..3b7cd95 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -2,112 +2,52 @@ name: Rust on: push: - branches: [ - master, - auto, # used for bors - try # used for bors - ] + branches: + - master + - stable pull_request: - branches: [ master ] + branches: + - master + - stable env: CARGO_TERM_COLOR: always jobs: - build_stable: - + build: + strategy: + matrix: + rust: [ stable, beta, nightly ] + include: + - rust: nightly + check_cfg: '-Zcheck-cfg' runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable + - uses: actions/checkout@v4 + - name: Set up Rust toolchain + run: | + rustup toolchain install --no-self-update --profile minimal ${{ matrix.rust }} + rustup default ${{ matrix.rust }} + # Add a big endian target so we can check that everything at least + # compiles on big endian. + rustup target add --toolchain ${{ matrix.rust }} powerpc64-unknown-linux-gnu - name: Build - run: cargo build --verbose --all + run: cargo build --verbose --all ${{ matrix.check_cfg }} - name: Run tests - run: cargo test --verbose --all + run: cargo test --verbose --all ${{ matrix.check_cfg }} - name: Docs - run: cargo doc --verbose --all - - build_beta: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: beta - override: true - - uses: actions-rs/cargo@v1 - with: - command: build - args: --verbose --all - - uses: actions-rs/cargo@v1 - with: - command: test - args: --verbose --all - - uses: actions-rs/cargo@v1 - with: - command: doc - args: --verbose --all - - build_nightly: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: nightly - override: true - - uses: actions-rs/cargo@v1 - with: - command: build - args: --verbose --all -Zcheck-cfg - - uses: actions-rs/cargo@v1 - with: - command: test - args: --verbose --all -Zcheck-cfg - - uses: actions-rs/cargo@v1 - with: - command: doc - args: --verbose --all - - check_big_endian: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: powerpc64-unknown-linux-gnu - override: true - - uses: actions-rs/cargo@v1 - with: - command: check - args: --verbose --lib --bins --tests - - # These jobs doesn't actually test anything, but they're only used to tell - # bors the build completed, as there is no practical way to detect when a - # workflow is successful listening to webhooks only. - # - # ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB! - end-success: - name: bors build finished - runs-on: ubuntu-latest - needs: [build_stable, build_beta, build_nightly, check_big_endian] - if: github.event.pusher.name == 'bors' && success() - steps: - - name: mark the job as a success - run: exit 0 - - end-failure: - name: bors build finished + run: cargo doc --verbose --no-deps + - name: Check big endian + run: cargo check --target powerpc64-unknown-linux-gnu --verbose --all + success: + needs: + - build runs-on: ubuntu-latest - needs: [build_stable, build_beta, build_nightly, check_big_endian] - if: github.event.pusher.name == 'bors' && (failure() || cancelled()) + # GitHub branch protection is exceedingly silly and treats "jobs skipped because a dependency + # failed" as success. So we have to do some contortions to ensure the job fails if any of its + # dependencies fails. + if: always() # make sure this is never "skipped" steps: - - name: mark the job as a failure - run: exit 1 + # Manually check the status of all dependencies. `if: failure()` does not work. + - name: check if any dependency failed + run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' diff --git a/CHANGELOG.md b/CHANGELOG.md index 6116dd5..13c414e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,19 @@ # Changelog +## [11.0.1] - 2024-01-11 + +### Changed + +- `measureme`: Fix compilation error and regression tests for big endian platforms ([GH-220]) + +### Added + +- Add GitHub Workflow for publishing measureme ([GH-221]) + ## [11.0.0] - 2023-12-14 ### Changed + - `measureme`: Update StringId and Addr sizes from u32 to u64 ([GH-216]) - `analyzeme`: v9 file format, which uses larger events ([GH-216]) @@ -239,3 +250,5 @@ [GH-209]: https://github.com/rust-lang/measureme/pull/209 [GH-211]: https://github.com/rust-lang/measureme/pull/211 [GH-216]: https://github.com/rust-lang/measureme/pull/216 +[GH-220]: https://github.com/rust-lang/measureme/pull/220 +[GH-221]: https://github.com/rust-lang/measureme/pull/221 diff --git a/analyzeme/Cargo.toml b/analyzeme/Cargo.toml index ee30421..eba1136 100644 --- a/analyzeme/Cargo.toml +++ b/analyzeme/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "analyzeme" -version = "11.0.0" +version = "11.0.1" authors = ["Wesley Wiser ", "Michael Woerister "] edition = "2018" license = "MIT OR Apache-2.0" diff --git a/crox/Cargo.toml b/crox/Cargo.toml index 21a9414..02259a5 100644 --- a/crox/Cargo.toml +++ b/crox/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "crox" -version = "11.0.0" +version = "11.0.1" authors = ["Wesley Wiser "] edition = "2018" diff --git a/decodeme/Cargo.toml b/decodeme/Cargo.toml index d15e64b..f808286 100644 --- a/decodeme/Cargo.toml +++ b/decodeme/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "decodeme" -version = "11.0.0" +version = "11.0.1" edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/flamegraph/Cargo.toml b/flamegraph/Cargo.toml index edf4c3b..4a4a6f1 100644 --- a/flamegraph/Cargo.toml +++ b/flamegraph/Cargo.toml @@ -1,7 +1,10 @@ [package] name = "flamegraph" -version = "11.0.0" -authors = ["Wesley Wiser ", "Michael Woerister "] +version = "11.0.1" +authors = [ + "Wesley Wiser ", + "Michael Woerister ", +] edition = "2018" license = "MIT OR Apache-2.0" @@ -9,4 +12,4 @@ license = "MIT OR Apache-2.0" measureme = { path = "../measureme" } analyzeme = { path = "../analyzeme" } clap = { version = "3.2", features = ["derive"] } -inferno = { version="0.9.1", default-features = false } +inferno = { version = "0.11", default-features = false } diff --git a/measureme/Cargo.toml b/measureme/Cargo.toml index d057d2c..d93a686 100644 --- a/measureme/Cargo.toml +++ b/measureme/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "measureme" -version = "11.0.0" +version = "11.0.1" authors = ["Wesley Wiser ", "Michael Woerister "] edition = "2018" description = "Support crate for rustc's self-profiling feature" diff --git a/measureme/src/raw_event.rs b/measureme/src/raw_event.rs index ec17427..29b682f 100644 --- a/measureme/src/raw_event.rs +++ b/measureme/src/raw_event.rs @@ -154,12 +154,12 @@ impl RawEvent { { // We always emit data as little endian, which we have to do // manually on big endian targets. - bytes[0..4].copy_from_slice(&self.event_kind.as_u32().to_le_bytes()); - bytes[4..8].copy_from_slice(&self.event_id.as_u32().to_le_bytes()); - bytes[8..12].copy_from_slice(&self.thread_id.to_le_bytes()); - bytes[12..16].copy_from_slice(&self.payload1_lower.to_le_bytes()); - bytes[16..20].copy_from_slice(&self.payload2_lower.to_le_bytes()); - bytes[20..24].copy_from_slice(&self.payloads_upper.to_le_bytes()); + bytes[0..8].copy_from_slice(&self.event_kind.as_u64().to_le_bytes()); + bytes[8..16].copy_from_slice(&self.event_id.as_u64().to_le_bytes()); + bytes[16..20].copy_from_slice(&self.thread_id.to_le_bytes()); + bytes[20..24].copy_from_slice(&self.payload1_lower.to_le_bytes()); + bytes[24..28].copy_from_slice(&self.payload2_lower.to_le_bytes()); + bytes[28..32].copy_from_slice(&self.payloads_upper.to_le_bytes()); } } @@ -183,12 +183,12 @@ impl RawEvent { #[cfg(target_endian = "big")] { RawEvent { - event_kind: StringId::new(u32::from_le_bytes(bytes[0..4].try_into().unwrap())), - event_id: EventId::from_u32(u32::from_le_bytes(bytes[4..8].try_into().unwrap())), - thread_id: u32::from_le_bytes(bytes[8..12].try_into().unwrap()), - payload1_lower: u32::from_le_bytes(bytes[12..16].try_into().unwrap()), - payload2_lower: u32::from_le_bytes(bytes[16..20].try_into().unwrap()), - payloads_upper: u32::from_le_bytes(bytes[20..24].try_into().unwrap()), + event_kind: StringId::new(u64::from_le_bytes(bytes[0..8].try_into().unwrap())), + event_id: EventId::from_u64(u64::from_le_bytes(bytes[8..16].try_into().unwrap())), + thread_id: u32::from_le_bytes(bytes[16..20].try_into().unwrap()), + payload1_lower: u32::from_le_bytes(bytes[20..24].try_into().unwrap()), + payload2_lower: u32::from_le_bytes(bytes[24..28].try_into().unwrap()), + payloads_upper: u32::from_le_bytes(bytes[28..32].try_into().unwrap()), } } } diff --git a/mmedit/Cargo.toml b/mmedit/Cargo.toml index ca0bc35..181e077 100644 --- a/mmedit/Cargo.toml +++ b/mmedit/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mmedit" -version = "11.0.0" +version = "11.0.1" edition = "2018" [dependencies] diff --git a/mmview/Cargo.toml b/mmview/Cargo.toml index 5a720c7..5f6c2a3 100644 --- a/mmview/Cargo.toml +++ b/mmview/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mmview" -version = "11.0.0" +version = "11.0.1" authors = ["Wesley Wiser ", "Michael Woerister "] edition = "2018" license = "MIT OR Apache-2.0" diff --git a/stack_collapse/Cargo.toml b/stack_collapse/Cargo.toml index e536097..fbf3db4 100644 --- a/stack_collapse/Cargo.toml +++ b/stack_collapse/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "stack_collapse" -version = "11.0.0" +version = "11.0.1" authors = ["Wesley Wiser ", "Michael Woerister "] edition = "2018" license = "MIT OR Apache-2.0" diff --git a/summarize/Cargo.toml b/summarize/Cargo.toml index 5d8f871..8b58a3c 100644 --- a/summarize/Cargo.toml +++ b/summarize/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "summarize" -version = "11.0.0" +version = "11.0.1" authors = ["Wesley Wiser ", "Michael Woerister "] edition = "2018" license = "MIT OR Apache-2.0" diff --git a/version_checker/Cargo.toml b/version_checker/Cargo.toml index 75bccd2..84d04b8 100644 --- a/version_checker/Cargo.toml +++ b/version_checker/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "version_checker" -version = "11.0.0" +version = "11.0.1" authors = ["Michael Woerister "] edition = "2018" license = "MIT OR Apache-2.0"