Skip to content

Commit

Permalink
Make paste optional, add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
fasterthanlime committed Jul 18, 2024
1 parent 1cf321a commit bd2e8e8
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Tests

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
- name: Run cargo command
run: cargo run --manifest-path test-crates/bin/Cargo.toml
3 changes: 3 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
check:
cargo hack --each-feature --exclude-all-features clippy

test:
cargo run --manifest-path test-crates/bin/Cargo.toml

build:
#!/usr/bin/env bash -eux
cd rubicon
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -417,3 +417,11 @@ which means, that's right, we're back to manually prefixing things, like in C.
We've just covered process-locals. The situation for thread-locals is much the
same, except we have to do some more trickery because the internals of `LocalKey`
are, well, internal, and cannot be accessed from stable Rust.
Getting all these just right is tricky — that's why `rubicon` ships macros, which
are meant to be used by any crate that has global state, such as `tokio`, `tracing`,
`parking_lot`, etc.
## Adding rubicon support to a crate
Let's take tokio as an example. First, we'll want to
8 changes: 4 additions & 4 deletions rubicon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ authors = ["Amos Wenger <[email protected]>"]
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/bearcove/rubicon"
description = "A way to export/import thread-locals from/to shared objects"
description = "Deduplicate globals across shared objects to enable a dangerous form of dynamic linking"
categories = ["development-tools::ffi"]
keywords = ["ffi", "thread-local"]

[lib]
crate-type = ["dylib"]

[dependencies]
paste = "1.0.15"
paste = { version = "1.0.15", optional = true }

[features]
default = []
export-globals = []
import-globals = []
export-globals = ["dep:paste"]
import-globals = ["dep:paste"]
soprintln = []

0 comments on commit bd2e8e8

Please sign in to comment.