Skip to content

Commit

Permalink
Merge branch 'main' into server_name
Browse files Browse the repository at this point in the history
  • Loading branch information
wmedrano authored Sep 14, 2024
2 parents 3d71cc4 + 8dcc07d commit b7c59ce
Show file tree
Hide file tree
Showing 58 changed files with 2,160 additions and 2,365 deletions.
5 changes: 5 additions & 0 deletions .config/nextest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[profile.default]
test-threads = 1
fail-fast = false
slow-timeout = { period = "2s", terminate-after = 2 }
retries = { backoff = "fixed", count = 3, delay = "1s" }
24 changes: 24 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: lint
on:
push:
branches: [main]
pull_request:
branches: [main]

env:
CARGO_TERM_COLOR: always

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: sudo apt update && sudo apt install jackd2 libjack-jackd2-0 libjack-jackd2-dev
- name: Lint (Default Features)
run: cargo clippy --all-targets -- -D clippy::all
- name: Lint (No features)
run: cargo clippy --all-targets --no-default-features -- -D clippy::all
- name: Cargo Fmt
run: cargo fmt --check
37 changes: 0 additions & 37 deletions .github/workflows/rust.yml

This file was deleted.

60 changes: 60 additions & 0 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: publish_site

on:
push:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub
# Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between
# the run in-progress and latest queued. However, do NOT cancel
# in-progress runs as we want to allow these production deployments to
# complete.
concurrency:
group: "pages"
cancel-in-progress: false

jobs:
build-site:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0
bundler-cache: true
cache-version: 0 # Increment this number to re-download cached gems.
- name: Setup Pages
id: pages
uses: actions/configure-pages@v5
- name: Build with Jekyll
run: |
bundle install
bundle exec jekyll build --baseurl "${{ steps.pages.outputs.base_path }}"
working-directory: ./docs
env:
JEKYLL_ENV: production
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./docs/_site
deploy-site:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build-site
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
34 changes: 34 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: test
on:
push:
branches: [main]
pull_request:
branches: [main]

env:
CARGO_TERM_COLOR: always

jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: sudo apt update && sudo apt install jackd2 libjack-jackd2-0 libjack-jackd2-dev
# This is required for the tests, but we start it earlier since it may
# take a while to initialize.
- name: Start dummy JACK server
run: jackd -r -ddummy -r44100 -p1024 &
- name: Install Cargo Nextest
uses: taiki-e/install-action@nextest
- name: Build (Default Features)
run: cargo build --verbose
- name: Build (No Features)
run: cargo build --verbose --no-default-features
- name: Build (examples)
run: cargo build --verbose --examples
- name: Run Tests (Default Features)
run: cargo nextest run
- name: Run Doc Tests
run: cargo doc && cargo test --doc
11 changes: 6 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,20 @@ license = "MIT"
name = "jack"
readme = "README.md"
repository = "https://github.com/RustAudio/rust-jack"
version = "0.11.4"
version = "0.13.0"

[dependencies]
bitflags = "1"
bitflags = "2"
jack-sys = {version = "0.5", path = "./jack-sys"}
lazy_static = "1.4"
libc = "0.2"
log = "0.4"
log = { version = "0.4", optional = true}

[dev-dependencies]
approx = "0.5"
crossbeam-channel = "0.5"
ctor = "0.2"

[features]
default = ["dynamic_loading"]
metadata = []
default = ["dynamic_loading", "log"]
dynamic_loading = ["jack-sys/dynamic_loading"]
56 changes: 56 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# JACK (for Rust)

Rust bindings for [JACK Audio Connection Kit](<https://jackaudio.org>).

| [![Crates.io](https://img.shields.io/crates/v/jack.svg)](https://crates.io/crates/jack) | [![License](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) |
|-----------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [![Docs.rs](https://docs.rs/jack/badge.svg)](https://docs.rs/jack) | [![Test](https://github.com/RustAudio/rust-jack/actions/workflows/testing.yml/badge.svg)](https://github.com/RustAudio/rust-jack/actions/workflows/testing.yml) |
| [📚 Documentation](https://rustaudio.github.io/rust-jack) | [:heart: Sponsor](<https://github.com/sponsors/wmedrano>) |

## Using JACK


The JACK server is usually started by the user or system. Clients can request
that the JACK server is started on demand when they connect, but this can be
disabled by creating a client with the `NO_START_SERVER` option or
`ClientOptions::default()`.

- Linux and BSD users may install JACK1, JACK2 (preferred for low latency), or
Pipewire JACK (preferred for ease of use) from their system package manager.
- Windows users may install JACK from the [official
website](<http://jackaudio.org/downloads/>) or [Chocolatey](<https://community.chocolatey.org/packages/jack>).
- MacOS users may install JACK from the [official
website](<http://jackaudio.org/downloads/>) or [Homebrew](<https://formulae.brew.sh/formula/jack>).

Refer to the [docs.rs documentation](<https://docs.rs/jack/>) for details about
the API. For more general documentation, visit <https://rustaudio.github.io/rust-jack>.


# Testing

Testing requires setting up a dummy server and running the tests using a single
thread. `rust-jack` automatically configures `cargo nextest` to use a single
thread.

```sh
# Set up a dummy server for tests. The script is included in this repository.
./dummy_jack_server.sh &
# Run tests
cargo nextest run
```

Note: If cargo nextest is not available, use `RUST_TEST_THREADS=1 cargo test` to
run in single threaded mode.


## Possible Issues

If the tests are failing, a possible gotcha may be timing issues.

1. If using `cargo test`, try `cargo nextest`. The `cargo nextest`
configuration is set up to run single threaded and to retry flaky tests up
to 3 times.
1. Increase the value used by `sleep_on_test` in `client/common.rs`.

Another case is that libjack may be broken on your setup. Try using libjack2 or
pipewire-jack.
62 changes: 0 additions & 62 deletions README.org

This file was deleted.

5 changes: 5 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
_site
.sass-cache
.jekyll-cache
.jekyll-metadata
vendor
25 changes: 25 additions & 0 deletions docs/404.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
permalink: /404.html
layout: default
---

<style type="text/css" media="screen">
.container {
margin: 10px auto;
max-width: 600px;
text-align: center;
}
h1 {
margin: 30px 0;
font-size: 4em;
line-height: 1;
letter-spacing: -1px;
}
</style>

<div class="container">
<h1>404</h1>

<p><strong>Page not found :(</strong></p>
<p>The requested page could not be found.</p>
</div>
35 changes: 35 additions & 0 deletions docs/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
source "https://rubygems.org"
# Hello! This is where you manage which Jekyll version is used to run.
# When you want to use a different version, change it below, save the
# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
#
# bundle exec jekyll serve
#
# This will help ensure the proper Jekyll version is running.
# Happy Jekylling!
gem "jekyll", "~> 4.3.3"
# This is the default theme for new Jekyll sites. You may change this to anything you like.
gem "minima", "~> 2.5"
# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem "jekyll-feed", "~> 0.12"
end

# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
platforms :mingw, :x64_mingw, :mswin, :jruby do
gem "tzinfo", ">= 1", "< 3"
gem "tzinfo-data"
end

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]

# Lock `http_parser.rb` gem to `v0.6.x` on JRuby builds since newer versions of the gem
# do not have a Java counterpart.
gem "http_parser.rb", "~> 0.6.0", :platforms => [:jruby]
gem "jekyll-mermaid"
gem "just-the-docs"
Loading

0 comments on commit b7c59ce

Please sign in to comment.