-
Notifications
You must be signed in to change notification settings - Fork 4
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
Initial release #1
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Templated by `cargo-generate` using https://github.com/danielhenrymantilla/proc-macro-template | ||
[alias] | ||
docs-rs = [ | ||
"doc", "--no-deps", "--open", | ||
"--features", "docs-rs", | ||
] | ||
|
||
[build] | ||
rustdocflags = [ | ||
"--html-before-content", "fix-docsrs-li-details-summary.html", | ||
] | ||
|
||
[doc.extern-map.registries] | ||
crates-io = "https://docs.rs/" | ||
|
||
[profile.rust-analyzer] | ||
inherits = "dev" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
name: CI | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
# == CHECK == # | ||
check: | ||
name: "Check beta stable and MSRV=1.65.0" | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
rust-toolchain: | ||
- 1.65.0 | ||
- stable | ||
# Try to guard against a near-future regression. | ||
- beta | ||
cargo-locked: ['', '--locked'] | ||
feature-nightly-dropck_eyepatch: ['', '--features nightly-dropck_eyepatch'] | ||
exclude: | ||
# MSRV guarantee only stands for `.lock`-tested dependencies. | ||
- rust-toolchain: 1.65.0 | ||
cargo-locked: '' | ||
steps: | ||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: minimal | ||
toolchain: ${{ matrix.rust-toolchain }} | ||
override: true | ||
|
||
- name: Clone repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Update `Cargo.lock` | ||
if: matrix.cargo-locked != '--locked' | ||
run: cargo update -v | ||
|
||
- name: Cargo check | ||
uses: actions-rs/cargo@v1 | ||
env: | ||
RUSTC_BOOTSTRAP: 1 | ||
with: | ||
command: check | ||
args: ${{ matrix.cargo-locked }} ${{ matrix.feature-nightly-dropck_eyepatch }} | ||
|
||
# == BUILD & TEST == # | ||
build-and-test: | ||
name: Build and test | ||
runs-on: ${{ matrix.os }} | ||
needs: [] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- macos-latest | ||
- windows-latest | ||
rust-toolchain: | ||
- 1.65.0 | ||
- stable | ||
steps: | ||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: default | ||
override: true | ||
toolchain: ${{ matrix.rust-toolchain }} | ||
|
||
- name: Clone repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: cargo test --lib --tests | ||
uses: actions-rs/cargo@v1 | ||
with: | ||
command: test | ||
args: --lib --tests | ||
|
||
- name: cargo test --doc | ||
if: matrix.rust-toolchain == 'stable' | ||
uses: actions-rs/cargo@v1 | ||
env: | ||
RUSTC_BOOTSTRAP: 1 | ||
with: | ||
command: test | ||
args: --features better-docs --doc | ||
|
||
required-jobs: | ||
name: 'All the required jobs' | ||
needs: | ||
- check | ||
- build-and-test | ||
runs-on: ubuntu-latest | ||
if: ${{ always() }} | ||
steps: | ||
- name: 'Check success of the required jobs' | ||
run: | | ||
RESULT=$(echo "${{ join(needs.*.result, '') }}" | sed -e "s/success//g") | ||
if [ -n "$RESULT" ]; then | ||
echo "❌" | ||
false | ||
fi | ||
echo "✅" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Templated by `cargo-generate` using https://github.com/danielhenrymantilla/proc-macro-template | ||
name: Cron CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
schedule: | ||
- cron: '0 8 * * 1,5' | ||
|
||
jobs: | ||
# == TEST == # | ||
test-no-ui: | ||
name: (Check & Build &) Test | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: | ||
- ubuntu-latest | ||
- macos-latest | ||
- windows-latest | ||
rust-toolchain: | ||
# Future-proof against compiler-regressions | ||
- beta | ||
- nightly | ||
cargo-locked: ['--locked'] | ||
feature-nightly-dropck_eyepatch: ['', '--features nightly-dropck_eyepatch'] | ||
include: | ||
# Also future-proof against semver breakage from dependencies. | ||
- rust-toolchain: stable | ||
cargo-locked: '' | ||
steps: | ||
- name: Install Rust toolchain | ||
uses: actions-rs/toolchain@v1 | ||
with: | ||
profile: default | ||
override: true | ||
toolchain: ${{ matrix.rust-toolchain }} | ||
|
||
- name: Clone repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Update `Cargo.lock` | ||
if: matrix.cargo-locked != '--locked' | ||
run: cargo update -v | ||
|
||
- name: Cargo test | ||
uses: actions-rs/cargo@v1 | ||
env: | ||
RUSTC_BOOTSTRAP: 1 | ||
with: | ||
command: test | ||
args: | | ||
--features better-docs | ||
${{ matrix.cargo-locked }} | ||
${{ matrix.feature-nightly-dropck_eyepatch }} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# Templated by `cargo-generate` using https://github.com/danielhenrymantilla/proc-macro-template | ||
/target |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Templated by `cargo-generate` using https://github.com/danielhenrymantilla/proc-macro-template | ||
[package] | ||
name = "maybe-dangling" | ||
authors = [ | ||
"Daniel Henry-Mantilla <[email protected]>", | ||
] | ||
version = "0.1.0" # Keep in sync | ||
edition = "2021" | ||
rust-version = "1.65.0" | ||
|
||
license = "Zlib OR MIT OR Apache-2.0" | ||
repository = "https://github.com/danielhenrymantilla/maybe-dangling.rs" | ||
documentation = "https://docs.rs/maybe-dangling" | ||
readme = "README.md" | ||
|
||
description = "`ManuallyDrop<T>` and `MaybeDangling<T>` semantics in stable Rust as per https://github.com/rust-lang/rfcs/pull/3336" | ||
keywords = ["unsafe", "dangling", "aliasing", "dereferenceable", "manuallydrop"] | ||
|
||
[features] | ||
default = [ | ||
] | ||
|
||
# Enable and use `#![feature(dropck_eyepatch)]` for `MaybeDangling`. | ||
nightly-dropck_eyepatch = [] | ||
|
||
# unstable! Will probably use nightly to improve doc quality | ||
better-docs = [] | ||
|
||
ui-tests = [ | ||
"better-docs", | ||
] | ||
|
||
# `docs-rs` is very similar to `better-docs`, but for it being allowed to enable | ||
# other features as well, often to make sure optional/non-`default` features | ||
# make it to the rendered docs (using `--all-features` instead is not that great). | ||
docs-rs = [ | ||
"better-docs", | ||
] | ||
Comment on lines
+33
to
+38
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it not make more sense for this to be a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've seen this pattern quite a bit, true, but I somehow find the feature to be more convenient, provided that it is properly document as unstable (I'm not that fond of fiddling with env vars / rustflags unless strictly necessary). But I have no strong opinions on this either way 🙂 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm used to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, currently the If you feel like making the change for these docs.rs knobs anyways feel free to do so or suggested it over #2 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It doesn't seem like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah true 😄 This is from a template I use, which lets me opt into extra facilities. For instance, it has recently occurred to me that we could consider feature-gating the |
||
|
||
[dependencies] | ||
|
||
[dev-dependencies] | ||
|
||
[workspace] | ||
|
||
[package.metadata.docs.rs] | ||
features = [ | ||
"docs-rs", | ||
] | ||
rustdoc-args = [ | ||
# Use (with or without `open`): | ||
# ```md | ||
# <details open class="custom"><summary><span class="summary-box"><span>Click to hide</span></span></summary> | ||
# … | ||
# </details> | ||
# ``` | ||
# to get nice drop-down menus (and avoid the css bug with rustdoc). | ||
"--html-before-content", "fix-docsrs-li-details-summary.html", | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder why
Cargo.lock
is in source control? I always thought libraries don't do thatThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This recommendation may change soon; this PR includes some discussion of the rationale.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for sharing the link, the PR is quite informative. I got curious about why the lockfile was included while trying to understand why CI is testing against the locked and latest versions of the (hypothetical) dependencies. This conservative approach to CI testing both deterministically and non-deterministically makes sense to me after reading the PR. Never really thought about dependencies breaking pipelines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've also written my own take on the topic: https://gist.github.com/danielhenrymantilla/9b59de4db8e5f2467ed008b3c450527b#about-tracking-cargolock