From 5544c367c7d938dd048cb78941ae8c68c51c4841 Mon Sep 17 00:00:00 2001 From: ivan-aksamentov Date: Thu, 19 Dec 2024 17:16:20 +0100 Subject: [PATCH] chore: migrate to dev/ folder --- .cargo/config.toml | 6 +- .dockerignore | 4 +- .env.example | 4 + .github/workflows/builder-docker-image.yml | 65 - .github/workflows/cli.yml | 388 +- Cargo.lock | 55 +- Cargo.toml | 18 +- dev/cross/all | 143 + dev/cross/build | 74 + dev/cross/check | 28 + dev/cross/dump-symbols | 30 + dev/cross/run | 24 + dev/cross/strip | 34 + dev/dev | 168 + dev/docker/checksum | 12 + dev/docker/cross-darwin.dockerfile | 253 + dev/docker/cross-linux.dockerfile | 311 ++ {docker => dev/docker}/files/.conda/.condarc | 2 +- .../notification.jupyterlab-settings | 5 + .../themes.jupyterlab-settings | 0 .../plugin.jupyterlab-settings | 5 +- .../tracker.jupyterlab-settings | 9 + .../plugin.jupyterlab-settings | 4 + .../plugin.jupyterlab-settings | 18 + .../tracker.jupyterlab-settings | 30 + dev/docker/files/create-user | 86 + dev/docker/files/install-bryptprimitives | 10 + dev/docker/files/install-ccache | 11 + dev/docker/files/install-dasel | 7 + dev/docker/files/install-gcc | 15 + dev/docker/files/install-gcc-cross | 37 + dev/docker/files/install-hyperfine | 13 + dev/docker/files/install-jq | 7 + dev/docker/files/install-libbzip2 | 10 + dev/docker/files/install-liblzma | 10 + dev/docker/files/install-libz | 10 + dev/docker/files/install-libzstd | 10 + dev/docker/files/install-llvm | 15 + dev/docker/files/install-openblas | 12 + dev/docker/files/install-openssl | 13 + dev/docker/files/install-osxcross | 9 + dev/docker/files/install-protobuf | 15 + dev/docker/files/install-rust | 32 + {docker => dev/docker}/files/start-jupyter | 10 +- dev/docker/jupyter | 77 + dev/docker/jupyter.dockerfile | 120 + dev/docker/native.dockerfile | 111 + dev/docker/run | 175 + dev/is-arch | 32 + dev/is-ci | 40 + dev/is-static-binary | 102 + dev/lib/utils.sh | 180 + {docker => dev}/prettytest | 13 +- dev/profile | 62 + {tests => dev}/run-smoke-tests | 0 .../test-linux-distros-gnu | 31 +- dev/test-linux-distros-musl | 63 + docker/cross | 28 - docker/cross-split | 40 - docker/dev | 630 --- docker/docker-dev.dockerfile | 618 --- packages/minimap2-sys/Cargo.toml | 2 + packages/minimap2-sys/build.rs | 6 +- packages/minimap2-sys/src/bindings.rs | 4657 +++++++++++------ packages/minimap2/Cargo.toml | 57 +- tests/in/randseqs.fa | 3 - tests/run-cli-tests.sh | 67 - 67 files changed, 5750 insertions(+), 3386 deletions(-) delete mode 100644 .github/workflows/builder-docker-image.yml create mode 100755 dev/cross/all create mode 100755 dev/cross/build create mode 100755 dev/cross/check create mode 100755 dev/cross/dump-symbols create mode 100755 dev/cross/run create mode 100755 dev/cross/strip create mode 100755 dev/dev create mode 100755 dev/docker/checksum create mode 100644 dev/docker/cross-darwin.dockerfile create mode 100644 dev/docker/cross-linux.dockerfile rename {docker => dev/docker}/files/.conda/.condarc (90%) create mode 100644 dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/notification.jupyterlab-settings rename {docker => dev/docker}/files/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/themes.jupyterlab-settings (100%) rename {docker/files/.jupyter/lab/user-settings/@jupyterlab/fileeditor-extension => dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/codemirror-extension}/plugin.jupyterlab-settings (58%) create mode 100644 dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/console-extension/tracker.jupyterlab-settings create mode 100644 dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/extensionmanager-extension/plugin.jupyterlab-settings create mode 100644 dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/fileeditor-extension/plugin.jupyterlab-settings create mode 100644 dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/notebook-extension/tracker.jupyterlab-settings create mode 100755 dev/docker/files/create-user create mode 100755 dev/docker/files/install-bryptprimitives create mode 100755 dev/docker/files/install-ccache create mode 100755 dev/docker/files/install-dasel create mode 100755 dev/docker/files/install-gcc create mode 100755 dev/docker/files/install-gcc-cross create mode 100755 dev/docker/files/install-hyperfine create mode 100755 dev/docker/files/install-jq create mode 100755 dev/docker/files/install-libbzip2 create mode 100755 dev/docker/files/install-liblzma create mode 100755 dev/docker/files/install-libz create mode 100755 dev/docker/files/install-libzstd create mode 100755 dev/docker/files/install-llvm create mode 100755 dev/docker/files/install-openblas create mode 100755 dev/docker/files/install-openssl create mode 100755 dev/docker/files/install-osxcross create mode 100755 dev/docker/files/install-protobuf create mode 100755 dev/docker/files/install-rust rename {docker => dev/docker}/files/start-jupyter (59%) create mode 100755 dev/docker/jupyter create mode 100644 dev/docker/jupyter.dockerfile create mode 100644 dev/docker/native.dockerfile create mode 100755 dev/docker/run create mode 100755 dev/is-arch create mode 100755 dev/is-ci create mode 100755 dev/is-static-binary create mode 100644 dev/lib/utils.sh rename {docker => dev}/prettytest (82%) create mode 100755 dev/profile rename {tests => dev}/run-smoke-tests (100%) rename tests/test-linux-distros => dev/test-linux-distros-gnu (68%) create mode 100755 dev/test-linux-distros-musl delete mode 100755 docker/cross delete mode 100755 docker/cross-split delete mode 100755 docker/dev delete mode 100644 docker/docker-dev.dockerfile delete mode 100644 tests/in/randseqs.fa delete mode 100755 tests/run-cli-tests.sh diff --git a/.cargo/config.toml b/.cargo/config.toml index e0b6b5bc..a506b5ec 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -9,7 +9,6 @@ codegen-units = 4096 incremental = true lto = "off" - [profile.dev.package."*"] opt-level = 2 [profile.dev.package.backtrace] @@ -25,7 +24,6 @@ opt-level = 3 [profile.dev.package.pretty_assertions] opt-level = 3 - [profile.profiling] inherits = "release" debug = 1 @@ -46,14 +44,14 @@ opt-level = 3 [profile.profiling.package.pretty_assertions] opt-level = 3 - [profile.release] codegen-units = 1 +debug = 1 incremental = false lto = "fat" opt-level = 3 panic = "abort" -strip = "debuginfo" +strip = false [profile.bench] codegen-units = 1 diff --git a/.dockerignore b/.dockerignore index 68badcce..736c52c6 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,4 @@ * -!/rust-toolchain.toml !/\.nvmrc -!docker/files +!/dev/docker/files/ +!/rust-toolchain.toml diff --git a/.env.example b/.env.example index e0c5d47c..a2557788 100644 --- a/.env.example +++ b/.env.example @@ -1,3 +1,7 @@ +PROJECT_NAME=pangraph +PROJECT_DOCKER_REPO=neherlab/pangraph +PROJECT_DOCKER_BUILDER_REPO=neherlab/pangraph_builder + # URL to `osxcross.tar.xz` file containing osxcross toolchain # distribution (https://github.com/tpoechtrager/osxcross) used for cross-compilation # from Linux to macOS. See `tools/osxcross/README.md` for instructions on how to diff --git a/.github/workflows/builder-docker-image.yml b/.github/workflows/builder-docker-image.yml deleted file mode 100644 index 6d2caf2e..00000000 --- a/.github/workflows/builder-docker-image.yml +++ /dev/null @@ -1,65 +0,0 @@ -# Build 'neherlab/pangraph_builder' docker image and push it to DockerHub. -# This image is used as a build environment to produce pangraph binaries. -name: builder-docker-image - -on: - repository_dispatch: - types: build - - workflow_dispatch: - - workflow_call: - -concurrency: - group: builder-docker-image-${{ github.workflow }}-${{ github.ref_type }}-${{ github.event.pull_request.number || github.ref || github.run_id }} - cancel-in-progress: true - -defaults: - run: - shell: bash -euxo pipefail {0} - -env: - GITHUB_REPOSITORY_URL: ${{ github.server_url }}/${{ github.repository }} - VERBOSE: 1 - -jobs: - build-base-image: - name: "Build base image" - - runs-on: ubuntu-22.04 - - steps: - - name: "Set up Docker Buildx" - uses: docker/setup-buildx-action@v3 - - - name: "Checkout code" - uses: actions/checkout@v4 - with: - fetch-depth: 1 - submodules: true - - - name: "Login to Docker Hub" - uses: docker/login-action@v3 - with: - registry: docker.io - username: ${{ secrets.NEHERLAB_BOT_DOCKERHUB_USERNAME }} - password: ${{ secrets.NEHERLAB_BOT_DOCKERHUB_TOKEN }} - - - name: "Get docker build checksum" - id: docker-build-checksum - run: echo "checksum=$(./scripts/docker_build_checksum.sh)" >> $GITHUB_OUTPUT - - - name: "Setup cache for Docker buildx" - uses: actions/cache@v4 - with: - path: .cache/docker/buildx - key: cache-v1-buildx-${{ runner.os }}-${{ steps.docker-build-checksum.outputs.checksum }} - restore-keys: | - cache-v1-buildx-${{ runner.os }}-${{ steps.docker-build-checksum.outputs.checksum }} - cache-v1-buildx-${{ runner.os }}- - - - name: "Build image: base" - run: | - cp .env.example .env - sed -i -e "s|OSXCROSS_URL=http://example.com/osxcross/osxcross.tar.xz|OSXCROSS_URL=${{ secrets.OSXCROSS_URL }}|g" .env - ./docker/dev docker-image-build-push diff --git a/.github/workflows/cli.yml b/.github/workflows/cli.yml index dd62b9ab..d6681251 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/cli.yml @@ -20,26 +20,19 @@ concurrency: defaults: run: - shell: bash -euxo pipefail {0} + shell: bash -euo pipefail {0} env: GITHUB_REPOSITORY_URL: ${{ github.server_url }}/${{ github.repository }} VERBOSE: 1 -jobs: - builder-docker-image: - name: "Run 'builder-docker-image.yml' workflow" - uses: ./.github/workflows/builder-docker-image.yml - secrets: inherit - concurrency: - group: cli-builder-docker-image-workflow_call-${{ github.workflow }}-${{ github.ref_type }}-${{ github.event.pull_request.number || github.ref || github.run_id }} - cancel-in-progress: true + +jobs: build-cli: name: "Build CLI (${{ matrix.arch }})" - needs: [ builder-docker-image ] - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: fail-fast: false @@ -63,43 +56,19 @@ jobs: fetch-depth: 1 submodules: true - - name: "Get docker build checksum" - id: docker-build-checksum - run: echo "checksum=$(./scripts/docker_build_checksum.sh)" >> $GITHUB_OUTPUT - - - name: "Setup cache for Docker buildx (${{ matrix.arch }})" - uses: actions/cache@v4 - with: - path: .cache/docker-${{ matrix.arch }}/buildx - key: neherlab-pangraph-cli-cache-v1-buildx-${{ runner.os }}-${{ matrix.arch }}-${{ steps.docker-build-checksum.outputs.checksum }} - restore-keys: | - neherlab-pangraph-cli-cache-v1-buildx-${{ runner.os }}-${{ matrix.arch }}-${{ steps.docker-build-checksum.outputs.checksum }} - neherlab-pangraph-cli-cache-v1-buildx-${{ runner.os }}-${{ matrix.arch }}- - neherlab-pangraph-cli-cache-v1-buildx-${{ runner.os }}-${{ steps.docker-build-checksum.outputs.checksum }} - neherlab-pangraph-cli-cache-v1-buildx-${{ runner.os }}- - - name: "Setup cache for Rust and Cargo" uses: actions/cache@v4 with: path: | - .cache/docker-${{ matrix.arch }}/.cargo - .build/ + .cache/docker-${{ matrix.arch }}/cargo/registry/index/ + .cache/docker-${{ matrix.arch }}/cargo/registry/cache/ + .cache/docker-${{ matrix.arch }}/cargo/git/db/ key: neherlab-pangraph-cli-cache-v1-cargo-${{ runner.os }}-${{ matrix.arch }}-${{ hashFiles('**/Cargo.lock') }} restore-keys: | neherlab-pangraph-cli-cache-v1-cargo-${{ runner.os }}-${{ matrix.arch }}-${{ hashFiles('**/Cargo.lock') }} neherlab-pangraph-cli-cache-v1-cargo-${{ runner.os }}-${{ matrix.arch }}- neherlab-pangraph-cli-cache-v1-cargo-${{ runner.os }}- - - name: "Install deps" - run: | - mkdir -p "${HOME}/bin" - curl -fsSL "https://github.com/TomWright/dasel/releases/download/v1.24.3/dasel_linux_amd64" -o "${HOME}/bin/dasel" && chmod +x "${HOME}/bin/dasel" - - - name: "Prepare .env file" - run: | - cp .env.example .env - sed -i -e "s|OSXCROSS_URL=http://example.com/osxcross/osxcross.tar.xz|OSXCROSS_URL=${{ secrets.OSXCROSS_URL }}|g" .env - - name: "Login to Docker Hub" uses: docker/login-action@v3 with: @@ -107,26 +76,31 @@ jobs: username: ${{ secrets.NEHERLAB_BOT_DOCKERHUB_USERNAME }} password: ${{ secrets.NEHERLAB_BOT_DOCKERHUB_TOKEN }} + - name: "Prepare .env file" + run: | + cp .env.example .env + sed -i -e "s|OSXCROSS_URL=http://example.com/osxcross/osxcross.tar.xz|OSXCROSS_URL=${{ secrets.OSXCROSS_URL }}|g" .env + - name: "Build docker image (${{ matrix.arch }})" run: | - CROSS="${{ matrix.arch }}" ./docker/dev docker-image-build-push + CROSS_COMPILE="${{ matrix.arch }}" ./dev/docker/run echo "Success" - name: "Build CLI (${{ matrix.arch }})" run: | - CROSS="${{ matrix.arch }}" ./docker/dev build-release + CROSS_COMPILE="${{ matrix.arch }}" ./dev/docker/run ./dev/cross/build pangraph - name: "Upload build artifacts (${{ matrix.arch }})" uses: actions/upload-artifact@v4 with: - name: out-${{ matrix.arch }} + name: pangraph-${{ matrix.arch }} path: ./.out/* include-hidden-files: true + run-unit-tests: name: "Run unit tests" - needs: [ builder-docker-image ] - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: "Set up Docker Buildx" @@ -138,44 +112,44 @@ jobs: fetch-depth: 1 submodules: true - - name: "Get docker build checksum" - id: docker-build-checksum - run: echo "checksum=$(./scripts/docker_build_checksum.sh)" >> $GITHUB_OUTPUT - - - name: "Setup cache for Docker buildx" - uses: actions/cache@v4 - with: - path: .cache-${{ matrix.arch }}/docker/buildx - key: neherlab-pangraph-cli-cache-v1-buildx-unit-tests-${{ runner.os }}-${{ steps.docker-build-checksum.outputs.checksum }} - restore-keys: | - neherlab-pangraph-cli-cache-v1-buildx-unit-tests-${{ runner.os }}-${{ steps.docker-build-checksum.outputs.checksum }} - neherlab-pangraph-cli-cache-v1-buildx-unit-tests-${{ runner.os }}- - - name: "Setup cache for Rust and Cargo" uses: actions/cache@v4 with: path: | - .cache-${{ matrix.arch }}/docker/.cargo - .build/ - key: neherlab-pangraph-cli-cache-v1-cargo-unit-tests-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} + .cache/docker-native/cargo/registry/index/ + .cache/docker-native/cargo/registry/cache/ + .cache/docker-native/cargo/git/db/ + key: neherlab-pangraph-cli-cache-v1-cargo-${{ runner.os }}-native-${{ hashFiles('**/Cargo.lock') }} restore-keys: | - neherlab-pangraph-cli-cache-v1-cargo-unit-tests-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} - neherlab-pangraph-cli-cache-v1-cargo-unit-tests-${{ runner.os }}- + neherlab-pangraph-cli-cache-v1-cargo-${{ runner.os }}-native-${{ hashFiles('**/Cargo.lock') }} + neherlab-pangraph-cli-cache-v1-cargo-${{ runner.os }}-native- + neherlab-pangraph-cli-cache-v1-cargo-${{ runner.os }}- + + - name: "Login to Docker Hub" + uses: docker/login-action@v3 + with: + registry: docker.io + username: ${{ secrets.NEHERLAB_BOT_DOCKERHUB_USERNAME }} + password: ${{ secrets.NEHERLAB_BOT_DOCKERHUB_TOKEN }} - name: "Prepare .env file" run: | cp .env.example .env sed -i -e "s|OSXCROSS_URL=http://example.com/osxcross/osxcross.tar.xz|OSXCROSS_URL=${{ secrets.OSXCROSS_URL }}|g" .env + - name: "Build docker image" + run: | + ./dev/docker/run echo "Success" + - name: "Run unit tests" run: | - ./docker/dev test + ./dev/docker/run ./dev/dev test + run-lints: name: "Run lints" - needs: [ builder-docker-image ] - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - name: "Set up Docker Buildx" @@ -187,83 +161,71 @@ jobs: fetch-depth: 1 submodules: true - - name: "Get docker build checksum" - id: docker-build-checksum - run: echo "checksum=$(./scripts/docker_build_checksum.sh)" >> $GITHUB_OUTPUT - - - name: "Setup cache for Docker buildx" - uses: actions/cache@v4 - with: - path: .cache/docker-${{ matrix.arch }}/buildx - key: neherlab-pangraph-cli-cache-v1-buildx-lints-${{ runner.os }}-${{ steps.docker-build-checksum.outputs.checksum }} - restore-keys: | - neherlab-pangraph-cli-cache-v1-buildx-lints-${{ runner.os }}-${{ steps.docker-build-checksum.outputs.checksum }} - neherlab-pangraph-cli-cache-v1-buildx-lints-${{ runner.os }}- - - name: "Setup cache for Rust and Cargo" uses: actions/cache@v4 with: path: | - .cache/docker-${{ matrix.arch }}/.cargo - .build/ - key: neherlab-pangraph-cli-cache-v1-cargo-lints-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} + .cache/docker-native/cargo/registry/index/ + .cache/docker-native/cargo/registry/cache/ + .cache/docker-native/cargo/git/db/ + key: neherlab-pangraph-cli-cache-v1-cargo-${{ runner.os }}-native-${{ hashFiles('**/Cargo.lock') }} restore-keys: | - neherlab-pangraph-cli-cache-v1-cargo-lints-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }} - neherlab-pangraph-cli-cache-v1-cargo-lints-${{ runner.os }}- + neherlab-pangraph-cli-cache-v1-cargo-${{ runner.os }}-native-${{ hashFiles('**/Cargo.lock') }} + neherlab-pangraph-cli-cache-v1-cargo-${{ runner.os }}-native- + neherlab-pangraph-cli-cache-v1-cargo-${{ runner.os }}- + + - name: "Login to Docker Hub" + uses: docker/login-action@v3 + with: + registry: docker.io + username: ${{ secrets.NEHERLAB_BOT_DOCKERHUB_USERNAME }} + password: ${{ secrets.NEHERLAB_BOT_DOCKERHUB_TOKEN }} - name: "Prepare .env file" run: | cp .env.example .env sed -i -e "s|OSXCROSS_URL=http://example.com/osxcross/osxcross.tar.xz|OSXCROSS_URL=${{ secrets.OSXCROSS_URL }}|g" .env + - name: "Build docker image" + run: | + ./dev/docker/run echo "Success" + - name: "Run lints" run: | - ./docker/dev lint-ci + ./dev/docker/run ./dev/dev lint + - run-smoke-tests: - name: "Run smoke tests (linux)" + run-compat-tests-x86_64-unknown-linux-gnu: + name: "Compat test (x86_64-unknown-linux-gnu)" needs: [ build-cli ] - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - - name: "Set up Docker Buildx" - uses: docker/setup-buildx-action@v3 - - name: "Checkout code" uses: actions/checkout@v4 with: fetch-depth: 1 submodules: true - lfs: true - - - name: "Install dependencies" - run: | - mkdir -p "${HOME}/bin" - export PATH="${HOME}/bin:${PATH}" - curl -fsSL "https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64" -o ${HOME}/bin/jq && chmod +x ${HOME}/bin/jq - name: "Download build artifacts" uses: actions/download-artifact@v4 with: - pattern: out-* + pattern: pangraph-* merge-multiple: true path: ".out" - - name: "Run smoke tests (linux)" + - name: "Test Linux distros compatibility" run: | - chmod +x ./.out/* - JOBS=2 ./tests/run-smoke-tests ./.out/pangraph-x86_64-unknown-linux-gnu --fast + chmod +x ./.out/pangraph-x86_64-unknown-linux-gnu + ./dev/test-linux-distros-gnu ./.out/pangraph-x86_64-unknown-linux-gnu --help - run-linux-distros-test: - name: "Run Linux distros compatibility test" + run-compat-tests-x86_64-unknown-linux-musl: + name: "Compat test (x86_64-unknown-linux-musl)" needs: [ build-cli ] - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - - name: "Set up Docker Buildx" - uses: docker/setup-buildx-action@v3 - - name: "Checkout code" uses: actions/checkout@v4 with: @@ -273,115 +235,183 @@ jobs: - name: "Download build artifacts" uses: actions/download-artifact@v4 with: - pattern: out-* + pattern: pangraph-* merge-multiple: true path: ".out" - name: "Test Linux distros compatibility" run: | - chmod +x ./.out/pangraph-x86_64-unknown-linux-gnu - ./tests/test-linux-distros ./.out/pangraph-x86_64-unknown-linux-gnu + chmod +x ./.out/pangraph-x86_64-unknown-linux-musl + ./dev/test-linux-distros-musl ./.out/pangraph-x86_64-unknown-linux-musl --help - - check-cli-docs: - name: "Check that autogenerated CLI documentation is up-to-date" + run-compat-tests-x86_64-apple-darwin: + name: "Compat test (x86_64-apple-darwin)" needs: [ build-cli ] - runs-on: ubuntu-22.04 + runs-on: macos-13 steps: - - name: "Checkout code" - uses: actions/checkout@v4 - with: - fetch-depth: 1 - submodules: true + - name: "Show system info" + run: | + set -x + uname -a || true + sw_vers || true + system_profiler SPSoftwareDataType SPHardwareDataType || true + + - name: "Check CPU Architecture" + run: | + arch="$(uname -m)" + if [[ "$arch" != "x86_64" ]]; then + echo "We hope to get x86_64 macOS instance for this job, to test whether our code still runs on Intel Macs. But we got '${arch}'. There isn't much point in testing this on non-x86_64 machine. From here you could either find a way to get an x86_64 macOS runner, or delete the test." + exit 1 + fi - name: "Download build artifacts" uses: actions/download-artifact@v4 with: - pattern: out-* + pattern: pangraph-* merge-multiple: true path: ".out" - - name: "Re-generate CLI docs" + - name: "Run compat test (x86_64-apple-darwin, native)" run: | - chmod +x ./.out/pangraph-x86_64-unknown-linux-gnu - ./scripts/update_cli_reference_docs ./.out/pangraph-x86_64-unknown-linux-gnu - - - name: "Check that the git diff is clean" - run: | - git -c color.ui=always diff --exit-code 'docs/docs/usage/reference.md' || (echo "Autogenerated CLI documentation is not up-to-date, please run './scripts/update_cli_reference_docs ', then verify and commit the changes." >&2; exit 1) + chmod +x ./.out/* + ./.out/pangraph-x86_64-apple-darwin --help - publish-to-github-releases: - name: "Publish to GitHub Releases" - needs: [ build-cli, run-unit-tests, run-lints, run-smoke-tests, run-linux-distros-test, check-cli-docs ] - if: endsWith(github.ref, '/release-cli') - runs-on: ubuntu-22.04 + run-compat-tests-aarch64-apple-darwin: + name: "Compat test (aarch64-apple-darwin)" + needs: [ build-cli ] + runs-on: macos-latest steps: - - name: "Checkout code" - uses: actions/checkout@v4 - with: - fetch-depth: 1 - submodules: true + - name: "Show system info" + run: | + set -x + uname -a || true + sw_vers || true + system_profiler SPSoftwareDataType SPHardwareDataType || true + + - name: "Check CPU Architecture" + run: | + arch="$(uname -m)" + if [[ "$arch" != "arm64" ]]; then + echo "This test requires arm64 machine, but got ${arch}" + exit 1 + fi - name: "Download build artifacts" uses: actions/download-artifact@v4 with: - pattern: out-* + pattern: pangraph-* merge-multiple: true path: ".out" - - name: "Install deploy dependencies" + - name: "Run compat test (aarch64-apple-darwin, native)" run: | - mkdir -p "${HOME}/bin" - curl -fsSL "https://github.com/cli/cli/releases/download/v2.10.1/gh_2.10.1_linux_amd64.tar.gz" | tar xz -C "${HOME}/bin" --strip-components=2 gh_2.10.1_linux_amd64/bin/gh - curl -fsSL "https://github.com/TomWright/dasel/releases/download/v1.24.3/dasel_linux_amd64" -o "${HOME}/bin/dasel" && chmod +x "${HOME}/bin/dasel" - curl -fsSL "https://github.com/orhun/git-cliff/releases/download/v0.7.0/git-cliff-0.7.0-x86_64-unknown-linux-gnu.tar.gz" | tar -C "${HOME}/bin" --strip-components=1 -xz "git-cliff-0.7.0/git-cliff" - curl -fsSL "https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64" -o ${HOME}/bin/jq && chmod +x ${HOME}/bin/jq + chmod +x ./.out/* + ./.out/pangraph-aarch64-apple-darwin --help - - name: "Publish build artifacts to GitHub releases" - run: | - export PATH="${PATH}:${HOME}/bin" - export GITHUB_TOKEN="${{ secrets.NEHERLAB_BOT_GITHUB_TOKEN }}" - ./scripts/publish_github \ - --artifacts_dir ".out" \ - --repo "${{ github.repository }}" \ - --git_sha "${{ github.sha }}" - - publish-to-docker-hub: - name: "Publish to Docker Hub" - needs: [ build-cli, run-unit-tests, run-lints, run-smoke-tests, run-linux-distros-test, check-cli-docs ] - if: endsWith(github.ref, '/release-cli') - runs-on: ubuntu-22.04 + + run-compat-tests-x86_64-pc-windows-gnu: + name: "Compat test (x86_64-pc-windows-gnu)" + needs: [ build-cli ] + runs-on: windows-2019 steps: - - name: "Checkout code" - uses: actions/checkout@v4 - with: - fetch-depth: 1 - submodules: true + - name: "Show system info" + shell: powershell + run: | + $ErrorActionPreference = 'Stop' + Set-PSDebug -Trace 1 + Write-Output "Architecture: $env:PROCESSOR_ARCHITECTURE" + Write-Output "Windows Version:" + systeminfo | Select-String "OS Name", "OS Version" + Get-WmiObject Win32_Processor | Select-Object Name, NumberOfCores, NumberOfLogicalProcessors | Format-Table -AutoSize - name: "Download build artifacts" uses: actions/download-artifact@v4 with: - pattern: out-* + pattern: pangraph-* merge-multiple: true path: ".out" - - name: "Install deploy dependencies" + - name: "Run compat test (x86_64-pc-windows-gnu)" + shell: powershell run: | - mkdir -p "${HOME}/bin" - curl -fsSL "https://github.com/TomWright/dasel/releases/download/v1.24.3/dasel_linux_amd64" -o "${HOME}/bin/dasel" && chmod +x "${HOME}/bin/dasel" - - - name: "Login to Docker Hub" - uses: docker/login-action@v3 - with: - registry: docker.io - username: ${{ secrets.NEHERLAB_BOT_DOCKERHUB_USERNAME }} - password: ${{ secrets.NEHERLAB_BOT_DOCKERHUB_TOKEN }} - - - name: "Build and publish Docker container images to Docker Hub" - run: | - export PATH="${PATH}:${HOME}/bin" - chmod +x ./.out/* - ./scripts/publish_docker --push + .\.out\pangraph-x86_64-pc-windows-gnu --help + + + +# publish-to-github-releases: +# name: "Publish to GitHub Releases" +# needs: [ build-cli, run-unit-tests, run-lints, run-smoke-tests, run-linux-distros-test ] +# if: endsWith(github.ref, '/release-cli') +# runs-on: ubuntu-24.04 +# +# steps: +# - name: "Checkout code" +# uses: actions/checkout@v4 +# with: +# fetch-depth: 1 +# submodules: true +# +# - name: "Download build artifacts" +# uses: actions/download-artifact@v4 +# with: +# pattern: pangraph-* +# merge-multiple: true +# path: ".out" +# +# - name: "Install deploy dependencies" +# run: | +# mkdir -p "${HOME}/bin" +# curl -fsSL "https://github.com/cli/cli/releases/download/v2.10.1/gh_2.10.1_linux_amd64.tar.gz" | tar xz -C "${HOME}/bin" --strip-components=2 gh_2.10.1_linux_amd64/bin/gh +# curl -fsSL "https://github.com/TomWright/dasel/releases/download/v1.24.3/dasel_linux_amd64" -o "${HOME}/bin/dasel" && chmod +x "${HOME}/bin/dasel" +# curl -fsSL "https://github.com/orhun/git-cliff/releases/download/v0.7.0/git-cliff-0.7.0-x86_64-unknown-linux-gnu.tar.gz" | tar -C "${HOME}/bin" --strip-components=1 -xz "git-cliff-0.7.0/git-cliff" +# curl -fsSL "https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64" -o ${HOME}/bin/jq && chmod +x ${HOME}/bin/jq +# +# - name: "Publish build artifacts to GitHub releases" +# run: | +# export PATH="${PATH}:${HOME}/bin" +# export GITHUB_TOKEN="${{ secrets.NEHERLAB_BOT_GITHUB_TOKEN }}" +# ./scripts/publish_github \ +# --artifacts_dir ".out" \ +# --repo "${{ github.repository }}" \ +# --git_sha "${{ github.sha }}" + +# publish-to-docker-hub: +# name: "Publish to Docker Hub" +# needs: [ build-cli, run-unit-tests, run-lints, run-smoke-tests, run-linux-distros-test ] +# if: endsWith(github.ref, '/release-cli') +# runs-on: ubuntu-24.04 +# +# steps: +# - name: "Checkout code" +# uses: actions/checkout@v4 +# with: +# fetch-depth: 1 +# submodules: true +# +# - name: "Download build artifacts" +# uses: actions/download-artifact@v4 +# with: +# pattern: pangraph-* +# merge-multiple: true +# path: ".out" +# +# - name: "Install deploy dependencies" +# run: | +# mkdir -p "${HOME}/bin" +# curl -fsSL "https://github.com/TomWright/dasel/releases/download/v1.24.3/dasel_linux_amd64" -o "${HOME}/bin/dasel" && chmod +x "${HOME}/bin/dasel" +# +# - name: "Login to Docker Hub" +# uses: docker/login-action@v3 +# with: +# registry: docker.io +# username: ${{ secrets.NEHERLAB_BOT_DOCKERHUB_USERNAME }} +# password: ${{ secrets.NEHERLAB_BOT_DOCKERHUB_TOKEN }} +# +# - name: "Build and publish Docker container images to Docker Hub" +# run: | +# export PATH="${PATH}:${HOME}/bin" +# chmod +x ./.out/* +# ./scripts/publish_docker --push diff --git a/Cargo.lock b/Cargo.lock index abddb3b9..87e28c85 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -467,9 +467,9 @@ checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "cmake" -version = "0.1.51" +version = "0.1.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb1e43aa7fd152b1f968787f7dbcdeb306d1867ff373c69955211876c053f91a" +checksum = "c682c223677e0e5b6b7f63a64b9351844c3f1b1678a68b7ee617e30fb082620e" dependencies = [ "cc", ] @@ -1386,62 +1386,11 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" name = "minimap2" version = "1.0.0" dependencies = [ - "approx", - "atty", - "auto_ops", - "bio", - "bio-types", - "bzip2", - "chrono", - "clap", - "clap_complete", - "clap_complete_fig", - "cmd_lib", - "color-eyre", - "csv", - "ctor", - "derive_more", - "env_logger 0.11.5", "eyre", - "flate2", - "gcollections", - "getset", - "intervallum", "itertools", - "lazy_static", - "log", - "maplit", - "memoize", "minimap2-sys", - "ndarray", - "ndarray-rand", - "ndarray-stats", - "noodles", - "num", - "num-integer", - "num-traits", - "num_cpus", "ordered-float", - "parking_lot", - "pretty_assertions", - "pretty_dtoa", - "rand", - "rand_distr", - "rand_isaac", - "rayon", - "rstest", - "rstest_reuse", "serde", - "serde-aux", - "serde_json", - "serde_stacker", - "smart-default", - "strum", - "strum_macros", - "tempfile", - "twox-hash", - "xz2", - "zstd", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index c916c99b..ab83b0fb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,12 +27,23 @@ keywords = [ authors = ["NeherLab team"] [workspace.dependencies] +bzip2 = { version = "=0.4.4", features = ["static"] } +flate2 = "=1.0.33" +libz-sys = { version = "=1.1.20", features = ["static", "stock-zlib", "cmake"] } +xz2 = { version = "=0.1.7", features = ["static"] } +zstd = { version = "=0.13.2", features = ["zstdmt"] } + + +minimap2 = { path = "packages/minimap2", features = ["serde"] } +minimap2-sys = { path = "packages/minimap2-sys", features = ["simde", "static", "vendored", "stock-zlib"] } +#minimap2-sys = { path = "packages/minimap2-sys", features = ["simde", "vendored"] } + + approx = "=0.5.1" atty = "=0.2.14" auto_ops = "=0.3.0" bio = "=2.0.3" bio-types = "=1.0.4" -bzip2 = { version = "=0.4.4", features = ["static"] } chrono = { version = "=0.4.38", default-features = false, features = ["clock", "std", "wasmbind"] } clap = { version = "=4.5.17", features = ["derive", "color", "unicode", "unstable-styles"] } clap-markdown = "=0.1.4" @@ -45,7 +56,6 @@ ctor = "=0.2.8" derive_more = { version = "=1.0.0", features = ["full"] } env_logger = "=0.11.5" eyre = "=0.6.12" -flate2 = "=1.0.33" gcollections = "=1.5.0" getset = "0.1.3" intervallum = "=1.4.1" @@ -54,8 +64,6 @@ lazy_static = "=1.5.0" log = "=0.4.22" maplit = "=1.0.2" memoize = { version = "=0.4.2", features = ["full"] } -minimap2 = { path = "packages/minimap2", features = ["serde"] } -minimap2-sys = { path = "packages/minimap2-sys", features = ["simde", "static", "vendored"] } ndarray = { version = "=0.16.1", features = ["rayon", "serde", "blas", "approx"] } ndarray-rand = "=0.15.0" ndarray-stats = "=0.6.0" @@ -86,8 +94,6 @@ strum = "=0.26.3" strum_macros = "=0.26.4" tempfile = "=3.12.0" twox-hash = { version = "=1.6.3", features = ["serde"] } -xz2 = "=0.1.7" -zstd = { version = "=0.13.2", features = ["zstdmt"] } [workspace.lints.rust] diff --git a/dev/cross/all b/dev/cross/all new file mode 100755 index 00000000..ec2b211b --- /dev/null +++ b/dev/cross/all @@ -0,0 +1,143 @@ +#!/usr/bin/env bash +set -euo pipefail +trap "exit" INT +# shellcheck source=./../lib/utils.sh +source "${BASH_SOURCE%/*}/../lib/utils.sh" +load_env "$(project_root)/.env.example" +load_env_maybe "$(project_root)/.env" + +# Runs bulk cross-compilation of CLI binaries for all supported platforms + +export targets=( + "x86_64-unknown-linux-gnu" + "x86_64-unknown-linux-musl" + "aarch64-unknown-linux-gnu" + "aarch64-unknown-linux-musl" + "x86_64-pc-windows-gnu" + "aarch64-apple-darwin" + "x86_64-apple-darwin" +) + +export build_time="${BUILD_TIME:-$(datetime_safe)}" + +function run_one() { + set -euo pipefail + trap "exit" INT + + local target="${1:?}" + + local arg bin + for arg in $(eval "echo ${*:2}"); do + case ${arg} in + --run) + local run=1 + ;; + *) + bin+=("${arg}") + ;; + esac + done + + info "Building for ${target}" + ( + trap "exit" INT + export CROSS_COMPILE=${target} + export BUILD_TIME=${build_time} + ./dev/docker/run ./dev/cross/build "${bin[@]}" "${target}" || { echo "Build failed for ${target}"; return 1; } + ./dev/docker/run ./dev/cross/check "${bin[@]}" "${target}" + if [ -n "${run:-}" ]; then + ./dev/docker/run ./dev/cross/run "${bin[@]}" "${target}" || { echo "Run failed for ${target}"; return 1; } + fi + ) +} +export -f run_one + +function run_serial() { + set -euo pipefail + trap "exit" INT + + local target + for target in "${targets[@]}"; do + run_one "${target}" "${*}" + done +} +export -f run_serial + +function run_parallel() { + set -euo pipefail + trap "exit" INT + + # shellcheck disable=SC2016 + parallel \ + --line-buffer \ + --tag --tagstring '|{#}| \033[34m{= sprintf("%-s", $_) =}\033[0m' \ + --jobs="${#targets[@]}" \ + run_one \ + ::: "${targets[@]}" ::: "${*}" +} +export -f run_parallel + +function run_in_tmux_split() { + set -euo pipefail + trap "exit" INT + + local session=$(datetime_ms_safe) + + # Run builds in parallel, in a separate tmux windows. + # Kill tmux server with `Ctrl`+`b` followed by `k` (change `b` to your "prefix" shortcut if it's not default) + tmux new-session -d -s "${session}" + tmux send-keys -t "${session}" 'exit' C-m # Close the initial shell to start with a clean layout + + # begin: eye candy options + tmux set -g mouse on + tmux set -g default-terminal "screen-256color" + tmux unbind k + tmux bind k kill-session + tmux set -g pane-border-status top + tmux set -g pane-border-format "#{pane_title}" + tmux set -g pane-border-style "bg=colour235,fg=colour8" + tmux set -g pane-active-border-style "bg=colour242,fg=colour237" + # end: eye candy options + + local target + for target in "${targets[@]}"; do + tmux split-window -v -t "${session}" bash -c "source ${BASH_SOURCE[0]}; run_one ${target} ${*} || true; exec $SHELL" + tmux select-layout -t "${session}" even-vertical + tmux select-pane -t "" -T "${target}" + done + + tmux kill-pane -t 0 # Remove the initial empty pane + tmux attach -t "${session}" +} + +function main() { + local arg bin + for arg in "$@"; do + case ${arg} in + --split) + local split=1 + ;; + --serial) + local serial=1 + ;; + --parallel) + # This is the default + ;; + *) + bin+=("$arg") + ;; + esac + done + + if [ -n "${split:-}" ]; then + run_in_tmux_split "${bin[@]}" + elif [ -n "${serial:-}" ]; then + run_serial "${bin[@]}" + else + run_parallel "${bin[@]}" + fi +} + +if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then + main "$@" +fi diff --git a/dev/cross/build b/dev/cross/build new file mode 100755 index 00000000..6e6577cb --- /dev/null +++ b/dev/cross/build @@ -0,0 +1,74 @@ +#!/usr/bin/env bash +set -euo pipefail +trap "exit" INT +# shellcheck source=./../lib/utils.sh +source "${BASH_SOURCE%/*}/../lib/utils.sh" + +function build() { + trap "exit" INT + + local bin="${1:?}" + local target="${2:-"${CROSS_COMPILE:-}"}" + local target_safe="${target//-/_}" + + local rust_crt_static="-C target-feature=+crt-static" + local rust_static="-C link-arg=-static" + local rust_self_contained="-C link-self-contained=yes" + + # https://github.com/NixOS/nixpkgs/issues/177129 + # https://github.com/llvm/llvm-project/issues/32805 + local rust_apple="-C link-arg=-lgcc_eh" + + # HACK: musl toolchains cannot figure out what libraries to link. Let's help them. + # To investigate. Might be related to '-C link-self-contained=yes' + local rust_musl="-C link-args=-lpthread -C link-args=-lm -C link-args=-lc" + + local c_arch="-march=native" + local rust_arch="-C target-cpu=native" + case "${target}" in + aarch64-apple* | aarch64-darwin*) + c_arch="-mcpu=apple-m1" + rust_arch="-C target-cpu=apple-m1" + ;; + aarch64*) + c_arch="-march=armv8.2-a" + # Target features are listed explicitly from `-C target-feature=+v8.2a` which is currently unstable: + # $ rustc --target aarch64-unknown-linux-gnu -C target-cpu=generic -C target-feature=+v8.2a --print cfg + rust_arch="-C target-cpu=generic -C target-feature=+crc,+dpb,+lor,+lse,+neon,+pan,+ras,+rdm,+vh" + ;; + x86_64*) + c_arch="-march=haswell" + rust_arch="-C target-cpu=haswell" + ;; + esac + + declare -x CARGO_TARGET_AARCH64_APPLE_DARWIN_RUSTFLAGS="${rust_arch} ${rust_crt_static} ${rust_apple}" + declare -x CARGO_TARGET_X86_64_APPLE_DARWIN_RUSTFLAGS="${rust_arch} ${rust_crt_static} ${rust_apple}" + declare -x CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_RUSTFLAGS="${rust_arch}" + declare -x CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS="${rust_arch}" + declare -x CARGO_TARGET_X86_64_PC_WINDOWS_GNU_RUSTFLAGS="${rust_arch} ${rust_crt_static} ${rust_static} ${rust_self_contained}" + declare -x CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="${rust_arch} ${rust_musl} ${rust_crt_static} ${rust_static} ${rust_self_contained}" + declare -x CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_RUSTFLAGS="${rust_arch} ${rust_musl} ${rust_crt_static} ${rust_static} ${rust_self_contained}" + + local c_common="-O3 -ftree-vectorize -funroll-loops ${c_arch}" + declare -x "CFLAGS_${target_safe}=${CFLAGS:-} ${c_common}" + declare -x "CXXFLAGS_${target_safe}=${CXXFLAGS:-} ${c_common}" + declare -x "FCFLAGS_${target_safe}=${FCFLAGS:-} ${c_common}" + + local target_dir="$(get_build_dir "${target}")" + nicely cargo -q build --release ${target:+--target="${target}"} --target-dir="${target_dir}" --bin="${bin}" + + if [ -n "${target}" ] && [ "${target}" != 'native' ]; then + local full_bin="$(get_full_bin_path "${bin}" "${target}")" + local final_bin="$(get_final_bin_path "${bin}" "${target}")" + mkdir -p "$(dirname "${final_bin}")" + ( + set -x + cp "${full_bin}" "${final_bin}" + ) + fi +} + +if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then + build "$@" +fi diff --git a/dev/cross/check b/dev/cross/check new file mode 100755 index 00000000..dfc90ea0 --- /dev/null +++ b/dev/cross/check @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +set -euo pipefail +trap "exit" INT +# shellcheck source=./../lib/utils.sh +source "${BASH_SOURCE%/*}/../lib/utils.sh" + +# Check cross-compiled binary (whether it is static, its format, arch etc.) +function check() { + trap "exit" INT + + local bin="${1:?}" + local target="${2:-"${CROSS_COMPILE:-}"}" + local final_bin="$(get_final_bin_path "${bin}" "${target}")" + + ( + set -x + ./dev/is-static-binary "${final_bin}" "${target}" + ) || true + + ( + set -x + file -h "${final_bin}" || true >/dev/null + ) || true +} + +if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then + check "$@" +fi diff --git a/dev/cross/dump-symbols b/dev/cross/dump-symbols new file mode 100755 index 00000000..ab6183f9 --- /dev/null +++ b/dev/cross/dump-symbols @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +set -euo pipefail +trap "exit" INT +# shellcheck source=./../lib/utils.sh +source "${BASH_SOURCE%/*}/../lib/utils.sh" + +# Dump symbols of a cross-compiled binary in a platform-dependent way + +bin="${1:?}" +target="${2:-"${CROSS_COMPILE:-}"}" +final_bin="$(get_final_bin_path "${bin}" "${target}")" + +function dump_symbols() { + if [[ "${target}" =~ (apple|darwin) ]]; then + local NM=$(printenv "NM_${target}" || printenv "NM" || echo "nm") + ${NM} -gU "${1}" + else + local OBJDUMP=$(printenv "OBJDUMP_${target}" || printenv "OBJDUMP" || echo "objdump") + ${OBJDUMP} --syms "${1}" + fi +} + +function main() { + trap "exit" INT + dump_symbols "${final_bin}" | grep -oP '_\K[A-Z]+[A-Z0-9]*' | sort -u +} + +if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then + main "$@" +fi diff --git a/dev/cross/run b/dev/cross/run new file mode 100755 index 00000000..1374a880 --- /dev/null +++ b/dev/cross/run @@ -0,0 +1,24 @@ +#!/usr/bin/env bash +set -euo pipefail +trap "exit" INT +# shellcheck source=./../lib/utils.sh +source "${BASH_SOURCE%/*}/../lib/utils.sh" + +# Run cross-compiled binary using cross-runner, e.g. qemu or wine +function run() { + trap "exit" INT + + local bin="${1:?}" + local target="${2:-"${CROSS_COMPILE:-}"}" + local final_bin="$(get_final_bin_path "${bin}" "${target}")" + if [ -n "${CROSS_RUNNER:-}" ]; then + ( + set -x + ${CROSS_RUNNER} "${final_bin}" "${@:3}" + ) + fi +} + +if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then + run "$@" +fi diff --git a/dev/cross/strip b/dev/cross/strip new file mode 100755 index 00000000..35850a62 --- /dev/null +++ b/dev/cross/strip @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +set -euo pipefail +trap "exit" INT +# shellcheck source=./../lib/utils.sh +source "${BASH_SOURCE%/*}/../lib/utils.sh" + +# Strip cross-compiled binary in a platform-dependent way + +bin="${1:?}" +target="${2:-"${CROSS_COMPILE:-}"}" +final_bin="$(get_final_bin_path "${bin}" "${target}")" + +function strip() { + local STRIP=$(printenv "STRIP_${target}" || printenv "STRIP" || echo "strip") + if [[ "${target}" =~ (mingw|windows) ]]; then + ${STRIP} "${1}" + elif [[ "${target}" =~ (apple|darwin) ]]; then + ${STRIP} "${1}" + else + ${STRIP} --strip-debug --strip-unneeded "${1}" + fi +} + +function main() { + trap "exit" INT + + printf "Original: %16s\n" "$(du -k "${final_bin}" | cut -f1) kbytes" + strip "${final_bin}" + printf "Stripped: %16s\n" "$(du -k "${final_bin}" | cut -f1) kbytes" +} + +if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then + main "$@" +fi diff --git a/dev/dev b/dev/dev new file mode 100755 index 00000000..318bfcd1 --- /dev/null +++ b/dev/dev @@ -0,0 +1,168 @@ +#!/usr/bin/env bash +# shellcheck disable=SC2178 +set -euo pipefail +trap "exit" INT +# shellcheck source=./lib/utils.sh +source "${BASH_SOURCE%/*}/lib/utils.sh" + +function main() { + local cargo_cmd cargo_test_cmd cmd docs_cmd npm_cmd wasm_cmd + + local docker_args=() + local cargo_append_args=() + + case "${1:-}" in + "docker-image-build" | "Db") + docker_args+=("--build") + ;; + "docker-image-build-push" | "Dp") + docker_args+=("--build --push") + ;; + "build" | "b") + cargo_cmd=("build") + ;; + "build-release" | "br") + cargo_cmd=("build --release") + ;; + "run" | "r") + cargo_cmd=("run") + ;; + "run-release" | "rr") + cargo_cmd=("run --release") + ;; + "wasm" | "W") + wasm_cmd="dev" + ;; + "wasm-release" | "Wr") + wasm_cmd="prod" + ;; + "web" | "app" | "a") + npm_cmd="dev" + ;; + "web-release" | "app-release" | "ar") + npm_cmd="prod:build" + ;; + "web-release-serve" | "app-release-serve" | "ars") + npm_cmd="prod:serve" + ;; + "watch-web-release" | "watch-app-release" | "war") + npm_cmd="prod:watch" + ;; + "docs" | "d") + docs_cmd="dev" + ;; + "docs-release" | "dr") + docs_cmd="prod:build" + ;; + "docs-release-serve" | "drs") + docs_cmd="prod" + ;; + "test" | "t") + cargo_test_cmd=" " + ;; + "test-unit" | "tu") + cargo_test_cmd="--lib" + ;; + "test-integration" | "ti") + cargo_test_cmd=("--test='*'") + ;; + "lint" | "l") + cargo_cmd=("clippy -q") + ;; + "lint-fix" | "lf") + cargo_cmd=("clippy -q --fix --allow-staged") + ;; + "lint-ci" | "lc") + cargo_cmd=("clippy -q") + cargo_append_args=("-- -Dwarnings") + ;; + "format" | "f") + cargo_cmd=("fmt") + ;; + "format-check" | "fc") + cargo_cmd=("fmt --check") + ;; + "bench" | "B") + cargo_cmd=("bench --workspace --benches") + ;; + "bench-hyperfine" | "H") + cargo_cmd=("build --release") + cmd=("hyperfine") + ;; + "p" | "py") + bash + ;; + "jupyter" | "j") + /files/start-jupyter + ;; + esac + + shift + + declare -x RUST_BACKTRACE="full" + + # Run a cargo command (except tests) + if [ -n "${cargo_cmd:-}" ]; then + if [ "$("$(project_root)/dev/is-ci")" == "1" ]; then + cargo_cmd+=("--locked") + fi + + local target_dir= + # shellcheck disable=SC2199 + if [[ "${cargo_cmd[@]}" != fmt* ]]; then + target_dir="$(get_build_dir)" + fi + + local args=("${@:-}") + local bin="${args[0]}" + local args=("${args[@]:2}") + local cargo_run_args=() + if [[ "${cargo_cmd:-}" != build* ]]; then + cargo_run_args=("${args[@]}") + fi + + nicely cargo -q ${cargo_cmd[@]} ${target_dir:+--target-dir="${target_dir}"} ${cargo_append_args[@]} ${bin:+--bin="${bin}"} "${cargo_run_args[@]}" + + if [ "${cmd[*]:-}" == "hyperfine" ]; then + nicely hyperfine --warmup 1 --show-output "'${target_dir}/release/${bin} ${args[*]}'" + fi + + # Run rust tests + elif [ -n "${cargo_test_cmd:-}" ]; then + # shellcheck disable=SC2119 + local target_dir="$(get_test_dir)" + # HACK: `cargo nextest` seems to be having problems discovering linked libraries, let's specify them explicitly + declare -x RUSTFLAGS="-C linker=${HOSTCC} -C link-arg=-pthread -C link-arg=-lopenblas -C link-arg=-lgfortran -C link-arg=-static-libgfortran -C link-arg=-static-libgcc -C link-arg=-static-libstdc++ ${RUSTFLAGS:-}" + + local args=$(echo "${@:-}" | xargs) + + # shellcheck disable=SC2086 + nicely cargo -q nextest run --success-output=immediate --workspace --cargo-quiet --no-fail-fast --hide-progress-bar --color=always --target-dir="${target_dir}" ${args[@]} 2>&1 | + "$(project_root)/dev/prettytest" + + # TODO: run an npm/yarn/bun/deno command + elif [ -n "${npm_cmd:-}" ]; then + ( + set -x + echo "${npm_cmd}" + ) + + # TODO: run WASM build + elif [ -n "${wasm_cmd:-}" ]; then + ( + set -x + echo "${wasm_cmd}" + ) + + # TODO: build docs + elif [ -n "${docs_cmd:-}" ]; then + ( + set -x + echo "${docs_cmd}" + ) + fi +} + +if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then + main "$@" +fi diff --git a/dev/docker/checksum b/dev/docker/checksum new file mode 100755 index 00000000..96df4639 --- /dev/null +++ b/dev/docker/checksum @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -euo pipefail +trap "exit" INT +# shellcheck source=./../lib/utils.sh +source "${BASH_SOURCE%/*}/../lib/utils.sh" + +# shellcheck disable=SC2046 +file_hash \ + .dockerignore \ + .gitignore \ + rust-toolchain.toml \ + $(find dev/docker -type f) diff --git a/dev/docker/cross-darwin.dockerfile b/dev/docker/cross-darwin.dockerfile new file mode 100644 index 00000000..fe264296 --- /dev/null +++ b/dev/docker/cross-darwin.dockerfile @@ -0,0 +1,253 @@ +# syntax=docker/dockerfile:1 +# check=experimental=all +FROM debian:12.8 + +SHELL ["bash", "-euxo", "pipefail", "-c"] + +ARG HOST_TUPLE_DEBIAN +ARG HOST_TUPLE +ARG HOST_TUPLE_UPPER +ARG HOST_GCC_TRIPLET + +ENV HOST_TUPLE_DEBIAN="${HOST_TUPLE_DEBIAN}" +ENV HOST_TUPLE="${HOST_TUPLE}" +ENV HOST_TUPLE_UPPER="${HOST_TUPLE_UPPER}" +ENV HOST_GCC_TRIPLET="${HOST_GCC_TRIPLET}" + +ARG CROSS_COMPILE +ARG CROSS_COMPILE_UPPER +ARG CROSS_APPLE_TRIPLET +ARG CROSS_GCC_TRIPLET + +ENV CROSS_COMPILE="${CROSS_COMPILE}" +ENV CROSS_COMPILE_UPPER="${CROSS_COMPILE_UPPER}" +ENV CROSS_APPLE_TRIPLET="${CROSS_APPLE_TRIPLET}" +ENV CROSS_GCC_TRIPLET="${CROSS_GCC_TRIPLET}" + +RUN set -euxo pipefail >/dev/null \ +&& export DEBIAN_FRONTEND=noninteractive \ +&& apt-get update -qq --yes \ +&& apt-get install -qq --no-install-recommends --yes \ + bash \ + ca-certificates \ + curl \ + file \ + git \ + make \ + pigz \ + pixz \ + pkg-config \ + sudo \ + tar \ + time \ + unzip \ + util-linux \ + xz-utils \ + zstd \ +>/dev/null \ +&& rm -rf /var/lib/apt/lists/* \ +&& apt-get clean autoclean >/dev/null \ +&& apt-get autoremove --yes >/dev/null + +ENV PREFIX_HOST="/opt/host" +ENV HOST_GCC_DIR="${PREFIX_HOST}" +COPY --link "dev/docker/files/install-gcc-cross" "/" +RUN /install-gcc-cross "${HOST_TUPLE}" "${HOST_GCC_DIR}" + +COPY --link "dev/docker/files/install-llvm" "/" +RUN /install-llvm + +COPY --link "dev/docker/files/install-protobuf" "/" +RUN /install-protobuf + +COPY --link "dev/docker/files/install-libbzip2" "/" +RUN /install-libbzip2 "${HOST_TUPLE}" "${PREFIX_HOST}" + +COPY --link "dev/docker/files/install-liblzma" "/" +RUN /install-liblzma "${HOST_TUPLE}" "${PREFIX_HOST}" + +COPY --link "dev/docker/files/install-libz" "/" +RUN /install-libz "${HOST_TUPLE}" "${PREFIX_HOST}" + +COPY --link "dev/docker/files/install-libzstd" "/" +RUN /install-libzstd "${HOST_TUPLE}" "${PREFIX_HOST}" +ENV ZSTD_SYS_USE_PKG_CONFIG="1" + + + +ENV PREFIX_CROSS="/opt/cross-${CROSS_COMPILE}" +ENV OSX_CROSS_PATH="/opt/osxcross" +COPY --link "dev/docker/files/install-osxcross" "/" +RUN /install-osxcross "${OSX_CROSS_PATH}" + +ENV OPENBLAS_LIB_DIR="${PREFIX_CROSS}/lib" +COPY --link "dev/docker/files/install-openblas" "/" +RUN /install-openblas "${CROSS_COMPILE}" "${PREFIX_CROSS}" + +COPY --link "dev/docker/files/install-libbzip2" "/" +RUN /install-libbzip2 "${CROSS_COMPILE}" "${PREFIX_CROSS}" + +COPY --link "dev/docker/files/install-liblzma" "/" +RUN /install-liblzma "${CROSS_COMPILE}" "${PREFIX_CROSS}" + +COPY --link "dev/docker/files/install-libz" "/" +RUN /install-libz "${CROSS_COMPILE}" "${PREFIX_CROSS}" + +COPY --link "dev/docker/files/install-libzstd" "/" +RUN /install-libzstd "${CROSS_COMPILE}" "${PREFIX_CROSS}" +ENV ZSTD_SYS_USE_PKG_CONFIG="1" +ENV LIBZ_SYS_STATIC="1" + + +ENV OSXCROSS_MP_INC="1" +ENV MACOSX_DEPLOYMENT_TARGET="10.12" +ENV PATH="${OSX_CROSS_PATH}/bin:${PATH}" +ENV CROSS_SYSROOT="${OSX_CROSS_PATH}/SDK/MacOSX11.1.sdk" + +ENV CC_${CROSS_COMPILE}="${OSX_CROSS_PATH}/bin/${CROSS_APPLE_TRIPLET}-clang" +ENV CXX_${CROSS_COMPILE}="${OSX_CROSS_PATH}/bin/${CROSS_APPLE_TRIPLET}-clang++" +ENV FC_${CROSS_COMPILE}="${OSX_CROSS_PATH}/bin/${CROSS_GCC_TRIPLET}-gfortran" +ENV AR_${CROSS_COMPILE}="${OSX_CROSS_PATH}/bin/${CROSS_APPLE_TRIPLET}-ar" +ENV AS_${CROSS_COMPILE}="${OSX_CROSS_PATH}/bin/${CROSS_APPLE_TRIPLET}-as" +ENV DSYMUTIL_${CROSS_COMPILE}="${OSX_CROSS_PATH}/bin/${CROSS_APPLE_TRIPLET}-dsymutil" +ENV LD_${CROSS_COMPILE}="${OSX_CROSS_PATH}/bin/${CROSS_APPLE_TRIPLET}-ld" +ENV LIBTOOL_${CROSS_COMPILE}="${OSX_CROSS_PATH}/bin/${CROSS_APPLE_TRIPLET}-libtool" +ENV LIPO_${CROSS_COMPILE}="${OSX_CROSS_PATH}/bin/${CROSS_APPLE_TRIPLET}-lipo" +ENV NM_${CROSS_COMPILE}="${OSX_CROSS_PATH}/bin/${CROSS_APPLE_TRIPLET}-nm" +ENV OBJDUMP_${CROSS_COMPILE}="${OSX_CROSS_PATH}/bin/${CROSS_APPLE_TRIPLET}-ObjectDump" +ENV OTOOL_${CROSS_COMPILE}="${OSX_CROSS_PATH}/bin/${CROSS_APPLE_TRIPLET}-otool" +ENV RANLIB_${CROSS_COMPILE}="${OSX_CROSS_PATH}/bin/${CROSS_APPLE_TRIPLET}-ranlib" +ENV STRIP_${CROSS_COMPILE}="${OSX_CROSS_PATH}/bin/${CROSS_APPLE_TRIPLET}-strip" + + +ENV BINDGEN_EXTRA_CLANG_ARGS_${CROSS_COMPILE}="--sysroot=${CROSS_SYSROOT}" +ENV CARGO_TARGET_${CROSS_COMPILE_UPPER}_AR="${OSX_CROSS_PATH}/bin/${CROSS_APPLE_TRIPLET}-ar" +ENV CARGO_TARGET_${CROSS_COMPILE_UPPER}_LINKER="${OSX_CROSS_PATH}/bin/${CROSS_APPLE_TRIPLET}-clang" +ENV CARGO_TARGET_${CROSS_COMPILE_UPPER}_STRIP="${OSX_CROSS_PATH}/bin/${CROSS_APPLE_TRIPLET}-strip" + + +ENV HOST_SYSROOT="${HOST_GCC_DIR}/${HOST_GCC_TRIPLET}/sysroot" + +ENV HOST_GCC="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-gcc" +ENV HOST_GXX="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-g++" +ENV HOST_GFORTRAN="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-gfortran" +ENV HOST_CLANG="/usr/bin/clang" +ENV HOST_CLANGPP="/usr/bin/clang++" +ENV HOST_ADDR2LINE="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-addr2line" +ENV HOST_AR="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-gcc-ar" +ENV HOST_AS="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-as" +ENV HOST_CPP="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-cpp" +ENV HOST_ELFEDIT="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-elfedit" +ENV HOST_LD="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-ld" +ENV HOST_LDD="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-ldd" +ENV HOST_NM="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-gcc-nm" +ENV HOST_OBJCOPY="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-objcopy" +ENV HOST_OBJDUMP="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-objdump" +ENV HOST_RANLIB="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-gcc-ranlib" +ENV HOST_READELF="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-readelf" +ENV HOST_SIZE="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-size" +ENV HOST_STRINGS="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-strings" +ENV HOST_STRIP="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-strip" + +ENV HOST_CC="${HOST_GCC}" +ENV HOST_CXX="${HOST_GXX}" +ENV HOST_FC="${HOST_GFORTRAN}" + +ENV HOSTCC="${HOST_CC}" +ENV HOSTCXX="${HOST_CXX}" +ENV HOSTFC="${HOST_FC}" +ENV HOSTLD="${HOST_LD}" + +ENV CC_${HOST_TUPLE}="$HOST_GCC" +ENV CXX_${HOST_TUPLE}="$HOST_GXX" +ENV GCC_${HOST_TUPLE}="$HOST_GCC" +ENV GXX_${HOST_TUPLE}="$HOST_GXX" +ENV CLANG_${HOST_TUPLE}="$HOST_CLANG" +ENV CLANGPP_${HOST_TUPLE}="$HOST_CLANGPP" +ENV FC_${HOST_TUPLE}="$HOST_FC" +ENV ADDR2LINE_${HOST_TUPLE}="$HOST_ADDR2LINE" +ENV AR_${HOST_TUPLE}="$HOST_AR" +ENV AS_${HOST_TUPLE}="$HOST_AS" +ENV CPP_${HOST_TUPLE}="$HOST_CPP" +ENV ELFEDIT_${HOST_TUPLE}="$HOST_ELFEDIT" +ENV LD_${HOST_TUPLE}="$HOST_LD" +ENV LDD_${HOST_TUPLE}="$HOST_LDD" +ENV NM_${HOST_TUPLE}="$HOST_NM" +ENV OBJCOPY_${HOST_TUPLE}="$HOST_OBJCOPY" +ENV OBJDUMP_${HOST_TUPLE}="$HOST_OBJDUMP" +ENV RANLIB_${HOST_TUPLE}="$HOST_RANLIB" +ENV READELF_${HOST_TUPLE}="$HOST_READELF" +ENV SIZE_${HOST_TUPLE}="$HOST_SIZE" +ENV STRINGS_${HOST_TUPLE}="$HOST_STRINGS" +ENV STRIP_${HOST_TUPLE}="$HOST_STRIP" + +ENV BINDGEN_EXTRA_CLANG_ARGS_${HOST_TUPLE}="--sysroot=${HOST_SYSROOT}" +ENV CARGO_TARGET_${HOST_TUPLE_UPPER}_AR="${HOST_AR}" +ENV CARGO_TARGET_${HOST_TUPLE_UPPER}_LINKER="${HOST_GCC}" +ENV CARGO_TARGET_${HOST_TUPLE_UPPER}_STRIP="${HOST_STRIP}" + + +ENV CROSS_C_INCLUDE_PATH="${PREFIX_CROSS}/include:${CROSS_GCC_DIR}/include" +ENV HOST_C_INCLUDE_PATH="${PREFIX_HOST}/include:${HOST_GCC_DIR}/include" + +ENV CROSS_CPLUS_INCLUDE_PATH="${CROSS_C_INCLUDE_PATH}" +ENV HOST_CPLUS_INCLUDE_PATH="${HOST_C_INCLUDE_PATH}" + +ENV CROSS_LIBRARY_PATH="${PREFIX_CROSS}/lib:${PREFIX_CROSS}/lib64:${CROSS_GCC_DIR}/lib:${CROSS_GCC_DIR}/lib64:${OSX_CROSS_PATH}/lib/gcc/${CROSS_APPLE_TRIPLET}/14.2.0:${OSX_CROSS_PATH}/lib/gcc/${CROSS_GCC_TRIPLET}/14.2.0:${LIBRARY_PATH}" +ENV HOST_LIBRARY_PATH="${HOST_GCC_DIR}/lib:${HOST_GCC_DIR}/lib64" + +ENV C_INCLUDE_PATH="${CROSS_C_INCLUDE_PATH}:${HOST_C_INCLUDE_PATH}" +ENV CPLUS_INCLUDE_PATH="${CROSS_CPLUS_INCLUDE_PATH}:${HOST_CPLUS_INCLUDE_PATH}" +ENV LIBRARY_PATH="${CROSS_LIBRARY_PATH}:${HOST_LIBRARY_PATH}" + +ENV C_INCLUDE_PATH_${HOST_TUPLE}="${HOST_C_INCLUDE_PATH}" +ENV CPLUS_INCLUDE_PATH_${HOST_TUPLE}="${HOST_CPLUS_INCLUDE_PATH}" +ENV LIBRARY_PATH_${HOST_TUPLE}="${HOST_LIBRARY_PATH}" + +ENV C_INCLUDE_PATH_${CROSS_COMPILE}="${CROSS_C_INCLUDE_PATH}" +ENV CPLUS_INCLUDE_PATH_${CROSS_COMPILE}="${CROSS_CPLUS_INCLUDE_PATH}" +ENV LIBRARY_PATH_${CROSS_COMPILE}="${CROSS_LIBRARY_PATH}" + +ENV CROSS_PKG_CONFIG_PATH="${PREFIX_CROSS}/lib/pkgconfig:${PREFIX_CROSS}/lib64/pkgconfig" +ENV HOST_PKG_CONFIG_PATH="${HOST_GCC_DIR}/lib/pkgconfig:${HOST_GCC_DIR}/lib64/pkgconfig" +ENV PKG_CONFIG_PATH="${CROSS_PKG_CONFIG_PATH}:${HOST_PKG_CONFIG_PATH}" +ENV PKG_CONFIG_ALLOW_CROSS="1" + +ENV PKG_CONFIG_PATH_${HOST_TUPLE}="${HOST_PKG_CONFIG_PATH}" +ENV PKG_CONFIG_SYSROOT_DIR_${HOST_TUPLE}="${PREFIX_HOST}" + +ENV PKG_CONFIG_PATH_${CROSS_COMPILE}="${CROSS_PKG_CONFIG_PATH}" +ENV PKG_CONFIG_SYSROOT_DIR_${CROSS_COMPILE}="${PREFIX_CROSS}" + +ENV PKG_CONFIG_SYSROOT_DIR="${PREFIX_CROSS}" + +ENV CMAKE_PREFIX_PATH="${PREFIX_CROSS}" + +ENV LD_LIBRARY_PATH="${OSX_CROSS_PATH}/lib" + + +ARG USER=user +ARG GROUP=user +ARG UID +ARG GID + +ENV USER=$USER +ENV GROUP=$GROUP +ENV UID=$UID +ENV GID=$GID +ENV TERM="xterm-256color" +ENV HOME="/home/${USER}" + +COPY --link "dev/docker/files/create-user" "/" +RUN /create-user + + +USER ${USER} + + +ENV CARGO_HOME="${HOME}/.cargo" +ENV PATH="${CARGO_HOME}/bin:${PATH}" +COPY --link --chown="${UID}:${GID}" "rust-toolchain.toml" "${CARGO_HOME}/rust-toolchain.toml" +COPY --link "dev/docker/files/install-rust" "/" +RUN set -euxo pipefail >/dev/null \ +&& /install-rust "${CROSS_COMPILE}" "${CARGO_HOME}" diff --git a/dev/docker/cross-linux.dockerfile b/dev/docker/cross-linux.dockerfile new file mode 100644 index 00000000..b7d76bfb --- /dev/null +++ b/dev/docker/cross-linux.dockerfile @@ -0,0 +1,311 @@ +# syntax=docker/dockerfile:1 +# check=experimental=all +FROM debian:12.8 + +SHELL ["bash", "-euxo", "pipefail", "-c"] + +ARG HOST_TUPLE_DEBIAN +ARG HOST_TUPLE +ARG HOST_TUPLE_UPPER +ARG HOST_GCC_TRIPLET + +ENV HOST_TUPLE_DEBIAN="${HOST_TUPLE_DEBIAN}" +ENV HOST_TUPLE="${HOST_TUPLE}" +ENV HOST_TUPLE_UPPER="${HOST_TUPLE_UPPER}" +ENV HOST_GCC_TRIPLET="${HOST_GCC_TRIPLET}" + +ARG CROSS_ARCH_DEBIAN +ARG CROSS_ARCH +ARG CROSS_COMPILE +ARG CROSS_COMPILE_UPPER +ARG CROSS_GCC_TRIPLET +ARG CROSS_RUNNER + +ENV CROSS_ARCH_DEBIAN="${CROSS_ARCH_DEBIAN}" +ENV CROSS_ARCH="${CROSS_ARCH}" +ENV CROSS_COMPILE="${CROSS_COMPILE}" +ENV CROSS_COMPILE_UPPER="${CROSS_COMPILE_UPPER}" +ENV CROSS_GCC_TRIPLET="${CROSS_GCC_TRIPLET}" +ENV CROSS_RUNNER="${CROSS_RUNNER}" + +RUN set -euxo pipefail >/dev/null \ +&& export DEBIAN_FRONTEND=noninteractive \ +&& dpkg --add-architecture ${CROSS_ARCH_DEBIAN} \ +&& apt-get update -qq --yes \ +&& apt-get install -qq --no-install-recommends --yes \ + bash \ + ca-certificates \ + curl \ + file \ + git \ + make \ + pigz \ + pixz \ + pkg-config \ + sudo \ + tar \ + time \ + unzip \ + util-linux \ + xz-utils \ + zstd \ +>/dev/null \ +&& if [[ "${CROSS_COMPILE}" =~ (linux) ]]; then apt-get install -qq --no-install-recommends --yes \ + libc6:${CROSS_ARCH_DEBIAN} \ + qemu-user \ +>/dev/null \ +;fi \ +&& if [[ "${CROSS_COMPILE}" =~ (mingw|windows) ]]; then apt-get install -qq --no-install-recommends --yes \ + wine64 \ +>/dev/null \ +;fi \ +&& rm -rf /var/lib/apt/lists/* \ +&& apt-get clean autoclean >/dev/null \ +&& apt-get autoremove --yes >/dev/null + +ENV PREFIX_HOST="/opt/host" +ENV HOST_GCC_DIR="${PREFIX_HOST}" +COPY --link "dev/docker/files/install-gcc-cross" "/" +RUN /install-gcc-cross "${HOST_TUPLE}" "${HOST_GCC_DIR}" + +COPY --link "dev/docker/files/install-llvm" "/" +RUN /install-llvm + +COPY --link "dev/docker/files/install-protobuf" "/" +RUN /install-protobuf + +COPY --link "dev/docker/files/install-libbzip2" "/" +RUN /install-libbzip2 "${HOST_TUPLE}" "${PREFIX_HOST}" + +COPY --link "dev/docker/files/install-liblzma" "/" +RUN /install-liblzma "${HOST_TUPLE}" "${PREFIX_HOST}" + +COPY --link "dev/docker/files/install-libz" "/" +RUN /install-libz "${HOST_TUPLE}" "${PREFIX_HOST}" + +COPY --link "dev/docker/files/install-libzstd" "/" +RUN /install-libzstd "${HOST_TUPLE}" "${PREFIX_HOST}" +ENV ZSTD_SYS_USE_PKG_CONFIG="1" + + + +ENV PREFIX_CROSS="/opt/cross-${CROSS_COMPILE}" +ENV CROSS_GCC_DIR="${PREFIX_CROSS}" +COPY --link "dev/docker/files/install-gcc-cross" "/" +RUN /install-gcc-cross "${CROSS_GCC_TRIPLET}" "${CROSS_GCC_DIR}" + +ENV OPENBLAS_LIB_DIR="${PREFIX_CROSS}/lib" +COPY --link "dev/docker/files/install-openblas" "/" +RUN /install-openblas "${CROSS_COMPILE}" "${PREFIX_CROSS}" + +COPY --link "dev/docker/files/install-libbzip2" "/" +RUN /install-libbzip2 "${CROSS_COMPILE}" "${PREFIX_CROSS}" + +COPY --link "dev/docker/files/install-liblzma" "/" +RUN /install-liblzma "${CROSS_COMPILE}" "${PREFIX_CROSS}" + +COPY --link "dev/docker/files/install-libz" "/" +RUN /install-libz "${CROSS_COMPILE}" "${PREFIX_CROSS}" + +COPY --link "dev/docker/files/install-libzstd" "/" +RUN /install-libzstd "${CROSS_COMPILE}" "${PREFIX_CROSS}" +ENV ZSTD_SYS_USE_PKG_CONFIG="1" +ENV LIBZ_SYS_STATIC="1" + + +ENV CROSS_SYSROOT="${CROSS_GCC_DIR}/${CROSS_GCC_TRIPLET}/sysroot" + +ENV CROSS_GCC="${CROSS_GCC_DIR}/bin/${CROSS_GCC_TRIPLET}-gcc" +ENV CROSS_GXX="${CROSS_GCC_DIR}/bin/${CROSS_GCC_TRIPLET}-g++" +ENV CROSS_GFORTRAN="${CROSS_GCC_DIR}/bin/${CROSS_GCC_TRIPLET}-gfortran" +ENV CROSS_CLANG="/usr/bin/clang" +ENV CROSS_CLANGPP="/usr/bin/clang++" +ENV CROSS_ADDR2LINE="${CROSS_GCC_DIR}/bin/${CROSS_GCC_TRIPLET}-addr2line" +ENV CROSS_AR="${CROSS_GCC_DIR}/bin/${CROSS_GCC_TRIPLET}-gcc-ar" +ENV CROSS_AS="${CROSS_GCC_DIR}/bin/${CROSS_GCC_TRIPLET}-as" +ENV CROSS_CPP="${CROSS_GCC_DIR}/bin/${CROSS_GCC_TRIPLET}-cpp" +ENV CROSS_ELFEDIT="${CROSS_GCC_DIR}/bin/${CROSS_GCC_TRIPLET}-elfedit" +ENV CROSS_LD="${CROSS_GCC_DIR}/bin/${CROSS_GCC_TRIPLET}-ld" +ENV CROSS_LDD="${CROSS_GCC_DIR}/bin/${CROSS_GCC_TRIPLET}-ldd" +ENV CROSS_NM="${CROSS_GCC_DIR}/bin/${CROSS_GCC_TRIPLET}-gcc-nm" +ENV CROSS_OBJCOPY="${CROSS_GCC_DIR}/bin/${CROSS_GCC_TRIPLET}-objcopy" +ENV CROSS_OBJDUMP="${CROSS_GCC_DIR}/bin/${CROSS_GCC_TRIPLET}-objdump" +ENV CROSS_RANLIB="${CROSS_GCC_DIR}/bin/${CROSS_GCC_TRIPLET}-gcc-ranlib" +ENV CROSS_READELF="${CROSS_GCC_DIR}/bin/${CROSS_GCC_TRIPLET}-readelf" +ENV CROSS_SIZE="${CROSS_GCC_DIR}/bin/${CROSS_GCC_TRIPLET}-size" +ENV CROSS_STRINGS="${CROSS_GCC_DIR}/bin/${CROSS_GCC_TRIPLET}-strings" +ENV CROSS_STRIP="${CROSS_GCC_DIR}/bin/${CROSS_GCC_TRIPLET}-strip" + +ENV CROSS_CC="${CROSS_GCC}" +ENV CROSS_CXX="${CROSS_GXX}" +ENV CROSS_FC="${CROSS_GFORTRAN}" + +ENV CROSSCC="${CROSS_CC}" +ENV CROSSCXX="${CROSS_CXX}" +ENV CROSSFC="${CROSS_FC}" +ENV CROSSLD="${CROSS_LD}" + +ENV CC_${CROSS_COMPILE}="$CROSS_GCC" +ENV CXX_${CROSS_COMPILE}="$CROSS_GXX" +ENV GCC_${CROSS_COMPILE}="$CROSS_GCC" +ENV GXX_${CROSS_COMPILE}="$CROSS_GXX" +ENV CLANG_${CROSS_COMPILE}="$CROSS_CLANG" +ENV CLANGPP_${CROSS_COMPILE}="$CROSS_CLANGPP" +ENV FC_${CROSS_COMPILE}="$CROSS_FC" +ENV ADDR2LINE_${CROSS_COMPILE}="$CROSS_ADDR2LINE" +ENV AR_${CROSS_COMPILE}="$CROSS_AR" +ENV AS_${CROSS_COMPILE}="$CROSS_AS" +ENV CPP_${CROSS_COMPILE}="$CROSS_CPP" +ENV ELFEDIT_${CROSS_COMPILE}="$CROSS_ELFEDIT" +ENV LD_${CROSS_COMPILE}="$CROSS_LD" +ENV LDD_${CROSS_COMPILE}="$CROSS_LDD" +ENV NM_${CROSS_COMPILE}="$CROSS_NM" +ENV OBJCOPY_${CROSS_COMPILE}="$CROSS_OBJCOPY" +ENV OBJDUMP_${CROSS_COMPILE}="$CROSS_OBJDUMP" +ENV RANLIB_${CROSS_COMPILE}="$CROSS_RANLIB" +ENV READELF_${CROSS_COMPILE}="$CROSS_READELF" +ENV SIZE_${CROSS_COMPILE}="$CROSS_SIZE" +ENV STRINGS_${CROSS_COMPILE}="$CROSS_STRINGS" +ENV STRIP_${CROSS_COMPILE}="$CROSS_STRIP" + + +ENV BINDGEN_EXTRA_CLANG_ARGS_${CROSS_COMPILE}="--sysroot=${CROSS_SYSROOT}" +ENV CARGO_TARGET_${CROSS_COMPILE_UPPER}_AR="${CROSS_AR}" +ENV CARGO_TARGET_${CROSS_COMPILE_UPPER}_LINKER="${CROSS_CC}" +ENV CARGO_TARGET_${CROSS_COMPILE_UPPER}_STRIP="${CROSS_STRIP}" +ENV CARGO_TARGET_${CROSS_COMPILE_UPPER}_RUNNER="${CROSS_RUNNER}" + + +ENV HOST_SYSROOT="${HOST_GCC_DIR}/${HOST_GCC_TRIPLET}/sysroot" + +ENV HOST_GCC="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-gcc" +ENV HOST_GXX="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-g++" +ENV HOST_GFORTRAN="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-gfortran" +ENV HOST_CLANG="/usr/bin/clang" +ENV HOST_CLANGPP="/usr/bin/clang++" +ENV HOST_ADDR2LINE="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-addr2line" +ENV HOST_AR="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-gcc-ar" +ENV HOST_AS="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-as" +ENV HOST_CPP="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-cpp" +ENV HOST_ELFEDIT="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-elfedit" +ENV HOST_LD="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-ld" +ENV HOST_LDD="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-ldd" +ENV HOST_NM="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-gcc-nm" +ENV HOST_OBJCOPY="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-objcopy" +ENV HOST_OBJDUMP="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-objdump" +ENV HOST_RANLIB="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-gcc-ranlib" +ENV HOST_READELF="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-readelf" +ENV HOST_SIZE="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-size" +ENV HOST_STRINGS="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-strings" +ENV HOST_STRIP="${HOST_GCC_DIR}/bin/${HOST_GCC_TRIPLET}-strip" + +ENV HOST_CC="${HOST_GCC}" +ENV HOST_CXX="${HOST_GXX}" +ENV HOST_FC="${HOST_GFORTRAN}" + +ENV HOSTCC="${HOST_CC}" +ENV HOSTCXX="${HOST_CXX}" +ENV HOSTFC="${HOST_FC}" +ENV HOSTLD="${HOST_LD}" + +ENV CC_${HOST_TUPLE}="$HOST_GCC" +ENV CXX_${HOST_TUPLE}="$HOST_GXX" +ENV GCC_${HOST_TUPLE}="$HOST_GCC" +ENV GXX_${HOST_TUPLE}="$HOST_GXX" +ENV CLANG_${HOST_TUPLE}="$HOST_CLANG" +ENV CLANGPP_${HOST_TUPLE}="$HOST_CLANGPP" +ENV FC_${HOST_TUPLE}="$HOST_FC" +ENV ADDR2LINE_${HOST_TUPLE}="$HOST_ADDR2LINE" +ENV AR_${HOST_TUPLE}="$HOST_AR" +ENV AS_${HOST_TUPLE}="$HOST_AS" +ENV CPP_${HOST_TUPLE}="$HOST_CPP" +ENV ELFEDIT_${HOST_TUPLE}="$HOST_ELFEDIT" +ENV LD_${HOST_TUPLE}="$HOST_LD" +ENV LDD_${HOST_TUPLE}="$HOST_LDD" +ENV NM_${HOST_TUPLE}="$HOST_NM" +ENV OBJCOPY_${HOST_TUPLE}="$HOST_OBJCOPY" +ENV OBJDUMP_${HOST_TUPLE}="$HOST_OBJDUMP" +ENV RANLIB_${HOST_TUPLE}="$HOST_RANLIB" +ENV READELF_${HOST_TUPLE}="$HOST_READELF" +ENV SIZE_${HOST_TUPLE}="$HOST_SIZE" +ENV STRINGS_${HOST_TUPLE}="$HOST_STRINGS" +ENV STRIP_${HOST_TUPLE}="$HOST_STRIP" + +ENV BINDGEN_EXTRA_CLANG_ARGS_${HOST_TUPLE}="--sysroot=${HOST_SYSROOT}" +ENV CARGO_TARGET_${HOST_TUPLE_UPPER}_AR="${HOST_AR}" +ENV CARGO_TARGET_${HOST_TUPLE_UPPER}_LINKER="${HOST_GCC}" +ENV CARGO_TARGET_${HOST_TUPLE_UPPER}_STRIP="${HOST_STRIP}" + + +ENV CROSS_C_INCLUDE_PATH="${PREFIX_CROSS}/include:${CROSS_GCC_DIR}/include" +ENV HOST_C_INCLUDE_PATH="${PREFIX_HOST}/include:${HOST_GCC_DIR}/include" + +ENV CROSS_CPLUS_INCLUDE_PATH="${CROSS_C_INCLUDE_PATH}" +ENV HOST_CPLUS_INCLUDE_PATH="${HOST_C_INCLUDE_PATH}" + +ENV CROSS_LIBRARY_PATH="${PREFIX_CROSS}/lib:${PREFIX_CROSS}/lib64:${CROSS_GCC_DIR}/lib:${CROSS_GCC_DIR}/lib64" +ENV HOST_LIBRARY_PATH="${HOST_GCC_DIR}/lib:${HOST_GCC_DIR}/lib64" + +ENV C_INCLUDE_PATH="${CROSS_C_INCLUDE_PATH}:${HOST_C_INCLUDE_PATH}" +ENV CPLUS_INCLUDE_PATH="${CROSS_CPLUS_INCLUDE_PATH}:${HOST_CPLUS_INCLUDE_PATH}" +ENV LIBRARY_PATH="${CROSS_LIBRARY_PATH}:${HOST_LIBRARY_PATH}" + +ENV C_INCLUDE_PATH_${HOST_TUPLE}="${HOST_C_INCLUDE_PATH}" +ENV CPLUS_INCLUDE_PATH_${HOST_TUPLE}="${HOST_CPLUS_INCLUDE_PATH}" +ENV LIBRARY_PATH_${HOST_TUPLE}="${HOST_LIBRARY_PATH}" + +ENV C_INCLUDE_PATH_${CROSS_COMPILE}="${CROSS_C_INCLUDE_PATH}" +ENV CPLUS_INCLUDE_PATH_${CROSS_COMPILE}="${CROSS_CPLUS_INCLUDE_PATH}" +ENV LIBRARY_PATH_${CROSS_COMPILE}="${CROSS_LIBRARY_PATH}" + +ENV CROSS_PKG_CONFIG_PATH="${PREFIX_CROSS}/lib/pkgconfig:${PREFIX_CROSS}/lib64/pkgconfig" +ENV HOST_PKG_CONFIG_PATH="${HOST_GCC_DIR}/lib/pkgconfig:${HOST_GCC_DIR}/lib64/pkgconfig" +ENV PKG_CONFIG_PATH="${CROSS_PKG_CONFIG_PATH}:${HOST_PKG_CONFIG_PATH}" +ENV PKG_CONFIG_ALLOW_CROSS="1" + +ENV PKG_CONFIG_PATH_${HOST_TUPLE}="${HOST_PKG_CONFIG_PATH}" +ENV PKG_CONFIG_SYSROOT_DIR_${HOST_TUPLE}="${PREFIX_HOST}" + +ENV PKG_CONFIG_PATH_${CROSS_COMPILE}="${CROSS_PKG_CONFIG_PATH}" +ENV PKG_CONFIG_SYSROOT_DIR_${CROSS_COMPILE}="${PREFIX_CROSS}" + +ENV PKG_CONFIG_SYSROOT_DIR="${PREFIX_CROSS}" + +ENV CMAKE_PREFIX_PATH="${PREFIX_CROSS}" + +ENV MINGW_LIB_DIR="${CROSS_SYSROOT}/lib" + + +ARG USER=user +ARG GROUP=user +ARG UID +ARG GID + +ENV USER=$USER +ENV GROUP=$GROUP +ENV UID=$UID +ENV GID=$GID +ENV TERM="xterm-256color" +ENV HOME="/home/${USER}" + +COPY --link "dev/docker/files/create-user" "/" +RUN /create-user + + +USER ${USER} + + +ENV CARGO_HOME="${HOME}/.cargo" +ENV PATH="${CARGO_HOME}/bin:${PATH}" +COPY --link --chown="${UID}:${GID}" "rust-toolchain.toml" "${CARGO_HOME}/rust-toolchain.toml" +COPY --link "dev/docker/files/install-rust" "/" +RUN set -euxo pipefail >/dev/null \ +&& /install-rust "${CROSS_COMPILE}" "${CARGO_HOME}" + + + +ENV WINEPREFIX="${HOME}/wine" +ENV WINEARCH="win64" +ENV WINEDEBUG="err+all,err-winediag,err-ole,fixme-all" +COPY --link "dev/docker/files/install-bryptprimitives" "/" +RUN if [[ "${CROSS_COMPILE}" =~ (mingw|windows) ]]; then /install-bryptprimitives "${WINEPREFIX}/drive_c/windows/system32"; fi diff --git a/docker/files/.conda/.condarc b/dev/docker/files/.conda/.condarc similarity index 90% rename from docker/files/.conda/.condarc rename to dev/docker/files/.conda/.condarc index 6cf10bad..be76fb44 100644 --- a/docker/files/.conda/.condarc +++ b/dev/docker/files/.conda/.condarc @@ -5,4 +5,4 @@ channels: - conda-forge - defaults track_features: - - mkl + - openblas diff --git a/dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/notification.jupyterlab-settings b/dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/notification.jupyterlab-settings new file mode 100644 index 00000000..7c921766 --- /dev/null +++ b/dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/notification.jupyterlab-settings @@ -0,0 +1,5 @@ +{ + "fetchNews": "false", + "checkForUpdates": false, + "doNotDisturbMode": false +} \ No newline at end of file diff --git a/docker/files/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/themes.jupyterlab-settings b/dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/themes.jupyterlab-settings similarity index 100% rename from docker/files/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/themes.jupyterlab-settings rename to dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/apputils-extension/themes.jupyterlab-settings diff --git a/docker/files/.jupyter/lab/user-settings/@jupyterlab/fileeditor-extension/plugin.jupyterlab-settings b/dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/codemirror-extension/plugin.jupyterlab-settings similarity index 58% rename from docker/files/.jupyter/lab/user-settings/@jupyterlab/fileeditor-extension/plugin.jupyterlab-settings rename to dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/codemirror-extension/plugin.jupyterlab-settings index 0d4f2e08..ddb4d6c0 100644 --- a/docker/files/.jupyter/lab/user-settings/@jupyterlab/fileeditor-extension/plugin.jupyterlab-settings +++ b/dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/codemirror-extension/plugin.jupyterlab-settings @@ -1,7 +1,6 @@ { - "editorConfig": { - "highlightActiveLine": false, + "defaultConfig": { "highlightTrailingWhitespace": true, "highlightWhitespace": true } -} +} \ No newline at end of file diff --git a/dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/console-extension/tracker.jupyterlab-settings b/dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/console-extension/tracker.jupyterlab-settings new file mode 100644 index 00000000..bd6e8d25 --- /dev/null +++ b/dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/console-extension/tracker.jupyterlab-settings @@ -0,0 +1,9 @@ +{ + "promptCellConfig": { + "autoClosingBrackets": true, + "highlightTrailingWhitespace": true, + "highlightWhitespace": true + }, + "interactionMode": "notebook", + "showAllKernelActivity": false +} \ No newline at end of file diff --git a/dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/extensionmanager-extension/plugin.jupyterlab-settings b/dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/extensionmanager-extension/plugin.jupyterlab-settings new file mode 100644 index 00000000..14d2470b --- /dev/null +++ b/dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/extensionmanager-extension/plugin.jupyterlab-settings @@ -0,0 +1,4 @@ +{ + "enabled": true, + "disclaimed": true +} \ No newline at end of file diff --git a/dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/fileeditor-extension/plugin.jupyterlab-settings b/dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/fileeditor-extension/plugin.jupyterlab-settings new file mode 100644 index 00000000..841802e5 --- /dev/null +++ b/dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/fileeditor-extension/plugin.jupyterlab-settings @@ -0,0 +1,18 @@ +{ + // Text Editor + // @jupyterlab/fileeditor-extension:plugin + // Text editor settings. + // *************************************** + + // Editor Configuration + // The configuration for all text editors; it will override the CodeMirror default configuration. + // If `fontFamily`, `fontSize` or `lineHeight` are `null`, + // values from current theme are used. + "editorConfig": { + "highlightActiveLine": false, + "highlightTrailingWhitespace": true, + "highlightWhitespace": true, + "autoClosingBrackets": true, + "theme": "jupyter" + } +} \ No newline at end of file diff --git a/dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/notebook-extension/tracker.jupyterlab-settings b/dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/notebook-extension/tracker.jupyterlab-settings new file mode 100644 index 00000000..f6382d35 --- /dev/null +++ b/dev/docker/files/.jupyter/lab/user-settings/@jupyterlab/notebook-extension/tracker.jupyterlab-settings @@ -0,0 +1,30 @@ +{ + // Notebook + // @jupyterlab/notebook-extension:tracker + // Notebook settings. + // ************************************** + + // Code Cell Configuration + // The configuration for all code cells; it will override the CodeMirror default configuration. + "codeCellConfig": { + "lineNumbers": true, + "lineWrap": true, + "autoClosingBrackets": true + }, + + // Markdown Cell Configuration + // The configuration for all markdown cells; it will override the CodeMirror default configuration. + "markdownCellConfig": { + "lineNumbers": true, + "matchBrackets": true, + "autoClosingBrackets": true + }, + + // Raw Cell Configuration + // The configuration for all raw cells; it will override the CodeMirror default configuration. + "rawCellConfig": { + "lineNumbers": true, + "matchBrackets": true, + "autoClosingBrackets": true + } +} diff --git a/dev/docker/files/create-user b/dev/docker/files/create-user new file mode 100755 index 00000000..baf389fe --- /dev/null +++ b/dev/docker/files/create-user @@ -0,0 +1,86 @@ +#!/usr/bin/env bash +set -euxo pipefail + +: "${UID:? "UID is not set."}" +: "${GID:? "GID is not set."}" +: "${USER:? "USER is not set."}" +: "${GROUP:? "GROUP is not set."}" +: "${HOME:? "HOME is not set."}" + +if [ -z "$(getent group "${GID}")" ]; then + groupadd --system --gid "${GID}" "${GROUP}" +else + GROUP_EXISTING=$(getent group "${GID}" | cut -d: -f1) + groupmod --new-name "${GROUP}" "${GROUP_EXISTING}" +fi + +if [ -f /etc/debian_version ]; then + SUDO_GROUP="sudo" +else + SUDO_GROUP="wheel" +fi + +if [ -z "$(getent passwd ${UID})" ]; then + useradd \ + --system \ + --home-dir "${HOME}" \ + --create-home \ + --shell "/bin/bash" \ + --gid "${GROUP}" \ + --groups "${SUDO_GROUP},${GROUP}" \ + --uid ${UID} \ + "${USER}" +else + USER_EXISTING="$(getent passwd ${UID} | cut -d: -f1)" + + if [ "$(getent passwd "${USER_EXISTING}" | cut -d: -f6)" != "${HOME}" ]; then + if [ -d "$(getent passwd "${USER_EXISTING}" | cut -d: -f6)" ]; then + cp -r "$(getent passwd "${USER_EXISTING}" | cut -d: -f6)/." "${HOME}/" + fi + usermod \ + --home "${HOME}" \ + --shell "/bin/bash" \ + --gid "${GID}" \ + --groups "${SUDO_GROUP},${GROUP}" \ + --uid "${UID}" \ + --login "${USER}" \ + "${USER_EXISTING}" + chown -R "${USER}:${GROUP}" "${HOME}" + fi + +fi + +cp -a /etc/skel/. "${HOME}"/ + +sed -i'' \ + -e 's|^%sudo.*|%sudo ALL=(ALL:ALL) NOPASSWD: ALL|g' \ + -e 's|^root.*|root ALL=(ALL:ALL) NOPASSWD: ALL|g' \ + -e 's|^#includedir.*||g' \ + "/etc/sudoers" + +echo "%sudo ALL=(ALL) NOPASSWD:ALL" >> "/etc/sudoers" +echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> "/etc/sudoers" + +cat <<'EOF' >> "${HOME}/.bashrc" +HISTSIZE=100000 +HISTFILESIZE=200000 + +alias ls='ls --color=auto --group-directories-first' +alias ll='ls -alFhp --time-style="+%Y-%m-%d %H:%M:%S"' +alias la='ls -Ah' +alias l='ls -CFh' +alias l1='ls -a1' + +alias dir='dir --color=auto' +alias vdir='vdir --color=auto' +alias grep='grep --color=auto' +alias fgrep='fgrep --color=auto' +alias egrep='egrep --color=auto' + +function mkcd() { mkdir -p "${1}" && cd "${1}" ; } + +EOF + + +touch "${HOME}/.hushlogin" +chown -R "${USER}:${GROUP}" "${HOME}" diff --git a/dev/docker/files/install-bryptprimitives b/dev/docker/files/install-bryptprimitives new file mode 100755 index 00000000..f2a2b110 --- /dev/null +++ b/dev/docker/files/install-bryptprimitives @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -euxo pipefail + +# Install bcryptprimitives.dll mock for Wine. Only relevant when running Windows executables on Wine. + +dest=${1} +mkdir -p "${dest}" + +curl -fsSL "https://github.com/binarylandia/wine_bcryptprimitives_dll_mock/releases/download/2024-11-04_16-27-34/bcryptprimitives.dll-2024-11-04_16-27-34.gz" \ + | gzip -cd > "${dest}/bcryptprimitives.dll" diff --git a/dev/docker/files/install-ccache b/dev/docker/files/install-ccache new file mode 100755 index 00000000..d1e2477b --- /dev/null +++ b/dev/docker/files/install-ccache @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -euxo pipefail + +dest=${1:-"/usr/local"} +mkdir -p "${dest}/bin" + +curl -fsSL "https://github.com/ccache/ccache/releases/download/v4.10.2/ccache-4.10.2-linux-x86_64.tar.xz" \ + | tar --strip-components=1 -C "${dest}/bin" -xJ "ccache-4.10.2-linux-x86_64/ccache" + +ls "${dest}/bin/ccache" +ccache --version diff --git a/dev/docker/files/install-dasel b/dev/docker/files/install-dasel new file mode 100755 index 00000000..703a2863 --- /dev/null +++ b/dev/docker/files/install-dasel @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -euxo pipefail + +curl -fsSL "https://github.com/TomWright/dasel/releases/download/v1.22.1/dasel_linux_amd64" -o "/usr/bin/dasel" +chmod +x "/usr/bin/dasel" +which dasel +dasel --version diff --git a/dev/docker/files/install-gcc b/dev/docker/files/install-gcc new file mode 100755 index 00000000..d3a623c0 --- /dev/null +++ b/dev/docker/files/install-gcc @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -euxo pipefail + +dest=${1:-"/usr/local"} +mkdir -p "${dest}" + +curl -fsSL "https://github.com/binarylandia/build_gcc/releases/download/2024-11-03_12-57-14/gcc-14.2.0-host-x86_64-unknown-linux-gnu.2.17-2024-11-03_12-57-14.tar.xz" \ + | pixz -dp "$(nproc)" \ + | tar -C "${dest}" -x + +ls "${dest}/bin/gcc" +"${dest}/bin/gcc" -v + +ls "${dest}/bin/gcc-ar" +"${dest}/bin/gcc-ar" --version diff --git a/dev/docker/files/install-gcc-cross b/dev/docker/files/install-gcc-cross new file mode 100755 index 00000000..d1e84d42 --- /dev/null +++ b/dev/docker/files/install-gcc-cross @@ -0,0 +1,37 @@ +#!/usr/bin/env bash +set -euxo pipefail + +triplet=${1} +dest=${2:-"/opt/${triplet}"} +mkdir -p "${dest}" + +URL="https://github.com/binarylandia/build_crosstool-ng/releases/download/2024-11-08_06-06-34/gcc-14.2.0-${triplet}-2024-11-08_06-06-34.tar.xz" + +curl -fsSL "${URL}" \ + | pixz -dp "$(nproc)" \ + | tar -C "${dest}" -x + +ls "${dest}/bin/${triplet}-gcc" +"${dest}/bin/${triplet}-gcc" -v + +ls "${dest}/bin/${triplet}-gcc-ar" +"${dest}/bin/${triplet}-gcc-ar" --version + +if [[ "${triplet}" =~ (mingw|windows) ]]; then + # HACK: symlink missing libgcc_eh.a, because cargo insists it's needed. However, mingw toolchain does not have it. + # https://github.com/r-windows/rtools-packages/issues/185 + # https://github.com/skeeto/w64devkit/issues/52 + pushd "${dest}/lib/gcc/x86_64-w64-mingw32/14.2.0" >/dev/null + ln -s "libgcc.a" "libgcc_eh.a" + popd >/dev/null + + # HACK: sysroot in MinGW GCC is nested under additional `mingw/` path segment, copy it upstairs to avoid having to + # set different sysroot variables for Linux and Windows + cp -r "${dest}/x86_64-w64-mingw32/sysroot/mingw/"* "${dest}/x86_64-w64-mingw32/sysroot"/ +fi + +gcc_triplet="$("${dest}/bin/${triplet}-gcc" -dumpmachine)" +if [ "${gcc_triplet}" != "${triplet}" ]; then + echo "$0: GCC target triplet '${gcc_triplet}' does not match requested '${triplet}'" >&2 + exit 1 +fi diff --git a/dev/docker/files/install-hyperfine b/dev/docker/files/install-hyperfine new file mode 100755 index 00000000..4575bd85 --- /dev/null +++ b/dev/docker/files/install-hyperfine @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -euxo pipefail + +dest=${1:-"/usr/local"} +mkdir -p "${dest}/bin" + +version="1.19.0" + +curl -fsSL "https://github.com/sharkdp/hyperfine/releases/download/v${version}/hyperfine-v${version}-x86_64-unknown-linux-gnu.tar.gz" \ + | tar --strip-components=1 -C "${dest}/bin" -xz "hyperfine-v${version}-x86_64-unknown-linux-gnu/hyperfine" + +ls "${dest}/bin/hyperfine" +hyperfine --version diff --git a/dev/docker/files/install-jq b/dev/docker/files/install-jq new file mode 100755 index 00000000..3194d4db --- /dev/null +++ b/dev/docker/files/install-jq @@ -0,0 +1,7 @@ +#!/usr/bin/env bash +set -euxo pipefail + +curl -fsSL -o "/usr/bin/jq" "https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64" +chmod +x "/usr/bin/jq" +which jq +jq --version diff --git a/dev/docker/files/install-libbzip2 b/dev/docker/files/install-libbzip2 new file mode 100755 index 00000000..242e9216 --- /dev/null +++ b/dev/docker/files/install-libbzip2 @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -euxo pipefail + +triplet="${1}" +dest=${2:-"/usr/local/${triplet}"} +mkdir -p "${dest}" + +curl -fsSL "https://github.com/binarylandia/staticbourg/releases/download/2024-11-13_07-48-58/bzip2-1.0.8-static-${triplet}-2024-11-13_07-48-58.tar.zst" \ + | pzstd -dc -p "$(nproc)" \ + | tar -C "${dest}" -x diff --git a/dev/docker/files/install-liblzma b/dev/docker/files/install-liblzma new file mode 100755 index 00000000..7955f557 --- /dev/null +++ b/dev/docker/files/install-liblzma @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -euxo pipefail + +triplet="${1}" +dest=${2:-"/usr/local/${triplet}"} +mkdir -p "${dest}" + +curl -fsSL "https://github.com/binarylandia/staticbourg/releases/download/2024-11-13_07-48-58/lzma-5.6.3-static-${triplet}-2024-11-13_07-48-58.tar.zst" \ + | pzstd -dc -p "$(nproc)" \ + | tar -C "${dest}" -x diff --git a/dev/docker/files/install-libz b/dev/docker/files/install-libz new file mode 100755 index 00000000..c4bcd982 --- /dev/null +++ b/dev/docker/files/install-libz @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -euxo pipefail + +triplet="${1}" +dest=${2:-"/usr/local/${triplet}"} +mkdir -p "${dest}" + +curl -fsSL "https://github.com/binarylandia/staticbourg/releases/download/2024-11-13_07-48-58/zlib-1.3.1-static-${triplet}-2024-11-13_07-48-58.tar.zst" \ + | pzstd -dc -p "$(nproc)" \ + | tar -C "${dest}" -x diff --git a/dev/docker/files/install-libzstd b/dev/docker/files/install-libzstd new file mode 100755 index 00000000..4cdd40f2 --- /dev/null +++ b/dev/docker/files/install-libzstd @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -euxo pipefail + +triplet="${1}" +dest=${2:-"/usr/local/${triplet}"} +mkdir -p "${dest}" + +curl -fsSL "https://github.com/binarylandia/staticbourg/releases/download/2024-11-13_07-48-58/zstd-1.5.6-static-${triplet}-2024-11-13_07-48-58.tar.zst" \ + | pzstd -dc -p "$(nproc)" \ + | tar -C "${dest}" -x diff --git a/dev/docker/files/install-llvm b/dev/docker/files/install-llvm new file mode 100755 index 00000000..8263a4bf --- /dev/null +++ b/dev/docker/files/install-llvm @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -euxo pipefail + +dest=${1:-"/usr/local"} +mkdir -p "${dest}" + +curl -fsSL "https://github.com/binarylandia/build_llvm/releases/download/llvm-19.1.5-2024-12-21_14-43-03/llvm-19.1.5-2024-12-21_14-43-03.tar.gz" \ + | pigz -d -p "$(nproc)" \ + | tar -C "${dest}" -x + +ls "${dest}/bin/clang" +"${dest}/bin/clang" -v + +ls "${dest}/bin/llvm-ar" +"${dest}/bin/llvm-ar" --version diff --git a/dev/docker/files/install-openblas b/dev/docker/files/install-openblas new file mode 100755 index 00000000..de4ad3e2 --- /dev/null +++ b/dev/docker/files/install-openblas @@ -0,0 +1,12 @@ +#!/usr/bin/env bash +set -euxo pipefail + +triplet="${1}" +dest=${2:-"/usr/local/${triplet}"} +mkdir -p "${dest}" + +curl -fsSL "https://github.com/binarylandia/build_openblas/releases/download/2024-11-07_22-51-18/openblas-static-threads-0.3.28-${triplet}-2024-11-07_22-51-18.tar.xz" \ + | pixz -dp "$(nproc)" \ + | tar -C "${dest}" -x + +ls "${dest}/lib/libopenblas.a" diff --git a/dev/docker/files/install-openssl b/dev/docker/files/install-openssl new file mode 100755 index 00000000..39afee45 --- /dev/null +++ b/dev/docker/files/install-openssl @@ -0,0 +1,13 @@ +#!/usr/bin/env bash +set -euxo pipefail + +dest=${1:-"/usr/local"} +mkdir -p "${dest}" + +curl -fsSL "https://github.com/binarylandia/staticbourg/releases/download/2024-12-03_21-25-53/openssl-3.4.0-static-x86_64-unknown-linux-gnu-2024-12-03_21-25-53.tar.xz" \ + | pixz -dp "$(nproc)" \ + | tar -C "${dest}" -x + +ls "${dest}/include/openssl/evp.h" +ls "${dest}/lib/libssl.a" +ls "${dest}/lib/libcrypto.a" diff --git a/dev/docker/files/install-osxcross b/dev/docker/files/install-osxcross new file mode 100755 index 00000000..a7f78a71 --- /dev/null +++ b/dev/docker/files/install-osxcross @@ -0,0 +1,9 @@ +#!/usr/bin/env bash +set -euxo pipefail + +dest=${1:-"/opt/osxcross"} +mkdir -p "${dest}" + +curl -fsSL "https://github.com/binarylandia/build_osxcross/releases/download/2024-12-22_17-20-35/osxcross-full-41f3856-2024-12-22_17-20-35.tar.xz" \ + | pixz -dp "$(nproc)" \ + | tar -C "${dest}" -x diff --git a/dev/docker/files/install-protobuf b/dev/docker/files/install-protobuf new file mode 100755 index 00000000..d59baf7a --- /dev/null +++ b/dev/docker/files/install-protobuf @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +set -euxo pipefail + +dest=${1:-"/usr/local/"} + +version="${2:-"28.3"}" + +tmp_dir="$(mktemp -d)" +curl -fsSL -o "${tmp_dir}/protoc.zip" "https://github.com/protocolbuffers/protobuf/releases/download/v${version}/protoc-${version}-linux-x86_64.zip" +mkdir -p "${dest}" +unzip "${tmp_dir}/protoc.zip" -d "${dest}" >/dev/null +rm -rf "${tmp_dir}" + +ls "${dest}/bin/protoc" +"${dest}/bin/protoc" --version diff --git a/dev/docker/files/install-rust b/dev/docker/files/install-rust new file mode 100755 index 00000000..c48042b8 --- /dev/null +++ b/dev/docker/files/install-rust @@ -0,0 +1,32 @@ +#!/usr/bin/env bash +set -euxo pipefail + +triplet=${1} +dest=${2:-"/opt/rust-${1}"} +mkdir -p "${dest}" + +export PATH="${dest}/bin:${PATH:+":${PATH}"}" + +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain=none + +if [ ! -f "${dest}/rust-toolchain.toml" ]; then + echo "$0: file not found: '${dest}/rust-toolchain.toml'" >&2 + exit 1 +fi + +# `rustup show` installs toolchain version specified in `rust-toolchain.toml` in the current directory +cd "${dest}" +rustup show + +if [ -n "${triplet:-}" ]; then + rustup target add "${triplet}" +fi + +rustc --version --verbose +cargo --version --verbose + + +CARGO_NEXTEST_VERSION="0.9.67" +curl -sSL "https://github.com/nextest-rs/nextest/releases/download/cargo-nextest-${CARGO_NEXTEST_VERSION}/cargo-nextest-${CARGO_NEXTEST_VERSION}-x86_64-unknown-linux-gnu.tar.gz" | tar -C "${dest}/bin" -xz "cargo-nextest" +chmod +x "${dest}/bin/cargo-nextest" +cargo nextest --version --verbose diff --git a/docker/files/start-jupyter b/dev/docker/files/start-jupyter similarity index 59% rename from docker/files/start-jupyter rename to dev/docker/files/start-jupyter index 23d30322..cabac590 100755 --- a/docker/files/start-jupyter +++ b/dev/docker/files/start-jupyter @@ -2,15 +2,17 @@ set -euo pipefail -if [ ! -d "$HOME/.jupyter/lab" ]; then - cp -r "/files/.jupyter" "$HOME/.jupyter" +: ${JUPYTER_PORT:-10000} + +if [ ! -d "${HOME}/.jupyter/lab" ]; then + cp -r "/.jupyter" "${HOME}/" fi -echo "🧪 Starting Jupyter Lab" +echo "🧪 Starting Jupyter Lab on port ${JUPYTER_PORT}" jupyter lab \ -y --no-browser \ - --ip='*' --port=8888 \ + --ip='*' --port=${JUPYTER_PORT} \ --IdentityProvider.token='' \ --ServerApp.log_level=ERROR \ --ExtensionApp.log_level=ERROR \ diff --git a/dev/docker/jupyter b/dev/docker/jupyter new file mode 100755 index 00000000..87012e63 --- /dev/null +++ b/dev/docker/jupyter @@ -0,0 +1,77 @@ +#!/usr/bin/env bash +set -euo pipefail +trap "exit" INT +# shellcheck source=./../lib/utils.sh +source "${BASH_SOURCE%/*}/../lib/utils.sh" + +load_env "$(project_root)/.env.example" +load_env_maybe "$(project_root)/.env" + +PROJECT_DOCKER_REPO="${PROJECT_DOCKER_BUILDER_REPO:?}" + +USER="user" +GROUP="user" + +cache_dir="$(get_cache_dir "jupyter")" + +dockerfile="$(project_root)/dev/docker/jupyter.dockerfile" + +docker_file_hash="$("$(project_root)/dev/docker/checksum")" +docker_repo_name_safe="${PROJECT_DOCKER_REPO//\//-}" +docker_image_tag="jupyter-${docker_file_hash}" +docker_container_name="${docker_repo_name_safe}-${docker_image_tag}-$(datetime_ms_safe)" + +images=( + "${PROJECT_DOCKER_REPO}:${docker_image_tag}" +) + +if ! docker inspect --format '{{.Id}}' "${PROJECT_DOCKER_REPO}:${docker_image_tag}" &>/dev/null || [ -n "${DOCKER_FORCE_REBUILD:-}" ]; then + build_params=() + + export BUILDKIT_PROGRESS=plain + export PROGRESS_NO_TRUNC=1 + docker buildx build \ + --file="${dockerfile}" \ + "${images[@]/#/--tag=}" \ + --network=host \ + \ + --build-arg="UID=$(id -u)" \ + --build-arg="GID=$(id -g)" \ + --build-arg="USER=${USER}" \ + --build-arg="GROUP=${GROUP}" \ + --load \ + \ + "${build_params[@]}" \ + \ + . >/dev/null +fi + +declare -A volumes=( + ["${cache_dir}/jupyter"]="/home/${USER}/.jupyter" +) + +mkdir -p "${!volumes[@]}" + +# shellcheck disable=SC2046 +docker run --rm $(tty -s && echo "-it") \ + --init \ + --network="host" \ + --name="${docker_container_name}" \ + --hostname="${docker_repo_name_safe}" \ + --add-host="${docker_repo_name_safe}:127.0.1.1" \ + --user="$(id -u):$(id -g)" \ + --workdir="/workdir" \ + --volume="$(pwd):/workdir" \ + $(for path in "${!volumes[@]}"; do echo "--volume=${path}:${volumes[$path]}"; done) \ + --env="UID=$(id -u)" \ + --env="GID=$(id -g)" \ + --env="USER=${USER}" \ + --env="GROUP=${GROUP}" \ + --env="PS1=\${USER}@\${HOST}" \ + --env="TERM=xterm-256color" \ + --env="TZ=Etc/UTC" \ + --env="LANG=C.UTF-8" \ + --env="JUPYTER_PORT=${JUPYTER_PORT:-10000}" \ + --ulimit="core=0" \ + "${PROJECT_DOCKER_REPO}:${docker_image_tag}" \ + bash -c "/start-jupyter" diff --git a/dev/docker/jupyter.dockerfile b/dev/docker/jupyter.dockerfile new file mode 100644 index 00000000..21e235be --- /dev/null +++ b/dev/docker/jupyter.dockerfile @@ -0,0 +1,120 @@ +# syntax=docker/dockerfile:1 +# check=experimental=all +FROM debian:12.8 + +SHELL ["bash", "-euxo", "pipefail", "-c"] + +RUN set -euxo pipefail >/dev/null \ +&& export DEBIAN_FRONTEND=noninteractive \ +&& apt-get update -qq --yes \ +&& apt-get install -qq --no-install-recommends --yes \ + bash \ + bash-completion \ + ca-certificates \ + curl \ + file \ + git \ + libc6-dev \ + lsb-release \ + parallel \ + pigz \ + pixz \ + pkg-config \ + python3 \ + python3-pip \ + sudo \ + tar \ + time \ + unzip \ + util-linux \ + xz-utils \ + zstd \ +>/dev/null \ +&& rm -rf /var/lib/apt/lists/* \ +&& apt-get clean autoclean >/dev/null \ +&& apt-get autoremove --yes >/dev/null + + +ARG USER=user +ARG GROUP=user +ARG UID +ARG GID + +ENV USER=$USER +ENV GROUP=$GROUP +ENV UID=$UID +ENV GID=$GID +ENV TERM="xterm-256color" +ENV HOME="/home/${USER}" +ENV CONDA_DIR="${HOME}/.conda" + +COPY --link "dev/docker/files/create-user" "/" +RUN /create-user + + +COPY --link "dev/docker/files/.conda" "/.conda" +COPY --link "dev/docker/files/.jupyter/" "/.jupyter" +COPY --link "dev/docker/files/start-jupyter" "/" +RUN set -euxo pipefail >/dev/null \ +&& cp -r /.conda "${CONDA_DIR}/" \ +&& sudo chown -R ${UID}:${GID} "${CONDA_DIR}" + + +USER ${USER} + + +ARG PYTHON_VERSION="3.12" +ENV PATH="${HOME}/bin:${CONDA_DIR}/bin:${PATH}" +ENV XDG_CACHE_HOME="${HOME}/.cache/" +ENV MPLBACKEND="Agg" +RUN set -euxo pipefail >/dev/null \ +&& export CONDA_DIR="${CONDA_DIR}" \ +&& export PYTHON_VERSION="${PYTHON_VERSION}" \ +&& mkdir -p "${CONDA_DIR}/bin" "${HOME}/.config/conda" ${CONDA_DIR}/conda-meta \ +&& echo "python=${PYTHON_VERSION}" >> "${CONDA_DIR}/conda-meta/pinned" \ +&& echo 'blas=*=*openblas' >> "${CONDA_DIR}/conda-meta/pinned" \ +&& echo 'conda-forge::blas=*=*openblas' >> "${CONDA_DIR}/conda-meta/pinned" \ +&& echo 'conda-forge::libblas=*=*openblas' >> "${CONDA_DIR}/conda-meta/pinned" \ +&& curl -fsSLo "${CONDA_DIR}/bin/micromamba" "https://github.com/mamba-org/micromamba-releases/releases/download/2.0.2-2/micromamba-linux-64" \ +&& chmod +x "${CONDA_DIR}/bin/micromamba" \ +&& micromamba install --yes \ + --root-prefix="${CONDA_DIR}" \ + --prefix="${CONDA_DIR}" \ + "python=${PYTHON_VERSION}" \ + 'mamba' + +RUN set -euxo pipefail >/dev/null \ +&& mamba install --quiet --yes \ + 'blas=*=*openblas*' \ + 'conda-forge::blas=*=*openblas*' \ + 'conda-forge::libblas=*=*openblas*' \ + 'bokeh' \ + 'cython' \ + 'dill' \ + 'ipywidgets' \ + 'jsonpickle' \ + 'jupyter-dash' \ + 'jupyterlab' \ + 'jupyterlab_widgets' \ + 'matplotlib-base' \ + 'notebook' \ + 'numpy' \ + 'pandas' \ + 'pathos' \ + 'plotly' \ + 'polars' \ + 'scikit-learn' \ + 'scipy' \ + 'seaborn' \ + 'statsmodels' \ + 'tqdm' \ + 'widgetsnbextension' \ +&& mamba clean --all -f -y \ +&& micromamba shell init --shell=bash + +RUN set -euxo pipefail >/dev/null \ +&& if [ -f "/requirements.txt" ]; then mamba install --yes --file "/requirements.txt"; fi + +# Import matplotlib the first time to build the font cache. +RUN set -euxo pipefail >/dev/null \ +&& python -c "import matplotlib.pyplot" diff --git a/dev/docker/native.dockerfile b/dev/docker/native.dockerfile new file mode 100644 index 00000000..52a7b11c --- /dev/null +++ b/dev/docker/native.dockerfile @@ -0,0 +1,111 @@ +# syntax=docker/dockerfile:1 +# check=experimental=all +FROM debian:12.8 + +SHELL ["bash", "-euxo", "pipefail", "-c"] + +ENV HOST_TUPLE_DEBIAN="x86_64-linux-gnu" +ENV HOST_TUPLE="x86_64-unknown-linux-gnu" + +RUN set -euxo pipefail >/dev/null \ +&& export DEBIAN_FRONTEND=noninteractive \ +&& apt-get update -qq --yes \ +&& apt-get install -qq --no-install-recommends --yes \ + bash \ + bash-completion \ + ca-certificates \ + curl \ + file \ + git \ + libc6-dev \ + lsb-release \ + make \ + parallel \ + pigz \ + pixz \ + pkg-config \ + python3 \ + python3-pip \ + sudo \ + tar \ + time \ + unzip \ + util-linux \ + xz-utils \ + zstd \ +>/dev/null \ +&& rm -rf /var/lib/apt/lists/* \ +&& apt-get clean autoclean >/dev/null \ +&& apt-get autoremove --yes >/dev/null + + + +ENV HOST_GCC_DIR="/usr/local" +ENV HOSTCC="${HOST_GCC_DIR}/bin/gcc" +ENV HOSTCXX="${HOST_GCC_DIR}/bin/g++" +ENV HOSTFC="${HOST_GCC_DIR}/bin/gfortran" +ENV C_INCLUDE_PATH="/usr/include::/usr/local/include:/usr/include/${HOST_TUPLE_DEBIAN}" +ENV CPLUS_INCLUDE_PATH="${C_INCLUDE_PATH}" +ENV LIBRARY_PATH="/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64:/usr/lib/${HOST_TUPLE_DEBIAN}" +ENV LD_LIBRARY_PATH="/usr/lib:/usr/lib64:/usr/local/lib:/usr/local/lib64:/usr/lib/${HOST_TUPLE_DEBIAN}" + +COPY --link "dev/docker/files/install-gcc" "/" +RUN /install-gcc "${HOST_GCC_DIR}" + +COPY --link "dev/docker/files/install-llvm" "/" +RUN /install-llvm + +COPY --link "dev/docker/files/install-protobuf" "/" +RUN /install-protobuf + +COPY --link "dev/docker/files/install-hyperfine" "/" +RUN /install-hyperfine + + +ENV HOST_PREFIX="/usr" +ENV PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:${HOST_PREFIX}/lib/pkgconfig" +ENV OPENBLAS_LIB_DIR="${HOST_PREFIX}/lib" +COPY --link "dev/docker/files/install-openblas" "/" +RUN /install-openblas "${HOST_TUPLE}" "${HOST_PREFIX}" + +COPY --link "dev/docker/files/install-libbzip2" "/" +RUN /install-libbzip2 "${HOST_TUPLE}" "${HOST_PREFIX}" + +COPY --link "dev/docker/files/install-liblzma" "/" +RUN /install-liblzma "${HOST_TUPLE}" "${HOST_PREFIX}" + +COPY --link "dev/docker/files/install-libz" "/" +RUN /install-libz "${HOST_TUPLE}" "${HOST_PREFIX}" + +COPY --link "dev/docker/files/install-libzstd" "/" +RUN /install-libzstd "${HOST_TUPLE}" "${HOST_PREFIX}" +ENV ZSTD_SYS_USE_PKG_CONFIG="1" +ENV LIBZ_SYS_STATIC="1" + + + +ARG USER=user +ARG GROUP=user +ARG UID +ARG GID + +ENV USER=$USER +ENV GROUP=$GROUP +ENV UID=$UID +ENV GID=$GID +ENV TERM="xterm-256color" +ENV HOME="/home/${USER}" + +COPY --link "dev/docker/files/create-user" "/" +RUN /create-user + + +USER ${USER} + + +ENV CARGO_HOME="${HOME}/.cargo" +ENV PATH="${CARGO_HOME}/bin:${PATH}" +COPY --link --chown="${UID}:${GID}" "rust-toolchain.toml" "${CARGO_HOME}/rust-toolchain.toml" +COPY --link "dev/docker/files/install-rust" "/" +RUN set -euxo pipefail >/dev/null \ +&& /install-rust "${HOST_TUPLE}" "${CARGO_HOME}" diff --git a/dev/docker/run b/dev/docker/run new file mode 100755 index 00000000..745570e5 --- /dev/null +++ b/dev/docker/run @@ -0,0 +1,175 @@ +#!/usr/bin/env bash +set -euo pipefail +trap "exit" INT +# shellcheck source=./../lib/utils.sh +source "${BASH_SOURCE%/*}/../lib/utils.sh" + +load_env "$(project_root)/.env.example" +load_env_maybe "$(project_root)/.env" + +CROSS_COMPILE="${CROSS_COMPILE:-"native"}" +PROJECT_DOCKER_REPO="${PROJECT_DOCKER_BUILDER_REPO:?}" + +USER="user" +GROUP="user" + +cache_dir="$(get_cache_dir "${CROSS_COMPILE}")" + +HOST_TUPLE_DEBIAN="x86_64-linux-gnu" +HOST_TUPLE="x86_64-unknown-linux-gnu" +HOST_TUPLE_UPPER="X86_64_UNKNOWN_LINUX_GNU" +HOST_GCC_TRIPLET="x86_64-unknown-linux-gnu" + +CROSS_GCC_TRIPLET="${CROSS_COMPILE}" +case "${CROSS_COMPILE}" in +x86_64-unknown-linux-gnu) + dockerfile="$(project_root)/dev/docker/cross-linux.dockerfile" + CROSS_ARCH_DEBIAN="amd64" + CROSS_ARCH="x86_64" + CROSS_COMPILE_UPPER="X86_64_UNKNOWN_LINUX_GNU" + CROSS_RUNNER="qemu-${CROSS_ARCH}" + ;; +x86_64-unknown-linux-musl) + dockerfile="$(project_root)/dev/docker/cross-linux.dockerfile" + CROSS_ARCH_DEBIAN="amd64" + CROSS_ARCH="x86_64" + CROSS_COMPILE_UPPER="X86_64_UNKNOWN_LINUX_MUSL" + CROSS_RUNNER="qemu-${CROSS_ARCH}" + ;; +aarch64-unknown-linux-gnu) + dockerfile="$(project_root)/dev/docker/cross-linux.dockerfile" + CROSS_ARCH_DEBIAN="arm64" + CROSS_ARCH="aarch64" + CROSS_COMPILE_UPPER="AARCH64_UNKNOWN_LINUX_GNU" + CROSS_RUNNER="qemu-${CROSS_ARCH}" + ;; +aarch64-unknown-linux-musl) + dockerfile="$(project_root)/dev/docker/cross-linux.dockerfile" + CROSS_ARCH_DEBIAN="arm64" + CROSS_ARCH="aarch64" + CROSS_COMPILE_UPPER="AARCH64_UNKNOWN_LINUX_MUSL" + CROSS_RUNNER="qemu-${CROSS_ARCH}" + ;; +x86_64-apple-darwin) + dockerfile="$(project_root)/dev/docker/cross-darwin.dockerfile" + CROSS_COMPILE_UPPER="X86_64_APPLE_DARWIN" + CROSS_APPLE_TRIPLET="x86_64-apple-darwin20.2" + CROSS_GCC_TRIPLET="x86_64-apple-darwin20.2" + ;; +aarch64-apple-darwin) + dockerfile="$(project_root)/dev/docker/cross-darwin.dockerfile" + CROSS_COMPILE_UPPER="AARCH64_APPLE_DARWIN" + CROSS_APPLE_TRIPLET="arm64-apple-darwin20.2" + CROSS_GCC_TRIPLET="aarch64-apple-darwin20.2" + ;; +x86_64-pc-windows-gnu) + dockerfile="$(project_root)/dev/docker/cross-linux.dockerfile" + CROSS_ARCH_DEBIAN="amd64" + CROSS_ARCH="x86_64" + CROSS_COMPILE_UPPER="X86_64_PC_WINDOWS_GNU" + CROSS_GCC_TRIPLET="x86_64-w64-mingw32" + CROSS_RUNNER="/usr/lib/wine/wine64" + ;; +native) + dockerfile="$(project_root)/dev/docker/native.dockerfile" + ;; +*) + printf "Unsupported CROSS_COMPILE value: %s", "${CROSS_COMPILE}" + exit 1 + ;; +esac + +docker_file_hash="$("$(project_root)/dev/docker/checksum")" +docker_repo_name_safe="${PROJECT_DOCKER_REPO//\//-}" +docker_image_tag="${CROSS_COMPILE}-${docker_file_hash}" +docker_container_name="${docker_repo_name_safe}-${docker_image_tag}-$(datetime_ms_safe)" +docker_builder_name="${docker_repo_name_safe}-${CROSS_COMPILE}_buildx_builder" + +images=( + "${PROJECT_DOCKER_REPO}:${CROSS_COMPILE}" + "${PROJECT_DOCKER_REPO}:${docker_image_tag}" +) + +if [ "$("$(project_root)/dev/is-ci")" == "1" ]; then + parallel -j ${#images[@]} docker pull --quiet ::: "${images[@]}" || true +fi + +if ! docker inspect --format '{{.Id}}' "${PROJECT_DOCKER_REPO}:${docker_image_tag}" &>/dev/null || [ -n "${DOCKER_FORCE_REBUILD:-}" ]; then + build_params=() + + # Use custom buildx builder with `docker-container` driver in CI to enable caching. + if [ "$("$(project_root)/dev/is-ci")" == "1" ]; then + if ! docker buildx inspect "${docker_builder_name}" &>/dev/null; then + docker buildx create --name="${docker_builder_name}" --driver="docker-container" --driver-opt="network=host" >/dev/null + fi + build_params+=("--builder=${docker_builder_name}") + build_params+=("--push") + build_params+=("--cache-to=type=registry,mode=max,ref=${PROJECT_DOCKER_REPO}:${docker_image_tag}") + build_params+=("${images[@]/#/--cache-from=}") + fi + + export BUILDKIT_PROGRESS=plain + export PROGRESS_NO_TRUNC=1 + docker buildx build \ + --file="${dockerfile}" \ + "${images[@]/#/--tag=}" \ + --network=host \ + \ + --build-arg="UID=$(id -u)" \ + --build-arg="GID=$(id -g)" \ + --build-arg="USER=${USER}" \ + --build-arg="GROUP=${GROUP}" \ + --build-arg="CROSS_ARCH_DEBIAN=${CROSS_ARCH_DEBIAN:-}" \ + --build-arg="CROSS_ARCH=${CROSS_ARCH:-}" \ + --build-arg="CROSS_COMPILE=${CROSS_COMPILE:-}" \ + --build-arg="CROSS_COMPILE_UPPER=${CROSS_COMPILE_UPPER:-}" \ + --build-arg="CROSS_APPLE_TRIPLET=${CROSS_APPLE_TRIPLET:-}" \ + --build-arg="CROSS_GCC_TRIPLET=${CROSS_GCC_TRIPLET:-}" \ + --build-arg="CROSS_RUNNER=${CROSS_RUNNER:-}" \ + --build-arg="HOST_TUPLE_DEBIAN=${HOST_TUPLE_DEBIAN}" \ + --build-arg="HOST_TUPLE=${HOST_TUPLE}" \ + --build-arg="HOST_TUPLE_UPPER=${HOST_TUPLE_UPPER}" \ + --build-arg="HOST_GCC_TRIPLET=${HOST_GCC_TRIPLET}" \ + --load \ + \ + "${build_params[@]}" \ + \ + . >/dev/null + + if [ "$("$(project_root)/dev/is-ci")" == "1" ]; then + parallel -j ${#images[@]} docker push --quiet ::: "${images[@]}" + fi +fi + +declare -A volumes=( + ["${cache_dir}/cargo/git"]="/home/${USER}/.cargo/git" + ["${cache_dir}/cargo/install"]="/home/${USER}/.cargo/install" + ["${cache_dir}/cargo/registry/cache"]="/home/${USER}/.cargo/registry/cache" + ["${cache_dir}/cargo/registry/index"]="/home/${USER}/.cargo/registry/index" + ["${cache_dir}/cargo/registry/src"]="/home/${USER}/.cargo/registry/src" + ["${cache_dir}/jupyter"]="/home/${USER}/.jupyter" +) + +mkdir -p "${!volumes[@]}" + +# shellcheck disable=SC2046 +docker run --rm $(tty -s && echo "-it") \ + --init \ + --name="${docker_container_name}" \ + --hostname="${docker_repo_name_safe}" \ + --add-host="${docker_repo_name_safe}:127.0.1.1" \ + --user="$(id -u):$(id -g)" \ + --workdir="/workdir" \ + --volume="$(pwd):/workdir" \ + $(for path in "${!volumes[@]}"; do echo "--volume=${path}:${volumes[$path]}"; done) \ + --env="UID=$(id -u)" \ + --env="GID=$(id -g)" \ + --env="USER=${USER}" \ + --env="GROUP=${GROUP}" \ + --env="PS1=\${USER}@\${HOST}" \ + --env="TERM=xterm-256color" \ + --env="TZ=Etc/UTC" \ + --env="LANG=C.UTF-8" \ + --ulimit="core=0" \ + "${PROJECT_DOCKER_REPO}:${docker_image_tag}" \ + bash -c "${*:-bash}" diff --git a/dev/is-arch b/dev/is-arch new file mode 100755 index 00000000..666656dd --- /dev/null +++ b/dev/is-arch @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +set -euo pipefail +trap "exit" INT + +if [ -z "${1:-}" ] || [ -z "${2:-}" ]; then + echo "Usage: $0 " >&2 + exit 1 +fi + +READELF=$(printenv "READELF_${CROSS_COMPILE}" || printenv "READELF" || echo "readelf") + +expected_arch=$(echo "${2}" | cut -d '-' -f1) +machine=$($READELF -h "${1}" | grep 'Machine:' | cut -d ':' -f2 | xargs) + +case "$expected_arch" in + "x86_64") + expected_machine="Advanced Micro Devices X86-64" + ;; + "aarch64") + expected_machine="AArch64" + ;; + *) + echo "Unsupported expected_arch." + exit 1 + ;; +esac + +if [[ "$machine" != "$expected_machine" ]]; then + echo "Binary platform does not match the requested architecture: expected ${expected_arch}, found ${machine} ${1}" + exit 1 +fi diff --git a/dev/is-ci b/dev/is-ci new file mode 100755 index 00000000..1149a16c --- /dev/null +++ b/dev/is-ci @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +set -euo pipefail +trap "exit" INT + +ci_vars=( + APPCENTER_BUILD_ID + BAMBOO_BUILDNUMBER + BITBUCKET_BUILD_NUMBER + BUDDY + BUILDKITE + BUILD_ID + CI + CIRCLECI + CIRRUS_CI + CODEBUILD_BUILD_ID + CONTINUOUS_INTEGRATION + DRONE + GITHUB_ACTIONS + GITLAB_CI + HEROKU_TEST_RUN_ID + HUDSON_URL + NETLIFY + NEVERCODE + SEMAPHORE + SHIPPABLE + TEAMCITY_VERSION + TF_BUILD + TRAVIS + VERCEL + WERCKER +) + +for var in "${ci_vars[@]}"; do + if [ -n "${!var:-}" ]; then + echo 1 + exit 0 + fi +done + +echo 0 diff --git a/dev/is-static-binary b/dev/is-static-binary new file mode 100755 index 00000000..fd054b9f --- /dev/null +++ b/dev/is-static-binary @@ -0,0 +1,102 @@ +#!/usr/bin/env bash +set -euo pipefail +trap "exit" INT +# shellcheck source=./lib/utils.sh +source "${BASH_SOURCE%/*}/lib/utils.sh" + +bin="${1:?}" +target="${2:-"${CROSS_COMPILE:-}"}" + +has_error=0 + +function run_for_linux() { + : "${CROSS_SYSROOT:?}" + + local LDD=$(printenv "LDD_${target}" || printenv "LDD" || echo "ldd") + local OBJDUMP=$(printenv "OBJDUMP_${target}" || printenv "OBJDUMP" || echo "objdump") + local STRINGS=$(printenv "STRINGS_${target}" || printenv "STRINGS" || echo "strings") + + local output=$("${LDD}" ${CROSS_SYSROOT:+--root="${CROSS_SYSROOT}"} "$1" 2>&1 || true) + if ! echo "$output" | grep -qE 'statically linked|not a dynamic executable'; then + echo "Not a static executable: '$1'" >&2 + has_error=1 + fi + + local dump=$("${OBJDUMP}" -p "$1" 2>&1 || true) + local glibc_version=$(echo "${dump}" | grep 'GLIBC_' | awk '{print $NF}' | sed 's/GLIBC_//' | sort -V | tail -n 1) + if [ -n "$glibc_version" ]; then + echo "Depends on glibc $glibc_version" >&2 + has_error=1 + fi + + local libgcc_version=$(echo "${dump}" | grep 'GCC_' | awk '{print $NF}' | sed 's/GCC_//' | sort -V | tail -n 1) + if [ -n "${libgcc_version}" ]; then + echo "Depends on libgcc ${libgcc_version}" >&2 + has_error=1 + fi + + local needs=$("${OBJDUMP}" -p "${1}" | grep NEEDED | awk '{print $2}' | tr -s ' ' | sort) + if [ -n "$needs" ]; then + echo "Needs:" + echo "$needs" | while read -r lib_name; do + if [[ ! "$lib_name" =~ ^(libc.so|libgcc) ]]; then + echo " * $lib_name" + fi + done + fi + + local output=$("${LDD}" ${CROSS_SYSROOT:+--root="${CROSS_SYSROOT}"} "$1" 2>&1 | awk '/=>/ {print $(NF-1)}' | while read -r lib_path; do + version="$("${STRINGS}" "${CROSS_SYSROOT}$lib_path" | grep -Eo '([0-9]+\.[0-9]+\.[0-9]+)' | sort -u | head -n 1)" + if [ -n "$version" ]; then + lib_name="$(basename "$lib_path")" + if [[ ! "$lib_name" =~ ^(libc.so|libgcc) ]]; then + echo "$lib_name $version" + fi + fi + done | sort) + + if [ -n "$output" ]; then + echo "Depends on:" + echo "$output" | while read -r line; do + echo " * $line" + done + fi +} + +function run_for_windows() { + local OBJDUMP=$(printenv "OBJDUMP_${target}" || printenv "OBJDUMP" || echo "objdump") + local dump=$($OBJDUMP -p "${1}" | grep "DLL Name" | sed 's/^[ \t]*DLL Name: //;s/^/ * /' | sort) + if [ -n "$dump" ]; then + echo "The executable '$1' depends on:" + echo "$dump" + fi +} + +function run_for_mac() { + local OTOOL=$(printenv "OTOOL_${target}" || printenv "OTOOL" || echo "objdump") + dump=$($OTOOL -L "${bin}" | awk 'NR>1 {print " * " $1}' | sort) + if [ -n "$dump" ]; then + echo "The executable '$1' depends on:" + echo "$dump" + fi +} + +function main() { + if [[ "${target}" =~ (mingw|windows) ]]; then + run_for_windows "${bin}" + elif [[ "${target}" =~ (apple|darwin) ]]; then + run_for_mac "${bin}" + elif [[ "${target}" =~ (linux) ]]; then + run_for_linux "${bin}" + else + warn "Unknown target platform: ${target}" + fi + + if [ "$has_error" != "0" ]; then + echo "$0: Error: static binary checks failed (see above): '$1'" >&2 + fi +} + +if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then + main "$@" +fi diff --git a/dev/lib/utils.sh b/dev/lib/utils.sh new file mode 100644 index 00000000..bde53944 --- /dev/null +++ b/dev/lib/utils.sh @@ -0,0 +1,180 @@ +#!/usr/bin/env bash +set -euo pipefail + +export JOBS="${JOBS:=$(($(nproc --all) + 2))}" + +function print_color() { + local color_code="${1}" + local message="${2}" + if [[ -z "${FORCE_COLOR:-}" && (-n "${NO_COLOR:-}" || "${TERM:-}" == "dumb" || $(tput colors 2>/dev/null) -lt 8) ]]; then + echo "${message}" + else + echo -e "\e[38;5;${color_code}m${message}\e[0m" + fi +} +export -f print_color + +function err() { + print_color 1 "[ERR] $0: $1" +} +export -f err + +function warn() { + print_color 3 "[WARN] $0: $1" +} +export -f warn + +function info() { + print_color 6 "[INFO] $0: $1" +} +export -f info + +function debug() { + print_color 8 "[DEBUG] $0: $1" +} +export -f debug + +function datetime_safe() { + TZ=UTC date -u '+%Y-%m-%d_%H-%M-%S' +} +export -f datetime_safe + +function datetime_ms_safe() { + TZ=UTC date -u '+%Y-%m-%d_%H-%M-%S_%3NZ' +} +export -f datetime_ms_safe + +# Run a command with lower (nicer) CPU and IO priority, time it and print the outcome +function nicely() { + print_color 8 "+${*:-}" + if bash -c " + trap 'print_color 4 \"🟦 Cancelled\" && exit 0' INT;\ + nice -14 ionice -c2 -n3 \ + /usr/bin/time -qf 'Cmd : %C\nTime: %E\nMem : %M KB' \ + ${*}"; then + ( + { set +x; } 2>/dev/null + print_color 2 '🟩 Success' + exit 0 + ) + else + local cmd_exit_code=$? + ( + { set +x; } 2>/dev/null + print_color 1 "🟥 Failure (code: ${cmd_exit_code})" + exit "${cmd_exit_code}" + ) + fi +} +export -f nicely + +function fake_tty() { + script -qefc bash -c "$*" /dev/null +} + +function file_hash() { + local paths=("$@") + local uid=$(id -u) + local gid=$(id -g) + local user=$(id -un) + local group=$(id -gn) + echo -n "$uid $gid $user $group" | cat - "${paths[@]}" | md5sum | cut -f 1 -d " " | cut -c1-7 +} +export -f file_hash + +function abspath() { + readlink -m "${1:?}" +} +export -f abspath + +function here() { + cd -P -- "$(dirname -- "${BASH_SOURCE[0]}")" + pwd -P +} +export -f here + +function project_root() { + abspath "$(here)/../.." +} +export -f project_root + +function get_build_dir() { + local target="${1:-}" + abspath "$(project_root)/.build/docker${target:+"-${target}"}" +} +export -f get_build_dir + +function get_cache_dir() { + local target="${1:-}" + abspath "$(project_root)/.cache/docker${target:+"-${target}"}" +} +export -f get_cache_dir + +function get_test_dir() { + local target="${1:-}" + abspath "$(get_build_dir "${target}")/test" +} +export -f get_test_dir + +function get_out_dir() { + abspath "$(project_root)/.out" +} +export -f get_out_dir + +function get_bin_dir() { + local target="${1:-}" + abspath "$(get_build_dir "${target}")/${target}/release" +} +export -f get_bin_dir + +function guess_ext() { + local target="${1:-}" + [[ "$target" =~ (mingw|windows) ]] && echo ".exe" +} +export -f guess_ext + +function get_full_bin_path() { + local bin="${1:?}" + local target="${2:-}" + ext="$(guess_ext "${target}")" + echo "$(get_bin_dir "${target}")/${bin}${ext}" +} +export -f get_full_bin_path + +function get_final_bin_path() { + local bin="${1:?}" + local target="${2:-}" + ext="$(guess_ext "${target}")" + echo "$(get_out_dir)/${bin}${target:+-${target}}${ext}" +} +export -f get_final_bin_path + +function load_env_maybe() { + local env_file="${1:-}" + # shellcheck disable=SC2046 + [ -n "${env_file}" ] && export $(grep -v '^#' .env | xargs) +} +export -f load_env_maybe + +function load_env() { + local env_file="${1:?}" + if ! [ -r "${env_file}" ]; then + err "unable to load env file: '${env_file}'" >&2 + exit 1 + fi + load_env_maybe "${env_file}" +} +export -f load_env + +function getenv_cross() { + local varname="${1:?}" + local target="${2:-${CROSS_COMPILE:?}}" + printenv "${varname^^}_${target}" +} +export -f getenv_cross + +SUCCESS="({ set +x; } 2> /dev/null && echo '🟩 Success' && exit 0)" +FAILURE="({ set +x; } 2> /dev/null && echo '🟥 Failure' && exit 1)" +CANCELLED="({ set +x; } 2> /dev/null && echo '🟦 Cancelled' && exit 0)" +export SUCCESS_OR_FAILURE="&& ${SUCCESS} || ${FAILURE}" +export HANDLE_SIGINT="trap \"${CANCELLED}; exit 0\" INT" diff --git a/docker/prettytest b/dev/prettytest similarity index 82% rename from docker/prettytest rename to dev/prettytest index a566e099..a837e699 100755 --- a/docker/prettytest +++ b/dev/prettytest @@ -3,21 +3,28 @@ import re import sys -patterns = [ +patterns_multiline = [ r'\n.*?PASS.*?\n\n.*STDOUT.*?---.*?\n\nrunning \d+ tests?(?s:.*?)test .*? ... ok\n\ntest result: (ok|FAILED). \d+ passed; \d+ failed; \d+ ignored; \d+ measured; \d+ filtered out; finished in .*?\n\n(?!--- STDERR)', r'test .* \.\.\. FAILED\n\nfailures:\n\nfailures:\n.*\n\ntest result: FAILED. \d+ passed; \d+ failed; \d+ ignored; \d+ measured; \d+ filtered out; finished in .*\n', r'\n-------------- TEST START --------------\n', - r'\n.*STDOUT.*?\n\nrunning \d+ test' + r'\n.*STDOUT.*?\n\nrunning \d+ test', +] + +patterns = [ + r'.*------------.*\n', ] s = sys.stdin.read() -for pattern in patterns: +for pattern in patterns_multiline: s = re.sub(pattern, '', s, flags=re.MULTILINE) +for pattern in patterns: + s = re.sub(pattern, '', s) + text = '--- PARAMS:\n' s = re.sub(r'\n------------ TEST ARGUMENTS ------------\n', f"\x1b[1;38;5;100m{text}\x1b[0m", s) diff --git a/dev/profile b/dev/profile new file mode 100755 index 00000000..91ef1555 --- /dev/null +++ b/dev/profile @@ -0,0 +1,62 @@ +#!/usr/bin/env bash +set -euo pipefail +trap "exit" INT + +# Perform sampling performance profiling and display the results in a web UI. +# +# This will do the following: +# * build the project using special "profiling" cargo profile (see .cargo/config.toml). This profile configures cargo +# for optimized (release) build, but with debug symbols emitted and kept (not stripped). +# * run the given program under sampling profiler called samply (https://github.com/mstange/samply), +# * upon finishing the recording, samply will open Firefox Profiler (https://profiler.firefox.com) in default browser +# with the results. If not, navigate to url printed to the console, then click "Open the profile in the profiler UI". +# +# NOTE: Sampling is performed at frequency about 1000 times per second, so for meaningful results you probably want +# to run your program with a workload which runs for at least a few seconds. +# +# NOTE: At first, you might want to run your program in single-threaded mode. +# +# +# Usage: +# +# ./dev/profile [arguments] +# +# Note: is executable name without path +# +# +# Requirements: +# * perf (https://perf.wiki.kernel.org) +# +# On Ubuntu: +# +# /!\ WARNING: If linux-tools- package is not already installed make sure that you are +# installing it specifically for your current version of kernel, and make sure to not install some broken kernel +# which bricks your system on next reboot! +# +# sudo apt-get install linux-tools-common linux-tools-$(uname -r) +# +# * samply (https://github.com/mstange/samply) +# +# cargo install samply +# +# * [optional] Access to performance events system for unprivileged users. The samply tool might work without these, +# but the results might be incomplete. +# +# /!\ WARNING: Learn about security implications of these settings: +# https://www.kernel.org/doc/html/latest/admin-guide/perf-security.html +# +# until next reboot: +# echo -1 | sudo tee /proc/sys/kernel/perf_event_paranoid >/dev/null +# echo 0 | sudo tee /proc/sys/kernel/kptr_restrict >/dev/null +# +# you can reset this back by rebooting, or with these commands: +# +# echo 2 | sudo tee /proc/sys/kernel/perf_event_paranoid >/dev/null +# echo 1 | sudo tee /proc/sys/kernel/kptr_restrict >/dev/null + +set -x + +cargo -q build --profile=profiling --bin="$(basename "$1")" + +# shellcheck disable=SC2068 +samply record --rate=1234 -o tmp/samply.json -- ./target/profiling/"$(basename "$1")" ${@:2} diff --git a/tests/run-smoke-tests b/dev/run-smoke-tests similarity index 100% rename from tests/run-smoke-tests rename to dev/run-smoke-tests diff --git a/tests/test-linux-distros b/dev/test-linux-distros-gnu similarity index 68% rename from tests/test-linux-distros rename to dev/test-linux-distros-gnu index fbaa251b..3558f5dc 100755 --- a/tests/test-linux-distros +++ b/dev/test-linux-distros-gnu @@ -1,25 +1,22 @@ #!/usr/bin/env bash set -euo pipefail -trap "exit 0" INT +trap "exit" INT +# shellcheck source=./lib/utils.sh +source "${BASH_SOURCE%/*}/lib/utils.sh" -# -# Run on different Linux distros, to ensure compatibility. +# Run a command on different Linux distros, to ensure compatibility. # We are mostly concerned about old distros with old glibc, libgcc and kernel. # +# Current directory will be mounted into the container as `/workdir` and this will be the working dir where +# the container starts. This way the executables and data are accessible starting from `./` +# # Dependencies: # sudo apt-get install -y bash parallel -echo "Docker version:" +info "Docker version:" docker version -function abspath() { - readlink -m "$1" -} - -export EXE="${1:? "Usage: ${0} "}" -VOLUME="$(abspath "${EXE}"):/exe" -export VOLUME -export RUN_COMMAND="/exe --help >/dev/null" +export args=${*:?} distros=( "debian/eol:jessie" # 8 @@ -54,6 +51,7 @@ distros=( "centos:8.1.1911" "centos:8.4.2105" "centos:latest" + "fedora:23" "fedora:27" "fedora:30" "fedora:33" @@ -67,17 +65,20 @@ distros=( "oraclelinux:8.9" "registry.access.redhat.com/ubi8/ubi" "registry.access.redhat.com/ubi9/ubi" + "registry.access.redhat.com/rhel7:7.0-21" "opensuse/archive:13.2" "opensuse/leap:15.2" "opensuse/tumbleweed:latest" "archlinux:latest" + "archlinux:20191006" ) function run_one_distro() { - distro=$1 + local distro="${1}" + info "Running '${args}' on '${distro}'" docker pull -q "$distro" >/dev/null - if ! docker run -i --rm -v "${VOLUME}" "$distro" bash -c "${RUN_COMMAND}"; then - echo "Failed running '${RUN_COMMAND}' on '$distro'" + if ! docker run -i --rm -v "$(pwd):/workdir" -w /workdir "$distro" ${args} >/dev/null; then + err "Failed running '${RUN_COMMAND}' on '$distro'" exit 1 fi } diff --git a/dev/test-linux-distros-musl b/dev/test-linux-distros-musl new file mode 100755 index 00000000..29a48a82 --- /dev/null +++ b/dev/test-linux-distros-musl @@ -0,0 +1,63 @@ +#!/usr/bin/env bash +set -euo pipefail +trap "exit" INT +# shellcheck source=./lib/utils.sh +source "${BASH_SOURCE%/*}/lib/utils.sh" + +# Run a command on different Linux distros, to ensure compatibility. +# Here we check distros which have either very old glibc or none at all. +# +# Current directory will be mounted into the container as `/workdir` and this will be the working dir where +# the container starts. This way the executables and data are accessible starting from `./` +# +# Dependencies: +# sudo apt-get install -y bash parallel + +info "Docker version:" +docker version + +export args="${*:?}" + +distros=( + "docker/pipeline_scratch@sha256:b2374472e2d18c89ceac4fdc9b93ef598824fedbf7002c2ed28a8d1cdab7059e" # empty image + + "alpine:edge" + "alpine:latest" + "alpine:3" + "alpine:3.1" + + "busybox:1-glibc" + "busybox:1-musl" + "busybox:1-uclibc" + "busybox:stable-glibc" + "busybox:stable-musl" + "busybox:stable-uclibc" + + "centos:6.6" + "centos:5" + + "debian/eol:wheezy" # 7 + "debian/eol:squeeze" # 6 + "debian/eol:lenny" # 5 + "debian/eol:etch" # 4 + + "oraclelinux:5.11" + "oraclelinux:6.6" + + "registry.access.redhat.com/rhel6:6.5-11" + + "ubuntu:12.04" +) + +function run_one_distro() { + local distro="${1}" + info "Running '${args}' on '${distro}'" + docker pull -q "$distro" >/dev/null + if ! docker run -i --rm -v "$(pwd):/workdir" -w /workdir "$distro" ${args} >/dev/null; then + err "Failed running '${RUN_COMMAND}' on '$distro'" + exit 1 + fi +} +export -f run_one_distro + +parallel --jobs="${#distros[@]}" run_one_distro ::: "${distros[@]}" diff --git a/docker/cross b/docker/cross deleted file mode 100755 index e25a112a..00000000 --- a/docker/cross +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash - -# Runs bulk cross-compilation of CLI binaries for all supported platforms - -set -euo pipefail - -function abspath() { - readlink -m "$1" -} - -targets=( - "aarch64-apple-darwin" - "aarch64-unknown-linux-gnu" - "aarch64-unknown-linux-musl" - "x86_64-apple-darwin" - "x86_64-pc-windows-gnu" - "x86_64-unknown-linux-gnu" - "x86_64-unknown-linux-musl" -) - -function run_one() { - target=${1:?} - printf "\nBuilding for %s\n" "${target}" - CROSS=${target} ./docker/dev br -} -export -f run_one - -parallel --jobs="${#targets[@]}" run_one ::: "${targets[@]}" diff --git a/docker/cross-split b/docker/cross-split deleted file mode 100755 index 2c88a1c8..00000000 --- a/docker/cross-split +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash - -# Runs bulk cross-compilation of CLI binaries for all supported platforms -# each in a separate tmux window -# -# Kill tmux server with `Ctrl`+`b` followed by `k` (change `b` to your "prefix" shortcut if it's not default) - -set -euo pipefail - -targets=( - "aarch64-apple-darwin" - "aarch64-unknown-linux-gnu" - "aarch64-unknown-linux-musl" - "x86_64-apple-darwin" - "x86_64-pc-windows-gnu" - "x86_64-unknown-linux-gnu" - "x86_64-unknown-linux-musl" -) - -tmux new-session -d -s build -tmux send-keys -t build 'exit' C-m # Close the initial shell to start with a clean layout - -# begin: eye candy options -tmux set -g mouse on -tmux set -g default-terminal "screen-256color" -tmux unbind k -tmux bind k kill-session -tmux set -g pane-border-status top -tmux set -g pane-border-format "#{pane_title}" -tmux set -g pane-border-style "bg=colour235,fg=colour8" -tmux set -g pane-active-border-style "bg=colour242,fg=colour237" -# end: eye candy options - -for target in "${targets[@]}"; do - tmux split-window -v -t build "CROSS=${target} ./docker/dev br; echo 'Build finished for ${target}'; exec $SHELL" - tmux select-layout -t build even-vertical - tmux select-pane -t "" -T "${target}" -done -tmux kill-pane -t 0 # Remove the initial empty pane -tmux attach -t build diff --git a/docker/dev b/docker/dev deleted file mode 100755 index 36150d58..00000000 --- a/docker/dev +++ /dev/null @@ -1,630 +0,0 @@ -#!/usr/bin/env bash - -# Runs various day-to-day dev commands inside dev docker container. -# -# The container includes all the tools required for maintaining the project. But this container and script exist -# for convenience only and are not required for operations. The usual `cargo` and `bun` workflows can still be used -# (see dev guide). -# -# See the full list of possible commands in the long `case` block halfway through the script. -# Here are some of the most useful ones (run them from project root): -# -# * Build pangraph binary in debug mode: -# ./docker/dev b pangraph -# -# * Build pangraph binary in release mode: -# ./docker/dev br pangraph -# -# * Build and run pangraph binary in debug mode, with arguments: -# ./docker/dev r pangraph -- timetree --help -# -# * Build and run pangraph binary in release mode, with arguments: -# ./docker/dev rr pangraph -- timetree --help -# -# * Cross-compile pangraph binary for Windows in release mode: -# CROSS=x86_64-pc-windows-gnu ./docker/dev br -# -# * Build WebAssembly module in debug mode: -# ./docker/dev W -# -# * Build WebAssembly module in release mode: -# ./docker/dev Wr -# -# * Build and run web application in debug mode: -# ./docker/dev a -# -# * Build and run web application in release mode: -# ./docker/dev war -# -# * Lint Rust code: -# ./docker/dev l -# -# * Lint Rust code, apply automatic fixes: -# ./docker/dev lf -# -# * Format Rust code: -# ./docker/dev f -# -# * Shell into the container: -# ./docker/dev bash -# -# * Run arbitrary command inside the container: -# ./docker/dev cargo --version -# -# * Run arbitrary bun command, in the context of web app, inside the container: -# ./docker/dev a bun add --dev react -# - -set -euo pipefail - -function abspath() { - readlink -m "$1" -} - -# Checks whether we are running on a Continuous integration server -function is_ci() { - if false || - [ "${BUILD_ID:=}" == "1" ] || [ "${BUILD_ID:=}" == "true" ] || - [ "${CI:=}" == "1" ] || [ "${CI:=}" == "true" ] || - [ "${CIRCLECI:=}" == "1" ] || [ "${CIRCLECI:=}" == "true" ] || - [ "${CIRRUS_CI:=}" == "1" ] || [ "${CIRRUS_CI:=}" == "true" ] || - [ "${CODEBUILD_BUILD_ID:=}" == "1" ] || [ "${CODEBUILD_BUILD_ID:=}" == "true" ] || - [ "${GITHUB_ACTIONS:=}" == "1" ] || [ "${GITHUB_ACTIONS:=}" == "true" ] || - [ "${GITLAB_CI:=}" == "1" ] || [ "${GITLAB_CI:=}" == "true" ] || - [ "${HEROKU_TEST_RUN_ID:=}" == "1" ] || [ "${HEROKU_TEST_RUN_ID:=}" == "true" ] || - [ "${TEAMCITY_VERSION:=}" == "1" ] || [ "${TEAMCITY_VERSION:=}" == "true" ] || - [ "${TF_BUILD:=}" == "1" ] || [ "${TF_BUILD:=}" == "true" ] || - [ "${TRAVIS:=}" == "1" ] || [ "${TRAVIS:=}" == "true" ] \ - ; then - echo "1" - else - echo "0" - fi -} - -export THIS_DIR=$( - cd "$(dirname "${BASH_SOURCE[0]}")" - pwd -) - -SUCCESS="({ set +x; } 2> /dev/null && echo '🟩 Success' && exit 0)" -FAILURE="({ set +x; } 2> /dev/null && echo '🟥 Failure' && exit 1)" -CANCELLED="({ set +x; } 2> /dev/null && echo '🟦 Cancelled' && exit 0)" -SUCCESS_OR_FAILURE="&& ${SUCCESS} || ${FAILURE}" -HANDLE_SIGINT="trap \"${CANCELLED}; exit 0\" INT" - -export PACKAGE_NAME="pangraph" -export PACKAGE_DIR_REL="" - -export PROJECT_ROOT_DIR="$(abspath "${THIS_DIR}/..")" -export PACKAGE_DIR="$(abspath "${PROJECT_ROOT_DIR}/${PACKAGE_DIR_REL}")" - -export DOCKER_REPO="neherlab/pangraph_builder" -export DOCKER_IMAGE_NAME_SAFE="${DOCKER_REPO//\//-}" -export DOCKER_CONTAINER_NAME="${DOCKER_IMAGE_NAME_SAFE}-$(date -u "+%Y-%m-%d_%H-%M-%S_%3NZ")" - -if [ -n "${CROSS:-}" ]; then - export DOCKER_CONTAINER_NAME="${DOCKER_IMAGE_NAME_SAFE}-${CROSS}-$(date -u "+%Y-%m-%d_%H-%M-%S_%3NZ")" -fi - -export USER=user -export GROUP=user - -export BUILD_DIR_REL=".build/docker${CROSS:+-$CROSS}/${PACKAGE_DIR_REL}" -export BUILD_DIR="$(abspath "${PACKAGE_DIR}/${BUILD_DIR_REL}")" -export BUILD_DIR_TEST="${BUILD_DIR}/test" - -export CACHE_DIR_REL=".cache/docker${CROSS:+-$CROSS}/${PACKAGE_DIR_REL}" -export CACHE_DIR="$(abspath "${PACKAGE_DIR}/${CACHE_DIR_REL}")" - -export NICE="nice -14 ionice -c2 -n3" -export TIME="/usr/bin/time -f \"Cmd : %C\nTime: %E\nMem : %M KB\n\"" - -export RUST_BACKTRACE="full" -export COLORBT_SHOW_HIDDEN="0" -export RUST_LOG="warn" - -if [ -f "${PROJECT_ROOT_DIR}/.env.example" ]; then - . "${PROJECT_ROOT_DIR}/.env.example" -fi - -if [ -f "${PROJECT_ROOT_DIR}/.env" ]; then - . "${PROJECT_ROOT_DIR}/.env" -fi - -export EXTENSIONS_TO_WATCH="rs,toml,lock" - -export FILES_TO_WATCH="\ --w 'Cargo.lock' \ --w 'Cargo.toml' \ --w 'clippy.toml' \ --w 'packages/pangraph/src' \ --w 'packages/pangraph/Cargo.toml' \ --w 'rust-toolchain.toml' \ --w 'rustfmt.toml' \ -" - -export FILES_TO_IGNORE="\ --i '.build' \ --i '.cache' \ --i '.vscode' \ --i 'target/' \ -" - -export LINT_FIX="--fix --allow-staged" - -FORCE_DOCKER_IMAGE_BUILD=${FORCE_DOCKER_IMAGE_BUILD:-} -DOCKER_IMAGE_PUSH=0 -BUILD=0 -RUN=0 -WASM=0 -WEB=0 -DOCS=0 -RELEASE= -WATCH=0 -TEST=0 -TEST_FLAGS= -SMOKE_TEST=0 -BENCH=0 -EXAMPLE=0 -LINT=0 -FORMAT=0 -FIX= -LINT_DENY= -JUPYTER=0 - -case "${1:-}" in -"docker-image-build") - shift - FORCE_DOCKER_IMAGE_BUILD=1 - ;; -"docker-image-build-push" | "dp") - shift - FORCE_DOCKER_IMAGE_BUILD=1 - DOCKER_IMAGE_PUSH=1 - ;; -"build" | "b") - shift - BUILD=1 - ;; -"build-release" | "br") - shift - BUILD=1 - RELEASE="--release" - ;; -"run" | "r") - shift - RUN=1 - ;; -"run-release" | "rr") - shift - RUN=1 - RELEASE="--release" - ;; -"watch-run" | "wr") - shift - RUN=1 - WATCH=1 - ;; -"watch-run-release" | "wrr") - shift - RUN=1 - RELEASE="--release" - WATCH=1 - ;; -"wasm" | "W") - shift - WASM=1 - RELEASE="dev" - ;; -"wasm-release" | "Wr") - shift - WASM=1 - RELEASE="prod" - ;; -"watch-wasm" | "wW") - shift - WASM=1 - RELEASE="dev" - WATCH=1 - ;; -"watch-wasm-release" | "wWr") - shift - WASM=1 - RELEASE="prod" - WATCH=1 - ;; -"web" | "a") - shift - DOCKER_TARGET="web" - WEB=1 - RELEASE="dev" - WATCH=0 - ;; -"web-release" | "ar") - shift - DOCKER_TARGET="web" - WEB=1 - RELEASE="prod:build" - WATCH=0 - ;; -"web-release-serve" | "ars") - shift - DOCKER_TARGET="web" - WEB=1 - RELEASE="prod" - WATCH=0 - ;; -"watch-web-release" | "war") - shift - DOCKER_TARGET="web" - WEB=1 - RELEASE="prod:watch" - WATCH=0 - ;; -"docs" | "d") - shift - DOCKER_TARGET="web" - DOCS=1 - RELEASE="dev" - WATCH=0 - ;; -"docs-release" | "dr") - shift - DOCKER_TARGET="web" - DOCS=1 - RELEASE="prod:build" - WATCH=0 - ;; -"docs-release-serve" | "drs") - shift - DOCKER_TARGET="web" - DOCS=1 - RELEASE="prod" - WATCH=0 - ;; -"watch-docs-release" | "wdr") - shift - DOCKER_TARGET="web" - DOCS=1 - RELEASE="prod:watch" - WATCH=0 - ;; -"test" | "t") - shift - TEST=1 - WATCH=0 - ;; -"watch-test" | "wt") - shift - TEST=1 - WATCH=1 - ;; -"test-smoke" | "ts") - shift - SMOKE_TEST=1 - WATCH=0 - ;; -"test-smoke-release" | "tsr") - shift - SMOKE_TEST=1 - RELEASE="--release" - WATCH=0 - ;; -"test-unit" | "tu") - shift - TEST=1 - TEST_FLAGS="--lib" - WATCH=0 - ;; -"watch-test-unit" | "wtu") - shift - TEST=1 - TEST_FLAGS="--lib" - WATCH=1 - ;; -"test-integration" | "ti") - shift - TEST=1 - TEST_FLAGS="--test='*'" - WATCH=0 - ;; -"watch-test-integration" | "wti") - shift - TEST=1 - TEST_FLAGS="--test='*'" - WATCH=1 - ;; -"bench" | "B") - shift - BENCH=1 - WATCH=0 - ;; -"watch-bench" | "wB") - shift - BENCH=1 - WATCH=1 - ;; -"example" | "E") - shift - EXAMPLE=1 - ;; -"example-release" | "Er") - shift - EXAMPLE=1 - RELEASE="--release" - ;; -"lint" | "l") - shift - LINT=1 - WATCH=0 - FIX= - ;; -"watch-lint" | "wl") - shift - LINT=1 - WATCH=1 - FIX= - ;; -"lint-fix" | "lf") - shift - LINT=1 - WATCH=0 - FIX="${LINT_FIX}" - ;; -"watch-lint-fix" | "wlf") - shift - LINT=1 - WATCH=1 - FIX="${LINT_FIX}" - ;; -"lint-ci" | "lc") - shift - LINT=1 - WATCH=0 - FIX= - LINT_DENY='-- -Dwarnings' # Fail if there's warnings - ;; -"format" | "f") - shift - FORMAT=1 - WATCH=0 - FIX= - ;; -"format-check" | "fc") - shift - FORMAT=1 - WATCH=0 - FIX="--check" - ;; -"p" | "py") - shift - DOCKER_TARGET="py" - ;; -"jupyter" | "j") - shift - JUPYTER=1 - DOCKER_TARGET="py" - ;; -"exec" | "e") - shift - RUN=0 - ;; -esac - -if [ "${WASM}" == "1" ]; then - CROSS="wasm32-unknown-unknown" -fi - -DOCKER_BASE_IMAGE="${DOCKER_BASE_IMAGE:=ubuntu:20.04}" -CLANG_VERSION="${CLANG_VERSION:=13}" -DOCKER_TARGET="${DOCKER_TARGET:-dev}" -RUST_TARGET="" -if [ -n "${CROSS:-}" ]; then - if [[ "${CROSS}" == *linux-gnu ]]; then - - if [[ "${CROSS}" == x86_64-* ]]; then - # 'manylinux2014_x86_64' image is based on 'centos:7.9.2009' and offers build environment with - # the best compatibility across target Linux distros - DOCKER_BASE_IMAGE="quay.io/pypa/manylinux2014_x86_64" - CLANG_VERSION="3.4" - else - DOCKER_BASE_IMAGE="debian:9.13" - CLANG_VERSION="13" - fi - fi - - DOCKER_TARGET="cross-${CROSS}" - RUST_TARGET="--target=${CROSS}" -fi - -DOCKER_IMAGE_VERSION="$(./scripts/docker_build_checksum.sh)" - -if ! docker inspect --format '{{.Id}}' "${DOCKER_REPO}:${DOCKER_TARGET}-${DOCKER_IMAGE_VERSION}" &>/dev/null || - [ -n "${FORCE_DOCKER_IMAGE_BUILD}" ]; then - - export BUILDKIT_PROGRESS=plain - export PROGRESS_NO_TRUNC=1 - - BUILDX_BUILDER=${DOCKER_IMAGE_NAME_SAFE}-${DOCKER_TARGET}_builder - if ! docker buildx inspect "${BUILDX_BUILDER}" &>/dev/null; then - # Using a persistent builder allows for faster local development. - # However, if this is changed and it was previously run on your machine, - # you may need to remove the builder manually before running the script: - # docker buildx rm $BUILDX_BUILDER - # Use this command to list builders: - # docker buildx ls - docker buildx create --name="${BUILDX_BUILDER}" --driver="docker-container" --driver-opt="network=host" - fi - - ADDITIONAL_DOCKER_BUILD_ARGS="--builder=${BUILDX_BUILDER}" - if [[ "${DOCKER_TARGET}" == *apple* ]]; then - # shellcheck disable=SC2089 - - ADDITIONAL_DOCKER_BUILD_ARGS="--build-arg OSXCROSS_URL=${OSXCROSS_URL}" - fi - - if [ "${DOCKER_IMAGE_PUSH}" == "1" ]; then - ADDITIONAL_DOCKER_BUILD_ARGS="${ADDITIONAL_DOCKER_BUILD_ARGS} --push" - else - ADDITIONAL_DOCKER_BUILD_ARGS="${ADDITIONAL_DOCKER_BUILD_ARGS} --load" - fi - - BRANCH="$(git rev-parse --abbrev-ref HEAD || echo "${GITHUB_REF_NAME:=}")" - CACHE_SCOPE="${DOCKER_REPO}-${DOCKER_TARGET}-${BRANCH}" - BUILDX_CACHE_DIR="${CACHE_DIR}/buildx" - - mkdir -p "${BUILDX_CACHE_DIR}" - if [ ! -f "${BUILDX_CACHE_DIR}/index.json" ]; then - ADDITIONAL_DOCKER_BUILD_ARGS="${ADDITIONAL_DOCKER_BUILD_ARGS} --cache-from=\"type=local,src=${BUILDX_CACHE_DIR},scope=${CACHE_SCOPE}\"" - fi - - ${NICE} docker buildx build \ - --builder="${BUILDX_BUILDER}" \ - --file="docker/docker-dev.dockerfile" \ - --target="${DOCKER_TARGET}" \ - --tag="${DOCKER_REPO}:${DOCKER_TARGET}" \ - --tag="${DOCKER_REPO}:${DOCKER_TARGET}-${DOCKER_IMAGE_VERSION}" \ - --cache-from="${DOCKER_REPO}:dev" \ - --cache-from="${DOCKER_REPO}:dev-${DOCKER_IMAGE_VERSION}" \ - --cache-from="${DOCKER_REPO}:${DOCKER_TARGET}" \ - --cache-from="${DOCKER_REPO}:${DOCKER_TARGET}-${DOCKER_IMAGE_VERSION}" \ - --cache-from="type=local,src=${BUILDX_CACHE_DIR}" \ - --cache-to="type=local,dest=${BUILDX_CACHE_DIR},mode=max,compression=zstd,ignore-error=true" \ - --build-arg="DOCKER_BASE_IMAGE=${DOCKER_BASE_IMAGE}" \ - --build-arg="CLANG_VERSION=${CLANG_VERSION}" \ - --build-arg="UID=$(id -u)" \ - --build-arg="GID=$(id -g)" \ - --build-arg="USER=${USER}" \ - --build-arg="GROUP=${GROUP}" \ - ${ADDITIONAL_DOCKER_BUILD_ARGS} \ - . \ - >/dev/null - - if [ -n "${FORCE_DOCKER_IMAGE_BUILD}" ]; then - exit 0; - fi -fi - -export RUSTC_FORCE_INCREMENTAL="" -if [ -n "${RELEASE}" ]; then - export RUSTC_FORCE_INCREMENTAL=1 -fi - -PARAMS="" -COMMAND=${*:-} -PORTS= -if [ "${RUN}" == "1" ]; then - PARAMS="$(echo "${@:-}" | xargs)" - if [ -n "${PARAMS}" ]; then - PARAMS="--bin=${PARAMS}" - fi - if [ "$(is_ci)" == "1" ]; then - PARAMS=" --locked ${PARAMS}" - fi - COMMAND="cargo run -q --target-dir='${BUILD_DIR_REL}' ${RUST_TARGET} ${RELEASE} ${PARAMS}" -elif [ "${EXAMPLE}" == "1" ]; then - PARAMS="$(echo "${@:-}" | xargs)" - if [ -n "${PARAMS}" ]; then - PARAMS="--example=${PARAMS}" - fi - if [ "$(is_ci)" == "1" ]; then - PARAMS=" --locked ${PARAMS}" - fi - COMMAND="cargo run -q --target-dir='${BUILD_DIR_REL}' ${RUST_TARGET} ${RELEASE} ${PARAMS}" -elif [ "${BUILD}" == "1" ]; then - PARAMS="$(echo "${@:-}" | xargs)" - if [ -n "${PARAMS}" ]; then - PARAMS="--bin=${PARAMS}" - fi - if [ "$(is_ci)" == "1" ]; then - PARAMS=" --locked ${PARAMS}" - fi - COMMAND="cargo build -q --target-dir='${BUILD_DIR_REL}' ${RUST_TARGET} ${RELEASE} ${PARAMS}" -elif [ "${SMOKE_TEST}" == "1" ]; then - COMMAND="./tests/run-smoke-tests 'cargo run -q --target-dir='${BUILD_DIR_REL}' ${RUST_TARGET} ${RELEASE} --bin=pangraph'" -elif [ "${WASM}" == "1" ]; then - COMMAND="bash -c \"set -euo pipefail && cd packages/web && bun install && bun wasm-${RELEASE}\"" -elif [ "${WEB}" == "1" ]; then - PORTS="-p 3000:3000" - COMMAND=${COMMAND:=bun install && bun ${RELEASE}} - COMMAND="bash -c \"set -euo pipefail && cd packages/web && ${COMMAND}\"" -elif [ "${DOCS}" == "1" ]; then - PORTS="-p 4000:4000 -p 5000:5000" - COMMAND=${COMMAND:=bun install && bun ${RELEASE}} - COMMAND="bash -c \"set -euo pipefail && cd docs/ && ${COMMAND}\"" -elif [ "${TEST}" == "1" ]; then - COMMAND="cargo -q nextest run --success-output=immediate --workspace --cargo-quiet --no-fail-fast --hide-progress-bar --color=always --target-dir='${BUILD_DIR_REL}' ${RUST_TARGET} ${TEST_FLAGS} ${*:-} 2>&1 | ./docker/prettytest ${SUCCESS_OR_FAILURE}" -elif [ "${BENCH}" == "1" ]; then - COMMAND="cargo -q bench --workspace --benches --target-dir='${BUILD_DIR_REL}' ${RUST_TARGET} -- --color=always ${SUCCESS_OR_FAILURE}" -elif [ "${LINT}" == "1" ]; then - COMMAND="cargo clippy -q --target-dir=\"${BUILD_DIR_REL}\" --all-targets --all ${FIX:-} ${LINT_DENY}" -elif [ "${FORMAT}" == "1" ]; then - if [ -z "${FIX}" ]; then - FIX="-q" - fi - COMMAND="cargo fmt --all ${FIX:-}" -elif [ "${JUPYTER}" == "1" ]; then - COMMAND="/files/start-jupyter" - PORTS="-p 10001:8888" -else - COMMAND="${NICE} ${TIME} ${COMMAND}" -fi - -if [ "${WATCH}" == "1" ]; then - COMMAND="${NICE} watchexec \ - --restart \ - --shell=bash \ - --debounce=10 \ - --no-meta \ - --no-environment \ - --exts=${EXTENSIONS_TO_WATCH} \ - ${FILES_TO_WATCH} \ - ${FILES_TO_IGNORE} \ - 'reset; ${NICE} ${TIME} ${COMMAND}'" -else - COMMAND="${NICE} ${TIME} ${COMMAND}" -fi - -mkdir -p "${BUILD_DIR}" "${CACHE_DIR}/.cargo/"{install,registry} "${CACHE_DIR}"/.jupyter - - -ADDITIONAL_DOCKER_RUN_ARGS="" -if [ -t 1 ]; then - ADDITIONAL_DOCKER_RUN_ARGS="${ADDITIONAL_DOCKER_RUN_ARGS} -it" -fi - -# shellcheck disable=SC2086 -${NICE} docker run --rm \ - ${ADDITIONAL_DOCKER_RUN_ARGS} \ - --init \ - --name="${DOCKER_CONTAINER_NAME}" \ - --hostname="${DOCKER_IMAGE_NAME_SAFE}" \ - --user="$(id -u):$(id -g)" \ - --volume="${PROJECT_ROOT_DIR}:/workdir" \ - --volume="${CACHE_DIR}/.cargo/install:/home/${USER}/.cargo/install" \ - --volume="${CACHE_DIR}/.cargo/registry:/home/${USER}/.cargo/registry" \ - --volume="${CACHE_DIR}/.jupyter:/home/${USER}/.jupyter" \ - --workdir="/workdir/${PACKAGE_DIR_REL}" \ - --env="UID=$(id -u)" \ - --env="GID=$(id -g)" \ - --env="USER=${USER}" \ - --env="GROUP=${GROUP}" \ - --env="PS1=\${USER}@\${HOST}" \ - --env="RUST_BACKTRACE=${RUST_BACKTRACE}" \ - --env="COLORBT_SHOW_HIDDEN=${COLORBT_SHOW_HIDDEN}" \ - --env="RUST_LOG=${RUST_LOG}" \ - --env-file="${PROJECT_ROOT_DIR}/.env" \ - --ulimit core=0 \ - ${PORTS} \ - "${DOCKER_REPO}:${DOCKER_TARGET}-${DOCKER_IMAGE_VERSION}" \ - bash -c "set -euo pipefail; ${HANDLE_SIGINT}; ${COMMAND} ${SUCCESS_OR_FAILURE}" - -if [ -n "${CROSS:-}" ] && [ -n "${RELEASE:-}" ] && { [ "${BUILD:-}" == 1 ] || [ "${RUN:-}" == 1 ]; }; then - mkdir -p .out/ - if [[ "${CROSS}" == *windows* ]]; then - cp "${BUILD_DIR}/${CROSS}/release/${PACKAGE_NAME}.exe" ".out/${PACKAGE_NAME}-${CROSS}.exe" - else - cp "${BUILD_DIR}/${CROSS}/release/${PACKAGE_NAME}" ".out/${PACKAGE_NAME}-${CROSS}" - fi -fi diff --git a/docker/docker-dev.dockerfile b/docker/docker-dev.dockerfile deleted file mode 100644 index c65f40b2..00000000 --- a/docker/docker-dev.dockerfile +++ /dev/null @@ -1,618 +0,0 @@ -# syntax=docker/dockerfile:1 - -ARG DOCKER_BASE_IMAGE - -FROM $DOCKER_BASE_IMAGE as base - -SHELL ["bash", "-euxo", "pipefail", "-c"] - -ARG DOCKER_BASE_IMAGE -ARG DASEL_VERSION="1.22.1" -ARG WATCHEXEC_VERSION="1.17.1" -ARG NODEMON_VERSION="2.0.15" -ARG BUN_VERSION="1.1.29" - - - -RUN set -euxo pipefail >/dev/null \ -&& if [[ "$DOCKER_BASE_IMAGE" != centos* ]] && [[ "$DOCKER_BASE_IMAGE" != *manylinux2014* ]]; then exit 0; fi \ -&& echo -e "[buildlogs-c7.2009.u]\nname=https://buildlogs.centos.org/c7.2009.u.x86_64/\nbaseurl=https://buildlogs.centos.org/c7.2009.u.x86_64/\nenabled=1\ngpgcheck=0\n\n[buildlogs-c7.2009.00]\nname=https://buildlogs.centos.org/c7.2009.00.x86_64/\nbaseurl=https://buildlogs.centos.org/c7.2009.00.x86_64/\nenabled=1\ngpgcheck=0" > /etc/yum.repos.d/buildlogs.repo \ -&& echo -e "[llvm-toolset]\nname=https://buildlogs.centos.org/c7-llvm-toolset-13.0.x86_64/\nbaseurl=https://buildlogs.centos.org/c7-llvm-toolset-13.0.x86_64/\nenabled=1\ngpgcheck=0" > /etc/yum.repos.d/llvm-toolset.repo \ -&& sed -i "s/enabled=1/enabled=0/g" "/etc/yum/pluginconf.d/fastestmirror.conf" \ -&& sed -i "s/enabled=1/enabled=0/g" "/etc/yum/pluginconf.d/ovl.conf" \ -&& yum clean all \ -&& yum -y install dnf epel-release \ -&& dnf install -y \ - autoconf \ - automake \ - bash \ - bash-completion \ - brotli \ - ca-certificates \ - cmake \ - curl \ - gdb \ - git \ - gnupg \ - gzip \ - llvm-toolset-13.0 \ - make \ - parallel \ - pigz \ - pkgconfig \ - python3 \ - python3-pip \ - redhat-lsb-core \ - sudo \ - tar \ - time \ - xz \ - zstd \ -&& dnf clean all \ -&& rm -rf /var/cache/yum - -ENV PATH="/opt/rh/llvm-toolset-13.0/root/usr/bin:/opt/rh/llvm-toolset-13.0/root/usr/sbin:${PATH}" -ENV LD_LIBRARY_PATH="/opt/rh/llvm-toolset-13.0/root/usr/lib64:${LD_LIBRARY_PATH}" -ENV MANPATH="/opt/rh/llvm-toolset-13.0/root/usr/share/man:${MANPATH:-}" -ENV PKG_CONFIG_PATH="/opt/rh/llvm-toolset-13.0/root/usr/lib64/pkgconfig:${PKG_CONFIG_PATH}" -ENV PYTHONPATH="/opt/rh/llvm-toolset-13.0/root/usr/lib/python3.6/site-packages:${PYTHONPATH}" - - - - -ARG CLANG_VERSION - -# Install required packages if running Debian or Ubuntu -RUN set -euxo pipefail >/dev/null \ -&& if [[ "$DOCKER_BASE_IMAGE" != debian* ]] && [[ "$DOCKER_BASE_IMAGE" != ubuntu* ]]; then exit 0; fi \ -&& if grep stretch "/etc/apt/sources.list"; then printf "deb http://archive.debian.org/debian/ stretch main non-free contrib\ndeb http://archive.debian.org/debian-security/ stretch/updates main non-free contrib\n" > "/etc/apt/sources.list"; fi \ -&& export DEBIAN_FRONTEND=noninteractive \ -&& apt-get update -qq --yes \ -&& apt-get install -qq --no-install-recommends --yes \ - apt-transport-https \ - bash \ - bash-completion \ - brotli \ - build-essential \ - ca-certificates \ - curl \ - git \ - gnupg \ - libssl-dev \ - lsb-release \ - make \ - parallel \ - pigz \ - pixz \ - pkg-config \ - python3 \ - python3-pip \ - rename \ - sudo \ - time \ - xz-utils \ ->/dev/null \ -&& echo "deb https://apt.llvm.org/$(lsb_release -cs)/ llvm-toolchain-$(lsb_release -cs)-${CLANG_VERSION} main" >> "/etc/apt/sources.list.d/llvm.list" \ -&& curl -fsSL "https://apt.llvm.org/llvm-snapshot.gpg.key" | sudo apt-key add - \ -&& export DEBIAN_FRONTEND=noninteractive \ -&& apt-get update -qq --yes \ -&& apt-get install -qq --no-install-recommends --yes \ - clang-${CLANG_VERSION} \ - clang-tools-${CLANG_VERSION} \ - lld-${CLANG_VERSION} \ - lldb-${CLANG_VERSION} \ - llvm-${CLANG_VERSION} \ - llvm-${CLANG_VERSION}-dev \ - llvm-${CLANG_VERSION}-tools \ - >/dev/null \ -&& apt-get clean autoclean >/dev/null \ -&& apt-get autoremove --yes >/dev/null \ -&& rm -rf /var/lib/apt/lists/* - -ARG USER=user -ARG GROUP=user -ARG UID -ARG GID - -ENV USER=$USER -ENV GROUP=$GROUP -ENV UID=$UID -ENV GID=$GID -ENV TERM="xterm-256color" -ENV HOME="/home/${USER}" -ENV CARGO_HOME="${HOME}/.cargo" -ENV CARGO_INSTALL_ROOT="${HOME}/.cargo/install" -ENV RUSTUP_HOME="${HOME}/.rustup" -ENV PATH="/usr/lib/llvm-${CLANG_VERSION}/bin:${HOME}/.local/bin:${HOME}/.cargo/bin:${HOME}/.cargo/install/bin:${PATH}" - -RUN set -euxo pipefail >/dev/null \ -&& pip3 install --user --upgrade cram - -RUN set -euxo pipefail >/dev/null \ -&& curl -fsSL -o "/usr/bin/jq" "https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64" \ -&& chmod +x "/usr/bin/jq" \ -&& jq --version - -RUN set -euxo pipefail >/dev/null \ -&& curl -fsSL "https://github.com/TomWright/dasel/releases/download/v${DASEL_VERSION}/dasel_linux_amd64" -o "/usr/bin/dasel" \ -&& chmod +x "/usr/bin/dasel" \ -&& dasel --version - -RUN set -euxo pipefail >/dev/null \ -&& curl -sSL "https://github.com/watchexec/watchexec/releases/download/cli-v${WATCHEXEC_VERSION}/watchexec-${WATCHEXEC_VERSION}-x86_64-unknown-linux-musl.tar.xz" | tar -C "/usr/bin/" -xJ --strip-components=1 "watchexec-${WATCHEXEC_VERSION}-x86_64-unknown-linux-musl/watchexec" \ -&& chmod +x "/usr/bin/watchexec" \ -&& watchexec --version - -# Make a user and group -RUN set -euxo pipefail >/dev/null \ -&& \ - if [ -z "$(getent group ${GID})" ]; then \ - groupadd --system --gid ${GID} ${GROUP}; \ - else \ - groupmod -n ${GROUP} $(getent group ${GID} | cut -d: -f1); \ - fi \ -&& export SUDO_GROUP="sudo" \ -&& \ - if [[ "$DOCKER_BASE_IMAGE" == centos* ]] || [[ "$DOCKER_BASE_IMAGE" == *manylinux2014* ]]; then \ - export SUDO_GROUP="wheel"; \ - fi \ -&& \ - if [ -z "$(getent passwd ${UID})" ]; then \ - useradd \ - --system \ - --create-home --home-dir ${HOME} \ - --shell /bin/bash \ - --gid ${GROUP} \ - --groups ${SUDO_GROUP} \ - --uid ${UID} \ - ${USER}; \ - fi \ -&& sed -i /etc/sudoers -re 's/^%sudo.*/%sudo ALL=(ALL:ALL) NOPASSWD: ALL/g' \ -&& sed -i /etc/sudoers -re 's/^root.*/root ALL=(ALL:ALL) NOPASSWD: ALL/g' \ -&& sed -i /etc/sudoers -re 's/^#includedir.*/## **Removed the include directive** ##"/g' \ -&& echo "%sudo ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \ -&& echo "${USER} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers \ -&& touch ${HOME}/.hushlogin \ -&& chown -R ${UID}:${GID} "${HOME}" - - -USER ${USER} - -# Install rustup and toolchain from rust-toolchain.toml -COPY rust-toolchain.toml "${HOME}/rust-toolchain.toml" -RUN set -euxo pipefail >/dev/null \ -&& cd "${HOME}" \ -&& RUST_TOOLCHAIN=$(dasel select -p toml -s ".toolchain.channel" -f "${HOME}/rust-toolchain.toml") \ -&& curl --proto '=https' -sSf https://sh.rustup.rs > rustup-init \ -&& chmod +x rustup-init \ -&& ./rustup-init -y --no-modify-path --default-toolchain="${RUST_TOOLCHAIN}" \ -&& rm rustup-init - -# Install toolchain from rust-toolchain.toml and make it default -RUN set -euxo pipefail >/dev/null \ -&& cd "${HOME}" \ -&& RUST_TOOLCHAIN=$(dasel select -p toml -s ".toolchain.channel" -f "rust-toolchain.toml") \ -&& rustup toolchain install "${RUST_TOOLCHAIN}" \ -&& rustup default "${RUST_TOOLCHAIN}" - -# Install remaining toolchain components from rust-toolchain.toml -RUN set -euxo pipefail >/dev/null \ -&& cd "${HOME}" \ -&& RUST_TOOLCHAIN=$(dasel select -p toml -s ".toolchain.channel" -f "rust-toolchain.toml") \ -&& rustup show \ -&& rustup default "${RUST_TOOLCHAIN}" - -RUN set -euxo pipefail >/dev/null \ -&& export SEQKIT_VERSION="2.5.0" \ -&& curl -sSL "https://github.com/shenwei356/seqkit/releases/download/v${SEQKIT_VERSION}/seqkit_linux_amd64.tar.gz" | tar -C "${CARGO_HOME}/bin" -xz "seqkit" \ -&& chmod +x "${CARGO_HOME}/bin/seqkit" - -RUN set -euxo pipefail >/dev/null \ -&& export CARGO_BINSTALL_VERSION="1.0.0" \ -&& curl -sSL "https://github.com/cargo-bins/cargo-binstall/releases/download/v${CARGO_BINSTALL_VERSION}/cargo-binstall-x86_64-unknown-linux-gnu.tgz" | tar -C "${CARGO_HOME}/bin" -xz "cargo-binstall" \ -&& chmod +x "${CARGO_HOME}/bin/cargo-binstall" - -RUN set -euxo pipefail >/dev/null \ -&& export CARGO_QUICKINSTALL_VERSION="0.2.9" \ -&& curl -sSL "https://github.com/alsuren/cargo-quickinstall/releases/download/cargo-quickinstall-${CARGO_QUICKINSTALL_VERSION}-x86_64-unknown-linux-musl/cargo-quickinstall-${CARGO_QUICKINSTALL_VERSION}-x86_64-unknown-linux-musl.tar.gz" | tar -C "${CARGO_HOME}/bin" -xz "cargo-quickinstall" \ -&& chmod +x "${CARGO_HOME}/bin/cargo-quickinstall" - -RUN set -euxo pipefail >/dev/null \ -&& export WASM_BINDGEN_CLI_VERSION="0.2.87" \ -&& curl -sSL "https://github.com/rustwasm/wasm-bindgen/releases/download/${WASM_BINDGEN_CLI_VERSION}/wasm-bindgen-${WASM_BINDGEN_CLI_VERSION}-x86_64-unknown-linux-musl.tar.gz" | tar -C "${CARGO_HOME}/bin" --strip-components=1 -xz "wasm-bindgen-${WASM_BINDGEN_CLI_VERSION}-x86_64-unknown-linux-musl/wasm-bindgen" \ -&& chmod +x "${CARGO_HOME}/bin/wasm-bindgen" - -RUN set -euxo pipefail >/dev/null \ -&& export BINARYEN_VERSION="114" \ -&& curl -sSL "https://github.com/WebAssembly/binaryen/releases/download/version_${BINARYEN_VERSION}/binaryen-version_${BINARYEN_VERSION}-x86_64-linux.tar.gz" | tar -C "${CARGO_HOME}/bin" --strip-components=2 -xz --wildcards "binaryen-version_${BINARYEN_VERSION}/bin/"'wasm*' \ -&& chmod +x ${CARGO_HOME}/bin/wasm* - -RUN set -euxo pipefail >/dev/null \ -&& export WASM_PACK_VERSION="0.12.1" \ -&& curl -sSL "https://github.com/rustwasm/wasm-pack/releases/download/v${WASM_PACK_VERSION}/wasm-pack-v${WASM_PACK_VERSION}-x86_64-unknown-linux-musl.tar.gz" | tar -C "${CARGO_HOME}/bin" --strip-components=1 -xz "wasm-pack-v${WASM_PACK_VERSION}-x86_64-unknown-linux-musl/wasm-pack" \ -&& chmod +x "${CARGO_HOME}/bin/wasm-pack" - -RUN set -euxo pipefail >/dev/null \ -&& export CARGO_WATCH_VERSION="8.4.0" \ -&& curl -sSL "https://github.com/watchexec/cargo-watch/releases/download/v${CARGO_WATCH_VERSION}/cargo-watch-v${CARGO_WATCH_VERSION}-x86_64-unknown-linux-gnu.tar.xz" | tar -C "${CARGO_HOME}/bin" --strip-components=1 -xJ "cargo-watch-v${CARGO_WATCH_VERSION}-x86_64-unknown-linux-gnu/cargo-watch" \ -&& chmod +x "${CARGO_HOME}/bin/cargo-watch" - -RUN set -euxo pipefail >/dev/null \ -&& export CARGO_NEXTEST_VERSION="0.9.67" \ -&& curl -sSL "https://github.com/nextest-rs/nextest/releases/download/cargo-nextest-${CARGO_NEXTEST_VERSION}/cargo-nextest-${CARGO_NEXTEST_VERSION}-x86_64-unknown-linux-gnu.tar.gz" | tar -C "${CARGO_HOME}/bin" -xz "cargo-nextest" \ -&& chmod +x "${CARGO_HOME}/bin/cargo-nextest" - -USER 0 - -# Install mmseqs -RUN set -euxo pipefail >/dev/null \ -&& export MMSEQS_VERSION="13-45111" \ -&& curl -fsSL "https://github.com/soedinglab/MMseqs2/releases/download/${MMSEQS_VERSION}/mmseqs-linux-sse2.tar.gz" | tar -C "/usr/bin/" -xz --strip-components=2 "mmseqs/bin/mmseqs" \ -&& mmseqs --help | grep "Version" - -RUN set -euxo pipefail >/dev/null \ -&& export MINIMAP2_VERSION="2.26" \ -&& curl -fsSL "https://github.com/lh3/minimap2/releases/download/v${MINIMAP2_VERSION}/minimap2-${MINIMAP2_VERSION}_x64-linux.tar.bz2" | tar -C "/usr/bin/" -xj --strip-components=1 "minimap2-${MINIMAP2_VERSION}_x64-linux/minimap2" \ -&& minimap2 --version - -# Install mash -RUN set -euxo pipefail >/dev/null \ -&& curl -fsSL "https://github.com/marbl/Mash/releases/download/v2.2/mash-Linux64-v2.2.tar" | tar -C "/usr/bin/" -x --strip-components=1 "mash-Linux64-v2.2/mash" \ -&& mash --version - -## Install fasttree -#RUN set -euxo pipefail >/dev/null \ -#&& curl -fsSLo "/usr/bin/fasttree" "http://www.microbesonline.org/fasttree/FastTree" \ -#&& chmod +x "/usr/bin/fasttree" \ -#&& fasttree -help - -# Install mafft -RUN set -euxo pipefail >/dev/null \ -&& mkdir -p "/opt/mafft" \ -&& curl -fsSL "https://mafft.cbrc.jp/alignment/software/mafft-7.490-linux.tgz" \ - | tar xz -C "/usr/bin/" --strip-components=1 "mafft-linux64/" \ -&& ln -s "/usr/bin/mafft.bat" "/usr/bin/mafft" \ -&& chmod 0777 "/usr/bin/mafft.bat" \ -&& chown root:root "/usr/bin/mafft.bat" \ - && chmod -R 0777 "/usr/bin/mafftdir" \ -&& chown -R root:root "/usr/bin/mafftdir" \ -&& mafft --version - -USER ${USER} - -# Setup bash -RUN set -euxo pipefail >/dev/null \ -&& echo 'alias ll="ls --color=always -alFhp"' >> ~/.bashrc \ -&& echo 'alias la="ls -Ah"' >> ~/.bashrc \ -&& echo 'alias l="ls -CFh"' >> ~/.bashrc \ -&& echo 'function mkcd() { mkdir -p ${1} && cd ${1} ; }' >> ~/.bashrc \ -&& rustup completions bash >> ~/.bash_completion \ -&& rustup completions bash cargo >> ~/.bash_completion \ -&& echo "source ~/.bash_completion" >> ~/.bashrc - -USER ${USER} - -WORKDIR ${HOME}/src - - - -# Native compilation for Linux x86_64 with gnu-libc -FROM base as dev - -ENV CC_x86_64-unknown-linux-gnu=clang -ENV CXX_x86_64-unknown-linux-gnu=clang++ - - - - -FROM dev as web - -USER 0 - -ENV NODE_DIR="/opt/node" -ENV PATH="${NODE_DIR}/bin:${PATH}" - -# Install Node.js -COPY .nvmrc / -RUN set -euxo pipefail >/dev/null \ -&& mkdir -p "${NODE_DIR}" \ -&& cd "${NODE_DIR}" \ -&& NODE_VERSION=$(cat /.nvmrc) \ -&& curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-x64.tar.xz" | tar -xJ --strip-components=1 \ -&& npm install -g nodemon@${NODEMON_VERSION} bun@${BUN_VERSION} >/dev/null - -USER ${USER} - - - -# Cross-compilation for Linux x86_64 with gnu-libc -FROM dev as cross-x86_64-unknown-linux-gnu - -ENV CC_x86_64-unknown-linux-gnu=clang -ENV CXX_x86_64-unknown-linux-gnu=clang++ - - -# Cross-compilation for Linux x86_64 with libmusl -FROM base as cross-x86_64-unknown-linux-musl - -USER 0 - -SHELL ["bash", "-euxo", "pipefail", "-c"] - -RUN set -euxo pipefail >/dev/null \ -&& curl -fsSL "https://more.musl.cc/11/x86_64-linux-musl/x86_64-linux-musl-cross.tgz" | tar -C "/usr" -xz --strip-components=1 - -USER ${USER} - -RUN set -euxo pipefail >/dev/null \ -&& rustup target add x86_64-unknown-linux-musl - -ENV CC_x86_64_unknown_linux_musl=x86_64-linux-musl-gcc -ENV CXX_x86_64_unknown_linux_musl=x86_64-linux-musl-g++ -ENV AR_x86_64_unknown_linux_musl=x86_64-linux-musl-ar -ENV CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=x86_64-linux-musl-gcc -ENV BINDGEN_EXTRA_CLANG_ARGS_x86_64_unknown_linux_musl="--sysroot /usr/x86_64-linux-musl" - - -# Cross-compilation to WebAssembly -FROM base as cross-wasm32-unknown-unknown - -SHELL ["bash", "-euxo", "pipefail", "-c"] - -RUN set -euxo pipefail >/dev/null \ -&& rustup target add wasm32-unknown-unknown - - -# Cross-compilation for Linux ARM64 -FROM base as cross-aarch64-unknown-linux-gnu - -USER 0 - -SHELL ["bash", "-euxo", "pipefail", "-c"] - -RUN set -euxo pipefail >/dev/null \ -&& export DEBIAN_FRONTEND=noninteractive \ -&& apt-get update -qq --yes \ -&& apt-get install -qq --no-install-recommends --yes \ - binutils-aarch64-linux-gnu \ - g++-aarch64-linux-gnu \ - gcc-aarch64-linux-gnu \ - gfortran-aarch64-linux-gnu \ - libc6-dev-arm64-cross \ ->/dev/null \ -&& apt-get clean autoclean >/dev/null \ -&& apt-get autoremove --yes >/dev/null \ -&& rm -rf /var/lib/apt/lists/* - -USER ${USER} - -RUN set -euxo pipefail >/dev/null \ -&& rustup target add aarch64-unknown-linux-gnu - -ENV CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc -ENV CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++ -ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc - -# Cross-compilation for Linux ARM64 with libmusl -FROM base as cross-aarch64-unknown-linux-musl - -USER 0 - -SHELL ["bash", "-euxo", "pipefail", "-c"] - -RUN set -euxo pipefail >/dev/null \ -&& curl -fsSL "https://more.musl.cc/11/x86_64-linux-musl/aarch64-linux-musl-cross.tgz" | tar -C "/usr" -xz --strip-components=1 - -USER ${USER} - -RUN set -euxo pipefail >/dev/null \ -&& rustup target add aarch64-unknown-linux-musl - -ENV CC_aarch64_unknown_linux_musl=aarch64-linux-musl-gcc -ENV CXX_aarch64_unknown_linux_musl=aarch64-linux-musl-g++ -ENV AR_aarch64_unknown_linux_musl=aarch64-linux-musl-ar -ENV CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_LINKER=aarch64-linux-musl-gcc -ENV BINDGEN_EXTRA_CLANG_ARGS_aarch64_unknown_linux_musl="--sysroot /usr/aarch64-linux-musl" - - -# Cross-compilation for Windows x86_64 -FROM base as cross-x86_64-pc-windows-gnu - -SHELL ["bash", "-euxo", "pipefail", "-c"] - -USER 0 - -RUN set -euxo pipefail >/dev/null \ -&& export DEBIAN_FRONTEND=noninteractive \ -&& apt-get update -qq --yes \ -&& apt-get install -qq --no-install-recommends --yes \ - binutils-mingw-w64-x86-64 \ - g++-mingw-w64-x86-64 \ - gcc-mingw-w64-x86-64 \ - gfortran-mingw-w64-x86-64 \ ->/dev/null \ -&& apt-get clean autoclean >/dev/null \ -&& apt-get autoremove --yes >/dev/null \ -&& rm -rf /var/lib/apt/lists/* - -USER ${USER} - -RUN set -euxo pipefail >/dev/null \ -&& rustup target add x86_64-pc-windows-gnu - -ENV MINGW_HOME="/usr/x86_64-w64-mingw32" -ENV MINGW_LIB_DIR="${MINGW_HOME}/lib" - -ENV PKG_CONFIG_ALLOW_CROSS=1 -ENV PKG_CONFIG_PATH="${MINGW_LIB_DIR}/pkgconfig" - -# Builds osxcross for Mac cross-compiation -FROM base as osxcross - -SHELL ["bash", "-euxo", "pipefail", "-c"] - -USER 0 - -ARG OSXCROSS_URL - -RUN set -euxo pipefail >/dev/null \ -&& mkdir -p "/opt/osxcross" \ -&& curl -fsSL "${OSXCROSS_URL}" | tar -C "/opt/osxcross" -xJ - -USER ${USER} - - - -# Cross-compilation for macOS x86_64 -FROM osxcross as cross-x86_64-apple-darwin - -SHELL ["bash", "-euxo", "pipefail", "-c"] - -USER ${USER} - -RUN set -euxo pipefail >/dev/null \ -&& rustup target add x86_64-apple-darwin - -ENV OSXCROSS_MP_INC=1 -ENV MACOSX_DEPLOYMENT_TARGET=10.7 -ENV CARGO_BUILD_TARGET=x86_64-apple-darwin -ENV OSX_TRIPLET=x86_64-apple-darwin20.2 - -ENV OSX_CROSS_PATH="/opt/osxcross" -ENV MY_SYSROOT="${OSX_CROSS_PATH}/SDK/MacOSX11.1.sdk" -ENV PATH="${OSX_CROSS_PATH}/bin/:${PATH}" - -ENV CC_x86_64-apple-darwin="${OSX_CROSS_PATH}/bin/o64-clang" -ENV CXX_x86_64-apple-darwin="${OSX_CROSS_PATH}/bin/o64-clang++" - -ENV AR_x86_64-apple-darwin="${OSX_CROSS_PATH}/bin/${OSX_TRIPLET}-ar" -ENV AS_x86_64-apple-darwin="${OSX_CROSS_PATH}/bin/${OSX_TRIPLET}-as" -ENV CMAKE_x86_64-apple-darwin="${OSX_CROSS_PATH}/bin/${OSX_TRIPLET}-cmake" -ENV DSYMUTIL_x86_64-apple-darwin="${OSX_CROSS_PATH}/bin/${OSX_TRIPLET}-dsymutil" -ENV LD_x86_64-apple-darwin="${OSX_CROSS_PATH}/bin/${OSX_TRIPLET}-ld" -ENV LIBTOOL_x86_64-apple-darwin="${OSX_CROSS_PATH}/bin/${OSX_TRIPLET}-libtool" -ENV NM_x86_64-apple-darwin="${OSX_CROSS_PATH}/bin/${OSX_TRIPLET}-nm" -ENV PKG_CONFIG_x86_64-apple-darwin="${OSX_CROSS_PATH}/bin/${OSX_TRIPLET}-pkg-config" -ENV STRIP_x86_64-apple-darwin="${OSX_CROSS_PATH}/bin/${OSX_TRIPLET}-strip" - -ENV CARGO_TARGET_X86_64_APPLE_DARWIN_AR="${OSX_CROSS_PATH}/bin/${OSX_TRIPLET}-ar" -ENV CARGO_TARGET_X86_64_APPLE_DARWIN_LINKER="${OSX_CROSS_PATH}/bin/o64-clang" -ENV CARGO_TARGET_X86_64_APPLE_DARWIN_STRIP="${OSX_CROSS_PATH}/bin/${OSX_TRIPLET}-strip" - -ENV BINDGEN_EXTRA_CLANG_ARGS_x86_64-apple-darwin="--sysroot ${MY_SYSROOT}" - -USER ${USER} - - - -# Cross-compilation for macOS ARM64 -FROM osxcross as cross-aarch64-apple-darwin - -SHELL ["bash", "-euxo", "pipefail", "-c"] - -USER ${USER} - -RUN set -euxo pipefail >/dev/null \ -&& rustup target add aarch64-apple-darwin - -ENV OSXCROSS_MP_INC=1 -ENV MACOSX_DEPLOYMENT_TARGET=10.7 -ENV CARGO_BUILD_TARGET=aarch64-apple-darwin -ENV OSX_TRIPLET=aarch64-apple-darwin20.2 - -ENV OSX_CROSS_PATH="/opt/osxcross" -ENV MY_SYSROOT="${OSX_CROSS_PATH}/SDK/MacOSX11.1.sdk" -ENV PATH="${OSX_CROSS_PATH}/bin/:${PATH}" - -ENV CC_aarch64-apple-darwin="${OSX_CROSS_PATH}/bin/oa64-clang" -ENV CXX_aarch64-apple-darwin="${OSX_CROSS_PATH}/bin/oa64-clang++" - -ENV AR_aarch64-apple-darwin="${OSX_CROSS_PATH}/bin/${OSX_TRIPLET}-ar" -ENV AS_aarch64-apple-darwin="${OSX_CROSS_PATH}/bin/${OSX_TRIPLET}-as" -ENV CMAKE_aarch64-apple-darwin="${OSX_CROSS_PATH}/bin/${OSX_TRIPLET}-cmake" -ENV DSYMUTIL_aarch64-apple-darwin="${OSX_CROSS_PATH}/bin/${OSX_TRIPLET}-dsymutil" -ENV LD_aarch64-apple-darwin="${OSX_CROSS_PATH}/bin/${OSX_TRIPLET}-ld" -ENV LIBTOOL_aarch64-apple-darwin="${OSX_CROSS_PATH}/bin/${OSX_TRIPLET}-libtool" -ENV NM_aarch64-apple-darwin="${OSX_CROSS_PATH}/bin/${OSX_TRIPLET}-nm" -ENV PKG_CONFIG_aarch64-apple-darwin="${OSX_CROSS_PATH}/bin/${OSX_TRIPLET}-pkg-config" -ENV STRIP_aarch64-apple-darwin="${OSX_CROSS_PATH}/bin/${OSX_TRIPLET}-strip" - -ENV CARGO_TARGET_AARCH64_APPLE_DARWIN_AR="${OSX_CROSS_PATH}/bin/${OSX_TRIPLET}-ar" -ENV CARGO_TARGET_AARCH64_APPLE_DARWIN_LINKER="${OSX_CROSS_PATH}/bin/oa64-clang" -ENV CARGO_TARGET_AARCH64_APPLE_DARWIN_STRIP="${OSX_CROSS_PATH}/bin/${OSX_TRIPLET}-strip" - -ENV BINDGEN_EXTRA_CLANG_ARGS_aarch64-apple-darwin="--sysroot ${MY_SYSROOT}" - -USER ${USER} - - - - -# Python and Jupyter -FROM base as py - - -ARG PYTHON_VERSION="3.11" -ARG CONDA_DIR="${HOME}/.conda" -ENV PATH="${HOME}/bin:${CONDA_DIR}/bin:${PATH}" -ENV XDG_CACHE_HOME="${HOME}/.cache/" -ENV MPLBACKEND="Agg" - -COPY docker/files /files - -RUN set -euxo pipefail >/dev/null \ -&& cp -r /files/.conda "${CONDA_DIR}/" \ -&& chown -R ${UID}:${GID} "${CONDA_DIR}" - -USER ${USER} - -RUN set -euxo pipefail >/dev/null \ -&& export CONDA_DIR="${CONDA_DIR}" \ -&& export PYTHON_VERSION="${PYTHON_VERSION}" \ -&& mkdir -p "${CONDA_DIR}/bin" "${HOME}/.config/conda" \ -&& curl -fsSL "https://micro.mamba.pm/api/micromamba/linux-64/latest" | tar -C "${CONDA_DIR}/bin" --strip-components=1 -xvj "bin/micromamba" \ -&& micromamba install --yes \ - --root-prefix="${CONDA_DIR}" \ - --prefix="${CONDA_DIR}" \ - "python=${PYTHON_VERSION}" \ - 'mamba' \ -&& mamba list python | grep '^python ' | tr -s ' ' | cut -d ' ' -f 1,2 >> "${CONDA_DIR}/conda-meta/pinned" \ -&& echo 'blas=*.*=*mkl*' >> "${CONDA_DIR}/conda-meta/pinned" \ -&& echo 'conda-forge::blas=*.*=*mkl*' >> "${CONDA_DIR}/conda-meta/pinned" \ -&& echo 'conda-forge::libblas=*.*=*mkl*' >> "${CONDA_DIR}/conda-meta/pinned" - -RUN set -euxo pipefail >/dev/null \ -&& mamba install --quiet --yes \ - 'blas=*.*=*mkl*' \ - 'conda-forge::blas=*.*=*mkl*' \ - 'conda-forge::libblas=*.*=*mkl*' \ - 'biopython' \ - 'bokeh' \ - 'cython' \ - 'dill' \ - 'ipywidgets' \ - 'jsonpickle' \ - 'jupyter-dash' \ - 'jupyterlab' \ - 'jupyterlab_widgets' \ - 'matplotlib-base' \ - 'mkl' \ - 'mkl-service' \ - 'notebook' \ - 'numpy' \ - 'pandas' \ - 'pathos' \ - 'plotly' \ - 'polars' \ - 'pytest' \ - 'scipy' \ - 'seaborn' \ - 'statsmodels' \ - 'tqdm' \ - 'widgetsnbextension' \ -&& mamba clean --all -f -y \ -&& mamba init bash - -# Import matplotlib the first time to build the font cache. -RUN set -euxo pipefail >/dev/null \ -&& python -c "import matplotlib.pyplot" diff --git a/packages/minimap2-sys/Cargo.toml b/packages/minimap2-sys/Cargo.toml index 8e92e015..aaa8edd8 100644 --- a/packages/minimap2-sys/Cargo.toml +++ b/packages/minimap2-sys/Cargo.toml @@ -44,3 +44,5 @@ simde = [] noopt = [] zlib-ng = ["libz-sys/zlib-ng"] static = ["libz-sys/static"] +stock-zlib = ["libz-sys/stock-zlib"] + diff --git a/packages/minimap2-sys/build.rs b/packages/minimap2-sys/build.rs index 05654353..8d272b43 100644 --- a/packages/minimap2-sys/build.rs +++ b/packages/minimap2-sys/build.rs @@ -33,6 +33,10 @@ fn configure(cc: &mut cc::Build) { println!("cargo:rerun-if-changed={}", file.display()); } + println!("cargo:rerun-if-env-changed=DEP_Z_INCLUDE"); + let zlib_include_path = env::var("DEP_Z_INCLUDE").unwrap(); + cc.include(zlib_include_path); + cc.include("minimap2"); cc.opt_level(2); @@ -133,7 +137,7 @@ fn simde(cc: &mut cc::Build) { cc.include("minimap2/lib/simde"); cc.flag("-DSIMDE_ENABLE_NATIVE_ALIASES"); cc.flag("-DUSE_SIMDE"); - cc.flag("-std=c99"); + cc.flag("-std=gnu99"); } fn compile() { diff --git a/packages/minimap2-sys/src/bindings.rs b/packages/minimap2-sys/src/bindings.rs index 886f30e5..78c32517 100644 --- a/packages/minimap2-sys/src/bindings.rs +++ b/packages/minimap2-sys/src/bindings.rs @@ -110,166 +110,303 @@ impl ::std::fmt::Debug for __IncompleteArrayField { fmt.write_str("__IncompleteArrayField") } } -pub const _STDINT_H: u32 = 1; -pub const _FEATURES_H: u32 = 1; -pub const _DEFAULT_SOURCE: u32 = 1; -pub const __GLIBC_USE_ISOC2X: u32 = 0; -pub const __USE_ISOC11: u32 = 1; -pub const __USE_ISOC99: u32 = 1; -pub const __USE_ISOC95: u32 = 1; -pub const __USE_POSIX_IMPLICITLY: u32 = 1; -pub const _POSIX_SOURCE: u32 = 1; -pub const _POSIX_C_SOURCE: u32 = 200809; -pub const __USE_POSIX: u32 = 1; -pub const __USE_POSIX2: u32 = 1; -pub const __USE_POSIX199309: u32 = 1; -pub const __USE_POSIX199506: u32 = 1; -pub const __USE_XOPEN2K: u32 = 1; -pub const __USE_XOPEN2K8: u32 = 1; -pub const _ATFILE_SOURCE: u32 = 1; -pub const __USE_MISC: u32 = 1; -pub const __USE_ATFILE: u32 = 1; -pub const __USE_FORTIFY_LEVEL: u32 = 0; -pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0; -pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0; -pub const _STDC_PREDEF_H: u32 = 1; -pub const __STDC_IEC_559__: u32 = 1; -pub const __STDC_IEC_559_COMPLEX__: u32 = 1; -pub const __STDC_ISO_10646__: u32 = 201706; -pub const __GNU_LIBRARY__: u32 = 6; -pub const __GLIBC__: u32 = 2; -pub const __GLIBC_MINOR__: u32 = 31; -pub const _SYS_CDEFS_H: u32 = 1; -pub const __glibc_c99_flexarr_available: u32 = 1; pub const __WORDSIZE: u32 = 64; -pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1; -pub const __SYSCALL_WORDSIZE: u32 = 64; -pub const __LONG_DOUBLE_USES_FLOAT128: u32 = 0; -pub const __HAVE_GENERIC_SELECTION: u32 = 1; -pub const __GLIBC_USE_LIB_EXT2: u32 = 0; -pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0; -pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X: u32 = 0; -pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0; -pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 0; -pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0; -pub const _BITS_TYPES_H: u32 = 1; -pub const __TIMESIZE: u32 = 64; -pub const _BITS_TYPESIZES_H: u32 = 1; -pub const __OFF_T_MATCHES_OFF64_T: u32 = 1; -pub const __INO_T_MATCHES_INO64_T: u32 = 1; -pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1; -pub const __STATFS_MATCHES_STATFS64: u32 = 1; -pub const __FD_SETSIZE: u32 = 1024; -pub const _BITS_TIME64_H: u32 = 1; -pub const _BITS_WCHAR_H: u32 = 1; -pub const _BITS_STDINT_INTN_H: u32 = 1; -pub const _BITS_STDINT_UINTN_H: u32 = 1; -pub const INT8_MIN: i32 = -128; -pub const INT16_MIN: i32 = -32768; -pub const INT32_MIN: i32 = -2147483648; +pub const __DARWIN_ONLY_64_BIT_INO_T: u32 = 1; +pub const __DARWIN_ONLY_UNIX_CONFORMANCE: u32 = 1; +pub const __DARWIN_ONLY_VERS_1050: u32 = 1; +pub const __DARWIN_UNIX03: u32 = 1; +pub const __DARWIN_64_BIT_INO_T: u32 = 1; +pub const __DARWIN_VERS_1050: u32 = 1; +pub const __DARWIN_NON_CANCELABLE: u32 = 0; +#[allow(unsafe_code)] +pub const __DARWIN_SUF_EXTSN: &::std::ffi::CStr = + unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"$DARWIN_EXTSN\0") }; +pub const __DARWIN_C_ANSI: u32 = 4096; +pub const __DARWIN_C_FULL: u32 = 900000; +pub const __DARWIN_C_LEVEL: u32 = 900000; +pub const __STDC_WANT_LIB_EXT1__: u32 = 1; +pub const __DARWIN_NO_LONG_LONG: u32 = 0; +pub const _DARWIN_FEATURE_64_BIT_INODE: u32 = 1; +pub const _DARWIN_FEATURE_ONLY_64_BIT_INODE: u32 = 1; +pub const _DARWIN_FEATURE_ONLY_VERS_1050: u32 = 1; +pub const _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE: u32 = 1; +pub const _DARWIN_FEATURE_UNIX_CONFORMANCE: u32 = 3; +pub const __PTHREAD_SIZE__: u32 = 8176; +pub const __PTHREAD_ATTR_SIZE__: u32 = 56; +pub const __PTHREAD_MUTEXATTR_SIZE__: u32 = 8; +pub const __PTHREAD_MUTEX_SIZE__: u32 = 56; +pub const __PTHREAD_CONDATTR_SIZE__: u32 = 8; +pub const __PTHREAD_COND_SIZE__: u32 = 40; +pub const __PTHREAD_ONCE_SIZE__: u32 = 8; +pub const __PTHREAD_RWLOCK_SIZE__: u32 = 192; +pub const __PTHREAD_RWLOCKATTR_SIZE__: u32 = 16; pub const INT8_MAX: u32 = 127; pub const INT16_MAX: u32 = 32767; pub const INT32_MAX: u32 = 2147483647; +pub const INT64_MAX: u64 = 9223372036854775807; +pub const INT8_MIN: i32 = -128; +pub const INT16_MIN: i32 = -32768; +pub const INT32_MIN: i32 = -2147483648; +pub const INT64_MIN: i64 = -9223372036854775808; pub const UINT8_MAX: u32 = 255; pub const UINT16_MAX: u32 = 65535; pub const UINT32_MAX: u32 = 4294967295; +pub const UINT64_MAX: i32 = -1; pub const INT_LEAST8_MIN: i32 = -128; pub const INT_LEAST16_MIN: i32 = -32768; pub const INT_LEAST32_MIN: i32 = -2147483648; +pub const INT_LEAST64_MIN: i64 = -9223372036854775808; pub const INT_LEAST8_MAX: u32 = 127; pub const INT_LEAST16_MAX: u32 = 32767; pub const INT_LEAST32_MAX: u32 = 2147483647; +pub const INT_LEAST64_MAX: u64 = 9223372036854775807; pub const UINT_LEAST8_MAX: u32 = 255; pub const UINT_LEAST16_MAX: u32 = 65535; pub const UINT_LEAST32_MAX: u32 = 4294967295; +pub const UINT_LEAST64_MAX: i32 = -1; pub const INT_FAST8_MIN: i32 = -128; -pub const INT_FAST16_MIN: i64 = -9223372036854775808; -pub const INT_FAST32_MIN: i64 = -9223372036854775808; +pub const INT_FAST16_MIN: i32 = -32768; +pub const INT_FAST32_MIN: i32 = -2147483648; +pub const INT_FAST64_MIN: i64 = -9223372036854775808; pub const INT_FAST8_MAX: u32 = 127; -pub const INT_FAST16_MAX: u64 = 9223372036854775807; -pub const INT_FAST32_MAX: u64 = 9223372036854775807; +pub const INT_FAST16_MAX: u32 = 32767; +pub const INT_FAST32_MAX: u32 = 2147483647; +pub const INT_FAST64_MAX: u64 = 9223372036854775807; pub const UINT_FAST8_MAX: u32 = 255; -pub const UINT_FAST16_MAX: i32 = -1; -pub const UINT_FAST32_MAX: i32 = -1; -pub const INTPTR_MIN: i64 = -9223372036854775808; +pub const UINT_FAST16_MAX: u32 = 65535; +pub const UINT_FAST32_MAX: u32 = 4294967295; +pub const UINT_FAST64_MAX: i32 = -1; pub const INTPTR_MAX: u64 = 9223372036854775807; +pub const INTPTR_MIN: i64 = -9223372036854775808; pub const UINTPTR_MAX: i32 = -1; -pub const PTRDIFF_MIN: i64 = -9223372036854775808; -pub const PTRDIFF_MAX: u64 = 9223372036854775807; +pub const SIZE_MAX: i32 = -1; +pub const RSIZE_MAX: i32 = -1; +pub const WINT_MIN: i32 = -2147483648; +pub const WINT_MAX: u32 = 2147483647; pub const SIG_ATOMIC_MIN: i32 = -2147483648; pub const SIG_ATOMIC_MAX: u32 = 2147483647; -pub const SIZE_MAX: i32 = -1; -pub const WINT_MIN: u32 = 0; -pub const WINT_MAX: u32 = 4294967295; -pub const _STDIO_H: u32 = 1; -pub const __GNUC_VA_LIST: u32 = 1; -pub const _____fpos_t_defined: u32 = 1; -pub const ____mbstate_t_defined: u32 = 1; -pub const _____fpos64_t_defined: u32 = 1; -pub const ____FILE_defined: u32 = 1; -pub const __FILE_defined: u32 = 1; -pub const __struct_FILE_defined: u32 = 1; -pub const _IO_EOF_SEEN: u32 = 16; -pub const _IO_ERR_SEEN: u32 = 32; -pub const _IO_USER_LOCK: u32 = 32768; +pub const __API_TO_BE_DEPRECATED: u32 = 100000; +pub const __MAC_10_0: u32 = 1000; +pub const __MAC_10_1: u32 = 1010; +pub const __MAC_10_2: u32 = 1020; +pub const __MAC_10_3: u32 = 1030; +pub const __MAC_10_4: u32 = 1040; +pub const __MAC_10_5: u32 = 1050; +pub const __MAC_10_6: u32 = 1060; +pub const __MAC_10_7: u32 = 1070; +pub const __MAC_10_8: u32 = 1080; +pub const __MAC_10_9: u32 = 1090; +pub const __MAC_10_10: u32 = 101000; +pub const __MAC_10_10_2: u32 = 101002; +pub const __MAC_10_10_3: u32 = 101003; +pub const __MAC_10_11: u32 = 101100; +pub const __MAC_10_11_2: u32 = 101102; +pub const __MAC_10_11_3: u32 = 101103; +pub const __MAC_10_11_4: u32 = 101104; +pub const __MAC_10_12: u32 = 101200; +pub const __MAC_10_12_1: u32 = 101201; +pub const __MAC_10_12_2: u32 = 101202; +pub const __MAC_10_12_4: u32 = 101204; +pub const __MAC_10_13: u32 = 101300; +pub const __MAC_10_13_1: u32 = 101301; +pub const __MAC_10_13_2: u32 = 101302; +pub const __MAC_10_13_4: u32 = 101304; +pub const __MAC_10_14: u32 = 101400; +pub const __MAC_10_14_1: u32 = 101401; +pub const __MAC_10_14_4: u32 = 101404; +pub const __MAC_10_14_6: u32 = 101406; +pub const __MAC_10_15: u32 = 101500; +pub const __MAC_10_15_1: u32 = 101501; +pub const __MAC_10_15_4: u32 = 101504; +pub const __MAC_10_16: u32 = 101600; +pub const __MAC_11_0: u32 = 110000; +pub const __MAC_11_1: u32 = 110100; +pub const __IPHONE_2_0: u32 = 20000; +pub const __IPHONE_2_1: u32 = 20100; +pub const __IPHONE_2_2: u32 = 20200; +pub const __IPHONE_3_0: u32 = 30000; +pub const __IPHONE_3_1: u32 = 30100; +pub const __IPHONE_3_2: u32 = 30200; +pub const __IPHONE_4_0: u32 = 40000; +pub const __IPHONE_4_1: u32 = 40100; +pub const __IPHONE_4_2: u32 = 40200; +pub const __IPHONE_4_3: u32 = 40300; +pub const __IPHONE_5_0: u32 = 50000; +pub const __IPHONE_5_1: u32 = 50100; +pub const __IPHONE_6_0: u32 = 60000; +pub const __IPHONE_6_1: u32 = 60100; +pub const __IPHONE_7_0: u32 = 70000; +pub const __IPHONE_7_1: u32 = 70100; +pub const __IPHONE_8_0: u32 = 80000; +pub const __IPHONE_8_1: u32 = 80100; +pub const __IPHONE_8_2: u32 = 80200; +pub const __IPHONE_8_3: u32 = 80300; +pub const __IPHONE_8_4: u32 = 80400; +pub const __IPHONE_9_0: u32 = 90000; +pub const __IPHONE_9_1: u32 = 90100; +pub const __IPHONE_9_2: u32 = 90200; +pub const __IPHONE_9_3: u32 = 90300; +pub const __IPHONE_10_0: u32 = 100000; +pub const __IPHONE_10_1: u32 = 100100; +pub const __IPHONE_10_2: u32 = 100200; +pub const __IPHONE_10_3: u32 = 100300; +pub const __IPHONE_11_0: u32 = 110000; +pub const __IPHONE_11_1: u32 = 110100; +pub const __IPHONE_11_2: u32 = 110200; +pub const __IPHONE_11_3: u32 = 110300; +pub const __IPHONE_11_4: u32 = 110400; +pub const __IPHONE_12_0: u32 = 120000; +pub const __IPHONE_12_1: u32 = 120100; +pub const __IPHONE_12_2: u32 = 120200; +pub const __IPHONE_12_3: u32 = 120300; +pub const __IPHONE_12_4: u32 = 120400; +pub const __IPHONE_13_0: u32 = 130000; +pub const __IPHONE_13_1: u32 = 130100; +pub const __IPHONE_13_2: u32 = 130200; +pub const __IPHONE_13_3: u32 = 130300; +pub const __IPHONE_13_4: u32 = 130400; +pub const __IPHONE_13_5: u32 = 130500; +pub const __IPHONE_13_6: u32 = 130600; +pub const __IPHONE_13_7: u32 = 130700; +pub const __IPHONE_14_0: u32 = 140000; +pub const __IPHONE_14_1: u32 = 140100; +pub const __IPHONE_14_2: u32 = 140200; +pub const __IPHONE_14_3: u32 = 140300; +pub const __TVOS_9_0: u32 = 90000; +pub const __TVOS_9_1: u32 = 90100; +pub const __TVOS_9_2: u32 = 90200; +pub const __TVOS_10_0: u32 = 100000; +pub const __TVOS_10_0_1: u32 = 100001; +pub const __TVOS_10_1: u32 = 100100; +pub const __TVOS_10_2: u32 = 100200; +pub const __TVOS_11_0: u32 = 110000; +pub const __TVOS_11_1: u32 = 110100; +pub const __TVOS_11_2: u32 = 110200; +pub const __TVOS_11_3: u32 = 110300; +pub const __TVOS_11_4: u32 = 110400; +pub const __TVOS_12_0: u32 = 120000; +pub const __TVOS_12_1: u32 = 120100; +pub const __TVOS_12_2: u32 = 120200; +pub const __TVOS_12_3: u32 = 120300; +pub const __TVOS_12_4: u32 = 120400; +pub const __TVOS_13_0: u32 = 130000; +pub const __TVOS_13_2: u32 = 130200; +pub const __TVOS_13_3: u32 = 130300; +pub const __TVOS_13_4: u32 = 130400; +pub const __TVOS_14_0: u32 = 140000; +pub const __TVOS_14_1: u32 = 140100; +pub const __TVOS_14_2: u32 = 140200; +pub const __TVOS_14_3: u32 = 140300; +pub const __WATCHOS_1_0: u32 = 10000; +pub const __WATCHOS_2_0: u32 = 20000; +pub const __WATCHOS_2_1: u32 = 20100; +pub const __WATCHOS_2_2: u32 = 20200; +pub const __WATCHOS_3_0: u32 = 30000; +pub const __WATCHOS_3_1: u32 = 30100; +pub const __WATCHOS_3_1_1: u32 = 30101; +pub const __WATCHOS_3_2: u32 = 30200; +pub const __WATCHOS_4_0: u32 = 40000; +pub const __WATCHOS_4_1: u32 = 40100; +pub const __WATCHOS_4_2: u32 = 40200; +pub const __WATCHOS_4_3: u32 = 40300; +pub const __WATCHOS_5_0: u32 = 50000; +pub const __WATCHOS_5_1: u32 = 50100; +pub const __WATCHOS_5_2: u32 = 50200; +pub const __WATCHOS_5_3: u32 = 50300; +pub const __WATCHOS_6_0: u32 = 60000; +pub const __WATCHOS_6_1: u32 = 60100; +pub const __WATCHOS_6_2: u32 = 60200; +pub const __WATCHOS_7_0: u32 = 70000; +pub const __WATCHOS_7_1: u32 = 70100; +pub const __WATCHOS_7_2: u32 = 70200; +pub const MAC_OS_X_VERSION_10_0: u32 = 1000; +pub const MAC_OS_X_VERSION_10_1: u32 = 1010; +pub const MAC_OS_X_VERSION_10_2: u32 = 1020; +pub const MAC_OS_X_VERSION_10_3: u32 = 1030; +pub const MAC_OS_X_VERSION_10_4: u32 = 1040; +pub const MAC_OS_X_VERSION_10_5: u32 = 1050; +pub const MAC_OS_X_VERSION_10_6: u32 = 1060; +pub const MAC_OS_X_VERSION_10_7: u32 = 1070; +pub const MAC_OS_X_VERSION_10_8: u32 = 1080; +pub const MAC_OS_X_VERSION_10_9: u32 = 1090; +pub const MAC_OS_X_VERSION_10_10: u32 = 101000; +pub const MAC_OS_X_VERSION_10_10_2: u32 = 101002; +pub const MAC_OS_X_VERSION_10_10_3: u32 = 101003; +pub const MAC_OS_X_VERSION_10_11: u32 = 101100; +pub const MAC_OS_X_VERSION_10_11_2: u32 = 101102; +pub const MAC_OS_X_VERSION_10_11_3: u32 = 101103; +pub const MAC_OS_X_VERSION_10_11_4: u32 = 101104; +pub const MAC_OS_X_VERSION_10_12: u32 = 101200; +pub const MAC_OS_X_VERSION_10_12_1: u32 = 101201; +pub const MAC_OS_X_VERSION_10_12_2: u32 = 101202; +pub const MAC_OS_X_VERSION_10_12_4: u32 = 101204; +pub const MAC_OS_X_VERSION_10_13: u32 = 101300; +pub const MAC_OS_X_VERSION_10_13_1: u32 = 101301; +pub const MAC_OS_X_VERSION_10_13_2: u32 = 101302; +pub const MAC_OS_X_VERSION_10_13_4: u32 = 101304; +pub const MAC_OS_X_VERSION_10_14: u32 = 101400; +pub const MAC_OS_X_VERSION_10_14_1: u32 = 101401; +pub const MAC_OS_X_VERSION_10_14_4: u32 = 101404; +pub const MAC_OS_X_VERSION_10_14_6: u32 = 101406; +pub const MAC_OS_X_VERSION_10_15: u32 = 101500; +pub const MAC_OS_X_VERSION_10_15_1: u32 = 101501; +pub const MAC_OS_X_VERSION_10_16: u32 = 101600; +pub const MAC_OS_VERSION_11_0: u32 = 110000; +pub const __DRIVERKIT_19_0: u32 = 190000; +pub const __DRIVERKIT_20_0: u32 = 200000; +pub const __MAC_OS_X_VERSION_MAX_ALLOWED: u32 = 110100; +pub const __ENABLE_LEGACY_MAC_AVAILABILITY: u32 = 1; +pub const __DARWIN_WCHAR_MIN: i32 = -2147483648; +pub const _FORTIFY_SOURCE: u32 = 2; +pub const RENAME_SECLUDE: u32 = 1; +pub const RENAME_SWAP: u32 = 2; +pub const RENAME_EXCL: u32 = 4; +pub const __SLBF: u32 = 1; +pub const __SNBF: u32 = 2; +pub const __SRD: u32 = 4; +pub const __SWR: u32 = 8; +pub const __SRW: u32 = 16; +pub const __SEOF: u32 = 32; +pub const __SERR: u32 = 64; +pub const __SMBF: u32 = 128; +pub const __SAPP: u32 = 256; +pub const __SSTR: u32 = 512; +pub const __SOPT: u32 = 1024; +pub const __SNPT: u32 = 2048; +pub const __SOFF: u32 = 4096; +pub const __SMOD: u32 = 8192; +pub const __SALC: u32 = 16384; +pub const __SIGN: u32 = 32768; pub const _IOFBF: u32 = 0; pub const _IOLBF: u32 = 1; pub const _IONBF: u32 = 2; -pub const BUFSIZ: u32 = 8192; +pub const BUFSIZ: u32 = 1024; pub const EOF: i32 = -1; +pub const FOPEN_MAX: u32 = 20; +pub const FILENAME_MAX: u32 = 1024; +#[allow(unsafe_code)] +pub const P_tmpdir: &::std::ffi::CStr = unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"/var/tmp/\0") }; +pub const L_tmpnam: u32 = 1024; +pub const TMP_MAX: u32 = 308915776; pub const SEEK_SET: u32 = 0; pub const SEEK_CUR: u32 = 1; pub const SEEK_END: u32 = 2; -#[allow(unsafe_code)] -pub const P_tmpdir: &::std::ffi::CStr = unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"/tmp\0") }; -pub const _BITS_STDIO_LIM_H: u32 = 1; -pub const L_tmpnam: u32 = 20; -pub const TMP_MAX: u32 = 238328; -pub const FILENAME_MAX: u32 = 4096; -pub const L_ctermid: u32 = 9; -pub const FOPEN_MAX: u32 = 16; -pub const _SYS_TYPES_H: u32 = 1; -pub const __clock_t_defined: u32 = 1; -pub const __clockid_t_defined: u32 = 1; -pub const __time_t_defined: u32 = 1; -pub const __timer_t_defined: u32 = 1; -pub const __BIT_TYPES_DEFINED__: u32 = 1; -pub const _ENDIAN_H: u32 = 1; -pub const _BITS_ENDIAN_H: u32 = 1; -pub const __LITTLE_ENDIAN: u32 = 1234; -pub const __BIG_ENDIAN: u32 = 4321; -pub const __PDP_ENDIAN: u32 = 3412; -pub const _BITS_ENDIANNESS_H: u32 = 1; -pub const __BYTE_ORDER: u32 = 1234; -pub const __FLOAT_WORD_ORDER: u32 = 1234; +pub const L_ctermid: u32 = 1024; +pub const _USE_FORTIFY_LEVEL: u32 = 2; +pub const _QUAD_HIGHWORD: u32 = 1; +pub const _QUAD_LOWWORD: u32 = 0; +pub const __DARWIN_LITTLE_ENDIAN: u32 = 1234; +pub const __DARWIN_BIG_ENDIAN: u32 = 4321; +pub const __DARWIN_PDP_ENDIAN: u32 = 3412; +pub const __DARWIN_BYTE_ORDER: u32 = 1234; pub const LITTLE_ENDIAN: u32 = 1234; pub const BIG_ENDIAN: u32 = 4321; pub const PDP_ENDIAN: u32 = 3412; pub const BYTE_ORDER: u32 = 1234; -pub const _BITS_BYTESWAP_H: u32 = 1; -pub const _BITS_UINTN_IDENTITY_H: u32 = 1; -pub const _SYS_SELECT_H: u32 = 1; -#[allow(unsafe_code)] -pub const __FD_ZERO_STOS: &::std::ffi::CStr = unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"stosq\0") }; -pub const __sigset_t_defined: u32 = 1; -pub const __timeval_defined: u32 = 1; -pub const _STRUCT_TIMESPEC: u32 = 1; +pub const __DARWIN_FD_SETSIZE: u32 = 1024; +pub const __DARWIN_NBBY: u32 = 8; +pub const NBBY: u32 = 8; pub const FD_SETSIZE: u32 = 1024; -pub const _BITS_PTHREADTYPES_COMMON_H: u32 = 1; -pub const _THREAD_SHARED_TYPES_H: u32 = 1; -pub const _BITS_PTHREADTYPES_ARCH_H: u32 = 1; -pub const __SIZEOF_PTHREAD_MUTEX_T: u32 = 40; -pub const __SIZEOF_PTHREAD_ATTR_T: u32 = 56; -pub const __SIZEOF_PTHREAD_RWLOCK_T: u32 = 56; -pub const __SIZEOF_PTHREAD_BARRIER_T: u32 = 32; -pub const __SIZEOF_PTHREAD_MUTEXATTR_T: u32 = 4; -pub const __SIZEOF_PTHREAD_COND_T: u32 = 48; -pub const __SIZEOF_PTHREAD_CONDATTR_T: u32 = 4; -pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: u32 = 8; -pub const __SIZEOF_PTHREAD_BARRIERATTR_T: u32 = 4; -pub const _THREAD_MUTEX_INTERNAL_H: u32 = 1; -pub const __PTHREAD_MUTEX_HAVE_PREV: u32 = 1; -pub const __have_pthread_attr_t: u32 = 1; #[allow(unsafe_code)] pub const MM_VERSION: &::std::ffi::CStr = unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"2.26-r1175\0") }; pub const MM_F_NO_DIAG: u32 = 1; @@ -326,127 +463,339 @@ pub const MM_CIGAR_EQ_MATCH: u32 = 7; pub const MM_CIGAR_X_MISMATCH: u32 = 8; #[allow(unsafe_code)] pub const MM_CIGAR_STR: &::std::ffi::CStr = unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"MIDNSHP=XB\0") }; -pub const _STRING_H: u32 = 1; -pub const _BITS_TYPES_LOCALE_T_H: u32 = 1; -pub const _BITS_TYPES___LOCALE_T_H: u32 = 1; -pub const _STRINGS_H: u32 = 1; -pub const _STDLIB_H: u32 = 1; +pub const __HAS_FIXED_CHK_PROTOTYPES: u32 = 1; +pub const __DARWIN_NSIG: u32 = 32; +pub const NSIG: u32 = 32; +pub const _ARM_SIGNAL_: u32 = 1; +pub const SIGHUP: u32 = 1; +pub const SIGINT: u32 = 2; +pub const SIGQUIT: u32 = 3; +pub const SIGILL: u32 = 4; +pub const SIGTRAP: u32 = 5; +pub const SIGABRT: u32 = 6; +pub const SIGIOT: u32 = 6; +pub const SIGEMT: u32 = 7; +pub const SIGFPE: u32 = 8; +pub const SIGKILL: u32 = 9; +pub const SIGBUS: u32 = 10; +pub const SIGSEGV: u32 = 11; +pub const SIGSYS: u32 = 12; +pub const SIGPIPE: u32 = 13; +pub const SIGALRM: u32 = 14; +pub const SIGTERM: u32 = 15; +pub const SIGURG: u32 = 16; +pub const SIGSTOP: u32 = 17; +pub const SIGTSTP: u32 = 18; +pub const SIGCONT: u32 = 19; +pub const SIGCHLD: u32 = 20; +pub const SIGTTIN: u32 = 21; +pub const SIGTTOU: u32 = 22; +pub const SIGIO: u32 = 23; +pub const SIGXCPU: u32 = 24; +pub const SIGXFSZ: u32 = 25; +pub const SIGVTALRM: u32 = 26; +pub const SIGPROF: u32 = 27; +pub const SIGWINCH: u32 = 28; +pub const SIGINFO: u32 = 29; +pub const SIGUSR1: u32 = 30; +pub const SIGUSR2: u32 = 31; +pub const __DARWIN_OPAQUE_ARM_THREAD_STATE64: u32 = 0; +pub const SIGEV_NONE: u32 = 0; +pub const SIGEV_SIGNAL: u32 = 1; +pub const SIGEV_THREAD: u32 = 3; +pub const ILL_NOOP: u32 = 0; +pub const ILL_ILLOPC: u32 = 1; +pub const ILL_ILLTRP: u32 = 2; +pub const ILL_PRVOPC: u32 = 3; +pub const ILL_ILLOPN: u32 = 4; +pub const ILL_ILLADR: u32 = 5; +pub const ILL_PRVREG: u32 = 6; +pub const ILL_COPROC: u32 = 7; +pub const ILL_BADSTK: u32 = 8; +pub const FPE_NOOP: u32 = 0; +pub const FPE_FLTDIV: u32 = 1; +pub const FPE_FLTOVF: u32 = 2; +pub const FPE_FLTUND: u32 = 3; +pub const FPE_FLTRES: u32 = 4; +pub const FPE_FLTINV: u32 = 5; +pub const FPE_FLTSUB: u32 = 6; +pub const FPE_INTDIV: u32 = 7; +pub const FPE_INTOVF: u32 = 8; +pub const SEGV_NOOP: u32 = 0; +pub const SEGV_MAPERR: u32 = 1; +pub const SEGV_ACCERR: u32 = 2; +pub const BUS_NOOP: u32 = 0; +pub const BUS_ADRALN: u32 = 1; +pub const BUS_ADRERR: u32 = 2; +pub const BUS_OBJERR: u32 = 3; +pub const TRAP_BRKPT: u32 = 1; +pub const TRAP_TRACE: u32 = 2; +pub const CLD_NOOP: u32 = 0; +pub const CLD_EXITED: u32 = 1; +pub const CLD_KILLED: u32 = 2; +pub const CLD_DUMPED: u32 = 3; +pub const CLD_TRAPPED: u32 = 4; +pub const CLD_STOPPED: u32 = 5; +pub const CLD_CONTINUED: u32 = 6; +pub const POLL_IN: u32 = 1; +pub const POLL_OUT: u32 = 2; +pub const POLL_MSG: u32 = 3; +pub const POLL_ERR: u32 = 4; +pub const POLL_PRI: u32 = 5; +pub const POLL_HUP: u32 = 6; +pub const SA_ONSTACK: u32 = 1; +pub const SA_RESTART: u32 = 2; +pub const SA_RESETHAND: u32 = 4; +pub const SA_NOCLDSTOP: u32 = 8; +pub const SA_NODEFER: u32 = 16; +pub const SA_NOCLDWAIT: u32 = 32; +pub const SA_SIGINFO: u32 = 64; +pub const SA_USERTRAMP: u32 = 256; +pub const SA_64REGSET: u32 = 512; +pub const SA_USERSPACE_MASK: u32 = 127; +pub const SIG_BLOCK: u32 = 1; +pub const SIG_UNBLOCK: u32 = 2; +pub const SIG_SETMASK: u32 = 3; +pub const SI_USER: u32 = 65537; +pub const SI_QUEUE: u32 = 65538; +pub const SI_TIMER: u32 = 65539; +pub const SI_ASYNCIO: u32 = 65540; +pub const SI_MESGQ: u32 = 65541; +pub const SS_ONSTACK: u32 = 1; +pub const SS_DISABLE: u32 = 4; +pub const MINSIGSTKSZ: u32 = 32768; +pub const SIGSTKSZ: u32 = 131072; +pub const SV_ONSTACK: u32 = 1; +pub const SV_INTERRUPT: u32 = 2; +pub const SV_RESETHAND: u32 = 4; +pub const SV_NODEFER: u32 = 16; +pub const SV_NOCLDSTOP: u32 = 8; +pub const SV_SIGINFO: u32 = 64; +pub const PRIO_PROCESS: u32 = 0; +pub const PRIO_PGRP: u32 = 1; +pub const PRIO_USER: u32 = 2; +pub const PRIO_DARWIN_THREAD: u32 = 3; +pub const PRIO_DARWIN_PROCESS: u32 = 4; +pub const PRIO_MIN: i32 = -20; +pub const PRIO_MAX: u32 = 20; +pub const PRIO_DARWIN_BG: u32 = 4096; +pub const PRIO_DARWIN_NONUI: u32 = 4097; +pub const RUSAGE_SELF: u32 = 0; +pub const RUSAGE_CHILDREN: i32 = -1; +pub const RUSAGE_INFO_V0: u32 = 0; +pub const RUSAGE_INFO_V1: u32 = 1; +pub const RUSAGE_INFO_V2: u32 = 2; +pub const RUSAGE_INFO_V3: u32 = 3; +pub const RUSAGE_INFO_V4: u32 = 4; +pub const RUSAGE_INFO_V5: u32 = 5; +pub const RUSAGE_INFO_CURRENT: u32 = 5; +pub const RU_PROC_RUNS_RESLIDE: u32 = 1; +pub const RLIMIT_CPU: u32 = 0; +pub const RLIMIT_FSIZE: u32 = 1; +pub const RLIMIT_DATA: u32 = 2; +pub const RLIMIT_STACK: u32 = 3; +pub const RLIMIT_CORE: u32 = 4; +pub const RLIMIT_AS: u32 = 5; +pub const RLIMIT_RSS: u32 = 5; +pub const RLIMIT_MEMLOCK: u32 = 6; +pub const RLIMIT_NPROC: u32 = 7; +pub const RLIMIT_NOFILE: u32 = 8; +pub const RLIM_NLIMITS: u32 = 9; +pub const _RLIMIT_POSIX_FLAG: u32 = 4096; +pub const RLIMIT_WAKEUPS_MONITOR: u32 = 1; +pub const RLIMIT_CPU_USAGE_MONITOR: u32 = 2; +pub const RLIMIT_THREAD_CPULIMITS: u32 = 3; +pub const RLIMIT_FOOTPRINT_INTERVAL: u32 = 4; +pub const WAKEMON_ENABLE: u32 = 1; +pub const WAKEMON_DISABLE: u32 = 2; +pub const WAKEMON_GET_PARAMS: u32 = 4; +pub const WAKEMON_SET_DEFAULTS: u32 = 8; +pub const WAKEMON_MAKE_FATAL: u32 = 16; +pub const CPUMON_MAKE_FATAL: u32 = 4096; +pub const FOOTPRINT_INTERVAL_RESET: u32 = 1; +pub const IOPOL_TYPE_DISK: u32 = 0; +pub const IOPOL_TYPE_VFS_ATIME_UPDATES: u32 = 2; +pub const IOPOL_TYPE_VFS_MATERIALIZE_DATALESS_FILES: u32 = 3; +pub const IOPOL_TYPE_VFS_STATFS_NO_DATA_VOLUME: u32 = 4; +pub const IOPOL_TYPE_VFS_TRIGGER_RESOLVE: u32 = 5; +pub const IOPOL_TYPE_VFS_IGNORE_CONTENT_PROTECTION: u32 = 6; +pub const IOPOL_SCOPE_PROCESS: u32 = 0; +pub const IOPOL_SCOPE_THREAD: u32 = 1; +pub const IOPOL_SCOPE_DARWIN_BG: u32 = 2; +pub const IOPOL_DEFAULT: u32 = 0; +pub const IOPOL_IMPORTANT: u32 = 1; +pub const IOPOL_PASSIVE: u32 = 2; +pub const IOPOL_THROTTLE: u32 = 3; +pub const IOPOL_UTILITY: u32 = 4; +pub const IOPOL_STANDARD: u32 = 5; +pub const IOPOL_APPLICATION: u32 = 5; +pub const IOPOL_NORMAL: u32 = 1; +pub const IOPOL_ATIME_UPDATES_DEFAULT: u32 = 0; +pub const IOPOL_ATIME_UPDATES_OFF: u32 = 1; +pub const IOPOL_MATERIALIZE_DATALESS_FILES_DEFAULT: u32 = 0; +pub const IOPOL_MATERIALIZE_DATALESS_FILES_OFF: u32 = 1; +pub const IOPOL_MATERIALIZE_DATALESS_FILES_ON: u32 = 2; +pub const IOPOL_VFS_STATFS_NO_DATA_VOLUME_DEFAULT: u32 = 0; +pub const IOPOL_VFS_STATFS_FORCE_NO_DATA_VOLUME: u32 = 1; +pub const IOPOL_VFS_TRIGGER_RESOLVE_DEFAULT: u32 = 0; +pub const IOPOL_VFS_TRIGGER_RESOLVE_OFF: u32 = 1; +pub const IOPOL_VFS_CONTENT_PROTECTION_DEFAULT: u32 = 0; +pub const IOPOL_VFS_CONTENT_PROTECTION_IGNORE: u32 = 1; pub const WNOHANG: u32 = 1; pub const WUNTRACED: u32 = 2; -pub const WSTOPPED: u32 = 2; +pub const WCOREFLAG: u32 = 128; +pub const _WSTOPPED: u32 = 127; pub const WEXITED: u32 = 4; -pub const WCONTINUED: u32 = 8; -pub const WNOWAIT: u32 = 16777216; -pub const __WNOTHREAD: u32 = 536870912; -pub const __WALL: u32 = 1073741824; -pub const __WCLONE: u32 = 2147483648; -pub const __ENUM_IDTYPE_T: u32 = 1; -pub const __W_CONTINUED: u32 = 65535; -pub const __WCOREFLAG: u32 = 128; -pub const __HAVE_FLOAT128: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT128: u32 = 0; -pub const __HAVE_FLOAT64X: u32 = 1; -pub const __HAVE_FLOAT64X_LONG_DOUBLE: u32 = 1; -pub const __HAVE_FLOAT16: u32 = 0; -pub const __HAVE_FLOAT32: u32 = 1; -pub const __HAVE_FLOAT64: u32 = 1; -pub const __HAVE_FLOAT32X: u32 = 1; -pub const __HAVE_FLOAT128X: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT16: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT32: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT64: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT32X: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT64X: u32 = 0; -pub const __HAVE_DISTINCT_FLOAT128X: u32 = 0; -pub const __HAVE_FLOATN_NOT_TYPEDEF: u32 = 0; -pub const __ldiv_t_defined: u32 = 1; -pub const __lldiv_t_defined: u32 = 1; -pub const RAND_MAX: u32 = 2147483647; +pub const WSTOPPED: u32 = 8; +pub const WCONTINUED: u32 = 16; +pub const WNOWAIT: u32 = 32; +pub const WAIT_ANY: i32 = -1; +pub const WAIT_MYPGRP: u32 = 0; pub const EXIT_FAILURE: u32 = 1; pub const EXIT_SUCCESS: u32 = 0; -pub const _ALLOCA_H: u32 = 1; +pub const RAND_MAX: u32 = 2147483647; #[allow(unsafe_code)] pub const AC_VERSION_KHASH_H: &::std::ffi::CStr = unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"0.2.8\0") }; -pub const _LIBC_LIMITS_H_: u32 = 1; -pub const MB_LEN_MAX: u32 = 16; -pub const _BITS_POSIX1_LIM_H: u32 = 1; -pub const _POSIX_AIO_LISTIO_MAX: u32 = 2; -pub const _POSIX_AIO_MAX: u32 = 1; +pub const __DARWIN_CLK_TCK: u32 = 100; +pub const CHAR_BIT: u32 = 8; +pub const MB_LEN_MAX: u32 = 6; +pub const CLK_TCK: u32 = 100; +pub const SCHAR_MAX: u32 = 127; +pub const SCHAR_MIN: i32 = -128; +pub const UCHAR_MAX: u32 = 255; +pub const CHAR_MAX: u32 = 127; +pub const CHAR_MIN: i32 = -128; +pub const USHRT_MAX: u32 = 65535; +pub const SHRT_MAX: u32 = 32767; +pub const SHRT_MIN: i32 = -32768; +pub const UINT_MAX: u32 = 4294967295; +pub const INT_MAX: u32 = 2147483647; +pub const INT_MIN: i32 = -2147483648; +pub const ULONG_MAX: i32 = -1; +pub const LONG_MAX: u64 = 9223372036854775807; +pub const LONG_MIN: i64 = -9223372036854775808; +pub const ULLONG_MAX: i32 = -1; +pub const LLONG_MAX: u64 = 9223372036854775807; +pub const LLONG_MIN: i64 = -9223372036854775808; +pub const LONG_BIT: u32 = 64; +pub const SSIZE_MAX: u64 = 9223372036854775807; +pub const WORD_BIT: u32 = 32; +pub const SIZE_T_MAX: i32 = -1; +pub const UQUAD_MAX: i32 = -1; +pub const QUAD_MAX: u64 = 9223372036854775807; +pub const QUAD_MIN: i64 = -9223372036854775808; +pub const ARG_MAX: u32 = 1048576; +pub const CHILD_MAX: u32 = 266; +pub const GID_MAX: u32 = 2147483647; +pub const LINK_MAX: u32 = 32767; +pub const MAX_CANON: u32 = 1024; +pub const MAX_INPUT: u32 = 1024; +pub const NAME_MAX: u32 = 255; +pub const NGROUPS_MAX: u32 = 16; +pub const UID_MAX: u32 = 2147483647; +pub const OPEN_MAX: u32 = 10240; +pub const PATH_MAX: u32 = 1024; +pub const PIPE_BUF: u32 = 512; +pub const BC_BASE_MAX: u32 = 99; +pub const BC_DIM_MAX: u32 = 2048; +pub const BC_SCALE_MAX: u32 = 99; +pub const BC_STRING_MAX: u32 = 1000; +pub const CHARCLASS_NAME_MAX: u32 = 14; +pub const COLL_WEIGHTS_MAX: u32 = 2; +pub const EQUIV_CLASS_MAX: u32 = 2; +pub const EXPR_NEST_MAX: u32 = 32; +pub const LINE_MAX: u32 = 2048; +pub const RE_DUP_MAX: u32 = 255; +pub const NZERO: u32 = 20; pub const _POSIX_ARG_MAX: u32 = 4096; pub const _POSIX_CHILD_MAX: u32 = 25; -pub const _POSIX_DELAYTIMER_MAX: u32 = 32; -pub const _POSIX_HOST_NAME_MAX: u32 = 255; pub const _POSIX_LINK_MAX: u32 = 8; -pub const _POSIX_LOGIN_NAME_MAX: u32 = 9; pub const _POSIX_MAX_CANON: u32 = 255; pub const _POSIX_MAX_INPUT: u32 = 255; -pub const _POSIX_MQ_OPEN_MAX: u32 = 8; -pub const _POSIX_MQ_PRIO_MAX: u32 = 32; pub const _POSIX_NAME_MAX: u32 = 14; pub const _POSIX_NGROUPS_MAX: u32 = 8; pub const _POSIX_OPEN_MAX: u32 = 20; pub const _POSIX_PATH_MAX: u32 = 256; pub const _POSIX_PIPE_BUF: u32 = 512; -pub const _POSIX_RE_DUP_MAX: u32 = 255; -pub const _POSIX_RTSIG_MAX: u32 = 8; -pub const _POSIX_SEM_NSEMS_MAX: u32 = 256; -pub const _POSIX_SEM_VALUE_MAX: u32 = 32767; -pub const _POSIX_SIGQUEUE_MAX: u32 = 32; pub const _POSIX_SSIZE_MAX: u32 = 32767; pub const _POSIX_STREAM_MAX: u32 = 8; -pub const _POSIX_SYMLINK_MAX: u32 = 255; -pub const _POSIX_SYMLOOP_MAX: u32 = 8; -pub const _POSIX_TIMER_MAX: u32 = 32; -pub const _POSIX_TTY_NAME_MAX: u32 = 9; pub const _POSIX_TZNAME_MAX: u32 = 6; -pub const _POSIX_CLOCKRES_MIN: u32 = 20000000; -pub const NR_OPEN: u32 = 1024; -pub const NGROUPS_MAX: u32 = 65536; -pub const ARG_MAX: u32 = 131072; -pub const LINK_MAX: u32 = 127; -pub const MAX_CANON: u32 = 255; -pub const MAX_INPUT: u32 = 255; -pub const NAME_MAX: u32 = 255; -pub const PATH_MAX: u32 = 4096; -pub const PIPE_BUF: u32 = 4096; -pub const XATTR_NAME_MAX: u32 = 255; -pub const XATTR_SIZE_MAX: u32 = 65536; -pub const XATTR_LIST_MAX: u32 = 65536; -pub const RTSIG_MAX: u32 = 32; -pub const _POSIX_THREAD_KEYS_MAX: u32 = 128; -pub const PTHREAD_KEYS_MAX: u32 = 1024; -pub const _POSIX_THREAD_DESTRUCTOR_ITERATIONS: u32 = 4; -pub const PTHREAD_DESTRUCTOR_ITERATIONS: u32 = 4; -pub const _POSIX_THREAD_THREADS_MAX: u32 = 64; -pub const AIO_PRIO_DELTA_MAX: u32 = 20; -pub const PTHREAD_STACK_MIN: u32 = 16384; -pub const DELAYTIMER_MAX: u32 = 2147483647; -pub const TTY_NAME_MAX: u32 = 32; -pub const LOGIN_NAME_MAX: u32 = 256; -pub const HOST_NAME_MAX: u32 = 64; -pub const MQ_PRIO_MAX: u32 = 32768; -pub const SEM_VALUE_MAX: u32 = 2147483647; -pub const _BITS_POSIX2_LIM_H: u32 = 1; pub const _POSIX2_BC_BASE_MAX: u32 = 99; pub const _POSIX2_BC_DIM_MAX: u32 = 2048; pub const _POSIX2_BC_SCALE_MAX: u32 = 99; pub const _POSIX2_BC_STRING_MAX: u32 = 1000; -pub const _POSIX2_COLL_WEIGHTS_MAX: u32 = 2; +pub const _POSIX2_EQUIV_CLASS_MAX: u32 = 2; pub const _POSIX2_EXPR_NEST_MAX: u32 = 32; pub const _POSIX2_LINE_MAX: u32 = 2048; pub const _POSIX2_RE_DUP_MAX: u32 = 255; +pub const _POSIX_AIO_LISTIO_MAX: u32 = 2; +pub const _POSIX_AIO_MAX: u32 = 1; +pub const _POSIX_DELAYTIMER_MAX: u32 = 32; +pub const _POSIX_MQ_OPEN_MAX: u32 = 8; +pub const _POSIX_MQ_PRIO_MAX: u32 = 32; +pub const _POSIX_RTSIG_MAX: u32 = 8; +pub const _POSIX_SEM_NSEMS_MAX: u32 = 256; +pub const _POSIX_SEM_VALUE_MAX: u32 = 32767; +pub const _POSIX_SIGQUEUE_MAX: u32 = 32; +pub const _POSIX_TIMER_MAX: u32 = 32; +pub const _POSIX_CLOCKRES_MIN: u32 = 20000000; +pub const _POSIX_THREAD_DESTRUCTOR_ITERATIONS: u32 = 4; +pub const _POSIX_THREAD_KEYS_MAX: u32 = 128; +pub const _POSIX_THREAD_THREADS_MAX: u32 = 64; +pub const PTHREAD_DESTRUCTOR_ITERATIONS: u32 = 4; +pub const PTHREAD_KEYS_MAX: u32 = 512; +pub const PTHREAD_STACK_MIN: u32 = 16384; +pub const _POSIX_HOST_NAME_MAX: u32 = 255; +pub const _POSIX_LOGIN_NAME_MAX: u32 = 9; +pub const _POSIX_SS_REPL_MAX: u32 = 4; +pub const _POSIX_SYMLINK_MAX: u32 = 255; +pub const _POSIX_SYMLOOP_MAX: u32 = 8; +pub const _POSIX_TRACE_EVENT_NAME_MAX: u32 = 30; +pub const _POSIX_TRACE_NAME_MAX: u32 = 8; +pub const _POSIX_TRACE_SYS_MAX: u32 = 8; +pub const _POSIX_TRACE_USER_EVENT_MAX: u32 = 32; +pub const _POSIX_TTY_NAME_MAX: u32 = 9; pub const _POSIX2_CHARCLASS_NAME_MAX: u32 = 14; -pub const BC_BASE_MAX: u32 = 99; -pub const BC_DIM_MAX: u32 = 2048; -pub const BC_SCALE_MAX: u32 = 99; -pub const BC_STRING_MAX: u32 = 1000; -pub const COLL_WEIGHTS_MAX: u32 = 255; -pub const EXPR_NEST_MAX: u32 = 32; -pub const LINE_MAX: u32 = 2048; -pub const CHARCLASS_NAME_MAX: u32 = 2048; -pub const RE_DUP_MAX: u32 = 32767; -pub const _CTYPE_H: u32 = 1; +pub const _POSIX2_COLL_WEIGHTS_MAX: u32 = 2; +pub const _POSIX_RE_DUP_MAX: u32 = 255; +pub const OFF_MIN: i64 = -9223372036854775808; +pub const OFF_MAX: u64 = 9223372036854775807; +pub const PASS_MAX: u32 = 128; +pub const NL_ARGMAX: u32 = 9; +pub const NL_LANGMAX: u32 = 14; +pub const NL_MSGMAX: u32 = 32767; +pub const NL_NMAX: u32 = 1; +pub const NL_SETMAX: u32 = 255; +pub const NL_TEXTMAX: u32 = 2048; +pub const _XOPEN_IOV_MAX: u32 = 16; +pub const IOV_MAX: u32 = 1024; +pub const _XOPEN_NAME_MAX: u32 = 255; +pub const _XOPEN_PATH_MAX: u32 = 1024; +pub const _CACHED_RUNES: u32 = 256; +pub const _CRMASK: i32 = -256; +#[allow(unsafe_code)] +pub const _RUNE_MAGIC_A: &::std::ffi::CStr = unsafe { ::std::ffi::CStr::from_bytes_with_nul_unchecked(b"RuneMagA\0") }; +pub const _CTYPE_A: u32 = 256; +pub const _CTYPE_C: u32 = 512; +pub const _CTYPE_D: u32 = 1024; +pub const _CTYPE_G: u32 = 2048; +pub const _CTYPE_L: u32 = 4096; +pub const _CTYPE_P: u32 = 8192; +pub const _CTYPE_S: u32 = 16384; +pub const _CTYPE_U: u32 = 32768; +pub const _CTYPE_X: u32 = 65536; +pub const _CTYPE_B: u32 = 131072; +pub const _CTYPE_R: u32 = 262144; +pub const _CTYPE_I: u32 = 524288; +pub const _CTYPE_T: u32 = 1048576; +pub const _CTYPE_Q: u32 = 2097152; +pub const _CTYPE_SW0: u32 = 536870912; +pub const _CTYPE_SW1: u32 = 1073741824; +pub const _CTYPE_SW2: u32 = 2147483648; +pub const _CTYPE_SW3: u32 = 3221225472; +pub const _CTYPE_SWM: u32 = 3758096384; +pub const _CTYPE_SWS: u32 = 30; pub const KS_SEP_SPACE: u32 = 0; pub const KS_SEP_TAB: u32 = 1; pub const KS_SEP_LINE: u32 = 2; @@ -467,7 +816,6 @@ pub const KSW_CIGAR_MATCH: u32 = 0; pub const KSW_CIGAR_INS: u32 = 1; pub const KSW_CIGAR_DEL: u32 = 2; pub const KSW_CIGAR_N_SKIP: u32 = 3; -pub const _ASSERT_H: u32 = 1; pub const MM_PARENT_UNSET: i32 = -1; pub const MM_PARENT_TMP_PRI: i32 = -2; pub const MM_DBG_NO_KALLOC: u32 = 1; @@ -487,1046 +835,862 @@ pub const ko_optional_argument: u32 = 2; pub const KRMQ_MAX_DEPTH: u32 = 64; pub const RS_MIN_SIZE: u32 = 64; pub const RS_MAX_BITS: u32 = 8; -pub type __u_char = ::std::os::raw::c_uchar; -pub type __u_short = ::std::os::raw::c_ushort; -pub type __u_int = ::std::os::raw::c_uint; -pub type __u_long = ::std::os::raw::c_ulong; +pub type int_least8_t = i8; +pub type int_least16_t = i16; +pub type int_least32_t = i32; +pub type int_least64_t = i64; +pub type uint_least8_t = u8; +pub type uint_least16_t = u16; +pub type uint_least32_t = u32; +pub type uint_least64_t = u64; +pub type int_fast8_t = i8; +pub type int_fast16_t = i16; +pub type int_fast32_t = i32; +pub type int_fast64_t = i64; +pub type uint_fast8_t = u8; +pub type uint_fast16_t = u16; +pub type uint_fast32_t = u32; +pub type uint_fast64_t = u64; pub type __int8_t = ::std::os::raw::c_schar; pub type __uint8_t = ::std::os::raw::c_uchar; pub type __int16_t = ::std::os::raw::c_short; pub type __uint16_t = ::std::os::raw::c_ushort; pub type __int32_t = ::std::os::raw::c_int; pub type __uint32_t = ::std::os::raw::c_uint; -pub type __int64_t = ::std::os::raw::c_long; -pub type __uint64_t = ::std::os::raw::c_ulong; -pub type __int_least8_t = __int8_t; -pub type __uint_least8_t = __uint8_t; -pub type __int_least16_t = __int16_t; -pub type __uint_least16_t = __uint16_t; -pub type __int_least32_t = __int32_t; -pub type __uint_least32_t = __uint32_t; -pub type __int_least64_t = __int64_t; -pub type __uint_least64_t = __uint64_t; -pub type __quad_t = ::std::os::raw::c_long; -pub type __u_quad_t = ::std::os::raw::c_ulong; -pub type __intmax_t = ::std::os::raw::c_long; -pub type __uintmax_t = ::std::os::raw::c_ulong; -pub type __dev_t = ::std::os::raw::c_ulong; -pub type __uid_t = ::std::os::raw::c_uint; -pub type __gid_t = ::std::os::raw::c_uint; -pub type __ino_t = ::std::os::raw::c_ulong; -pub type __ino64_t = ::std::os::raw::c_ulong; -pub type __mode_t = ::std::os::raw::c_uint; -pub type __nlink_t = ::std::os::raw::c_ulong; -pub type __off_t = ::std::os::raw::c_long; -pub type __off64_t = ::std::os::raw::c_long; -pub type __pid_t = ::std::os::raw::c_int; +pub type __int64_t = ::std::os::raw::c_longlong; +pub type __uint64_t = ::std::os::raw::c_ulonglong; +pub type __darwin_intptr_t = ::std::os::raw::c_long; +pub type __darwin_natural_t = ::std::os::raw::c_uint; +pub type __darwin_ct_rune_t = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Copy, Clone)] +pub union __mbstate_t { + pub __mbstate8: [::std::os::raw::c_char; 128usize], + pub _mbstateL: ::std::os::raw::c_longlong, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __mbstate_t"][::std::mem::size_of::<__mbstate_t>() - 128usize]; + ["Alignment of __mbstate_t"][::std::mem::align_of::<__mbstate_t>() - 8usize]; + ["Offset of field: __mbstate_t::__mbstate8"][::std::mem::offset_of!(__mbstate_t, __mbstate8) - 0usize]; + ["Offset of field: __mbstate_t::_mbstateL"][::std::mem::offset_of!(__mbstate_t, _mbstateL) - 0usize]; +}; +pub type __darwin_mbstate_t = __mbstate_t; +pub type __darwin_ptrdiff_t = ::std::os::raw::c_long; +pub type __darwin_size_t = ::std::os::raw::c_ulong; +pub type __darwin_va_list = __builtin_va_list; +pub type __darwin_wchar_t = ::std::os::raw::c_int; +pub type __darwin_rune_t = __darwin_wchar_t; +pub type __darwin_wint_t = ::std::os::raw::c_int; +pub type __darwin_clock_t = ::std::os::raw::c_ulong; +pub type __darwin_socklen_t = __uint32_t; +pub type __darwin_ssize_t = ::std::os::raw::c_long; +pub type __darwin_time_t = ::std::os::raw::c_long; +pub type __darwin_blkcnt_t = __int64_t; +pub type __darwin_blksize_t = __int32_t; +pub type __darwin_dev_t = __int32_t; +pub type __darwin_fsblkcnt_t = ::std::os::raw::c_uint; +pub type __darwin_fsfilcnt_t = ::std::os::raw::c_uint; +pub type __darwin_gid_t = __uint32_t; +pub type __darwin_id_t = __uint32_t; +pub type __darwin_ino64_t = __uint64_t; +pub type __darwin_ino_t = __darwin_ino64_t; +pub type __darwin_mach_port_name_t = __darwin_natural_t; +pub type __darwin_mach_port_t = __darwin_mach_port_name_t; +pub type __darwin_mode_t = __uint16_t; +pub type __darwin_off_t = __int64_t; +pub type __darwin_pid_t = __int32_t; +pub type __darwin_sigset_t = __uint32_t; +pub type __darwin_suseconds_t = __int32_t; +pub type __darwin_uid_t = __uint32_t; +pub type __darwin_useconds_t = __uint32_t; +pub type __darwin_uuid_t = [::std::os::raw::c_uchar; 16usize]; +pub type __darwin_uuid_string_t = [::std::os::raw::c_char; 37usize]; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct __fsid_t { - pub __val: [::std::os::raw::c_int; 2usize], +pub struct __darwin_pthread_handler_rec { + pub __routine: ::std::option::Option, + pub __arg: *mut ::std::os::raw::c_void, + pub __next: *mut __darwin_pthread_handler_rec, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of __fsid_t"][::std::mem::size_of::<__fsid_t>() - 8usize]; - ["Alignment of __fsid_t"][::std::mem::align_of::<__fsid_t>() - 4usize]; - ["Offset of field: __fsid_t::__val"][::std::mem::offset_of!(__fsid_t, __val) - 0usize]; + ["Size of __darwin_pthread_handler_rec"][::std::mem::size_of::<__darwin_pthread_handler_rec>() - 24usize]; + ["Alignment of __darwin_pthread_handler_rec"][::std::mem::align_of::<__darwin_pthread_handler_rec>() - 8usize]; + ["Offset of field: __darwin_pthread_handler_rec::__routine"] + [::std::mem::offset_of!(__darwin_pthread_handler_rec, __routine) - 0usize]; + ["Offset of field: __darwin_pthread_handler_rec::__arg"] + [::std::mem::offset_of!(__darwin_pthread_handler_rec, __arg) - 8usize]; + ["Offset of field: __darwin_pthread_handler_rec::__next"] + [::std::mem::offset_of!(__darwin_pthread_handler_rec, __next) - 16usize]; }; -pub type __clock_t = ::std::os::raw::c_long; -pub type __rlim_t = ::std::os::raw::c_ulong; -pub type __rlim64_t = ::std::os::raw::c_ulong; -pub type __id_t = ::std::os::raw::c_uint; -pub type __time_t = ::std::os::raw::c_long; -pub type __useconds_t = ::std::os::raw::c_uint; -pub type __suseconds_t = ::std::os::raw::c_long; -pub type __daddr_t = ::std::os::raw::c_int; -pub type __key_t = ::std::os::raw::c_int; -pub type __clockid_t = ::std::os::raw::c_int; -pub type __timer_t = *mut ::std::os::raw::c_void; -pub type __blksize_t = ::std::os::raw::c_long; -pub type __blkcnt_t = ::std::os::raw::c_long; -pub type __blkcnt64_t = ::std::os::raw::c_long; -pub type __fsblkcnt_t = ::std::os::raw::c_ulong; -pub type __fsblkcnt64_t = ::std::os::raw::c_ulong; -pub type __fsfilcnt_t = ::std::os::raw::c_ulong; -pub type __fsfilcnt64_t = ::std::os::raw::c_ulong; -pub type __fsword_t = ::std::os::raw::c_long; -pub type __ssize_t = ::std::os::raw::c_long; -pub type __syscall_slong_t = ::std::os::raw::c_long; -pub type __syscall_ulong_t = ::std::os::raw::c_ulong; -pub type __loff_t = __off64_t; -pub type __caddr_t = *mut ::std::os::raw::c_char; -pub type __intptr_t = ::std::os::raw::c_long; -pub type __socklen_t = ::std::os::raw::c_uint; -pub type __sig_atomic_t = ::std::os::raw::c_int; -pub type int_least8_t = __int_least8_t; -pub type int_least16_t = __int_least16_t; -pub type int_least32_t = __int_least32_t; -pub type int_least64_t = __int_least64_t; -pub type uint_least8_t = __uint_least8_t; -pub type uint_least16_t = __uint_least16_t; -pub type uint_least32_t = __uint_least32_t; -pub type uint_least64_t = __uint_least64_t; -pub type int_fast8_t = ::std::os::raw::c_schar; -pub type int_fast16_t = ::std::os::raw::c_long; -pub type int_fast32_t = ::std::os::raw::c_long; -pub type int_fast64_t = ::std::os::raw::c_long; -pub type uint_fast8_t = ::std::os::raw::c_uchar; -pub type uint_fast16_t = ::std::os::raw::c_ulong; -pub type uint_fast32_t = ::std::os::raw::c_ulong; -pub type uint_fast64_t = ::std::os::raw::c_ulong; -pub type intmax_t = __intmax_t; -pub type uintmax_t = __uintmax_t; -pub type va_list = __builtin_va_list; -pub type __gnuc_va_list = __builtin_va_list; #[repr(C)] -#[derive(Copy, Clone)] -pub struct __mbstate_t { - pub __count: ::std::os::raw::c_int, - pub __value: __mbstate_t__bindgen_ty_1, +#[derive(Debug, Copy, Clone)] +pub struct _opaque_pthread_attr_t { + pub __sig: ::std::os::raw::c_long, + pub __opaque: [::std::os::raw::c_char; 56usize], } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _opaque_pthread_attr_t"][::std::mem::size_of::<_opaque_pthread_attr_t>() - 64usize]; + ["Alignment of _opaque_pthread_attr_t"][::std::mem::align_of::<_opaque_pthread_attr_t>() - 8usize]; + ["Offset of field: _opaque_pthread_attr_t::__sig"][::std::mem::offset_of!(_opaque_pthread_attr_t, __sig) - 0usize]; + ["Offset of field: _opaque_pthread_attr_t::__opaque"] + [::std::mem::offset_of!(_opaque_pthread_attr_t, __opaque) - 8usize]; +}; #[repr(C)] -#[derive(Copy, Clone)] -pub union __mbstate_t__bindgen_ty_1 { - pub __wch: ::std::os::raw::c_uint, - pub __wchb: [::std::os::raw::c_char; 4usize], +#[derive(Debug, Copy, Clone)] +pub struct _opaque_pthread_cond_t { + pub __sig: ::std::os::raw::c_long, + pub __opaque: [::std::os::raw::c_char; 40usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of __mbstate_t__bindgen_ty_1"][::std::mem::size_of::<__mbstate_t__bindgen_ty_1>() - 4usize]; - ["Alignment of __mbstate_t__bindgen_ty_1"][::std::mem::align_of::<__mbstate_t__bindgen_ty_1>() - 4usize]; - ["Offset of field: __mbstate_t__bindgen_ty_1::__wch"] - [::std::mem::offset_of!(__mbstate_t__bindgen_ty_1, __wch) - 0usize]; - ["Offset of field: __mbstate_t__bindgen_ty_1::__wchb"] - [::std::mem::offset_of!(__mbstate_t__bindgen_ty_1, __wchb) - 0usize]; + ["Size of _opaque_pthread_cond_t"][::std::mem::size_of::<_opaque_pthread_cond_t>() - 48usize]; + ["Alignment of _opaque_pthread_cond_t"][::std::mem::align_of::<_opaque_pthread_cond_t>() - 8usize]; + ["Offset of field: _opaque_pthread_cond_t::__sig"][::std::mem::offset_of!(_opaque_pthread_cond_t, __sig) - 0usize]; + ["Offset of field: _opaque_pthread_cond_t::__opaque"] + [::std::mem::offset_of!(_opaque_pthread_cond_t, __opaque) - 8usize]; }; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _opaque_pthread_condattr_t { + pub __sig: ::std::os::raw::c_long, + pub __opaque: [::std::os::raw::c_char; 8usize], +} #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of __mbstate_t"][::std::mem::size_of::<__mbstate_t>() - 8usize]; - ["Alignment of __mbstate_t"][::std::mem::align_of::<__mbstate_t>() - 4usize]; - ["Offset of field: __mbstate_t::__count"][::std::mem::offset_of!(__mbstate_t, __count) - 0usize]; - ["Offset of field: __mbstate_t::__value"][::std::mem::offset_of!(__mbstate_t, __value) - 4usize]; + ["Size of _opaque_pthread_condattr_t"][::std::mem::size_of::<_opaque_pthread_condattr_t>() - 16usize]; + ["Alignment of _opaque_pthread_condattr_t"][::std::mem::align_of::<_opaque_pthread_condattr_t>() - 8usize]; + ["Offset of field: _opaque_pthread_condattr_t::__sig"] + [::std::mem::offset_of!(_opaque_pthread_condattr_t, __sig) - 0usize]; + ["Offset of field: _opaque_pthread_condattr_t::__opaque"] + [::std::mem::offset_of!(_opaque_pthread_condattr_t, __opaque) - 8usize]; }; #[repr(C)] -#[derive(Copy, Clone)] -pub struct _G_fpos_t { - pub __pos: __off_t, - pub __state: __mbstate_t, +#[derive(Debug, Copy, Clone)] +pub struct _opaque_pthread_mutex_t { + pub __sig: ::std::os::raw::c_long, + pub __opaque: [::std::os::raw::c_char; 56usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of _G_fpos_t"][::std::mem::size_of::<_G_fpos_t>() - 16usize]; - ["Alignment of _G_fpos_t"][::std::mem::align_of::<_G_fpos_t>() - 8usize]; - ["Offset of field: _G_fpos_t::__pos"][::std::mem::offset_of!(_G_fpos_t, __pos) - 0usize]; - ["Offset of field: _G_fpos_t::__state"][::std::mem::offset_of!(_G_fpos_t, __state) - 8usize]; + ["Size of _opaque_pthread_mutex_t"][::std::mem::size_of::<_opaque_pthread_mutex_t>() - 64usize]; + ["Alignment of _opaque_pthread_mutex_t"][::std::mem::align_of::<_opaque_pthread_mutex_t>() - 8usize]; + ["Offset of field: _opaque_pthread_mutex_t::__sig"][::std::mem::offset_of!(_opaque_pthread_mutex_t, __sig) - 0usize]; + ["Offset of field: _opaque_pthread_mutex_t::__opaque"] + [::std::mem::offset_of!(_opaque_pthread_mutex_t, __opaque) - 8usize]; }; -pub type __fpos_t = _G_fpos_t; #[repr(C)] -#[derive(Copy, Clone)] -pub struct _G_fpos64_t { - pub __pos: __off64_t, - pub __state: __mbstate_t, +#[derive(Debug, Copy, Clone)] +pub struct _opaque_pthread_mutexattr_t { + pub __sig: ::std::os::raw::c_long, + pub __opaque: [::std::os::raw::c_char; 8usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of _G_fpos64_t"][::std::mem::size_of::<_G_fpos64_t>() - 16usize]; - ["Alignment of _G_fpos64_t"][::std::mem::align_of::<_G_fpos64_t>() - 8usize]; - ["Offset of field: _G_fpos64_t::__pos"][::std::mem::offset_of!(_G_fpos64_t, __pos) - 0usize]; - ["Offset of field: _G_fpos64_t::__state"][::std::mem::offset_of!(_G_fpos64_t, __state) - 8usize]; + ["Size of _opaque_pthread_mutexattr_t"][::std::mem::size_of::<_opaque_pthread_mutexattr_t>() - 16usize]; + ["Alignment of _opaque_pthread_mutexattr_t"][::std::mem::align_of::<_opaque_pthread_mutexattr_t>() - 8usize]; + ["Offset of field: _opaque_pthread_mutexattr_t::__sig"] + [::std::mem::offset_of!(_opaque_pthread_mutexattr_t, __sig) - 0usize]; + ["Offset of field: _opaque_pthread_mutexattr_t::__opaque"] + [::std::mem::offset_of!(_opaque_pthread_mutexattr_t, __opaque) - 8usize]; }; -pub type __fpos64_t = _G_fpos64_t; -pub type __FILE = _IO_FILE; -pub type FILE = _IO_FILE; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _IO_marker { - _unused: [u8; 0], +pub struct _opaque_pthread_once_t { + pub __sig: ::std::os::raw::c_long, + pub __opaque: [::std::os::raw::c_char; 8usize], } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _opaque_pthread_once_t"][::std::mem::size_of::<_opaque_pthread_once_t>() - 16usize]; + ["Alignment of _opaque_pthread_once_t"][::std::mem::align_of::<_opaque_pthread_once_t>() - 8usize]; + ["Offset of field: _opaque_pthread_once_t::__sig"][::std::mem::offset_of!(_opaque_pthread_once_t, __sig) - 0usize]; + ["Offset of field: _opaque_pthread_once_t::__opaque"] + [::std::mem::offset_of!(_opaque_pthread_once_t, __opaque) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _IO_codecvt { - _unused: [u8; 0], +pub struct _opaque_pthread_rwlock_t { + pub __sig: ::std::os::raw::c_long, + pub __opaque: [::std::os::raw::c_char; 192usize], } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _opaque_pthread_rwlock_t"][::std::mem::size_of::<_opaque_pthread_rwlock_t>() - 200usize]; + ["Alignment of _opaque_pthread_rwlock_t"][::std::mem::align_of::<_opaque_pthread_rwlock_t>() - 8usize]; + ["Offset of field: _opaque_pthread_rwlock_t::__sig"] + [::std::mem::offset_of!(_opaque_pthread_rwlock_t, __sig) - 0usize]; + ["Offset of field: _opaque_pthread_rwlock_t::__opaque"] + [::std::mem::offset_of!(_opaque_pthread_rwlock_t, __opaque) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _IO_wide_data { - _unused: [u8; 0], +pub struct _opaque_pthread_rwlockattr_t { + pub __sig: ::std::os::raw::c_long, + pub __opaque: [::std::os::raw::c_char; 16usize], } -pub type _IO_lock_t = ::std::os::raw::c_void; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _opaque_pthread_rwlockattr_t"][::std::mem::size_of::<_opaque_pthread_rwlockattr_t>() - 24usize]; + ["Alignment of _opaque_pthread_rwlockattr_t"][::std::mem::align_of::<_opaque_pthread_rwlockattr_t>() - 8usize]; + ["Offset of field: _opaque_pthread_rwlockattr_t::__sig"] + [::std::mem::offset_of!(_opaque_pthread_rwlockattr_t, __sig) - 0usize]; + ["Offset of field: _opaque_pthread_rwlockattr_t::__opaque"] + [::std::mem::offset_of!(_opaque_pthread_rwlockattr_t, __opaque) - 8usize]; +}; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct _IO_FILE { - pub _flags: ::std::os::raw::c_int, - pub _IO_read_ptr: *mut ::std::os::raw::c_char, - pub _IO_read_end: *mut ::std::os::raw::c_char, - pub _IO_read_base: *mut ::std::os::raw::c_char, - pub _IO_write_base: *mut ::std::os::raw::c_char, - pub _IO_write_ptr: *mut ::std::os::raw::c_char, - pub _IO_write_end: *mut ::std::os::raw::c_char, - pub _IO_buf_base: *mut ::std::os::raw::c_char, - pub _IO_buf_end: *mut ::std::os::raw::c_char, - pub _IO_save_base: *mut ::std::os::raw::c_char, - pub _IO_backup_base: *mut ::std::os::raw::c_char, - pub _IO_save_end: *mut ::std::os::raw::c_char, - pub _markers: *mut _IO_marker, - pub _chain: *mut _IO_FILE, - pub _fileno: ::std::os::raw::c_int, - pub _flags2: ::std::os::raw::c_int, - pub _old_offset: __off_t, - pub _cur_column: ::std::os::raw::c_ushort, - pub _vtable_offset: ::std::os::raw::c_schar, - pub _shortbuf: [::std::os::raw::c_char; 1usize], - pub _lock: *mut _IO_lock_t, - pub _offset: __off64_t, - pub _codecvt: *mut _IO_codecvt, - pub _wide_data: *mut _IO_wide_data, - pub _freeres_list: *mut _IO_FILE, - pub _freeres_buf: *mut ::std::os::raw::c_void, - pub __pad5: usize, - pub _mode: ::std::os::raw::c_int, - pub _unused2: [::std::os::raw::c_char; 20usize], +pub struct _opaque_pthread_t { + pub __sig: ::std::os::raw::c_long, + pub __cleanup_stack: *mut __darwin_pthread_handler_rec, + pub __opaque: [::std::os::raw::c_char; 8176usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of _IO_FILE"][::std::mem::size_of::<_IO_FILE>() - 216usize]; - ["Alignment of _IO_FILE"][::std::mem::align_of::<_IO_FILE>() - 8usize]; - ["Offset of field: _IO_FILE::_flags"][::std::mem::offset_of!(_IO_FILE, _flags) - 0usize]; - ["Offset of field: _IO_FILE::_IO_read_ptr"][::std::mem::offset_of!(_IO_FILE, _IO_read_ptr) - 8usize]; - ["Offset of field: _IO_FILE::_IO_read_end"][::std::mem::offset_of!(_IO_FILE, _IO_read_end) - 16usize]; - ["Offset of field: _IO_FILE::_IO_read_base"][::std::mem::offset_of!(_IO_FILE, _IO_read_base) - 24usize]; - ["Offset of field: _IO_FILE::_IO_write_base"][::std::mem::offset_of!(_IO_FILE, _IO_write_base) - 32usize]; - ["Offset of field: _IO_FILE::_IO_write_ptr"][::std::mem::offset_of!(_IO_FILE, _IO_write_ptr) - 40usize]; - ["Offset of field: _IO_FILE::_IO_write_end"][::std::mem::offset_of!(_IO_FILE, _IO_write_end) - 48usize]; - ["Offset of field: _IO_FILE::_IO_buf_base"][::std::mem::offset_of!(_IO_FILE, _IO_buf_base) - 56usize]; - ["Offset of field: _IO_FILE::_IO_buf_end"][::std::mem::offset_of!(_IO_FILE, _IO_buf_end) - 64usize]; - ["Offset of field: _IO_FILE::_IO_save_base"][::std::mem::offset_of!(_IO_FILE, _IO_save_base) - 72usize]; - ["Offset of field: _IO_FILE::_IO_backup_base"][::std::mem::offset_of!(_IO_FILE, _IO_backup_base) - 80usize]; - ["Offset of field: _IO_FILE::_IO_save_end"][::std::mem::offset_of!(_IO_FILE, _IO_save_end) - 88usize]; - ["Offset of field: _IO_FILE::_markers"][::std::mem::offset_of!(_IO_FILE, _markers) - 96usize]; - ["Offset of field: _IO_FILE::_chain"][::std::mem::offset_of!(_IO_FILE, _chain) - 104usize]; - ["Offset of field: _IO_FILE::_fileno"][::std::mem::offset_of!(_IO_FILE, _fileno) - 112usize]; - ["Offset of field: _IO_FILE::_flags2"][::std::mem::offset_of!(_IO_FILE, _flags2) - 116usize]; - ["Offset of field: _IO_FILE::_old_offset"][::std::mem::offset_of!(_IO_FILE, _old_offset) - 120usize]; - ["Offset of field: _IO_FILE::_cur_column"][::std::mem::offset_of!(_IO_FILE, _cur_column) - 128usize]; - ["Offset of field: _IO_FILE::_vtable_offset"][::std::mem::offset_of!(_IO_FILE, _vtable_offset) - 130usize]; - ["Offset of field: _IO_FILE::_shortbuf"][::std::mem::offset_of!(_IO_FILE, _shortbuf) - 131usize]; - ["Offset of field: _IO_FILE::_lock"][::std::mem::offset_of!(_IO_FILE, _lock) - 136usize]; - ["Offset of field: _IO_FILE::_offset"][::std::mem::offset_of!(_IO_FILE, _offset) - 144usize]; - ["Offset of field: _IO_FILE::_codecvt"][::std::mem::offset_of!(_IO_FILE, _codecvt) - 152usize]; - ["Offset of field: _IO_FILE::_wide_data"][::std::mem::offset_of!(_IO_FILE, _wide_data) - 160usize]; - ["Offset of field: _IO_FILE::_freeres_list"][::std::mem::offset_of!(_IO_FILE, _freeres_list) - 168usize]; - ["Offset of field: _IO_FILE::_freeres_buf"][::std::mem::offset_of!(_IO_FILE, _freeres_buf) - 176usize]; - ["Offset of field: _IO_FILE::__pad5"][::std::mem::offset_of!(_IO_FILE, __pad5) - 184usize]; - ["Offset of field: _IO_FILE::_mode"][::std::mem::offset_of!(_IO_FILE, _mode) - 192usize]; - ["Offset of field: _IO_FILE::_unused2"][::std::mem::offset_of!(_IO_FILE, _unused2) - 196usize]; + ["Size of _opaque_pthread_t"][::std::mem::size_of::<_opaque_pthread_t>() - 8192usize]; + ["Alignment of _opaque_pthread_t"][::std::mem::align_of::<_opaque_pthread_t>() - 8usize]; + ["Offset of field: _opaque_pthread_t::__sig"][::std::mem::offset_of!(_opaque_pthread_t, __sig) - 0usize]; + ["Offset of field: _opaque_pthread_t::__cleanup_stack"] + [::std::mem::offset_of!(_opaque_pthread_t, __cleanup_stack) - 8usize]; + ["Offset of field: _opaque_pthread_t::__opaque"][::std::mem::offset_of!(_opaque_pthread_t, __opaque) - 16usize]; }; -pub type off_t = __off_t; -pub type fpos_t = __fpos_t; +pub type __darwin_pthread_attr_t = _opaque_pthread_attr_t; +pub type __darwin_pthread_cond_t = _opaque_pthread_cond_t; +pub type __darwin_pthread_condattr_t = _opaque_pthread_condattr_t; +pub type __darwin_pthread_key_t = ::std::os::raw::c_ulong; +pub type __darwin_pthread_mutex_t = _opaque_pthread_mutex_t; +pub type __darwin_pthread_mutexattr_t = _opaque_pthread_mutexattr_t; +pub type __darwin_pthread_once_t = _opaque_pthread_once_t; +pub type __darwin_pthread_rwlock_t = _opaque_pthread_rwlock_t; +pub type __darwin_pthread_rwlockattr_t = _opaque_pthread_rwlockattr_t; +pub type __darwin_pthread_t = *mut _opaque_pthread_t; +pub type u_int8_t = ::std::os::raw::c_uchar; +pub type u_int16_t = ::std::os::raw::c_ushort; +pub type u_int32_t = ::std::os::raw::c_uint; +pub type u_int64_t = ::std::os::raw::c_ulonglong; +pub type register_t = i64; +pub type user_addr_t = u_int64_t; +pub type user_size_t = u_int64_t; +pub type user_ssize_t = i64; +pub type user_long_t = i64; +pub type user_ulong_t = u_int64_t; +pub type user_time_t = i64; +pub type user_off_t = i64; +pub type syscall_arg_t = u_int64_t; +pub type intmax_t = ::std::os::raw::c_long; +pub type uintmax_t = ::std::os::raw::c_ulong; +pub type __darwin_nl_item = ::std::os::raw::c_int; +pub type __darwin_wctrans_t = ::std::os::raw::c_int; +pub type __darwin_wctype_t = __uint32_t; +pub type va_list = __darwin_va_list; extern "C" { - pub static mut stdin: *mut FILE; + pub fn renameat( + arg1: ::std::os::raw::c_int, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + arg4: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; } extern "C" { - pub static mut stdout: *mut FILE; + pub fn renamex_np( + arg1: *const ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; } extern "C" { - pub static mut stderr: *mut FILE; + pub fn renameatx_np( + arg1: ::std::os::raw::c_int, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + arg4: *const ::std::os::raw::c_char, + arg5: ::std::os::raw::c_uint, + ) -> ::std::os::raw::c_int; } -extern "C" { - pub fn remove(__filename: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +pub type fpos_t = __darwin_off_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __sbuf { + pub _base: *mut ::std::os::raw::c_uchar, + pub _size: ::std::os::raw::c_int, } -extern "C" { - pub fn rename(__old: *const ::std::os::raw::c_char, __new: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sbuf"][::std::mem::size_of::<__sbuf>() - 16usize]; + ["Alignment of __sbuf"][::std::mem::align_of::<__sbuf>() - 8usize]; + ["Offset of field: __sbuf::_base"][::std::mem::offset_of!(__sbuf, _base) - 0usize]; + ["Offset of field: __sbuf::_size"][::std::mem::offset_of!(__sbuf, _size) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __sFILEX { + _unused: [u8; 0], } +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __sFILE { + pub _p: *mut ::std::os::raw::c_uchar, + pub _r: ::std::os::raw::c_int, + pub _w: ::std::os::raw::c_int, + pub _flags: ::std::os::raw::c_short, + pub _file: ::std::os::raw::c_short, + pub _bf: __sbuf, + pub _lbfsize: ::std::os::raw::c_int, + pub _cookie: *mut ::std::os::raw::c_void, + pub _close: ::std::option::Option ::std::os::raw::c_int>, + pub _read: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, + >, + pub _seek: ::std::option::Option< + unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void, arg2: fpos_t, arg3: ::std::os::raw::c_int) -> fpos_t, + >, + pub _write: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, + >, + pub _ub: __sbuf, + pub _extra: *mut __sFILEX, + pub _ur: ::std::os::raw::c_int, + pub _ubuf: [::std::os::raw::c_uchar; 3usize], + pub _nbuf: [::std::os::raw::c_uchar; 1usize], + pub _lb: __sbuf, + pub _blksize: ::std::os::raw::c_int, + pub _offset: fpos_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sFILE"][::std::mem::size_of::<__sFILE>() - 152usize]; + ["Alignment of __sFILE"][::std::mem::align_of::<__sFILE>() - 8usize]; + ["Offset of field: __sFILE::_p"][::std::mem::offset_of!(__sFILE, _p) - 0usize]; + ["Offset of field: __sFILE::_r"][::std::mem::offset_of!(__sFILE, _r) - 8usize]; + ["Offset of field: __sFILE::_w"][::std::mem::offset_of!(__sFILE, _w) - 12usize]; + ["Offset of field: __sFILE::_flags"][::std::mem::offset_of!(__sFILE, _flags) - 16usize]; + ["Offset of field: __sFILE::_file"][::std::mem::offset_of!(__sFILE, _file) - 18usize]; + ["Offset of field: __sFILE::_bf"][::std::mem::offset_of!(__sFILE, _bf) - 24usize]; + ["Offset of field: __sFILE::_lbfsize"][::std::mem::offset_of!(__sFILE, _lbfsize) - 40usize]; + ["Offset of field: __sFILE::_cookie"][::std::mem::offset_of!(__sFILE, _cookie) - 48usize]; + ["Offset of field: __sFILE::_close"][::std::mem::offset_of!(__sFILE, _close) - 56usize]; + ["Offset of field: __sFILE::_read"][::std::mem::offset_of!(__sFILE, _read) - 64usize]; + ["Offset of field: __sFILE::_seek"][::std::mem::offset_of!(__sFILE, _seek) - 72usize]; + ["Offset of field: __sFILE::_write"][::std::mem::offset_of!(__sFILE, _write) - 80usize]; + ["Offset of field: __sFILE::_ub"][::std::mem::offset_of!(__sFILE, _ub) - 88usize]; + ["Offset of field: __sFILE::_extra"][::std::mem::offset_of!(__sFILE, _extra) - 104usize]; + ["Offset of field: __sFILE::_ur"][::std::mem::offset_of!(__sFILE, _ur) - 112usize]; + ["Offset of field: __sFILE::_ubuf"][::std::mem::offset_of!(__sFILE, _ubuf) - 116usize]; + ["Offset of field: __sFILE::_nbuf"][::std::mem::offset_of!(__sFILE, _nbuf) - 119usize]; + ["Offset of field: __sFILE::_lb"][::std::mem::offset_of!(__sFILE, _lb) - 120usize]; + ["Offset of field: __sFILE::_blksize"][::std::mem::offset_of!(__sFILE, _blksize) - 136usize]; + ["Offset of field: __sFILE::_offset"][::std::mem::offset_of!(__sFILE, _offset) - 144usize]; +}; +pub type FILE = __sFILE; extern "C" { - pub fn renameat( - __oldfd: ::std::os::raw::c_int, - __old: *const ::std::os::raw::c_char, - __newfd: ::std::os::raw::c_int, - __new: *const ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; + pub static mut __stdinp: *mut FILE; } extern "C" { - pub fn tmpfile() -> *mut FILE; + pub static mut __stdoutp: *mut FILE; } extern "C" { - pub fn tmpnam(__s: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; + pub static mut __stderrp: *mut FILE; } extern "C" { - pub fn tmpnam_r(__s: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; + pub fn clearerr(arg1: *mut FILE); } extern "C" { - pub fn tempnam( - __dir: *const ::std::os::raw::c_char, - __pfx: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; + pub fn fclose(arg1: *mut FILE) -> ::std::os::raw::c_int; } extern "C" { - pub fn fclose(__stream: *mut FILE) -> ::std::os::raw::c_int; + pub fn feof(arg1: *mut FILE) -> ::std::os::raw::c_int; } extern "C" { - pub fn fflush(__stream: *mut FILE) -> ::std::os::raw::c_int; + pub fn ferror(arg1: *mut FILE) -> ::std::os::raw::c_int; } extern "C" { - pub fn fflush_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; + pub fn fflush(arg1: *mut FILE) -> ::std::os::raw::c_int; } extern "C" { - pub fn fopen(__filename: *const ::std::os::raw::c_char, __modes: *const ::std::os::raw::c_char) -> *mut FILE; + pub fn fgetc(arg1: *mut FILE) -> ::std::os::raw::c_int; } extern "C" { - pub fn freopen( - __filename: *const ::std::os::raw::c_char, - __modes: *const ::std::os::raw::c_char, - __stream: *mut FILE, - ) -> *mut FILE; + pub fn fgetpos(arg1: *mut FILE, arg2: *mut fpos_t) -> ::std::os::raw::c_int; } extern "C" { - pub fn fdopen(__fd: ::std::os::raw::c_int, __modes: *const ::std::os::raw::c_char) -> *mut FILE; + pub fn fgets( + arg1: *mut ::std::os::raw::c_char, + arg2: ::std::os::raw::c_int, + arg3: *mut FILE, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn fmemopen(__s: *mut ::std::os::raw::c_void, __len: usize, __modes: *const ::std::os::raw::c_char) -> *mut FILE; + pub fn fopen(__filename: *const ::std::os::raw::c_char, __mode: *const ::std::os::raw::c_char) -> *mut FILE; } extern "C" { - pub fn open_memstream(__bufloc: *mut *mut ::std::os::raw::c_char, __sizeloc: *mut usize) -> *mut FILE; + pub fn fprintf(arg1: *mut FILE, arg2: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; } extern "C" { - pub fn setbuf(__stream: *mut FILE, __buf: *mut ::std::os::raw::c_char); + pub fn fputc(arg1: ::std::os::raw::c_int, arg2: *mut FILE) -> ::std::os::raw::c_int; } extern "C" { - pub fn setvbuf( - __stream: *mut FILE, - __buf: *mut ::std::os::raw::c_char, - __modes: ::std::os::raw::c_int, - __n: usize, - ) -> ::std::os::raw::c_int; + pub fn fputs(arg1: *const ::std::os::raw::c_char, arg2: *mut FILE) -> ::std::os::raw::c_int; } extern "C" { - pub fn setbuffer(__stream: *mut FILE, __buf: *mut ::std::os::raw::c_char, __size: usize); + pub fn fread( + __ptr: *mut ::std::os::raw::c_void, + __size: ::std::os::raw::c_ulong, + __nitems: ::std::os::raw::c_ulong, + __stream: *mut FILE, + ) -> ::std::os::raw::c_ulong; } extern "C" { - pub fn setlinebuf(__stream: *mut FILE); + pub fn freopen( + arg1: *const ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + arg3: *mut FILE, + ) -> *mut FILE; } extern "C" { - pub fn fprintf(__stream: *mut FILE, __format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; + pub fn fscanf(arg1: *mut FILE, arg2: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; } extern "C" { - pub fn printf(__format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; + pub fn fseek(arg1: *mut FILE, arg2: ::std::os::raw::c_long, arg3: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } extern "C" { - pub fn sprintf( - __s: *mut ::std::os::raw::c_char, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; + pub fn fsetpos(arg1: *mut FILE, arg2: *const fpos_t) -> ::std::os::raw::c_int; } extern "C" { - pub fn vfprintf( - __s: *mut FILE, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; + pub fn ftell(arg1: *mut FILE) -> ::std::os::raw::c_long; } extern "C" { - pub fn vprintf(__format: *const ::std::os::raw::c_char, __arg: *mut __va_list_tag) -> ::std::os::raw::c_int; + pub fn fwrite( + __ptr: *const ::std::os::raw::c_void, + __size: ::std::os::raw::c_ulong, + __nitems: ::std::os::raw::c_ulong, + __stream: *mut FILE, + ) -> ::std::os::raw::c_ulong; } extern "C" { - pub fn vsprintf( - __s: *mut ::std::os::raw::c_char, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; + pub fn getc(arg1: *mut FILE) -> ::std::os::raw::c_int; } extern "C" { - pub fn snprintf( - __s: *mut ::std::os::raw::c_char, - __maxlen: ::std::os::raw::c_ulong, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; + pub fn getchar() -> ::std::os::raw::c_int; } extern "C" { - pub fn vsnprintf( - __s: *mut ::std::os::raw::c_char, - __maxlen: ::std::os::raw::c_ulong, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; + pub fn gets(arg1: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn vdprintf( - __fd: ::std::os::raw::c_int, - __fmt: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; + pub fn perror(arg1: *const ::std::os::raw::c_char); } extern "C" { - pub fn dprintf(__fd: ::std::os::raw::c_int, __fmt: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; + pub fn printf(arg1: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; } extern "C" { - pub fn fscanf(__stream: *mut FILE, __format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; + pub fn putc(arg1: ::std::os::raw::c_int, arg2: *mut FILE) -> ::std::os::raw::c_int; } extern "C" { - pub fn scanf(__format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; + pub fn putchar(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } extern "C" { - pub fn sscanf( - __s: *const ::std::os::raw::c_char, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; + pub fn puts(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } extern "C" { - #[link_name = "\u{1}__isoc99_fscanf"] - pub fn fscanf1(__stream: *mut FILE, __format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; + pub fn remove(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } extern "C" { - #[link_name = "\u{1}__isoc99_scanf"] - pub fn scanf1(__format: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; + pub fn rename(__old: *const ::std::os::raw::c_char, __new: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } extern "C" { - #[link_name = "\u{1}__isoc99_sscanf"] - pub fn sscanf1( - __s: *const ::std::os::raw::c_char, - __format: *const ::std::os::raw::c_char, - ... - ) -> ::std::os::raw::c_int; + pub fn rewind(arg1: *mut FILE); } extern "C" { - pub fn vfscanf( - __s: *mut FILE, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; + pub fn scanf(arg1: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; } extern "C" { - pub fn vscanf(__format: *const ::std::os::raw::c_char, __arg: *mut __va_list_tag) -> ::std::os::raw::c_int; + pub fn setbuf(arg1: *mut FILE, arg2: *mut ::std::os::raw::c_char); } extern "C" { - pub fn vsscanf( - __s: *const ::std::os::raw::c_char, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, + pub fn setvbuf( + arg1: *mut FILE, + arg2: *mut ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + arg4: usize, ) -> ::std::os::raw::c_int; } extern "C" { - #[link_name = "\u{1}__isoc99_vfscanf"] - pub fn vfscanf1( - __s: *mut FILE, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; + pub fn sprintf(arg1: *mut ::std::os::raw::c_char, arg2: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; } extern "C" { - #[link_name = "\u{1}__isoc99_vscanf"] - pub fn vscanf1(__format: *const ::std::os::raw::c_char, __arg: *mut __va_list_tag) -> ::std::os::raw::c_int; + pub fn sscanf(arg1: *const ::std::os::raw::c_char, arg2: *const ::std::os::raw::c_char, ...) + -> ::std::os::raw::c_int; } extern "C" { - #[link_name = "\u{1}__isoc99_vsscanf"] - pub fn vsscanf1( - __s: *const ::std::os::raw::c_char, - __format: *const ::std::os::raw::c_char, - __arg: *mut __va_list_tag, - ) -> ::std::os::raw::c_int; + pub fn tmpfile() -> *mut FILE; } extern "C" { - pub fn fgetc(__stream: *mut FILE) -> ::std::os::raw::c_int; + pub fn tmpnam(arg1: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn getc(__stream: *mut FILE) -> ::std::os::raw::c_int; + pub fn ungetc(arg1: ::std::os::raw::c_int, arg2: *mut FILE) -> ::std::os::raw::c_int; } extern "C" { - pub fn getchar() -> ::std::os::raw::c_int; + pub fn vfprintf( + arg1: *mut FILE, + arg2: *const ::std::os::raw::c_char, + arg3: __builtin_va_list, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn getc_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; + pub fn vprintf(arg1: *const ::std::os::raw::c_char, arg2: __builtin_va_list) -> ::std::os::raw::c_int; } extern "C" { - pub fn getchar_unlocked() -> ::std::os::raw::c_int; + pub fn vsprintf( + arg1: *mut ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + arg3: __builtin_va_list, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn fgetc_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; + pub fn ctermid(arg1: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn fputc(__c: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int; + pub fn fdopen(arg1: ::std::os::raw::c_int, arg2: *const ::std::os::raw::c_char) -> *mut FILE; } extern "C" { - pub fn putc(__c: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int; + pub fn fileno(arg1: *mut FILE) -> ::std::os::raw::c_int; } extern "C" { - pub fn putchar(__c: ::std::os::raw::c_int) -> ::std::os::raw::c_int; + pub fn pclose(arg1: *mut FILE) -> ::std::os::raw::c_int; } extern "C" { - pub fn fputc_unlocked(__c: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int; + pub fn popen(arg1: *const ::std::os::raw::c_char, arg2: *const ::std::os::raw::c_char) -> *mut FILE; } extern "C" { - pub fn putc_unlocked(__c: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int; + pub fn __srget(arg1: *mut FILE) -> ::std::os::raw::c_int; } extern "C" { - pub fn putchar_unlocked(__c: ::std::os::raw::c_int) -> ::std::os::raw::c_int; + pub fn __svfscanf(arg1: *mut FILE, arg2: *const ::std::os::raw::c_char, arg3: va_list) -> ::std::os::raw::c_int; } extern "C" { - pub fn getw(__stream: *mut FILE) -> ::std::os::raw::c_int; + pub fn __swbuf(arg1: ::std::os::raw::c_int, arg2: *mut FILE) -> ::std::os::raw::c_int; } extern "C" { - pub fn putw(__w: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int; + pub fn flockfile(arg1: *mut FILE); } extern "C" { - pub fn fgets( - __s: *mut ::std::os::raw::c_char, - __n: ::std::os::raw::c_int, - __stream: *mut FILE, - ) -> *mut ::std::os::raw::c_char; + pub fn ftrylockfile(arg1: *mut FILE) -> ::std::os::raw::c_int; } extern "C" { - pub fn __getdelim( - __lineptr: *mut *mut ::std::os::raw::c_char, - __n: *mut usize, - __delimiter: ::std::os::raw::c_int, - __stream: *mut FILE, - ) -> __ssize_t; + pub fn funlockfile(arg1: *mut FILE); } extern "C" { - pub fn getdelim( - __lineptr: *mut *mut ::std::os::raw::c_char, - __n: *mut usize, - __delimiter: ::std::os::raw::c_int, - __stream: *mut FILE, - ) -> __ssize_t; + pub fn getc_unlocked(arg1: *mut FILE) -> ::std::os::raw::c_int; } extern "C" { - pub fn getline(__lineptr: *mut *mut ::std::os::raw::c_char, __n: *mut usize, __stream: *mut FILE) -> __ssize_t; + pub fn getchar_unlocked() -> ::std::os::raw::c_int; } extern "C" { - pub fn fputs(__s: *const ::std::os::raw::c_char, __stream: *mut FILE) -> ::std::os::raw::c_int; + pub fn putc_unlocked(arg1: ::std::os::raw::c_int, arg2: *mut FILE) -> ::std::os::raw::c_int; } extern "C" { - pub fn puts(__s: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; + pub fn putchar_unlocked(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } extern "C" { - pub fn ungetc(__c: ::std::os::raw::c_int, __stream: *mut FILE) -> ::std::os::raw::c_int; + pub fn getw(arg1: *mut FILE) -> ::std::os::raw::c_int; } extern "C" { - pub fn fread( - __ptr: *mut ::std::os::raw::c_void, - __size: ::std::os::raw::c_ulong, - __n: ::std::os::raw::c_ulong, - __stream: *mut FILE, - ) -> ::std::os::raw::c_ulong; + pub fn putw(arg1: ::std::os::raw::c_int, arg2: *mut FILE) -> ::std::os::raw::c_int; } extern "C" { - pub fn fwrite( - __ptr: *const ::std::os::raw::c_void, - __size: ::std::os::raw::c_ulong, - __n: ::std::os::raw::c_ulong, - __s: *mut FILE, - ) -> ::std::os::raw::c_ulong; + pub fn tempnam( + __dir: *const ::std::os::raw::c_char, + __prefix: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; } +pub type off_t = __darwin_off_t; extern "C" { - pub fn fread_unlocked(__ptr: *mut ::std::os::raw::c_void, __size: usize, __n: usize, __stream: *mut FILE) -> usize; + pub fn fseeko(__stream: *mut FILE, __offset: off_t, __whence: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } extern "C" { - pub fn fwrite_unlocked(__ptr: *const ::std::os::raw::c_void, __size: usize, __n: usize, __stream: *mut FILE) - -> usize; + pub fn ftello(__stream: *mut FILE) -> off_t; } extern "C" { - pub fn fseek( - __stream: *mut FILE, - __off: ::std::os::raw::c_long, - __whence: ::std::os::raw::c_int, + pub fn snprintf( + __str: *mut ::std::os::raw::c_char, + __size: ::std::os::raw::c_ulong, + __format: *const ::std::os::raw::c_char, + ... ) -> ::std::os::raw::c_int; } extern "C" { - pub fn ftell(__stream: *mut FILE) -> ::std::os::raw::c_long; + pub fn vfscanf( + __stream: *mut FILE, + __format: *const ::std::os::raw::c_char, + arg1: __builtin_va_list, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn rewind(__stream: *mut FILE); + pub fn vscanf(__format: *const ::std::os::raw::c_char, arg1: __builtin_va_list) -> ::std::os::raw::c_int; } extern "C" { - pub fn fseeko(__stream: *mut FILE, __off: __off_t, __whence: ::std::os::raw::c_int) -> ::std::os::raw::c_int; + pub fn vsnprintf( + __str: *mut ::std::os::raw::c_char, + __size: ::std::os::raw::c_ulong, + __format: *const ::std::os::raw::c_char, + arg1: __builtin_va_list, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn ftello(__stream: *mut FILE) -> __off_t; + pub fn vsscanf( + __str: *const ::std::os::raw::c_char, + __format: *const ::std::os::raw::c_char, + arg1: __builtin_va_list, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn fgetpos(__stream: *mut FILE, __pos: *mut fpos_t) -> ::std::os::raw::c_int; + pub fn dprintf(arg1: ::std::os::raw::c_int, arg2: *const ::std::os::raw::c_char, ...) -> ::std::os::raw::c_int; } extern "C" { - pub fn fsetpos(__stream: *mut FILE, __pos: *const fpos_t) -> ::std::os::raw::c_int; + pub fn vdprintf( + arg1: ::std::os::raw::c_int, + arg2: *const ::std::os::raw::c_char, + arg3: va_list, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn clearerr(__stream: *mut FILE); + pub fn getdelim( + __linep: *mut *mut ::std::os::raw::c_char, + __linecapp: *mut usize, + __delimiter: ::std::os::raw::c_int, + __stream: *mut FILE, + ) -> isize; } extern "C" { - pub fn feof(__stream: *mut FILE) -> ::std::os::raw::c_int; + pub fn getline(__linep: *mut *mut ::std::os::raw::c_char, __linecapp: *mut usize, __stream: *mut FILE) -> isize; } extern "C" { - pub fn ferror(__stream: *mut FILE) -> ::std::os::raw::c_int; + pub fn fmemopen( + __buf: *mut ::std::os::raw::c_void, + __size: usize, + __mode: *const ::std::os::raw::c_char, + ) -> *mut FILE; } extern "C" { - pub fn clearerr_unlocked(__stream: *mut FILE); + pub fn open_memstream(__bufp: *mut *mut ::std::os::raw::c_char, __sizep: *mut usize) -> *mut FILE; } extern "C" { - pub fn feof_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; + pub static sys_nerr: ::std::os::raw::c_int; } extern "C" { - pub fn ferror_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; + pub static sys_errlist: [*const ::std::os::raw::c_char; 0usize]; } extern "C" { - pub fn perror(__s: *const ::std::os::raw::c_char); + pub fn asprintf( + arg1: *mut *mut ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; } extern "C" { - pub static mut sys_nerr: ::std::os::raw::c_int; + pub fn ctermid_r(arg1: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; } extern "C" { - pub static sys_errlist: [*const ::std::os::raw::c_char; 0usize]; + pub fn fgetln(arg1: *mut FILE, arg2: *mut usize) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn fileno(__stream: *mut FILE) -> ::std::os::raw::c_int; + pub fn fmtcheck( + arg1: *const ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + ) -> *const ::std::os::raw::c_char; } extern "C" { - pub fn fileno_unlocked(__stream: *mut FILE) -> ::std::os::raw::c_int; + pub fn fpurge(arg1: *mut FILE) -> ::std::os::raw::c_int; } extern "C" { - pub fn popen(__command: *const ::std::os::raw::c_char, __modes: *const ::std::os::raw::c_char) -> *mut FILE; + pub fn setbuffer(arg1: *mut FILE, arg2: *mut ::std::os::raw::c_char, arg3: ::std::os::raw::c_int); } extern "C" { - pub fn pclose(__stream: *mut FILE) -> ::std::os::raw::c_int; + pub fn setlinebuf(arg1: *mut FILE) -> ::std::os::raw::c_int; } extern "C" { - pub fn ctermid(__s: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; + pub fn vasprintf( + arg1: *mut *mut ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + arg3: va_list, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn flockfile(__stream: *mut FILE); + pub fn zopen( + arg1: *const ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ) -> *mut FILE; } extern "C" { - pub fn ftrylockfile(__stream: *mut FILE) -> ::std::os::raw::c_int; + pub fn funopen( + arg1: *const ::std::os::raw::c_void, + arg2: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *mut ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, + >, + arg3: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int, + >, + arg4: ::std::option::Option< + unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void, arg2: fpos_t, arg3: ::std::os::raw::c_int) -> fpos_t, + >, + arg5: ::std::option::Option ::std::os::raw::c_int>, + ) -> *mut FILE; } extern "C" { - pub fn funlockfile(__stream: *mut FILE); + pub fn __sprintf_chk( + arg1: *mut ::std::os::raw::c_char, + arg2: ::std::os::raw::c_int, + arg3: usize, + arg4: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn __uflow(arg1: *mut FILE) -> ::std::os::raw::c_int; + pub fn __snprintf_chk( + arg1: *mut ::std::os::raw::c_char, + arg2: usize, + arg3: ::std::os::raw::c_int, + arg4: usize, + arg5: *const ::std::os::raw::c_char, + ... + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn __overflow(arg1: *mut FILE, arg2: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -pub type u_char = __u_char; -pub type u_short = __u_short; -pub type u_int = __u_int; -pub type u_long = __u_long; -pub type quad_t = __quad_t; -pub type u_quad_t = __u_quad_t; -pub type fsid_t = __fsid_t; -pub type loff_t = __loff_t; -pub type ino_t = __ino_t; -pub type dev_t = __dev_t; -pub type gid_t = __gid_t; -pub type mode_t = __mode_t; -pub type nlink_t = __nlink_t; -pub type uid_t = __uid_t; -pub type pid_t = __pid_t; -pub type id_t = __id_t; -pub type daddr_t = __daddr_t; -pub type caddr_t = __caddr_t; -pub type key_t = __key_t; -pub type clock_t = __clock_t; -pub type clockid_t = __clockid_t; -pub type time_t = __time_t; -pub type timer_t = __timer_t; -pub type ulong = ::std::os::raw::c_ulong; -pub type ushort = ::std::os::raw::c_ushort; -pub type uint = ::std::os::raw::c_uint; -pub type u_int8_t = __uint8_t; -pub type u_int16_t = __uint16_t; -pub type u_int32_t = __uint32_t; -pub type u_int64_t = __uint64_t; -pub type register_t = ::std::os::raw::c_long; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __sigset_t { - pub __val: [::std::os::raw::c_ulong; 16usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __sigset_t"][::std::mem::size_of::<__sigset_t>() - 128usize]; - ["Alignment of __sigset_t"][::std::mem::align_of::<__sigset_t>() - 8usize]; - ["Offset of field: __sigset_t::__val"][::std::mem::offset_of!(__sigset_t, __val) - 0usize]; -}; -pub type sigset_t = __sigset_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct timeval { - pub tv_sec: __time_t, - pub tv_usec: __suseconds_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of timeval"][::std::mem::size_of::() - 16usize]; - ["Alignment of timeval"][::std::mem::align_of::() - 8usize]; - ["Offset of field: timeval::tv_sec"][::std::mem::offset_of!(timeval, tv_sec) - 0usize]; - ["Offset of field: timeval::tv_usec"][::std::mem::offset_of!(timeval, tv_usec) - 8usize]; -}; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct timespec { - pub tv_sec: __time_t, - pub tv_nsec: __syscall_slong_t, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of timespec"][::std::mem::size_of::() - 16usize]; - ["Alignment of timespec"][::std::mem::align_of::() - 8usize]; - ["Offset of field: timespec::tv_sec"][::std::mem::offset_of!(timespec, tv_sec) - 0usize]; - ["Offset of field: timespec::tv_nsec"][::std::mem::offset_of!(timespec, tv_nsec) - 8usize]; -}; -pub type suseconds_t = __suseconds_t; -pub type __fd_mask = ::std::os::raw::c_long; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct fd_set { - pub __fds_bits: [__fd_mask; 16usize], -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of fd_set"][::std::mem::size_of::() - 128usize]; - ["Alignment of fd_set"][::std::mem::align_of::() - 8usize]; - ["Offset of field: fd_set::__fds_bits"][::std::mem::offset_of!(fd_set, __fds_bits) - 0usize]; -}; -pub type fd_mask = __fd_mask; -extern "C" { - pub fn select( - __nfds: ::std::os::raw::c_int, - __readfds: *mut fd_set, - __writefds: *mut fd_set, - __exceptfds: *mut fd_set, - __timeout: *mut timeval, + pub fn __vsprintf_chk( + arg1: *mut ::std::os::raw::c_char, + arg2: ::std::os::raw::c_int, + arg3: usize, + arg4: *const ::std::os::raw::c_char, + arg5: va_list, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn pselect( - __nfds: ::std::os::raw::c_int, - __readfds: *mut fd_set, - __writefds: *mut fd_set, - __exceptfds: *mut fd_set, - __timeout: *const timespec, - __sigmask: *const __sigset_t, + pub fn __vsnprintf_chk( + arg1: *mut ::std::os::raw::c_char, + arg2: usize, + arg3: ::std::os::raw::c_int, + arg4: usize, + arg5: *const ::std::os::raw::c_char, + arg6: va_list, ) -> ::std::os::raw::c_int; } -pub type blksize_t = __blksize_t; -pub type blkcnt_t = __blkcnt_t; -pub type fsblkcnt_t = __fsblkcnt_t; -pub type fsfilcnt_t = __fsfilcnt_t; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_internal_list { - pub __prev: *mut __pthread_internal_list, - pub __next: *mut __pthread_internal_list, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __pthread_internal_list"][::std::mem::size_of::<__pthread_internal_list>() - 16usize]; - ["Alignment of __pthread_internal_list"][::std::mem::align_of::<__pthread_internal_list>() - 8usize]; - ["Offset of field: __pthread_internal_list::__prev"] - [::std::mem::offset_of!(__pthread_internal_list, __prev) - 0usize]; - ["Offset of field: __pthread_internal_list::__next"] - [::std::mem::offset_of!(__pthread_internal_list, __next) - 8usize]; -}; -pub type __pthread_list_t = __pthread_internal_list; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __pthread_internal_slist { - pub __next: *mut __pthread_internal_slist, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __pthread_internal_slist"][::std::mem::size_of::<__pthread_internal_slist>() - 8usize]; - ["Alignment of __pthread_internal_slist"][::std::mem::align_of::<__pthread_internal_slist>() - 8usize]; - ["Offset of field: __pthread_internal_slist::__next"] - [::std::mem::offset_of!(__pthread_internal_slist, __next) - 0usize]; -}; -pub type __pthread_slist_t = __pthread_internal_slist; -#[repr(C)] +#[repr(C, packed)] #[derive(Debug, Copy, Clone)] -pub struct __pthread_mutex_s { - pub __lock: ::std::os::raw::c_int, - pub __count: ::std::os::raw::c_uint, - pub __owner: ::std::os::raw::c_int, - pub __nusers: ::std::os::raw::c_uint, - pub __kind: ::std::os::raw::c_int, - pub __spins: ::std::os::raw::c_short, - pub __elision: ::std::os::raw::c_short, - pub __list: __pthread_list_t, +pub struct _OSUnalignedU16 { + pub __val: u16, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of __pthread_mutex_s"][::std::mem::size_of::<__pthread_mutex_s>() - 40usize]; - ["Alignment of __pthread_mutex_s"][::std::mem::align_of::<__pthread_mutex_s>() - 8usize]; - ["Offset of field: __pthread_mutex_s::__lock"][::std::mem::offset_of!(__pthread_mutex_s, __lock) - 0usize]; - ["Offset of field: __pthread_mutex_s::__count"][::std::mem::offset_of!(__pthread_mutex_s, __count) - 4usize]; - ["Offset of field: __pthread_mutex_s::__owner"][::std::mem::offset_of!(__pthread_mutex_s, __owner) - 8usize]; - ["Offset of field: __pthread_mutex_s::__nusers"][::std::mem::offset_of!(__pthread_mutex_s, __nusers) - 12usize]; - ["Offset of field: __pthread_mutex_s::__kind"][::std::mem::offset_of!(__pthread_mutex_s, __kind) - 16usize]; - ["Offset of field: __pthread_mutex_s::__spins"][::std::mem::offset_of!(__pthread_mutex_s, __spins) - 20usize]; - ["Offset of field: __pthread_mutex_s::__elision"][::std::mem::offset_of!(__pthread_mutex_s, __elision) - 22usize]; - ["Offset of field: __pthread_mutex_s::__list"][::std::mem::offset_of!(__pthread_mutex_s, __list) - 24usize]; + ["Size of _OSUnalignedU16"][::std::mem::size_of::<_OSUnalignedU16>() - 2usize]; + ["Alignment of _OSUnalignedU16"][::std::mem::align_of::<_OSUnalignedU16>() - 1usize]; + ["Offset of field: _OSUnalignedU16::__val"][::std::mem::offset_of!(_OSUnalignedU16, __val) - 0usize]; }; -#[repr(C)] +#[repr(C, packed)] #[derive(Debug, Copy, Clone)] -pub struct __pthread_rwlock_arch_t { - pub __readers: ::std::os::raw::c_uint, - pub __writers: ::std::os::raw::c_uint, - pub __wrphase_futex: ::std::os::raw::c_uint, - pub __writers_futex: ::std::os::raw::c_uint, - pub __pad3: ::std::os::raw::c_uint, - pub __pad4: ::std::os::raw::c_uint, - pub __cur_writer: ::std::os::raw::c_int, - pub __shared: ::std::os::raw::c_int, - pub __rwelision: ::std::os::raw::c_schar, - pub __pad1: [::std::os::raw::c_uchar; 7usize], - pub __pad2: ::std::os::raw::c_ulong, - pub __flags: ::std::os::raw::c_uint, +pub struct _OSUnalignedU32 { + pub __val: u32, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of __pthread_rwlock_arch_t"][::std::mem::size_of::<__pthread_rwlock_arch_t>() - 56usize]; - ["Alignment of __pthread_rwlock_arch_t"][::std::mem::align_of::<__pthread_rwlock_arch_t>() - 8usize]; - ["Offset of field: __pthread_rwlock_arch_t::__readers"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __readers) - 0usize]; - ["Offset of field: __pthread_rwlock_arch_t::__writers"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __writers) - 4usize]; - ["Offset of field: __pthread_rwlock_arch_t::__wrphase_futex"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __wrphase_futex) - 8usize]; - ["Offset of field: __pthread_rwlock_arch_t::__writers_futex"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __writers_futex) - 12usize]; - ["Offset of field: __pthread_rwlock_arch_t::__pad3"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __pad3) - 16usize]; - ["Offset of field: __pthread_rwlock_arch_t::__pad4"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __pad4) - 20usize]; - ["Offset of field: __pthread_rwlock_arch_t::__cur_writer"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __cur_writer) - 24usize]; - ["Offset of field: __pthread_rwlock_arch_t::__shared"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __shared) - 28usize]; - ["Offset of field: __pthread_rwlock_arch_t::__rwelision"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __rwelision) - 32usize]; - ["Offset of field: __pthread_rwlock_arch_t::__pad1"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __pad1) - 33usize]; - ["Offset of field: __pthread_rwlock_arch_t::__pad2"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __pad2) - 40usize]; - ["Offset of field: __pthread_rwlock_arch_t::__flags"] - [::std::mem::offset_of!(__pthread_rwlock_arch_t, __flags) - 48usize]; + ["Size of _OSUnalignedU32"][::std::mem::size_of::<_OSUnalignedU32>() - 4usize]; + ["Alignment of _OSUnalignedU32"][::std::mem::align_of::<_OSUnalignedU32>() - 1usize]; + ["Offset of field: _OSUnalignedU32::__val"][::std::mem::offset_of!(_OSUnalignedU32, __val) - 0usize]; }; -#[repr(C)] -#[derive(Copy, Clone)] -pub struct __pthread_cond_s { - pub __bindgen_anon_1: __pthread_cond_s__bindgen_ty_1, - pub __bindgen_anon_2: __pthread_cond_s__bindgen_ty_2, - pub __g_refs: [::std::os::raw::c_uint; 2usize], - pub __g_size: [::std::os::raw::c_uint; 2usize], - pub __g1_orig_size: ::std::os::raw::c_uint, - pub __wrefs: ::std::os::raw::c_uint, - pub __g_signals: [::std::os::raw::c_uint; 2usize], -} -#[repr(C)] -#[derive(Copy, Clone)] -pub union __pthread_cond_s__bindgen_ty_1 { - pub __wseq: ::std::os::raw::c_ulonglong, - pub __wseq32: __pthread_cond_s__bindgen_ty_1__bindgen_ty_1, -} -#[repr(C)] +#[repr(C, packed)] #[derive(Debug, Copy, Clone)] -pub struct __pthread_cond_s__bindgen_ty_1__bindgen_ty_1 { - pub __low: ::std::os::raw::c_uint, - pub __high: ::std::os::raw::c_uint, +pub struct _OSUnalignedU64 { + pub __val: u64, } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of __pthread_cond_s__bindgen_ty_1__bindgen_ty_1"] - [::std::mem::size_of::<__pthread_cond_s__bindgen_ty_1__bindgen_ty_1>() - 8usize]; - ["Alignment of __pthread_cond_s__bindgen_ty_1__bindgen_ty_1"] - [::std::mem::align_of::<__pthread_cond_s__bindgen_ty_1__bindgen_ty_1>() - 4usize]; - ["Offset of field: __pthread_cond_s__bindgen_ty_1__bindgen_ty_1::__low"] - [::std::mem::offset_of!(__pthread_cond_s__bindgen_ty_1__bindgen_ty_1, __low) - 0usize]; - ["Offset of field: __pthread_cond_s__bindgen_ty_1__bindgen_ty_1::__high"] - [::std::mem::offset_of!(__pthread_cond_s__bindgen_ty_1__bindgen_ty_1, __high) - 4usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __pthread_cond_s__bindgen_ty_1"][::std::mem::size_of::<__pthread_cond_s__bindgen_ty_1>() - 8usize]; - ["Alignment of __pthread_cond_s__bindgen_ty_1"][::std::mem::align_of::<__pthread_cond_s__bindgen_ty_1>() - 8usize]; - ["Offset of field: __pthread_cond_s__bindgen_ty_1::__wseq"] - [::std::mem::offset_of!(__pthread_cond_s__bindgen_ty_1, __wseq) - 0usize]; - ["Offset of field: __pthread_cond_s__bindgen_ty_1::__wseq32"] - [::std::mem::offset_of!(__pthread_cond_s__bindgen_ty_1, __wseq32) - 0usize]; + ["Size of _OSUnalignedU64"][::std::mem::size_of::<_OSUnalignedU64>() - 8usize]; + ["Alignment of _OSUnalignedU64"][::std::mem::align_of::<_OSUnalignedU64>() - 1usize]; + ["Offset of field: _OSUnalignedU64::__val"][::std::mem::offset_of!(_OSUnalignedU64, __val) - 0usize]; }; -#[repr(C)] -#[derive(Copy, Clone)] -pub union __pthread_cond_s__bindgen_ty_2 { - pub __g1_start: ::std::os::raw::c_ulonglong, - pub __g1_start32: __pthread_cond_s__bindgen_ty_2__bindgen_ty_1, -} +pub type u_char = ::std::os::raw::c_uchar; +pub type u_short = ::std::os::raw::c_ushort; +pub type u_int = ::std::os::raw::c_uint; +pub type u_long = ::std::os::raw::c_ulong; +pub type ushort = ::std::os::raw::c_ushort; +pub type uint = ::std::os::raw::c_uint; +pub type u_quad_t = u_int64_t; +pub type quad_t = i64; +pub type qaddr_t = *mut quad_t; +pub type caddr_t = *mut ::std::os::raw::c_char; +pub type daddr_t = i32; +pub type dev_t = __darwin_dev_t; +pub type fixpt_t = u_int32_t; +pub type blkcnt_t = __darwin_blkcnt_t; +pub type blksize_t = __darwin_blksize_t; +pub type gid_t = __darwin_gid_t; +pub type in_addr_t = __uint32_t; +pub type in_port_t = __uint16_t; +pub type ino_t = __darwin_ino_t; +pub type ino64_t = __darwin_ino64_t; +pub type key_t = __int32_t; +pub type mode_t = __darwin_mode_t; +pub type nlink_t = __uint16_t; +pub type id_t = __darwin_id_t; +pub type pid_t = __darwin_pid_t; +pub type segsz_t = i32; +pub type swblk_t = i32; +pub type uid_t = __darwin_uid_t; +pub type clock_t = __darwin_clock_t; +pub type time_t = __darwin_time_t; +pub type useconds_t = __darwin_useconds_t; +pub type suseconds_t = __darwin_suseconds_t; +pub type rsize_t = __darwin_size_t; +pub type errno_t = ::std::os::raw::c_int; #[repr(C)] #[derive(Debug, Copy, Clone)] -pub struct __pthread_cond_s__bindgen_ty_2__bindgen_ty_1 { - pub __low: ::std::os::raw::c_uint, - pub __high: ::std::os::raw::c_uint, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __pthread_cond_s__bindgen_ty_2__bindgen_ty_1"] - [::std::mem::size_of::<__pthread_cond_s__bindgen_ty_2__bindgen_ty_1>() - 8usize]; - ["Alignment of __pthread_cond_s__bindgen_ty_2__bindgen_ty_1"] - [::std::mem::align_of::<__pthread_cond_s__bindgen_ty_2__bindgen_ty_1>() - 4usize]; - ["Offset of field: __pthread_cond_s__bindgen_ty_2__bindgen_ty_1::__low"] - [::std::mem::offset_of!(__pthread_cond_s__bindgen_ty_2__bindgen_ty_1, __low) - 0usize]; - ["Offset of field: __pthread_cond_s__bindgen_ty_2__bindgen_ty_1::__high"] - [::std::mem::offset_of!(__pthread_cond_s__bindgen_ty_2__bindgen_ty_1, __high) - 4usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __pthread_cond_s__bindgen_ty_2"][::std::mem::size_of::<__pthread_cond_s__bindgen_ty_2>() - 8usize]; - ["Alignment of __pthread_cond_s__bindgen_ty_2"][::std::mem::align_of::<__pthread_cond_s__bindgen_ty_2>() - 8usize]; - ["Offset of field: __pthread_cond_s__bindgen_ty_2::__g1_start"] - [::std::mem::offset_of!(__pthread_cond_s__bindgen_ty_2, __g1_start) - 0usize]; - ["Offset of field: __pthread_cond_s__bindgen_ty_2::__g1_start32"] - [::std::mem::offset_of!(__pthread_cond_s__bindgen_ty_2, __g1_start32) - 0usize]; -}; -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __pthread_cond_s"][::std::mem::size_of::<__pthread_cond_s>() - 48usize]; - ["Alignment of __pthread_cond_s"][::std::mem::align_of::<__pthread_cond_s>() - 8usize]; - ["Offset of field: __pthread_cond_s::__g_refs"][::std::mem::offset_of!(__pthread_cond_s, __g_refs) - 16usize]; - ["Offset of field: __pthread_cond_s::__g_size"][::std::mem::offset_of!(__pthread_cond_s, __g_size) - 24usize]; - ["Offset of field: __pthread_cond_s::__g1_orig_size"] - [::std::mem::offset_of!(__pthread_cond_s, __g1_orig_size) - 32usize]; - ["Offset of field: __pthread_cond_s::__wrefs"][::std::mem::offset_of!(__pthread_cond_s, __wrefs) - 36usize]; - ["Offset of field: __pthread_cond_s::__g_signals"][::std::mem::offset_of!(__pthread_cond_s, __g_signals) - 40usize]; -}; -pub type pthread_t = ::std::os::raw::c_ulong; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_mutexattr_t { - pub __size: [::std::os::raw::c_char; 4usize], - pub __align: ::std::os::raw::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of pthread_mutexattr_t"][::std::mem::size_of::() - 4usize]; - ["Alignment of pthread_mutexattr_t"][::std::mem::align_of::() - 4usize]; - ["Offset of field: pthread_mutexattr_t::__size"][::std::mem::offset_of!(pthread_mutexattr_t, __size) - 0usize]; - ["Offset of field: pthread_mutexattr_t::__align"][::std::mem::offset_of!(pthread_mutexattr_t, __align) - 0usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_condattr_t { - pub __size: [::std::os::raw::c_char; 4usize], - pub __align: ::std::os::raw::c_int, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of pthread_condattr_t"][::std::mem::size_of::() - 4usize]; - ["Alignment of pthread_condattr_t"][::std::mem::align_of::() - 4usize]; - ["Offset of field: pthread_condattr_t::__size"][::std::mem::offset_of!(pthread_condattr_t, __size) - 0usize]; - ["Offset of field: pthread_condattr_t::__align"][::std::mem::offset_of!(pthread_condattr_t, __align) - 0usize]; -}; -pub type pthread_key_t = ::std::os::raw::c_uint; -pub type pthread_once_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_attr_t { - pub __size: [::std::os::raw::c_char; 56usize], - pub __align: ::std::os::raw::c_long, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of pthread_attr_t"][::std::mem::size_of::() - 56usize]; - ["Alignment of pthread_attr_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: pthread_attr_t::__size"][::std::mem::offset_of!(pthread_attr_t, __size) - 0usize]; - ["Offset of field: pthread_attr_t::__align"][::std::mem::offset_of!(pthread_attr_t, __align) - 0usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_mutex_t { - pub __data: __pthread_mutex_s, - pub __size: [::std::os::raw::c_char; 40usize], - pub __align: ::std::os::raw::c_long, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of pthread_mutex_t"][::std::mem::size_of::() - 40usize]; - ["Alignment of pthread_mutex_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: pthread_mutex_t::__data"][::std::mem::offset_of!(pthread_mutex_t, __data) - 0usize]; - ["Offset of field: pthread_mutex_t::__size"][::std::mem::offset_of!(pthread_mutex_t, __size) - 0usize]; - ["Offset of field: pthread_mutex_t::__align"][::std::mem::offset_of!(pthread_mutex_t, __align) - 0usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_cond_t { - pub __data: __pthread_cond_s, - pub __size: [::std::os::raw::c_char; 48usize], - pub __align: ::std::os::raw::c_longlong, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of pthread_cond_t"][::std::mem::size_of::() - 48usize]; - ["Alignment of pthread_cond_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: pthread_cond_t::__data"][::std::mem::offset_of!(pthread_cond_t, __data) - 0usize]; - ["Offset of field: pthread_cond_t::__size"][::std::mem::offset_of!(pthread_cond_t, __size) - 0usize]; - ["Offset of field: pthread_cond_t::__align"][::std::mem::offset_of!(pthread_cond_t, __align) - 0usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_rwlock_t { - pub __data: __pthread_rwlock_arch_t, - pub __size: [::std::os::raw::c_char; 56usize], - pub __align: ::std::os::raw::c_long, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of pthread_rwlock_t"][::std::mem::size_of::() - 56usize]; - ["Alignment of pthread_rwlock_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: pthread_rwlock_t::__data"][::std::mem::offset_of!(pthread_rwlock_t, __data) - 0usize]; - ["Offset of field: pthread_rwlock_t::__size"][::std::mem::offset_of!(pthread_rwlock_t, __size) - 0usize]; - ["Offset of field: pthread_rwlock_t::__align"][::std::mem::offset_of!(pthread_rwlock_t, __align) - 0usize]; -}; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_rwlockattr_t { - pub __size: [::std::os::raw::c_char; 8usize], - pub __align: ::std::os::raw::c_long, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of pthread_rwlockattr_t"][::std::mem::size_of::() - 8usize]; - ["Alignment of pthread_rwlockattr_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: pthread_rwlockattr_t::__size"][::std::mem::offset_of!(pthread_rwlockattr_t, __size) - 0usize]; - ["Offset of field: pthread_rwlockattr_t::__align"][::std::mem::offset_of!(pthread_rwlockattr_t, __align) - 0usize]; -}; -pub type pthread_spinlock_t = ::std::os::raw::c_int; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_barrier_t { - pub __size: [::std::os::raw::c_char; 32usize], - pub __align: ::std::os::raw::c_long, +pub struct fd_set { + pub fds_bits: [__int32_t; 32usize], } #[allow(clippy::unnecessary_operation, clippy::identity_op)] const _: () = { - ["Size of pthread_barrier_t"][::std::mem::size_of::() - 32usize]; - ["Alignment of pthread_barrier_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: pthread_barrier_t::__size"][::std::mem::offset_of!(pthread_barrier_t, __size) - 0usize]; - ["Offset of field: pthread_barrier_t::__align"][::std::mem::offset_of!(pthread_barrier_t, __align) - 0usize]; + ["Size of fd_set"][::std::mem::size_of::() - 128usize]; + ["Alignment of fd_set"][::std::mem::align_of::() - 4usize]; + ["Offset of field: fd_set::fds_bits"][::std::mem::offset_of!(fd_set, fds_bits) - 0usize]; }; -#[repr(C)] -#[derive(Copy, Clone)] -pub union pthread_barrierattr_t { - pub __size: [::std::os::raw::c_char; 4usize], - pub __align: ::std::os::raw::c_int, +extern "C" { + pub fn __darwin_check_fd_set_overflow( + arg1: ::std::os::raw::c_int, + arg2: *const ::std::os::raw::c_void, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; } -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of pthread_barrierattr_t"][::std::mem::size_of::() - 4usize]; - ["Alignment of pthread_barrierattr_t"][::std::mem::align_of::() - 4usize]; - ["Offset of field: pthread_barrierattr_t::__size"][::std::mem::offset_of!(pthread_barrierattr_t, __size) - 0usize]; - ["Offset of field: pthread_barrierattr_t::__align"][::std::mem::offset_of!(pthread_barrierattr_t, __align) - 0usize]; -}; +pub type fd_mask = __int32_t; +pub type pthread_attr_t = __darwin_pthread_attr_t; +pub type pthread_cond_t = __darwin_pthread_cond_t; +pub type pthread_condattr_t = __darwin_pthread_condattr_t; +pub type pthread_mutex_t = __darwin_pthread_mutex_t; +pub type pthread_mutexattr_t = __darwin_pthread_mutexattr_t; +pub type pthread_once_t = __darwin_pthread_once_t; +pub type pthread_rwlock_t = __darwin_pthread_rwlock_t; +pub type pthread_rwlockattr_t = __darwin_pthread_rwlockattr_t; +pub type pthread_t = __darwin_pthread_t; +pub type pthread_key_t = __darwin_pthread_key_t; +pub type fsblkcnt_t = __darwin_fsblkcnt_t; +pub type fsfilcnt_t = __darwin_fsfilcnt_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mm128_t { @@ -2315,261 +2479,226 @@ extern "C" { ) -> *mut mm_idx_t; } extern "C" { - pub fn memcpy( - __dest: *mut ::std::os::raw::c_void, - __src: *const ::std::os::raw::c_void, + pub fn memchr( + __s: *const ::std::os::raw::c_void, + __c: ::std::os::raw::c_int, __n: ::std::os::raw::c_ulong, ) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn memmove( - __dest: *mut ::std::os::raw::c_void, + pub fn memcmp( + __s1: *const ::std::os::raw::c_void, + __s2: *const ::std::os::raw::c_void, + __n: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn memcpy( + __dst: *mut ::std::os::raw::c_void, __src: *const ::std::os::raw::c_void, __n: ::std::os::raw::c_ulong, ) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn memccpy( - __dest: *mut ::std::os::raw::c_void, + pub fn memmove( + __dst: *mut ::std::os::raw::c_void, __src: *const ::std::os::raw::c_void, - __c: ::std::os::raw::c_int, - __n: ::std::os::raw::c_ulong, + __len: ::std::os::raw::c_ulong, ) -> *mut ::std::os::raw::c_void; } extern "C" { pub fn memset( - __s: *mut ::std::os::raw::c_void, + __b: *mut ::std::os::raw::c_void, __c: ::std::os::raw::c_int, - __n: ::std::os::raw::c_ulong, + __len: ::std::os::raw::c_ulong, ) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn memcmp( - __s1: *const ::std::os::raw::c_void, - __s2: *const ::std::os::raw::c_void, - __n: ::std::os::raw::c_ulong, - ) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn memchr( - __s: *const ::std::os::raw::c_void, - __c: ::std::os::raw::c_int, - __n: ::std::os::raw::c_ulong, - ) -> *mut ::std::os::raw::c_void; + pub fn strcat(__s1: *mut ::std::os::raw::c_char, __s2: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn strcpy( - __dest: *mut ::std::os::raw::c_char, - __src: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; + pub fn strchr(__s: *const ::std::os::raw::c_char, __c: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn strncpy( - __dest: *mut ::std::os::raw::c_char, - __src: *const ::std::os::raw::c_char, - __n: ::std::os::raw::c_ulong, - ) -> *mut ::std::os::raw::c_char; + pub fn strcmp(__s1: *const ::std::os::raw::c_char, __s2: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } extern "C" { - pub fn strcat( - __dest: *mut ::std::os::raw::c_char, - __src: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; + pub fn strcoll(__s1: *const ::std::os::raw::c_char, __s2: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } extern "C" { - pub fn strncat( - __dest: *mut ::std::os::raw::c_char, + pub fn strcpy( + __dst: *mut ::std::os::raw::c_char, __src: *const ::std::os::raw::c_char, - __n: ::std::os::raw::c_ulong, ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn strcmp(__s1: *const ::std::os::raw::c_char, __s2: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; + pub fn strcspn( + __s: *const ::std::os::raw::c_char, + __charset: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_ulong; } extern "C" { - pub fn strncmp( - __s1: *const ::std::os::raw::c_char, - __s2: *const ::std::os::raw::c_char, - __n: ::std::os::raw::c_ulong, - ) -> ::std::os::raw::c_int; + pub fn strerror(__errnum: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn strcoll(__s1: *const ::std::os::raw::c_char, __s2: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; + pub fn strlen(__s: *const ::std::os::raw::c_char) -> ::std::os::raw::c_ulong; } extern "C" { - pub fn strxfrm( - __dest: *mut ::std::os::raw::c_char, - __src: *const ::std::os::raw::c_char, + pub fn strncat( + __s1: *mut ::std::os::raw::c_char, + __s2: *const ::std::os::raw::c_char, __n: ::std::os::raw::c_ulong, - ) -> ::std::os::raw::c_ulong; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __locale_struct { - pub __locales: [*mut __locale_data; 13usize], - pub __ctype_b: *const ::std::os::raw::c_ushort, - pub __ctype_tolower: *const ::std::os::raw::c_int, - pub __ctype_toupper: *const ::std::os::raw::c_int, - pub __names: [*const ::std::os::raw::c_char; 13usize], + ) -> *mut ::std::os::raw::c_char; } -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __locale_struct"][::std::mem::size_of::<__locale_struct>() - 232usize]; - ["Alignment of __locale_struct"][::std::mem::align_of::<__locale_struct>() - 8usize]; - ["Offset of field: __locale_struct::__locales"][::std::mem::offset_of!(__locale_struct, __locales) - 0usize]; - ["Offset of field: __locale_struct::__ctype_b"][::std::mem::offset_of!(__locale_struct, __ctype_b) - 104usize]; - ["Offset of field: __locale_struct::__ctype_tolower"] - [::std::mem::offset_of!(__locale_struct, __ctype_tolower) - 112usize]; - ["Offset of field: __locale_struct::__ctype_toupper"] - [::std::mem::offset_of!(__locale_struct, __ctype_toupper) - 120usize]; - ["Offset of field: __locale_struct::__names"][::std::mem::offset_of!(__locale_struct, __names) - 128usize]; -}; -pub type __locale_t = *mut __locale_struct; -pub type locale_t = __locale_t; extern "C" { - pub fn strcoll_l( + pub fn strncmp( __s1: *const ::std::os::raw::c_char, __s2: *const ::std::os::raw::c_char, - __l: locale_t, + __n: ::std::os::raw::c_ulong, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn strxfrm_l( - __dest: *mut ::std::os::raw::c_char, + pub fn strncpy( + __dst: *mut ::std::os::raw::c_char, __src: *const ::std::os::raw::c_char, - __n: usize, - __l: locale_t, - ) -> usize; -} -extern "C" { - pub fn strdup(__s: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -extern "C" { - pub fn strndup(__string: *const ::std::os::raw::c_char, __n: ::std::os::raw::c_ulong) -> *mut ::std::os::raw::c_char; + __n: ::std::os::raw::c_ulong, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn strchr(__s: *const ::std::os::raw::c_char, __c: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char; + pub fn strpbrk( + __s: *const ::std::os::raw::c_char, + __charset: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; } extern "C" { pub fn strrchr(__s: *const ::std::os::raw::c_char, __c: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn strcspn( + pub fn strspn( __s: *const ::std::os::raw::c_char, - __reject: *const ::std::os::raw::c_char, + __charset: *const ::std::os::raw::c_char, ) -> ::std::os::raw::c_ulong; } -extern "C" { - pub fn strspn(__s: *const ::std::os::raw::c_char, __accept: *const ::std::os::raw::c_char) - -> ::std::os::raw::c_ulong; -} -extern "C" { - pub fn strpbrk( - __s: *const ::std::os::raw::c_char, - __accept: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; -} extern "C" { pub fn strstr( - __haystack: *const ::std::os::raw::c_char, - __needle: *const ::std::os::raw::c_char, + __big: *const ::std::os::raw::c_char, + __little: *const ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char; } extern "C" { pub fn strtok( - __s: *mut ::std::os::raw::c_char, - __delim: *const ::std::os::raw::c_char, + __str: *mut ::std::os::raw::c_char, + __sep: *const ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn __strtok_r( - __s: *mut ::std::os::raw::c_char, - __delim: *const ::std::os::raw::c_char, - __save_ptr: *mut *mut ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; + pub fn strxfrm( + __s1: *mut ::std::os::raw::c_char, + __s2: *const ::std::os::raw::c_char, + __n: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_ulong; } extern "C" { pub fn strtok_r( - __s: *mut ::std::os::raw::c_char, - __delim: *const ::std::os::raw::c_char, - __save_ptr: *mut *mut ::std::os::raw::c_char, + __str: *mut ::std::os::raw::c_char, + __sep: *const ::std::os::raw::c_char, + __lasts: *mut *mut ::std::os::raw::c_char, ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn strlen(__s: *const ::std::os::raw::c_char) -> ::std::os::raw::c_ulong; -} -extern "C" { - pub fn strnlen(__string: *const ::std::os::raw::c_char, __maxlen: usize) -> usize; -} -extern "C" { - pub fn strerror(__errnum: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char; -} -extern "C" { - #[link_name = "\u{1}__xpg_strerror_r"] pub fn strerror_r( __errnum: ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_char, + __strerrbuf: *mut ::std::os::raw::c_char, __buflen: usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn strerror_l(__errnum: ::std::os::raw::c_int, __l: locale_t) -> *mut ::std::os::raw::c_char; + pub fn strdup(__s1: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn bcmp( - __s1: *const ::std::os::raw::c_void, - __s2: *const ::std::os::raw::c_void, + pub fn memccpy( + __dst: *mut ::std::os::raw::c_void, + __src: *const ::std::os::raw::c_void, + __c: ::std::os::raw::c_int, __n: ::std::os::raw::c_ulong, - ) -> ::std::os::raw::c_int; + ) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn bcopy(__src: *const ::std::os::raw::c_void, __dest: *mut ::std::os::raw::c_void, __n: usize); + pub fn stpcpy( + __dst: *mut ::std::os::raw::c_char, + __src: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn bzero(__s: *mut ::std::os::raw::c_void, __n: ::std::os::raw::c_ulong); + pub fn stpncpy( + __dst: *mut ::std::os::raw::c_char, + __src: *const ::std::os::raw::c_char, + __n: ::std::os::raw::c_ulong, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn index(__s: *const ::std::os::raw::c_char, __c: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char; + pub fn strndup(__s1: *const ::std::os::raw::c_char, __n: ::std::os::raw::c_ulong) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn rindex(__s: *const ::std::os::raw::c_char, __c: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char; + pub fn strnlen(__s1: *const ::std::os::raw::c_char, __n: usize) -> usize; } extern "C" { - pub fn ffs(__i: ::std::os::raw::c_int) -> ::std::os::raw::c_int; + pub fn strsignal(__sig: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn ffsl(__l: ::std::os::raw::c_long) -> ::std::os::raw::c_int; + pub fn memset_s( + __s: *mut ::std::os::raw::c_void, + __smax: rsize_t, + __c: ::std::os::raw::c_int, + __n: rsize_t, + ) -> errno_t; } extern "C" { - pub fn ffsll(__ll: ::std::os::raw::c_longlong) -> ::std::os::raw::c_int; + pub fn memmem( + __big: *const ::std::os::raw::c_void, + __big_len: usize, + __little: *const ::std::os::raw::c_void, + __little_len: usize, + ) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn strcasecmp(__s1: *const ::std::os::raw::c_char, __s2: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; + pub fn memset_pattern4(__b: *mut ::std::os::raw::c_void, __pattern4: *const ::std::os::raw::c_void, __len: usize); } extern "C" { - pub fn strncasecmp( - __s1: *const ::std::os::raw::c_char, - __s2: *const ::std::os::raw::c_char, - __n: ::std::os::raw::c_ulong, - ) -> ::std::os::raw::c_int; + pub fn memset_pattern8(__b: *mut ::std::os::raw::c_void, __pattern8: *const ::std::os::raw::c_void, __len: usize); } extern "C" { - pub fn strcasecmp_l( - __s1: *const ::std::os::raw::c_char, - __s2: *const ::std::os::raw::c_char, - __loc: locale_t, - ) -> ::std::os::raw::c_int; + pub fn memset_pattern16(__b: *mut ::std::os::raw::c_void, __pattern16: *const ::std::os::raw::c_void, __len: usize); } extern "C" { - pub fn strncasecmp_l( - __s1: *const ::std::os::raw::c_char, - __s2: *const ::std::os::raw::c_char, - __n: usize, - __loc: locale_t, - ) -> ::std::os::raw::c_int; + pub fn strcasestr( + __big: *const ::std::os::raw::c_char, + __little: *const ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strnstr( + __big: *const ::std::os::raw::c_char, + __little: *const ::std::os::raw::c_char, + __len: usize, + ) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn strlcat( + __dst: *mut ::std::os::raw::c_char, + __source: *const ::std::os::raw::c_char, + __size: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_ulong; +} +extern "C" { + pub fn strlcpy( + __dst: *mut ::std::os::raw::c_char, + __source: *const ::std::os::raw::c_char, + __size: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_ulong; } extern "C" { - pub fn explicit_bzero(__s: *mut ::std::os::raw::c_void, __n: usize); + pub fn strmode(__mode: ::std::os::raw::c_int, __bp: *mut ::std::os::raw::c_char); } extern "C" { pub fn strsep( @@ -2578,33 +2707,68 @@ extern "C" { ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn strsignal(__sig: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char; + pub fn swab(arg1: *const ::std::os::raw::c_void, arg2: *mut ::std::os::raw::c_void, arg3: isize); } extern "C" { - pub fn __stpcpy( - __dest: *mut ::std::os::raw::c_char, - __src: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; + pub fn timingsafe_bcmp( + __b1: *const ::std::os::raw::c_void, + __b2: *const ::std::os::raw::c_void, + __len: usize, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn stpcpy( - __dest: *mut ::std::os::raw::c_char, - __src: *const ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; + pub fn strsignal_r( + __sig: ::std::os::raw::c_int, + __strsignalbuf: *mut ::std::os::raw::c_char, + __buflen: usize, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn __stpncpy( - __dest: *mut ::std::os::raw::c_char, - __src: *const ::std::os::raw::c_char, - __n: usize, - ) -> *mut ::std::os::raw::c_char; + pub fn bcmp( + arg1: *const ::std::os::raw::c_void, + arg2: *const ::std::os::raw::c_void, + arg3: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn stpncpy( - __dest: *mut ::std::os::raw::c_char, - __src: *const ::std::os::raw::c_char, - __n: ::std::os::raw::c_ulong, - ) -> *mut ::std::os::raw::c_char; + pub fn bcopy(arg1: *const ::std::os::raw::c_void, arg2: *mut ::std::os::raw::c_void, arg3: ::std::os::raw::c_ulong); +} +extern "C" { + pub fn bzero(arg1: *mut ::std::os::raw::c_void, arg2: ::std::os::raw::c_ulong); +} +extern "C" { + pub fn index(arg1: *const ::std::os::raw::c_char, arg2: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn rindex(arg1: *const ::std::os::raw::c_char, arg2: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn ffs(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn strcasecmp(arg1: *const ::std::os::raw::c_char, arg2: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn strncasecmp( + arg1: *const ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_ulong, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ffsl(arg1: ::std::os::raw::c_long) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn ffsll(arg1: ::std::os::raw::c_longlong) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn fls(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn flsl(arg1: ::std::os::raw::c_long) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn flsll(arg1: ::std::os::raw::c_longlong) -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -2694,15 +2858,1258 @@ extern "C" { extern "C" { pub static mut seq_comp_table: [::std::os::raw::c_uchar; 256usize]; } -pub type wchar_t = ::std::os::raw::c_int; pub const idtype_t_P_ALL: idtype_t = 0; pub const idtype_t_P_PID: idtype_t = 1; pub const idtype_t_P_PGID: idtype_t = 2; pub type idtype_t = ::std::os::raw::c_uint; -pub type _Float32 = f32; -pub type _Float64 = f64; -pub type _Float32x = f64; -pub type _Float64x = u128; +pub type sig_atomic_t = ::std::os::raw::c_int; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __darwin_arm_exception_state { + pub __exception: __uint32_t, + pub __fsr: __uint32_t, + pub __far: __uint32_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __darwin_arm_exception_state"][::std::mem::size_of::<__darwin_arm_exception_state>() - 12usize]; + ["Alignment of __darwin_arm_exception_state"][::std::mem::align_of::<__darwin_arm_exception_state>() - 4usize]; + ["Offset of field: __darwin_arm_exception_state::__exception"] + [::std::mem::offset_of!(__darwin_arm_exception_state, __exception) - 0usize]; + ["Offset of field: __darwin_arm_exception_state::__fsr"] + [::std::mem::offset_of!(__darwin_arm_exception_state, __fsr) - 4usize]; + ["Offset of field: __darwin_arm_exception_state::__far"] + [::std::mem::offset_of!(__darwin_arm_exception_state, __far) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __darwin_arm_exception_state64 { + pub __far: __uint64_t, + pub __esr: __uint32_t, + pub __exception: __uint32_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __darwin_arm_exception_state64"][::std::mem::size_of::<__darwin_arm_exception_state64>() - 16usize]; + ["Alignment of __darwin_arm_exception_state64"][::std::mem::align_of::<__darwin_arm_exception_state64>() - 8usize]; + ["Offset of field: __darwin_arm_exception_state64::__far"] + [::std::mem::offset_of!(__darwin_arm_exception_state64, __far) - 0usize]; + ["Offset of field: __darwin_arm_exception_state64::__esr"] + [::std::mem::offset_of!(__darwin_arm_exception_state64, __esr) - 8usize]; + ["Offset of field: __darwin_arm_exception_state64::__exception"] + [::std::mem::offset_of!(__darwin_arm_exception_state64, __exception) - 12usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __darwin_arm_thread_state { + pub __r: [__uint32_t; 13usize], + pub __sp: __uint32_t, + pub __lr: __uint32_t, + pub __pc: __uint32_t, + pub __cpsr: __uint32_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __darwin_arm_thread_state"][::std::mem::size_of::<__darwin_arm_thread_state>() - 68usize]; + ["Alignment of __darwin_arm_thread_state"][::std::mem::align_of::<__darwin_arm_thread_state>() - 4usize]; + ["Offset of field: __darwin_arm_thread_state::__r"][::std::mem::offset_of!(__darwin_arm_thread_state, __r) - 0usize]; + ["Offset of field: __darwin_arm_thread_state::__sp"] + [::std::mem::offset_of!(__darwin_arm_thread_state, __sp) - 52usize]; + ["Offset of field: __darwin_arm_thread_state::__lr"] + [::std::mem::offset_of!(__darwin_arm_thread_state, __lr) - 56usize]; + ["Offset of field: __darwin_arm_thread_state::__pc"] + [::std::mem::offset_of!(__darwin_arm_thread_state, __pc) - 60usize]; + ["Offset of field: __darwin_arm_thread_state::__cpsr"] + [::std::mem::offset_of!(__darwin_arm_thread_state, __cpsr) - 64usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __darwin_arm_thread_state64 { + pub __x: [__uint64_t; 29usize], + pub __fp: __uint64_t, + pub __lr: __uint64_t, + pub __sp: __uint64_t, + pub __pc: __uint64_t, + pub __cpsr: __uint32_t, + pub __pad: __uint32_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __darwin_arm_thread_state64"][::std::mem::size_of::<__darwin_arm_thread_state64>() - 272usize]; + ["Alignment of __darwin_arm_thread_state64"][::std::mem::align_of::<__darwin_arm_thread_state64>() - 8usize]; + ["Offset of field: __darwin_arm_thread_state64::__x"] + [::std::mem::offset_of!(__darwin_arm_thread_state64, __x) - 0usize]; + ["Offset of field: __darwin_arm_thread_state64::__fp"] + [::std::mem::offset_of!(__darwin_arm_thread_state64, __fp) - 232usize]; + ["Offset of field: __darwin_arm_thread_state64::__lr"] + [::std::mem::offset_of!(__darwin_arm_thread_state64, __lr) - 240usize]; + ["Offset of field: __darwin_arm_thread_state64::__sp"] + [::std::mem::offset_of!(__darwin_arm_thread_state64, __sp) - 248usize]; + ["Offset of field: __darwin_arm_thread_state64::__pc"] + [::std::mem::offset_of!(__darwin_arm_thread_state64, __pc) - 256usize]; + ["Offset of field: __darwin_arm_thread_state64::__cpsr"] + [::std::mem::offset_of!(__darwin_arm_thread_state64, __cpsr) - 264usize]; + ["Offset of field: __darwin_arm_thread_state64::__pad"] + [::std::mem::offset_of!(__darwin_arm_thread_state64, __pad) - 268usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __darwin_arm_vfp_state { + pub __r: [__uint32_t; 64usize], + pub __fpscr: __uint32_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __darwin_arm_vfp_state"][::std::mem::size_of::<__darwin_arm_vfp_state>() - 260usize]; + ["Alignment of __darwin_arm_vfp_state"][::std::mem::align_of::<__darwin_arm_vfp_state>() - 4usize]; + ["Offset of field: __darwin_arm_vfp_state::__r"][::std::mem::offset_of!(__darwin_arm_vfp_state, __r) - 0usize]; + ["Offset of field: __darwin_arm_vfp_state::__fpscr"] + [::std::mem::offset_of!(__darwin_arm_vfp_state, __fpscr) - 256usize]; +}; +#[repr(C)] +#[repr(align(16))] +#[derive(Debug, Copy, Clone)] +pub struct __darwin_arm_neon_state64 { + pub __v: [__uint128_t; 32usize], + pub __fpsr: __uint32_t, + pub __fpcr: __uint32_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __darwin_arm_neon_state64"][::std::mem::size_of::<__darwin_arm_neon_state64>() - 528usize]; + ["Alignment of __darwin_arm_neon_state64"][::std::mem::align_of::<__darwin_arm_neon_state64>() - 16usize]; + ["Offset of field: __darwin_arm_neon_state64::__v"][::std::mem::offset_of!(__darwin_arm_neon_state64, __v) - 0usize]; + ["Offset of field: __darwin_arm_neon_state64::__fpsr"] + [::std::mem::offset_of!(__darwin_arm_neon_state64, __fpsr) - 512usize]; + ["Offset of field: __darwin_arm_neon_state64::__fpcr"] + [::std::mem::offset_of!(__darwin_arm_neon_state64, __fpcr) - 516usize]; +}; +#[repr(C)] +#[repr(align(16))] +#[derive(Debug, Copy, Clone)] +pub struct __darwin_arm_neon_state { + pub __v: [__uint128_t; 16usize], + pub __fpsr: __uint32_t, + pub __fpcr: __uint32_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __darwin_arm_neon_state"][::std::mem::size_of::<__darwin_arm_neon_state>() - 272usize]; + ["Alignment of __darwin_arm_neon_state"][::std::mem::align_of::<__darwin_arm_neon_state>() - 16usize]; + ["Offset of field: __darwin_arm_neon_state::__v"][::std::mem::offset_of!(__darwin_arm_neon_state, __v) - 0usize]; + ["Offset of field: __darwin_arm_neon_state::__fpsr"] + [::std::mem::offset_of!(__darwin_arm_neon_state, __fpsr) - 256usize]; + ["Offset of field: __darwin_arm_neon_state::__fpcr"] + [::std::mem::offset_of!(__darwin_arm_neon_state, __fpcr) - 260usize]; +}; +#[repr(C)] +#[repr(align(64))] +#[derive(Debug, Copy, Clone)] +pub struct __darwin_arm_amx_state_v1 { + pub __x: [[__uint8_t; 64usize]; 8usize], + pub __y: [[__uint8_t; 64usize]; 8usize], + pub __z: [[__uint8_t; 64usize]; 64usize], + pub __amx_state_t_el1: __uint64_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __darwin_arm_amx_state_v1"][::std::mem::size_of::<__darwin_arm_amx_state_v1>() - 5184usize]; + ["Alignment of __darwin_arm_amx_state_v1"][::std::mem::align_of::<__darwin_arm_amx_state_v1>() - 64usize]; + ["Offset of field: __darwin_arm_amx_state_v1::__x"][::std::mem::offset_of!(__darwin_arm_amx_state_v1, __x) - 0usize]; + ["Offset of field: __darwin_arm_amx_state_v1::__y"] + [::std::mem::offset_of!(__darwin_arm_amx_state_v1, __y) - 512usize]; + ["Offset of field: __darwin_arm_amx_state_v1::__z"] + [::std::mem::offset_of!(__darwin_arm_amx_state_v1, __z) - 1024usize]; + ["Offset of field: __darwin_arm_amx_state_v1::__amx_state_t_el1"] + [::std::mem::offset_of!(__darwin_arm_amx_state_v1, __amx_state_t_el1) - 5120usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __arm_pagein_state { + pub __pagein_error: ::std::os::raw::c_int, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __arm_pagein_state"][::std::mem::size_of::<__arm_pagein_state>() - 4usize]; + ["Alignment of __arm_pagein_state"][::std::mem::align_of::<__arm_pagein_state>() - 4usize]; + ["Offset of field: __arm_pagein_state::__pagein_error"] + [::std::mem::offset_of!(__arm_pagein_state, __pagein_error) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __arm_legacy_debug_state { + pub __bvr: [__uint32_t; 16usize], + pub __bcr: [__uint32_t; 16usize], + pub __wvr: [__uint32_t; 16usize], + pub __wcr: [__uint32_t; 16usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __arm_legacy_debug_state"][::std::mem::size_of::<__arm_legacy_debug_state>() - 256usize]; + ["Alignment of __arm_legacy_debug_state"][::std::mem::align_of::<__arm_legacy_debug_state>() - 4usize]; + ["Offset of field: __arm_legacy_debug_state::__bvr"] + [::std::mem::offset_of!(__arm_legacy_debug_state, __bvr) - 0usize]; + ["Offset of field: __arm_legacy_debug_state::__bcr"] + [::std::mem::offset_of!(__arm_legacy_debug_state, __bcr) - 64usize]; + ["Offset of field: __arm_legacy_debug_state::__wvr"] + [::std::mem::offset_of!(__arm_legacy_debug_state, __wvr) - 128usize]; + ["Offset of field: __arm_legacy_debug_state::__wcr"] + [::std::mem::offset_of!(__arm_legacy_debug_state, __wcr) - 192usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __darwin_arm_debug_state32 { + pub __bvr: [__uint32_t; 16usize], + pub __bcr: [__uint32_t; 16usize], + pub __wvr: [__uint32_t; 16usize], + pub __wcr: [__uint32_t; 16usize], + pub __mdscr_el1: __uint64_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __darwin_arm_debug_state32"][::std::mem::size_of::<__darwin_arm_debug_state32>() - 264usize]; + ["Alignment of __darwin_arm_debug_state32"][::std::mem::align_of::<__darwin_arm_debug_state32>() - 8usize]; + ["Offset of field: __darwin_arm_debug_state32::__bvr"] + [::std::mem::offset_of!(__darwin_arm_debug_state32, __bvr) - 0usize]; + ["Offset of field: __darwin_arm_debug_state32::__bcr"] + [::std::mem::offset_of!(__darwin_arm_debug_state32, __bcr) - 64usize]; + ["Offset of field: __darwin_arm_debug_state32::__wvr"] + [::std::mem::offset_of!(__darwin_arm_debug_state32, __wvr) - 128usize]; + ["Offset of field: __darwin_arm_debug_state32::__wcr"] + [::std::mem::offset_of!(__darwin_arm_debug_state32, __wcr) - 192usize]; + ["Offset of field: __darwin_arm_debug_state32::__mdscr_el1"] + [::std::mem::offset_of!(__darwin_arm_debug_state32, __mdscr_el1) - 256usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __darwin_arm_debug_state64 { + pub __bvr: [__uint64_t; 16usize], + pub __bcr: [__uint64_t; 16usize], + pub __wvr: [__uint64_t; 16usize], + pub __wcr: [__uint64_t; 16usize], + pub __mdscr_el1: __uint64_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __darwin_arm_debug_state64"][::std::mem::size_of::<__darwin_arm_debug_state64>() - 520usize]; + ["Alignment of __darwin_arm_debug_state64"][::std::mem::align_of::<__darwin_arm_debug_state64>() - 8usize]; + ["Offset of field: __darwin_arm_debug_state64::__bvr"] + [::std::mem::offset_of!(__darwin_arm_debug_state64, __bvr) - 0usize]; + ["Offset of field: __darwin_arm_debug_state64::__bcr"] + [::std::mem::offset_of!(__darwin_arm_debug_state64, __bcr) - 128usize]; + ["Offset of field: __darwin_arm_debug_state64::__wvr"] + [::std::mem::offset_of!(__darwin_arm_debug_state64, __wvr) - 256usize]; + ["Offset of field: __darwin_arm_debug_state64::__wcr"] + [::std::mem::offset_of!(__darwin_arm_debug_state64, __wcr) - 384usize]; + ["Offset of field: __darwin_arm_debug_state64::__mdscr_el1"] + [::std::mem::offset_of!(__darwin_arm_debug_state64, __mdscr_el1) - 512usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __darwin_arm_cpmu_state64 { + pub __ctrs: [__uint64_t; 16usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __darwin_arm_cpmu_state64"][::std::mem::size_of::<__darwin_arm_cpmu_state64>() - 128usize]; + ["Alignment of __darwin_arm_cpmu_state64"][::std::mem::align_of::<__darwin_arm_cpmu_state64>() - 8usize]; + ["Offset of field: __darwin_arm_cpmu_state64::__ctrs"] + [::std::mem::offset_of!(__darwin_arm_cpmu_state64, __ctrs) - 0usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __darwin_mcontext32 { + pub __es: __darwin_arm_exception_state, + pub __ss: __darwin_arm_thread_state, + pub __fs: __darwin_arm_vfp_state, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __darwin_mcontext32"][::std::mem::size_of::<__darwin_mcontext32>() - 340usize]; + ["Alignment of __darwin_mcontext32"][::std::mem::align_of::<__darwin_mcontext32>() - 4usize]; + ["Offset of field: __darwin_mcontext32::__es"][::std::mem::offset_of!(__darwin_mcontext32, __es) - 0usize]; + ["Offset of field: __darwin_mcontext32::__ss"][::std::mem::offset_of!(__darwin_mcontext32, __ss) - 12usize]; + ["Offset of field: __darwin_mcontext32::__fs"][::std::mem::offset_of!(__darwin_mcontext32, __fs) - 80usize]; +}; +#[repr(C)] +#[repr(align(16))] +#[derive(Debug, Copy, Clone)] +pub struct __darwin_mcontext64 { + pub __es: __darwin_arm_exception_state64, + pub __ss: __darwin_arm_thread_state64, + pub __ns: __darwin_arm_neon_state64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __darwin_mcontext64"][::std::mem::size_of::<__darwin_mcontext64>() - 816usize]; + ["Alignment of __darwin_mcontext64"][::std::mem::align_of::<__darwin_mcontext64>() - 16usize]; + ["Offset of field: __darwin_mcontext64::__es"][::std::mem::offset_of!(__darwin_mcontext64, __es) - 0usize]; + ["Offset of field: __darwin_mcontext64::__ss"][::std::mem::offset_of!(__darwin_mcontext64, __ss) - 16usize]; + ["Offset of field: __darwin_mcontext64::__ns"][::std::mem::offset_of!(__darwin_mcontext64, __ns) - 288usize]; +}; +pub type mcontext_t = *mut __darwin_mcontext64; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __darwin_sigaltstack { + pub ss_sp: *mut ::std::os::raw::c_void, + pub ss_size: __darwin_size_t, + pub ss_flags: ::std::os::raw::c_int, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __darwin_sigaltstack"][::std::mem::size_of::<__darwin_sigaltstack>() - 24usize]; + ["Alignment of __darwin_sigaltstack"][::std::mem::align_of::<__darwin_sigaltstack>() - 8usize]; + ["Offset of field: __darwin_sigaltstack::ss_sp"][::std::mem::offset_of!(__darwin_sigaltstack, ss_sp) - 0usize]; + ["Offset of field: __darwin_sigaltstack::ss_size"][::std::mem::offset_of!(__darwin_sigaltstack, ss_size) - 8usize]; + ["Offset of field: __darwin_sigaltstack::ss_flags"][::std::mem::offset_of!(__darwin_sigaltstack, ss_flags) - 16usize]; +}; +pub type stack_t = __darwin_sigaltstack; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct __darwin_ucontext { + pub uc_onstack: ::std::os::raw::c_int, + pub uc_sigmask: __darwin_sigset_t, + pub uc_stack: __darwin_sigaltstack, + pub uc_link: *mut __darwin_ucontext, + pub uc_mcsize: __darwin_size_t, + pub uc_mcontext: *mut __darwin_mcontext64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __darwin_ucontext"][::std::mem::size_of::<__darwin_ucontext>() - 56usize]; + ["Alignment of __darwin_ucontext"][::std::mem::align_of::<__darwin_ucontext>() - 8usize]; + ["Offset of field: __darwin_ucontext::uc_onstack"][::std::mem::offset_of!(__darwin_ucontext, uc_onstack) - 0usize]; + ["Offset of field: __darwin_ucontext::uc_sigmask"][::std::mem::offset_of!(__darwin_ucontext, uc_sigmask) - 4usize]; + ["Offset of field: __darwin_ucontext::uc_stack"][::std::mem::offset_of!(__darwin_ucontext, uc_stack) - 8usize]; + ["Offset of field: __darwin_ucontext::uc_link"][::std::mem::offset_of!(__darwin_ucontext, uc_link) - 32usize]; + ["Offset of field: __darwin_ucontext::uc_mcsize"][::std::mem::offset_of!(__darwin_ucontext, uc_mcsize) - 40usize]; + ["Offset of field: __darwin_ucontext::uc_mcontext"][::std::mem::offset_of!(__darwin_ucontext, uc_mcontext) - 48usize]; +}; +pub type ucontext_t = __darwin_ucontext; +pub type sigset_t = __darwin_sigset_t; +#[repr(C)] +#[derive(Copy, Clone)] +pub union sigval { + pub sival_int: ::std::os::raw::c_int, + pub sival_ptr: *mut ::std::os::raw::c_void, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigval"][::std::mem::size_of::() - 8usize]; + ["Alignment of sigval"][::std::mem::align_of::() - 8usize]; + ["Offset of field: sigval::sival_int"][::std::mem::offset_of!(sigval, sival_int) - 0usize]; + ["Offset of field: sigval::sival_ptr"][::std::mem::offset_of!(sigval, sival_ptr) - 0usize]; +}; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct sigevent { + pub sigev_notify: ::std::os::raw::c_int, + pub sigev_signo: ::std::os::raw::c_int, + pub sigev_value: sigval, + pub sigev_notify_function: ::std::option::Option, + pub sigev_notify_attributes: *mut pthread_attr_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigevent"][::std::mem::size_of::() - 32usize]; + ["Alignment of sigevent"][::std::mem::align_of::() - 8usize]; + ["Offset of field: sigevent::sigev_notify"][::std::mem::offset_of!(sigevent, sigev_notify) - 0usize]; + ["Offset of field: sigevent::sigev_signo"][::std::mem::offset_of!(sigevent, sigev_signo) - 4usize]; + ["Offset of field: sigevent::sigev_value"][::std::mem::offset_of!(sigevent, sigev_value) - 8usize]; + ["Offset of field: sigevent::sigev_notify_function"] + [::std::mem::offset_of!(sigevent, sigev_notify_function) - 16usize]; + ["Offset of field: sigevent::sigev_notify_attributes"] + [::std::mem::offset_of!(sigevent, sigev_notify_attributes) - 24usize]; +}; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct __siginfo { + pub si_signo: ::std::os::raw::c_int, + pub si_errno: ::std::os::raw::c_int, + pub si_code: ::std::os::raw::c_int, + pub si_pid: pid_t, + pub si_uid: uid_t, + pub si_status: ::std::os::raw::c_int, + pub si_addr: *mut ::std::os::raw::c_void, + pub si_value: sigval, + pub si_band: ::std::os::raw::c_long, + pub __pad: [::std::os::raw::c_ulong; 7usize], +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __siginfo"][::std::mem::size_of::<__siginfo>() - 104usize]; + ["Alignment of __siginfo"][::std::mem::align_of::<__siginfo>() - 8usize]; + ["Offset of field: __siginfo::si_signo"][::std::mem::offset_of!(__siginfo, si_signo) - 0usize]; + ["Offset of field: __siginfo::si_errno"][::std::mem::offset_of!(__siginfo, si_errno) - 4usize]; + ["Offset of field: __siginfo::si_code"][::std::mem::offset_of!(__siginfo, si_code) - 8usize]; + ["Offset of field: __siginfo::si_pid"][::std::mem::offset_of!(__siginfo, si_pid) - 12usize]; + ["Offset of field: __siginfo::si_uid"][::std::mem::offset_of!(__siginfo, si_uid) - 16usize]; + ["Offset of field: __siginfo::si_status"][::std::mem::offset_of!(__siginfo, si_status) - 20usize]; + ["Offset of field: __siginfo::si_addr"][::std::mem::offset_of!(__siginfo, si_addr) - 24usize]; + ["Offset of field: __siginfo::si_value"][::std::mem::offset_of!(__siginfo, si_value) - 32usize]; + ["Offset of field: __siginfo::si_band"][::std::mem::offset_of!(__siginfo, si_band) - 40usize]; + ["Offset of field: __siginfo::__pad"][::std::mem::offset_of!(__siginfo, __pad) - 48usize]; +}; +pub type siginfo_t = __siginfo; +#[repr(C)] +#[derive(Copy, Clone)] +pub union __sigaction_u { + pub __sa_handler: ::std::option::Option, + pub __sa_sigaction: ::std::option::Option< + unsafe extern "C" fn(arg1: ::std::os::raw::c_int, arg2: *mut __siginfo, arg3: *mut ::std::os::raw::c_void), + >, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sigaction_u"][::std::mem::size_of::<__sigaction_u>() - 8usize]; + ["Alignment of __sigaction_u"][::std::mem::align_of::<__sigaction_u>() - 8usize]; + ["Offset of field: __sigaction_u::__sa_handler"][::std::mem::offset_of!(__sigaction_u, __sa_handler) - 0usize]; + ["Offset of field: __sigaction_u::__sa_sigaction"][::std::mem::offset_of!(__sigaction_u, __sa_sigaction) - 0usize]; +}; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct __sigaction { + pub __sigaction_u: __sigaction_u, + pub sa_tramp: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + arg4: *mut siginfo_t, + arg5: *mut ::std::os::raw::c_void, + ), + >, + pub sa_mask: sigset_t, + pub sa_flags: ::std::os::raw::c_int, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of __sigaction"][::std::mem::size_of::<__sigaction>() - 24usize]; + ["Alignment of __sigaction"][::std::mem::align_of::<__sigaction>() - 8usize]; + ["Offset of field: __sigaction::__sigaction_u"][::std::mem::offset_of!(__sigaction, __sigaction_u) - 0usize]; + ["Offset of field: __sigaction::sa_tramp"][::std::mem::offset_of!(__sigaction, sa_tramp) - 8usize]; + ["Offset of field: __sigaction::sa_mask"][::std::mem::offset_of!(__sigaction, sa_mask) - 16usize]; + ["Offset of field: __sigaction::sa_flags"][::std::mem::offset_of!(__sigaction, sa_flags) - 20usize]; +}; +#[repr(C)] +#[derive(Copy, Clone)] +pub struct sigaction { + pub __sigaction_u: __sigaction_u, + pub sa_mask: sigset_t, + pub sa_flags: ::std::os::raw::c_int, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigaction"][::std::mem::size_of::() - 16usize]; + ["Alignment of sigaction"][::std::mem::align_of::() - 8usize]; + ["Offset of field: sigaction::__sigaction_u"][::std::mem::offset_of!(sigaction, __sigaction_u) - 0usize]; + ["Offset of field: sigaction::sa_mask"][::std::mem::offset_of!(sigaction, sa_mask) - 8usize]; + ["Offset of field: sigaction::sa_flags"][::std::mem::offset_of!(sigaction, sa_flags) - 12usize]; +}; +pub type sig_t = ::std::option::Option; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sigvec { + pub sv_handler: ::std::option::Option, + pub sv_mask: ::std::os::raw::c_int, + pub sv_flags: ::std::os::raw::c_int, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigvec"][::std::mem::size_of::() - 16usize]; + ["Alignment of sigvec"][::std::mem::align_of::() - 8usize]; + ["Offset of field: sigvec::sv_handler"][::std::mem::offset_of!(sigvec, sv_handler) - 0usize]; + ["Offset of field: sigvec::sv_mask"][::std::mem::offset_of!(sigvec, sv_mask) - 8usize]; + ["Offset of field: sigvec::sv_flags"][::std::mem::offset_of!(sigvec, sv_flags) - 12usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct sigstack { + pub ss_sp: *mut ::std::os::raw::c_char, + pub ss_onstack: ::std::os::raw::c_int, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of sigstack"][::std::mem::size_of::() - 16usize]; + ["Alignment of sigstack"][::std::mem::align_of::() - 8usize]; + ["Offset of field: sigstack::ss_sp"][::std::mem::offset_of!(sigstack, ss_sp) - 0usize]; + ["Offset of field: sigstack::ss_onstack"][::std::mem::offset_of!(sigstack, ss_onstack) - 8usize]; +}; +extern "C" { + pub fn signal( + arg1: ::std::os::raw::c_int, + arg2: ::std::option::Option, + ) -> ::std::option::Option< + unsafe extern "C" fn( + arg1: ::std::os::raw::c_int, + arg2: ::std::option::Option, + ), + >; +} +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct timeval { + pub tv_sec: __darwin_time_t, + pub tv_usec: __darwin_suseconds_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of timeval"][::std::mem::size_of::() - 16usize]; + ["Alignment of timeval"][::std::mem::align_of::() - 8usize]; + ["Offset of field: timeval::tv_sec"][::std::mem::offset_of!(timeval, tv_sec) - 0usize]; + ["Offset of field: timeval::tv_usec"][::std::mem::offset_of!(timeval, tv_usec) - 8usize]; +}; +pub type rlim_t = __uint64_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct rusage { + pub ru_utime: timeval, + pub ru_stime: timeval, + pub ru_maxrss: ::std::os::raw::c_long, + pub ru_ixrss: ::std::os::raw::c_long, + pub ru_idrss: ::std::os::raw::c_long, + pub ru_isrss: ::std::os::raw::c_long, + pub ru_minflt: ::std::os::raw::c_long, + pub ru_majflt: ::std::os::raw::c_long, + pub ru_nswap: ::std::os::raw::c_long, + pub ru_inblock: ::std::os::raw::c_long, + pub ru_oublock: ::std::os::raw::c_long, + pub ru_msgsnd: ::std::os::raw::c_long, + pub ru_msgrcv: ::std::os::raw::c_long, + pub ru_nsignals: ::std::os::raw::c_long, + pub ru_nvcsw: ::std::os::raw::c_long, + pub ru_nivcsw: ::std::os::raw::c_long, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of rusage"][::std::mem::size_of::() - 144usize]; + ["Alignment of rusage"][::std::mem::align_of::() - 8usize]; + ["Offset of field: rusage::ru_utime"][::std::mem::offset_of!(rusage, ru_utime) - 0usize]; + ["Offset of field: rusage::ru_stime"][::std::mem::offset_of!(rusage, ru_stime) - 16usize]; + ["Offset of field: rusage::ru_maxrss"][::std::mem::offset_of!(rusage, ru_maxrss) - 32usize]; + ["Offset of field: rusage::ru_ixrss"][::std::mem::offset_of!(rusage, ru_ixrss) - 40usize]; + ["Offset of field: rusage::ru_idrss"][::std::mem::offset_of!(rusage, ru_idrss) - 48usize]; + ["Offset of field: rusage::ru_isrss"][::std::mem::offset_of!(rusage, ru_isrss) - 56usize]; + ["Offset of field: rusage::ru_minflt"][::std::mem::offset_of!(rusage, ru_minflt) - 64usize]; + ["Offset of field: rusage::ru_majflt"][::std::mem::offset_of!(rusage, ru_majflt) - 72usize]; + ["Offset of field: rusage::ru_nswap"][::std::mem::offset_of!(rusage, ru_nswap) - 80usize]; + ["Offset of field: rusage::ru_inblock"][::std::mem::offset_of!(rusage, ru_inblock) - 88usize]; + ["Offset of field: rusage::ru_oublock"][::std::mem::offset_of!(rusage, ru_oublock) - 96usize]; + ["Offset of field: rusage::ru_msgsnd"][::std::mem::offset_of!(rusage, ru_msgsnd) - 104usize]; + ["Offset of field: rusage::ru_msgrcv"][::std::mem::offset_of!(rusage, ru_msgrcv) - 112usize]; + ["Offset of field: rusage::ru_nsignals"][::std::mem::offset_of!(rusage, ru_nsignals) - 120usize]; + ["Offset of field: rusage::ru_nvcsw"][::std::mem::offset_of!(rusage, ru_nvcsw) - 128usize]; + ["Offset of field: rusage::ru_nivcsw"][::std::mem::offset_of!(rusage, ru_nivcsw) - 136usize]; +}; +pub type rusage_info_t = *mut ::std::os::raw::c_void; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct rusage_info_v0 { + pub ri_uuid: [u8; 16usize], + pub ri_user_time: u64, + pub ri_system_time: u64, + pub ri_pkg_idle_wkups: u64, + pub ri_interrupt_wkups: u64, + pub ri_pageins: u64, + pub ri_wired_size: u64, + pub ri_resident_size: u64, + pub ri_phys_footprint: u64, + pub ri_proc_start_abstime: u64, + pub ri_proc_exit_abstime: u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of rusage_info_v0"][::std::mem::size_of::() - 96usize]; + ["Alignment of rusage_info_v0"][::std::mem::align_of::() - 8usize]; + ["Offset of field: rusage_info_v0::ri_uuid"][::std::mem::offset_of!(rusage_info_v0, ri_uuid) - 0usize]; + ["Offset of field: rusage_info_v0::ri_user_time"][::std::mem::offset_of!(rusage_info_v0, ri_user_time) - 16usize]; + ["Offset of field: rusage_info_v0::ri_system_time"][::std::mem::offset_of!(rusage_info_v0, ri_system_time) - 24usize]; + ["Offset of field: rusage_info_v0::ri_pkg_idle_wkups"] + [::std::mem::offset_of!(rusage_info_v0, ri_pkg_idle_wkups) - 32usize]; + ["Offset of field: rusage_info_v0::ri_interrupt_wkups"] + [::std::mem::offset_of!(rusage_info_v0, ri_interrupt_wkups) - 40usize]; + ["Offset of field: rusage_info_v0::ri_pageins"][::std::mem::offset_of!(rusage_info_v0, ri_pageins) - 48usize]; + ["Offset of field: rusage_info_v0::ri_wired_size"][::std::mem::offset_of!(rusage_info_v0, ri_wired_size) - 56usize]; + ["Offset of field: rusage_info_v0::ri_resident_size"] + [::std::mem::offset_of!(rusage_info_v0, ri_resident_size) - 64usize]; + ["Offset of field: rusage_info_v0::ri_phys_footprint"] + [::std::mem::offset_of!(rusage_info_v0, ri_phys_footprint) - 72usize]; + ["Offset of field: rusage_info_v0::ri_proc_start_abstime"] + [::std::mem::offset_of!(rusage_info_v0, ri_proc_start_abstime) - 80usize]; + ["Offset of field: rusage_info_v0::ri_proc_exit_abstime"] + [::std::mem::offset_of!(rusage_info_v0, ri_proc_exit_abstime) - 88usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct rusage_info_v1 { + pub ri_uuid: [u8; 16usize], + pub ri_user_time: u64, + pub ri_system_time: u64, + pub ri_pkg_idle_wkups: u64, + pub ri_interrupt_wkups: u64, + pub ri_pageins: u64, + pub ri_wired_size: u64, + pub ri_resident_size: u64, + pub ri_phys_footprint: u64, + pub ri_proc_start_abstime: u64, + pub ri_proc_exit_abstime: u64, + pub ri_child_user_time: u64, + pub ri_child_system_time: u64, + pub ri_child_pkg_idle_wkups: u64, + pub ri_child_interrupt_wkups: u64, + pub ri_child_pageins: u64, + pub ri_child_elapsed_abstime: u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of rusage_info_v1"][::std::mem::size_of::() - 144usize]; + ["Alignment of rusage_info_v1"][::std::mem::align_of::() - 8usize]; + ["Offset of field: rusage_info_v1::ri_uuid"][::std::mem::offset_of!(rusage_info_v1, ri_uuid) - 0usize]; + ["Offset of field: rusage_info_v1::ri_user_time"][::std::mem::offset_of!(rusage_info_v1, ri_user_time) - 16usize]; + ["Offset of field: rusage_info_v1::ri_system_time"][::std::mem::offset_of!(rusage_info_v1, ri_system_time) - 24usize]; + ["Offset of field: rusage_info_v1::ri_pkg_idle_wkups"] + [::std::mem::offset_of!(rusage_info_v1, ri_pkg_idle_wkups) - 32usize]; + ["Offset of field: rusage_info_v1::ri_interrupt_wkups"] + [::std::mem::offset_of!(rusage_info_v1, ri_interrupt_wkups) - 40usize]; + ["Offset of field: rusage_info_v1::ri_pageins"][::std::mem::offset_of!(rusage_info_v1, ri_pageins) - 48usize]; + ["Offset of field: rusage_info_v1::ri_wired_size"][::std::mem::offset_of!(rusage_info_v1, ri_wired_size) - 56usize]; + ["Offset of field: rusage_info_v1::ri_resident_size"] + [::std::mem::offset_of!(rusage_info_v1, ri_resident_size) - 64usize]; + ["Offset of field: rusage_info_v1::ri_phys_footprint"] + [::std::mem::offset_of!(rusage_info_v1, ri_phys_footprint) - 72usize]; + ["Offset of field: rusage_info_v1::ri_proc_start_abstime"] + [::std::mem::offset_of!(rusage_info_v1, ri_proc_start_abstime) - 80usize]; + ["Offset of field: rusage_info_v1::ri_proc_exit_abstime"] + [::std::mem::offset_of!(rusage_info_v1, ri_proc_exit_abstime) - 88usize]; + ["Offset of field: rusage_info_v1::ri_child_user_time"] + [::std::mem::offset_of!(rusage_info_v1, ri_child_user_time) - 96usize]; + ["Offset of field: rusage_info_v1::ri_child_system_time"] + [::std::mem::offset_of!(rusage_info_v1, ri_child_system_time) - 104usize]; + ["Offset of field: rusage_info_v1::ri_child_pkg_idle_wkups"] + [::std::mem::offset_of!(rusage_info_v1, ri_child_pkg_idle_wkups) - 112usize]; + ["Offset of field: rusage_info_v1::ri_child_interrupt_wkups"] + [::std::mem::offset_of!(rusage_info_v1, ri_child_interrupt_wkups) - 120usize]; + ["Offset of field: rusage_info_v1::ri_child_pageins"] + [::std::mem::offset_of!(rusage_info_v1, ri_child_pageins) - 128usize]; + ["Offset of field: rusage_info_v1::ri_child_elapsed_abstime"] + [::std::mem::offset_of!(rusage_info_v1, ri_child_elapsed_abstime) - 136usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct rusage_info_v2 { + pub ri_uuid: [u8; 16usize], + pub ri_user_time: u64, + pub ri_system_time: u64, + pub ri_pkg_idle_wkups: u64, + pub ri_interrupt_wkups: u64, + pub ri_pageins: u64, + pub ri_wired_size: u64, + pub ri_resident_size: u64, + pub ri_phys_footprint: u64, + pub ri_proc_start_abstime: u64, + pub ri_proc_exit_abstime: u64, + pub ri_child_user_time: u64, + pub ri_child_system_time: u64, + pub ri_child_pkg_idle_wkups: u64, + pub ri_child_interrupt_wkups: u64, + pub ri_child_pageins: u64, + pub ri_child_elapsed_abstime: u64, + pub ri_diskio_bytesread: u64, + pub ri_diskio_byteswritten: u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of rusage_info_v2"][::std::mem::size_of::() - 160usize]; + ["Alignment of rusage_info_v2"][::std::mem::align_of::() - 8usize]; + ["Offset of field: rusage_info_v2::ri_uuid"][::std::mem::offset_of!(rusage_info_v2, ri_uuid) - 0usize]; + ["Offset of field: rusage_info_v2::ri_user_time"][::std::mem::offset_of!(rusage_info_v2, ri_user_time) - 16usize]; + ["Offset of field: rusage_info_v2::ri_system_time"][::std::mem::offset_of!(rusage_info_v2, ri_system_time) - 24usize]; + ["Offset of field: rusage_info_v2::ri_pkg_idle_wkups"] + [::std::mem::offset_of!(rusage_info_v2, ri_pkg_idle_wkups) - 32usize]; + ["Offset of field: rusage_info_v2::ri_interrupt_wkups"] + [::std::mem::offset_of!(rusage_info_v2, ri_interrupt_wkups) - 40usize]; + ["Offset of field: rusage_info_v2::ri_pageins"][::std::mem::offset_of!(rusage_info_v2, ri_pageins) - 48usize]; + ["Offset of field: rusage_info_v2::ri_wired_size"][::std::mem::offset_of!(rusage_info_v2, ri_wired_size) - 56usize]; + ["Offset of field: rusage_info_v2::ri_resident_size"] + [::std::mem::offset_of!(rusage_info_v2, ri_resident_size) - 64usize]; + ["Offset of field: rusage_info_v2::ri_phys_footprint"] + [::std::mem::offset_of!(rusage_info_v2, ri_phys_footprint) - 72usize]; + ["Offset of field: rusage_info_v2::ri_proc_start_abstime"] + [::std::mem::offset_of!(rusage_info_v2, ri_proc_start_abstime) - 80usize]; + ["Offset of field: rusage_info_v2::ri_proc_exit_abstime"] + [::std::mem::offset_of!(rusage_info_v2, ri_proc_exit_abstime) - 88usize]; + ["Offset of field: rusage_info_v2::ri_child_user_time"] + [::std::mem::offset_of!(rusage_info_v2, ri_child_user_time) - 96usize]; + ["Offset of field: rusage_info_v2::ri_child_system_time"] + [::std::mem::offset_of!(rusage_info_v2, ri_child_system_time) - 104usize]; + ["Offset of field: rusage_info_v2::ri_child_pkg_idle_wkups"] + [::std::mem::offset_of!(rusage_info_v2, ri_child_pkg_idle_wkups) - 112usize]; + ["Offset of field: rusage_info_v2::ri_child_interrupt_wkups"] + [::std::mem::offset_of!(rusage_info_v2, ri_child_interrupt_wkups) - 120usize]; + ["Offset of field: rusage_info_v2::ri_child_pageins"] + [::std::mem::offset_of!(rusage_info_v2, ri_child_pageins) - 128usize]; + ["Offset of field: rusage_info_v2::ri_child_elapsed_abstime"] + [::std::mem::offset_of!(rusage_info_v2, ri_child_elapsed_abstime) - 136usize]; + ["Offset of field: rusage_info_v2::ri_diskio_bytesread"] + [::std::mem::offset_of!(rusage_info_v2, ri_diskio_bytesread) - 144usize]; + ["Offset of field: rusage_info_v2::ri_diskio_byteswritten"] + [::std::mem::offset_of!(rusage_info_v2, ri_diskio_byteswritten) - 152usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct rusage_info_v3 { + pub ri_uuid: [u8; 16usize], + pub ri_user_time: u64, + pub ri_system_time: u64, + pub ri_pkg_idle_wkups: u64, + pub ri_interrupt_wkups: u64, + pub ri_pageins: u64, + pub ri_wired_size: u64, + pub ri_resident_size: u64, + pub ri_phys_footprint: u64, + pub ri_proc_start_abstime: u64, + pub ri_proc_exit_abstime: u64, + pub ri_child_user_time: u64, + pub ri_child_system_time: u64, + pub ri_child_pkg_idle_wkups: u64, + pub ri_child_interrupt_wkups: u64, + pub ri_child_pageins: u64, + pub ri_child_elapsed_abstime: u64, + pub ri_diskio_bytesread: u64, + pub ri_diskio_byteswritten: u64, + pub ri_cpu_time_qos_default: u64, + pub ri_cpu_time_qos_maintenance: u64, + pub ri_cpu_time_qos_background: u64, + pub ri_cpu_time_qos_utility: u64, + pub ri_cpu_time_qos_legacy: u64, + pub ri_cpu_time_qos_user_initiated: u64, + pub ri_cpu_time_qos_user_interactive: u64, + pub ri_billed_system_time: u64, + pub ri_serviced_system_time: u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of rusage_info_v3"][::std::mem::size_of::() - 232usize]; + ["Alignment of rusage_info_v3"][::std::mem::align_of::() - 8usize]; + ["Offset of field: rusage_info_v3::ri_uuid"][::std::mem::offset_of!(rusage_info_v3, ri_uuid) - 0usize]; + ["Offset of field: rusage_info_v3::ri_user_time"][::std::mem::offset_of!(rusage_info_v3, ri_user_time) - 16usize]; + ["Offset of field: rusage_info_v3::ri_system_time"][::std::mem::offset_of!(rusage_info_v3, ri_system_time) - 24usize]; + ["Offset of field: rusage_info_v3::ri_pkg_idle_wkups"] + [::std::mem::offset_of!(rusage_info_v3, ri_pkg_idle_wkups) - 32usize]; + ["Offset of field: rusage_info_v3::ri_interrupt_wkups"] + [::std::mem::offset_of!(rusage_info_v3, ri_interrupt_wkups) - 40usize]; + ["Offset of field: rusage_info_v3::ri_pageins"][::std::mem::offset_of!(rusage_info_v3, ri_pageins) - 48usize]; + ["Offset of field: rusage_info_v3::ri_wired_size"][::std::mem::offset_of!(rusage_info_v3, ri_wired_size) - 56usize]; + ["Offset of field: rusage_info_v3::ri_resident_size"] + [::std::mem::offset_of!(rusage_info_v3, ri_resident_size) - 64usize]; + ["Offset of field: rusage_info_v3::ri_phys_footprint"] + [::std::mem::offset_of!(rusage_info_v3, ri_phys_footprint) - 72usize]; + ["Offset of field: rusage_info_v3::ri_proc_start_abstime"] + [::std::mem::offset_of!(rusage_info_v3, ri_proc_start_abstime) - 80usize]; + ["Offset of field: rusage_info_v3::ri_proc_exit_abstime"] + [::std::mem::offset_of!(rusage_info_v3, ri_proc_exit_abstime) - 88usize]; + ["Offset of field: rusage_info_v3::ri_child_user_time"] + [::std::mem::offset_of!(rusage_info_v3, ri_child_user_time) - 96usize]; + ["Offset of field: rusage_info_v3::ri_child_system_time"] + [::std::mem::offset_of!(rusage_info_v3, ri_child_system_time) - 104usize]; + ["Offset of field: rusage_info_v3::ri_child_pkg_idle_wkups"] + [::std::mem::offset_of!(rusage_info_v3, ri_child_pkg_idle_wkups) - 112usize]; + ["Offset of field: rusage_info_v3::ri_child_interrupt_wkups"] + [::std::mem::offset_of!(rusage_info_v3, ri_child_interrupt_wkups) - 120usize]; + ["Offset of field: rusage_info_v3::ri_child_pageins"] + [::std::mem::offset_of!(rusage_info_v3, ri_child_pageins) - 128usize]; + ["Offset of field: rusage_info_v3::ri_child_elapsed_abstime"] + [::std::mem::offset_of!(rusage_info_v3, ri_child_elapsed_abstime) - 136usize]; + ["Offset of field: rusage_info_v3::ri_diskio_bytesread"] + [::std::mem::offset_of!(rusage_info_v3, ri_diskio_bytesread) - 144usize]; + ["Offset of field: rusage_info_v3::ri_diskio_byteswritten"] + [::std::mem::offset_of!(rusage_info_v3, ri_diskio_byteswritten) - 152usize]; + ["Offset of field: rusage_info_v3::ri_cpu_time_qos_default"] + [::std::mem::offset_of!(rusage_info_v3, ri_cpu_time_qos_default) - 160usize]; + ["Offset of field: rusage_info_v3::ri_cpu_time_qos_maintenance"] + [::std::mem::offset_of!(rusage_info_v3, ri_cpu_time_qos_maintenance) - 168usize]; + ["Offset of field: rusage_info_v3::ri_cpu_time_qos_background"] + [::std::mem::offset_of!(rusage_info_v3, ri_cpu_time_qos_background) - 176usize]; + ["Offset of field: rusage_info_v3::ri_cpu_time_qos_utility"] + [::std::mem::offset_of!(rusage_info_v3, ri_cpu_time_qos_utility) - 184usize]; + ["Offset of field: rusage_info_v3::ri_cpu_time_qos_legacy"] + [::std::mem::offset_of!(rusage_info_v3, ri_cpu_time_qos_legacy) - 192usize]; + ["Offset of field: rusage_info_v3::ri_cpu_time_qos_user_initiated"] + [::std::mem::offset_of!(rusage_info_v3, ri_cpu_time_qos_user_initiated) - 200usize]; + ["Offset of field: rusage_info_v3::ri_cpu_time_qos_user_interactive"] + [::std::mem::offset_of!(rusage_info_v3, ri_cpu_time_qos_user_interactive) - 208usize]; + ["Offset of field: rusage_info_v3::ri_billed_system_time"] + [::std::mem::offset_of!(rusage_info_v3, ri_billed_system_time) - 216usize]; + ["Offset of field: rusage_info_v3::ri_serviced_system_time"] + [::std::mem::offset_of!(rusage_info_v3, ri_serviced_system_time) - 224usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct rusage_info_v4 { + pub ri_uuid: [u8; 16usize], + pub ri_user_time: u64, + pub ri_system_time: u64, + pub ri_pkg_idle_wkups: u64, + pub ri_interrupt_wkups: u64, + pub ri_pageins: u64, + pub ri_wired_size: u64, + pub ri_resident_size: u64, + pub ri_phys_footprint: u64, + pub ri_proc_start_abstime: u64, + pub ri_proc_exit_abstime: u64, + pub ri_child_user_time: u64, + pub ri_child_system_time: u64, + pub ri_child_pkg_idle_wkups: u64, + pub ri_child_interrupt_wkups: u64, + pub ri_child_pageins: u64, + pub ri_child_elapsed_abstime: u64, + pub ri_diskio_bytesread: u64, + pub ri_diskio_byteswritten: u64, + pub ri_cpu_time_qos_default: u64, + pub ri_cpu_time_qos_maintenance: u64, + pub ri_cpu_time_qos_background: u64, + pub ri_cpu_time_qos_utility: u64, + pub ri_cpu_time_qos_legacy: u64, + pub ri_cpu_time_qos_user_initiated: u64, + pub ri_cpu_time_qos_user_interactive: u64, + pub ri_billed_system_time: u64, + pub ri_serviced_system_time: u64, + pub ri_logical_writes: u64, + pub ri_lifetime_max_phys_footprint: u64, + pub ri_instructions: u64, + pub ri_cycles: u64, + pub ri_billed_energy: u64, + pub ri_serviced_energy: u64, + pub ri_interval_max_phys_footprint: u64, + pub ri_runnable_time: u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of rusage_info_v4"][::std::mem::size_of::() - 296usize]; + ["Alignment of rusage_info_v4"][::std::mem::align_of::() - 8usize]; + ["Offset of field: rusage_info_v4::ri_uuid"][::std::mem::offset_of!(rusage_info_v4, ri_uuid) - 0usize]; + ["Offset of field: rusage_info_v4::ri_user_time"][::std::mem::offset_of!(rusage_info_v4, ri_user_time) - 16usize]; + ["Offset of field: rusage_info_v4::ri_system_time"][::std::mem::offset_of!(rusage_info_v4, ri_system_time) - 24usize]; + ["Offset of field: rusage_info_v4::ri_pkg_idle_wkups"] + [::std::mem::offset_of!(rusage_info_v4, ri_pkg_idle_wkups) - 32usize]; + ["Offset of field: rusage_info_v4::ri_interrupt_wkups"] + [::std::mem::offset_of!(rusage_info_v4, ri_interrupt_wkups) - 40usize]; + ["Offset of field: rusage_info_v4::ri_pageins"][::std::mem::offset_of!(rusage_info_v4, ri_pageins) - 48usize]; + ["Offset of field: rusage_info_v4::ri_wired_size"][::std::mem::offset_of!(rusage_info_v4, ri_wired_size) - 56usize]; + ["Offset of field: rusage_info_v4::ri_resident_size"] + [::std::mem::offset_of!(rusage_info_v4, ri_resident_size) - 64usize]; + ["Offset of field: rusage_info_v4::ri_phys_footprint"] + [::std::mem::offset_of!(rusage_info_v4, ri_phys_footprint) - 72usize]; + ["Offset of field: rusage_info_v4::ri_proc_start_abstime"] + [::std::mem::offset_of!(rusage_info_v4, ri_proc_start_abstime) - 80usize]; + ["Offset of field: rusage_info_v4::ri_proc_exit_abstime"] + [::std::mem::offset_of!(rusage_info_v4, ri_proc_exit_abstime) - 88usize]; + ["Offset of field: rusage_info_v4::ri_child_user_time"] + [::std::mem::offset_of!(rusage_info_v4, ri_child_user_time) - 96usize]; + ["Offset of field: rusage_info_v4::ri_child_system_time"] + [::std::mem::offset_of!(rusage_info_v4, ri_child_system_time) - 104usize]; + ["Offset of field: rusage_info_v4::ri_child_pkg_idle_wkups"] + [::std::mem::offset_of!(rusage_info_v4, ri_child_pkg_idle_wkups) - 112usize]; + ["Offset of field: rusage_info_v4::ri_child_interrupt_wkups"] + [::std::mem::offset_of!(rusage_info_v4, ri_child_interrupt_wkups) - 120usize]; + ["Offset of field: rusage_info_v4::ri_child_pageins"] + [::std::mem::offset_of!(rusage_info_v4, ri_child_pageins) - 128usize]; + ["Offset of field: rusage_info_v4::ri_child_elapsed_abstime"] + [::std::mem::offset_of!(rusage_info_v4, ri_child_elapsed_abstime) - 136usize]; + ["Offset of field: rusage_info_v4::ri_diskio_bytesread"] + [::std::mem::offset_of!(rusage_info_v4, ri_diskio_bytesread) - 144usize]; + ["Offset of field: rusage_info_v4::ri_diskio_byteswritten"] + [::std::mem::offset_of!(rusage_info_v4, ri_diskio_byteswritten) - 152usize]; + ["Offset of field: rusage_info_v4::ri_cpu_time_qos_default"] + [::std::mem::offset_of!(rusage_info_v4, ri_cpu_time_qos_default) - 160usize]; + ["Offset of field: rusage_info_v4::ri_cpu_time_qos_maintenance"] + [::std::mem::offset_of!(rusage_info_v4, ri_cpu_time_qos_maintenance) - 168usize]; + ["Offset of field: rusage_info_v4::ri_cpu_time_qos_background"] + [::std::mem::offset_of!(rusage_info_v4, ri_cpu_time_qos_background) - 176usize]; + ["Offset of field: rusage_info_v4::ri_cpu_time_qos_utility"] + [::std::mem::offset_of!(rusage_info_v4, ri_cpu_time_qos_utility) - 184usize]; + ["Offset of field: rusage_info_v4::ri_cpu_time_qos_legacy"] + [::std::mem::offset_of!(rusage_info_v4, ri_cpu_time_qos_legacy) - 192usize]; + ["Offset of field: rusage_info_v4::ri_cpu_time_qos_user_initiated"] + [::std::mem::offset_of!(rusage_info_v4, ri_cpu_time_qos_user_initiated) - 200usize]; + ["Offset of field: rusage_info_v4::ri_cpu_time_qos_user_interactive"] + [::std::mem::offset_of!(rusage_info_v4, ri_cpu_time_qos_user_interactive) - 208usize]; + ["Offset of field: rusage_info_v4::ri_billed_system_time"] + [::std::mem::offset_of!(rusage_info_v4, ri_billed_system_time) - 216usize]; + ["Offset of field: rusage_info_v4::ri_serviced_system_time"] + [::std::mem::offset_of!(rusage_info_v4, ri_serviced_system_time) - 224usize]; + ["Offset of field: rusage_info_v4::ri_logical_writes"] + [::std::mem::offset_of!(rusage_info_v4, ri_logical_writes) - 232usize]; + ["Offset of field: rusage_info_v4::ri_lifetime_max_phys_footprint"] + [::std::mem::offset_of!(rusage_info_v4, ri_lifetime_max_phys_footprint) - 240usize]; + ["Offset of field: rusage_info_v4::ri_instructions"] + [::std::mem::offset_of!(rusage_info_v4, ri_instructions) - 248usize]; + ["Offset of field: rusage_info_v4::ri_cycles"][::std::mem::offset_of!(rusage_info_v4, ri_cycles) - 256usize]; + ["Offset of field: rusage_info_v4::ri_billed_energy"] + [::std::mem::offset_of!(rusage_info_v4, ri_billed_energy) - 264usize]; + ["Offset of field: rusage_info_v4::ri_serviced_energy"] + [::std::mem::offset_of!(rusage_info_v4, ri_serviced_energy) - 272usize]; + ["Offset of field: rusage_info_v4::ri_interval_max_phys_footprint"] + [::std::mem::offset_of!(rusage_info_v4, ri_interval_max_phys_footprint) - 280usize]; + ["Offset of field: rusage_info_v4::ri_runnable_time"] + [::std::mem::offset_of!(rusage_info_v4, ri_runnable_time) - 288usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct rusage_info_v5 { + pub ri_uuid: [u8; 16usize], + pub ri_user_time: u64, + pub ri_system_time: u64, + pub ri_pkg_idle_wkups: u64, + pub ri_interrupt_wkups: u64, + pub ri_pageins: u64, + pub ri_wired_size: u64, + pub ri_resident_size: u64, + pub ri_phys_footprint: u64, + pub ri_proc_start_abstime: u64, + pub ri_proc_exit_abstime: u64, + pub ri_child_user_time: u64, + pub ri_child_system_time: u64, + pub ri_child_pkg_idle_wkups: u64, + pub ri_child_interrupt_wkups: u64, + pub ri_child_pageins: u64, + pub ri_child_elapsed_abstime: u64, + pub ri_diskio_bytesread: u64, + pub ri_diskio_byteswritten: u64, + pub ri_cpu_time_qos_default: u64, + pub ri_cpu_time_qos_maintenance: u64, + pub ri_cpu_time_qos_background: u64, + pub ri_cpu_time_qos_utility: u64, + pub ri_cpu_time_qos_legacy: u64, + pub ri_cpu_time_qos_user_initiated: u64, + pub ri_cpu_time_qos_user_interactive: u64, + pub ri_billed_system_time: u64, + pub ri_serviced_system_time: u64, + pub ri_logical_writes: u64, + pub ri_lifetime_max_phys_footprint: u64, + pub ri_instructions: u64, + pub ri_cycles: u64, + pub ri_billed_energy: u64, + pub ri_serviced_energy: u64, + pub ri_interval_max_phys_footprint: u64, + pub ri_runnable_time: u64, + pub ri_flags: u64, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of rusage_info_v5"][::std::mem::size_of::() - 304usize]; + ["Alignment of rusage_info_v5"][::std::mem::align_of::() - 8usize]; + ["Offset of field: rusage_info_v5::ri_uuid"][::std::mem::offset_of!(rusage_info_v5, ri_uuid) - 0usize]; + ["Offset of field: rusage_info_v5::ri_user_time"][::std::mem::offset_of!(rusage_info_v5, ri_user_time) - 16usize]; + ["Offset of field: rusage_info_v5::ri_system_time"][::std::mem::offset_of!(rusage_info_v5, ri_system_time) - 24usize]; + ["Offset of field: rusage_info_v5::ri_pkg_idle_wkups"] + [::std::mem::offset_of!(rusage_info_v5, ri_pkg_idle_wkups) - 32usize]; + ["Offset of field: rusage_info_v5::ri_interrupt_wkups"] + [::std::mem::offset_of!(rusage_info_v5, ri_interrupt_wkups) - 40usize]; + ["Offset of field: rusage_info_v5::ri_pageins"][::std::mem::offset_of!(rusage_info_v5, ri_pageins) - 48usize]; + ["Offset of field: rusage_info_v5::ri_wired_size"][::std::mem::offset_of!(rusage_info_v5, ri_wired_size) - 56usize]; + ["Offset of field: rusage_info_v5::ri_resident_size"] + [::std::mem::offset_of!(rusage_info_v5, ri_resident_size) - 64usize]; + ["Offset of field: rusage_info_v5::ri_phys_footprint"] + [::std::mem::offset_of!(rusage_info_v5, ri_phys_footprint) - 72usize]; + ["Offset of field: rusage_info_v5::ri_proc_start_abstime"] + [::std::mem::offset_of!(rusage_info_v5, ri_proc_start_abstime) - 80usize]; + ["Offset of field: rusage_info_v5::ri_proc_exit_abstime"] + [::std::mem::offset_of!(rusage_info_v5, ri_proc_exit_abstime) - 88usize]; + ["Offset of field: rusage_info_v5::ri_child_user_time"] + [::std::mem::offset_of!(rusage_info_v5, ri_child_user_time) - 96usize]; + ["Offset of field: rusage_info_v5::ri_child_system_time"] + [::std::mem::offset_of!(rusage_info_v5, ri_child_system_time) - 104usize]; + ["Offset of field: rusage_info_v5::ri_child_pkg_idle_wkups"] + [::std::mem::offset_of!(rusage_info_v5, ri_child_pkg_idle_wkups) - 112usize]; + ["Offset of field: rusage_info_v5::ri_child_interrupt_wkups"] + [::std::mem::offset_of!(rusage_info_v5, ri_child_interrupt_wkups) - 120usize]; + ["Offset of field: rusage_info_v5::ri_child_pageins"] + [::std::mem::offset_of!(rusage_info_v5, ri_child_pageins) - 128usize]; + ["Offset of field: rusage_info_v5::ri_child_elapsed_abstime"] + [::std::mem::offset_of!(rusage_info_v5, ri_child_elapsed_abstime) - 136usize]; + ["Offset of field: rusage_info_v5::ri_diskio_bytesread"] + [::std::mem::offset_of!(rusage_info_v5, ri_diskio_bytesread) - 144usize]; + ["Offset of field: rusage_info_v5::ri_diskio_byteswritten"] + [::std::mem::offset_of!(rusage_info_v5, ri_diskio_byteswritten) - 152usize]; + ["Offset of field: rusage_info_v5::ri_cpu_time_qos_default"] + [::std::mem::offset_of!(rusage_info_v5, ri_cpu_time_qos_default) - 160usize]; + ["Offset of field: rusage_info_v5::ri_cpu_time_qos_maintenance"] + [::std::mem::offset_of!(rusage_info_v5, ri_cpu_time_qos_maintenance) - 168usize]; + ["Offset of field: rusage_info_v5::ri_cpu_time_qos_background"] + [::std::mem::offset_of!(rusage_info_v5, ri_cpu_time_qos_background) - 176usize]; + ["Offset of field: rusage_info_v5::ri_cpu_time_qos_utility"] + [::std::mem::offset_of!(rusage_info_v5, ri_cpu_time_qos_utility) - 184usize]; + ["Offset of field: rusage_info_v5::ri_cpu_time_qos_legacy"] + [::std::mem::offset_of!(rusage_info_v5, ri_cpu_time_qos_legacy) - 192usize]; + ["Offset of field: rusage_info_v5::ri_cpu_time_qos_user_initiated"] + [::std::mem::offset_of!(rusage_info_v5, ri_cpu_time_qos_user_initiated) - 200usize]; + ["Offset of field: rusage_info_v5::ri_cpu_time_qos_user_interactive"] + [::std::mem::offset_of!(rusage_info_v5, ri_cpu_time_qos_user_interactive) - 208usize]; + ["Offset of field: rusage_info_v5::ri_billed_system_time"] + [::std::mem::offset_of!(rusage_info_v5, ri_billed_system_time) - 216usize]; + ["Offset of field: rusage_info_v5::ri_serviced_system_time"] + [::std::mem::offset_of!(rusage_info_v5, ri_serviced_system_time) - 224usize]; + ["Offset of field: rusage_info_v5::ri_logical_writes"] + [::std::mem::offset_of!(rusage_info_v5, ri_logical_writes) - 232usize]; + ["Offset of field: rusage_info_v5::ri_lifetime_max_phys_footprint"] + [::std::mem::offset_of!(rusage_info_v5, ri_lifetime_max_phys_footprint) - 240usize]; + ["Offset of field: rusage_info_v5::ri_instructions"] + [::std::mem::offset_of!(rusage_info_v5, ri_instructions) - 248usize]; + ["Offset of field: rusage_info_v5::ri_cycles"][::std::mem::offset_of!(rusage_info_v5, ri_cycles) - 256usize]; + ["Offset of field: rusage_info_v5::ri_billed_energy"] + [::std::mem::offset_of!(rusage_info_v5, ri_billed_energy) - 264usize]; + ["Offset of field: rusage_info_v5::ri_serviced_energy"] + [::std::mem::offset_of!(rusage_info_v5, ri_serviced_energy) - 272usize]; + ["Offset of field: rusage_info_v5::ri_interval_max_phys_footprint"] + [::std::mem::offset_of!(rusage_info_v5, ri_interval_max_phys_footprint) - 280usize]; + ["Offset of field: rusage_info_v5::ri_runnable_time"] + [::std::mem::offset_of!(rusage_info_v5, ri_runnable_time) - 288usize]; + ["Offset of field: rusage_info_v5::ri_flags"][::std::mem::offset_of!(rusage_info_v5, ri_flags) - 296usize]; +}; +pub type rusage_info_current = rusage_info_v5; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct rlimit { + pub rlim_cur: rlim_t, + pub rlim_max: rlim_t, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of rlimit"][::std::mem::size_of::() - 16usize]; + ["Alignment of rlimit"][::std::mem::align_of::() - 8usize]; + ["Offset of field: rlimit::rlim_cur"][::std::mem::offset_of!(rlimit, rlim_cur) - 0usize]; + ["Offset of field: rlimit::rlim_max"][::std::mem::offset_of!(rlimit, rlim_max) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct proc_rlimit_control_wakeupmon { + pub wm_flags: u32, + pub wm_rate: i32, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of proc_rlimit_control_wakeupmon"][::std::mem::size_of::() - 8usize]; + ["Alignment of proc_rlimit_control_wakeupmon"][::std::mem::align_of::() - 4usize]; + ["Offset of field: proc_rlimit_control_wakeupmon::wm_flags"] + [::std::mem::offset_of!(proc_rlimit_control_wakeupmon, wm_flags) - 0usize]; + ["Offset of field: proc_rlimit_control_wakeupmon::wm_rate"] + [::std::mem::offset_of!(proc_rlimit_control_wakeupmon, wm_rate) - 4usize]; +}; +extern "C" { + pub fn getpriority(arg1: ::std::os::raw::c_int, arg2: id_t) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getiopolicy_np(arg1: ::std::os::raw::c_int, arg2: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getrlimit(arg1: ::std::os::raw::c_int, arg2: *mut rlimit) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn getrusage(arg1: ::std::os::raw::c_int, arg2: *mut rusage) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn setpriority(arg1: ::std::os::raw::c_int, arg2: id_t, arg3: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn setiopolicy_np( + arg1: ::std::os::raw::c_int, + arg2: ::std::os::raw::c_int, + arg3: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn setrlimit(arg1: ::std::os::raw::c_int, arg2: *const rlimit) -> ::std::os::raw::c_int; +} +#[repr(C)] +#[derive(Copy, Clone)] +pub union wait { + pub w_status: ::std::os::raw::c_int, + pub w_T: wait__bindgen_ty_1, + pub w_S: wait__bindgen_ty_2, +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct wait__bindgen_ty_1 { + pub _bitfield_align_1: [u16; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of wait__bindgen_ty_1"][::std::mem::size_of::() - 4usize]; + ["Alignment of wait__bindgen_ty_1"][::std::mem::align_of::() - 4usize]; +}; +impl wait__bindgen_ty_1 { + #[inline] + pub fn w_Termsig(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 7u8) as u32) } + } + #[inline] + pub fn set_w_Termsig(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 7u8, val as u64) + } + } + #[inline] + pub fn w_Coredump(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(7usize, 1u8) as u32) } + } + #[inline] + pub fn set_w_Coredump(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(7usize, 1u8, val as u64) + } + } + #[inline] + pub fn w_Retcode(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u32) } + } + #[inline] + pub fn set_w_Retcode(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 8u8, val as u64) + } + } + #[inline] + pub fn w_Filler(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 16u8) as u32) } + } + #[inline] + pub fn set_w_Filler(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 16u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + w_Termsig: ::std::os::raw::c_uint, + w_Coredump: ::std::os::raw::c_uint, + w_Retcode: ::std::os::raw::c_uint, + w_Filler: ::std::os::raw::c_uint, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 7u8, { + let w_Termsig: u32 = unsafe { ::std::mem::transmute(w_Termsig) }; + w_Termsig as u64 + }); + __bindgen_bitfield_unit.set(7usize, 1u8, { + let w_Coredump: u32 = unsafe { ::std::mem::transmute(w_Coredump) }; + w_Coredump as u64 + }); + __bindgen_bitfield_unit.set(8usize, 8u8, { + let w_Retcode: u32 = unsafe { ::std::mem::transmute(w_Retcode) }; + w_Retcode as u64 + }); + __bindgen_bitfield_unit.set(16usize, 16u8, { + let w_Filler: u32 = unsafe { ::std::mem::transmute(w_Filler) }; + w_Filler as u64 + }); + __bindgen_bitfield_unit + } +} +#[repr(C)] +#[repr(align(4))] +#[derive(Debug, Copy, Clone)] +pub struct wait__bindgen_ty_2 { + pub _bitfield_align_1: [u16; 0], + pub _bitfield_1: __BindgenBitfieldUnit<[u8; 4usize]>, +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of wait__bindgen_ty_2"][::std::mem::size_of::() - 4usize]; + ["Alignment of wait__bindgen_ty_2"][::std::mem::align_of::() - 4usize]; +}; +impl wait__bindgen_ty_2 { + #[inline] + pub fn w_Stopval(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(0usize, 8u8) as u32) } + } + #[inline] + pub fn set_w_Stopval(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(0usize, 8u8, val as u64) + } + } + #[inline] + pub fn w_Stopsig(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(8usize, 8u8) as u32) } + } + #[inline] + pub fn set_w_Stopsig(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(8usize, 8u8, val as u64) + } + } + #[inline] + pub fn w_Filler(&self) -> ::std::os::raw::c_uint { + unsafe { ::std::mem::transmute(self._bitfield_1.get(16usize, 16u8) as u32) } + } + #[inline] + pub fn set_w_Filler(&mut self, val: ::std::os::raw::c_uint) { + unsafe { + let val: u32 = ::std::mem::transmute(val); + self._bitfield_1.set(16usize, 16u8, val as u64) + } + } + #[inline] + pub fn new_bitfield_1( + w_Stopval: ::std::os::raw::c_uint, + w_Stopsig: ::std::os::raw::c_uint, + w_Filler: ::std::os::raw::c_uint, + ) -> __BindgenBitfieldUnit<[u8; 4usize]> { + let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Default::default(); + __bindgen_bitfield_unit.set(0usize, 8u8, { + let w_Stopval: u32 = unsafe { ::std::mem::transmute(w_Stopval) }; + w_Stopval as u64 + }); + __bindgen_bitfield_unit.set(8usize, 8u8, { + let w_Stopsig: u32 = unsafe { ::std::mem::transmute(w_Stopsig) }; + w_Stopsig as u64 + }); + __bindgen_bitfield_unit.set(16usize, 16u8, { + let w_Filler: u32 = unsafe { ::std::mem::transmute(w_Filler) }; + w_Filler as u64 + }); + __bindgen_bitfield_unit + } +} +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of wait"][::std::mem::size_of::() - 4usize]; + ["Alignment of wait"][::std::mem::align_of::() - 4usize]; + ["Offset of field: wait::w_status"][::std::mem::offset_of!(wait, w_status) - 0usize]; + ["Offset of field: wait::w_T"][::std::mem::offset_of!(wait, w_T) - 0usize]; + ["Offset of field: wait::w_S"][::std::mem::offset_of!(wait, w_S) - 0usize]; +}; +extern "C" { + pub fn wait(arg1: *mut ::std::os::raw::c_int) -> pid_t; +} +extern "C" { + pub fn waitpid(arg1: pid_t, arg2: *mut ::std::os::raw::c_int, arg3: ::std::os::raw::c_int) -> pid_t; +} +extern "C" { + pub fn waitid(arg1: idtype_t, arg2: id_t, arg3: *mut siginfo_t, arg4: ::std::os::raw::c_int) + -> ::std::os::raw::c_int; +} +extern "C" { + pub fn wait3(arg1: *mut ::std::os::raw::c_int, arg2: ::std::os::raw::c_int, arg3: *mut rusage) -> pid_t; +} +extern "C" { + pub fn wait4(arg1: pid_t, arg2: *mut ::std::os::raw::c_int, arg3: ::std::os::raw::c_int, arg4: *mut rusage) -> pid_t; +} +extern "C" { + pub fn alloca(arg1: ::std::os::raw::c_ulong) -> *mut ::std::os::raw::c_void; +} +pub type ct_rune_t = __darwin_ct_rune_t; +pub type rune_t = __darwin_rune_t; +pub type wchar_t = __darwin_wchar_t; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct div_t { @@ -2735,501 +4142,568 @@ pub struct lldiv_t { pub quot: ::std::os::raw::c_longlong, pub rem: ::std::os::raw::c_longlong, } -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of lldiv_t"][::std::mem::size_of::() - 16usize]; - ["Alignment of lldiv_t"][::std::mem::align_of::() - 8usize]; - ["Offset of field: lldiv_t::quot"][::std::mem::offset_of!(lldiv_t, quot) - 0usize]; - ["Offset of field: lldiv_t::rem"][::std::mem::offset_of!(lldiv_t, rem) - 8usize]; -}; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of lldiv_t"][::std::mem::size_of::() - 16usize]; + ["Alignment of lldiv_t"][::std::mem::align_of::() - 8usize]; + ["Offset of field: lldiv_t::quot"][::std::mem::offset_of!(lldiv_t, quot) - 0usize]; + ["Offset of field: lldiv_t::rem"][::std::mem::offset_of!(lldiv_t, rem) - 8usize]; +}; +extern "C" { + pub static mut __mb_cur_max: ::std::os::raw::c_int; +} +extern "C" { + pub fn malloc(__size: ::std::os::raw::c_ulong) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn calloc(__count: ::std::os::raw::c_ulong, __size: ::std::os::raw::c_ulong) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn free(arg1: *mut ::std::os::raw::c_void); +} +extern "C" { + pub fn realloc(__ptr: *mut ::std::os::raw::c_void, __size: ::std::os::raw::c_ulong) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn valloc(arg1: usize) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn aligned_alloc( + __alignment: ::std::os::raw::c_ulong, + __size: ::std::os::raw::c_ulong, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn posix_memalign( + __memptr: *mut *mut ::std::os::raw::c_void, + __alignment: usize, + __size: usize, + ) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn abort() -> !; +} +extern "C" { + pub fn abs(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn atexit(arg1: ::std::option::Option) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn atof(arg1: *const ::std::os::raw::c_char) -> f64; +} +extern "C" { + pub fn atoi(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; +} +extern "C" { + pub fn atol(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn atoll(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn bsearch( + __key: *const ::std::os::raw::c_void, + __base: *const ::std::os::raw::c_void, + __nel: usize, + __width: usize, + __compar: ::std::option::Option< + unsafe extern "C" fn( + arg1: *const ::std::os::raw::c_void, + arg2: *const ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int, + >, + ) -> *mut ::std::os::raw::c_void; +} +extern "C" { + pub fn div(arg1: ::std::os::raw::c_int, arg2: ::std::os::raw::c_int) -> div_t; +} +extern "C" { + pub fn exit(arg1: ::std::os::raw::c_int) -> !; +} +extern "C" { + pub fn getenv(arg1: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; +} +extern "C" { + pub fn labs(arg1: ::std::os::raw::c_long) -> ::std::os::raw::c_long; +} +extern "C" { + pub fn ldiv(arg1: ::std::os::raw::c_long, arg2: ::std::os::raw::c_long) -> ldiv_t; +} +extern "C" { + pub fn llabs(arg1: ::std::os::raw::c_longlong) -> ::std::os::raw::c_longlong; +} +extern "C" { + pub fn lldiv(arg1: ::std::os::raw::c_longlong, arg2: ::std::os::raw::c_longlong) -> lldiv_t; +} extern "C" { - pub fn __ctype_get_mb_cur_max() -> usize; + pub fn mblen(__s: *const ::std::os::raw::c_char, __n: usize) -> ::std::os::raw::c_int; } extern "C" { - pub fn atof(__nptr: *const ::std::os::raw::c_char) -> f64; + pub fn mbstowcs(arg1: *mut wchar_t, arg2: *const ::std::os::raw::c_char, arg3: usize) -> usize; } extern "C" { - pub fn atoi(__nptr: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; + pub fn mbtowc(arg1: *mut wchar_t, arg2: *const ::std::os::raw::c_char, arg3: usize) -> ::std::os::raw::c_int; } extern "C" { - pub fn atol(__nptr: *const ::std::os::raw::c_char) -> ::std::os::raw::c_long; + pub fn qsort( + __base: *mut ::std::os::raw::c_void, + __nel: usize, + __width: usize, + __compar: ::std::option::Option< + unsafe extern "C" fn( + arg1: *const ::std::os::raw::c_void, + arg2: *const ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int, + >, + ); } extern "C" { - pub fn atoll(__nptr: *const ::std::os::raw::c_char) -> ::std::os::raw::c_longlong; + pub fn rand() -> ::std::os::raw::c_int; } extern "C" { - pub fn strtod(__nptr: *const ::std::os::raw::c_char, __endptr: *mut *mut ::std::os::raw::c_char) -> f64; + pub fn srand(arg1: ::std::os::raw::c_uint); } extern "C" { - pub fn strtof(__nptr: *const ::std::os::raw::c_char, __endptr: *mut *mut ::std::os::raw::c_char) -> f32; + pub fn strtod(arg1: *const ::std::os::raw::c_char, arg2: *mut *mut ::std::os::raw::c_char) -> f64; } extern "C" { - pub fn strtold(__nptr: *const ::std::os::raw::c_char, __endptr: *mut *mut ::std::os::raw::c_char) -> u128; + pub fn strtof(arg1: *const ::std::os::raw::c_char, arg2: *mut *mut ::std::os::raw::c_char) -> f32; } extern "C" { pub fn strtol( - __nptr: *const ::std::os::raw::c_char, + __str: *const ::std::os::raw::c_char, __endptr: *mut *mut ::std::os::raw::c_char, __base: ::std::os::raw::c_int, ) -> ::std::os::raw::c_long; } extern "C" { - pub fn strtoul( - __nptr: *const ::std::os::raw::c_char, - __endptr: *mut *mut ::std::os::raw::c_char, - __base: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_ulong; + pub fn strtold(arg1: *const ::std::os::raw::c_char, arg2: *mut *mut ::std::os::raw::c_char) -> f64; } extern "C" { - pub fn strtoq( - __nptr: *const ::std::os::raw::c_char, + pub fn strtoll( + __str: *const ::std::os::raw::c_char, __endptr: *mut *mut ::std::os::raw::c_char, __base: ::std::os::raw::c_int, ) -> ::std::os::raw::c_longlong; } extern "C" { - pub fn strtouq( - __nptr: *const ::std::os::raw::c_char, - __endptr: *mut *mut ::std::os::raw::c_char, - __base: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_ulonglong; -} -extern "C" { - pub fn strtoll( - __nptr: *const ::std::os::raw::c_char, + pub fn strtoul( + __str: *const ::std::os::raw::c_char, __endptr: *mut *mut ::std::os::raw::c_char, __base: ::std::os::raw::c_int, - ) -> ::std::os::raw::c_longlong; + ) -> ::std::os::raw::c_ulong; } extern "C" { pub fn strtoull( - __nptr: *const ::std::os::raw::c_char, + __str: *const ::std::os::raw::c_char, __endptr: *mut *mut ::std::os::raw::c_char, __base: ::std::os::raw::c_int, ) -> ::std::os::raw::c_ulonglong; } extern "C" { - pub fn l64a(__n: ::std::os::raw::c_long) -> *mut ::std::os::raw::c_char; + pub fn system(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } extern "C" { - pub fn a64l(__s: *const ::std::os::raw::c_char) -> ::std::os::raw::c_long; + pub fn wcstombs(arg1: *mut ::std::os::raw::c_char, arg2: *const wchar_t, arg3: usize) -> usize; } extern "C" { - pub fn random() -> ::std::os::raw::c_long; + pub fn wctomb(arg1: *mut ::std::os::raw::c_char, arg2: wchar_t) -> ::std::os::raw::c_int; } extern "C" { - pub fn srandom(__seed: ::std::os::raw::c_uint); + pub fn _Exit(arg1: ::std::os::raw::c_int) -> !; } extern "C" { - pub fn initstate( - __seed: ::std::os::raw::c_uint, - __statebuf: *mut ::std::os::raw::c_char, - __statelen: usize, - ) -> *mut ::std::os::raw::c_char; + pub fn a64l(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_long; } extern "C" { - pub fn setstate(__statebuf: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct random_data { - pub fptr: *mut i32, - pub rptr: *mut i32, - pub state: *mut i32, - pub rand_type: ::std::os::raw::c_int, - pub rand_deg: ::std::os::raw::c_int, - pub rand_sep: ::std::os::raw::c_int, - pub end_ptr: *mut i32, + pub fn drand48() -> f64; } -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of random_data"][::std::mem::size_of::() - 48usize]; - ["Alignment of random_data"][::std::mem::align_of::() - 8usize]; - ["Offset of field: random_data::fptr"][::std::mem::offset_of!(random_data, fptr) - 0usize]; - ["Offset of field: random_data::rptr"][::std::mem::offset_of!(random_data, rptr) - 8usize]; - ["Offset of field: random_data::state"][::std::mem::offset_of!(random_data, state) - 16usize]; - ["Offset of field: random_data::rand_type"][::std::mem::offset_of!(random_data, rand_type) - 24usize]; - ["Offset of field: random_data::rand_deg"][::std::mem::offset_of!(random_data, rand_deg) - 28usize]; - ["Offset of field: random_data::rand_sep"][::std::mem::offset_of!(random_data, rand_sep) - 32usize]; - ["Offset of field: random_data::end_ptr"][::std::mem::offset_of!(random_data, end_ptr) - 40usize]; -}; extern "C" { - pub fn random_r(__buf: *mut random_data, __result: *mut i32) -> ::std::os::raw::c_int; + pub fn ecvt( + arg1: f64, + arg2: ::std::os::raw::c_int, + arg3: *mut ::std::os::raw::c_int, + arg4: *mut ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn srandom_r(__seed: ::std::os::raw::c_uint, __buf: *mut random_data) -> ::std::os::raw::c_int; + pub fn erand48(arg1: *mut ::std::os::raw::c_ushort) -> f64; } extern "C" { - pub fn initstate_r( - __seed: ::std::os::raw::c_uint, - __statebuf: *mut ::std::os::raw::c_char, - __statelen: usize, - __buf: *mut random_data, - ) -> ::std::os::raw::c_int; + pub fn fcvt( + arg1: f64, + arg2: ::std::os::raw::c_int, + arg3: *mut ::std::os::raw::c_int, + arg4: *mut ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn setstate_r(__statebuf: *mut ::std::os::raw::c_char, __buf: *mut random_data) -> ::std::os::raw::c_int; + pub fn gcvt(arg1: f64, arg2: ::std::os::raw::c_int, arg3: *mut ::std::os::raw::c_char) + -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn rand() -> ::std::os::raw::c_int; + pub fn getsubopt( + arg1: *mut *mut ::std::os::raw::c_char, + arg2: *const *mut ::std::os::raw::c_char, + arg3: *mut *mut ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn srand(__seed: ::std::os::raw::c_uint); + pub fn grantpt(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } extern "C" { - pub fn rand_r(__seed: *mut ::std::os::raw::c_uint) -> ::std::os::raw::c_int; + pub fn initstate( + arg1: ::std::os::raw::c_uint, + arg2: *mut ::std::os::raw::c_char, + arg3: usize, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn drand48() -> f64; + pub fn jrand48(arg1: *mut ::std::os::raw::c_ushort) -> ::std::os::raw::c_long; } extern "C" { - pub fn erand48(__xsubi: *mut ::std::os::raw::c_ushort) -> f64; + pub fn l64a(arg1: ::std::os::raw::c_long) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn lrand48() -> ::std::os::raw::c_long; + pub fn lcong48(arg1: *mut ::std::os::raw::c_ushort); } extern "C" { - pub fn nrand48(__xsubi: *mut ::std::os::raw::c_ushort) -> ::std::os::raw::c_long; + pub fn lrand48() -> ::std::os::raw::c_long; } extern "C" { - pub fn mrand48() -> ::std::os::raw::c_long; + pub fn mktemp(arg1: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn jrand48(__xsubi: *mut ::std::os::raw::c_ushort) -> ::std::os::raw::c_long; + pub fn mkstemp(arg1: *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; } extern "C" { - pub fn srand48(__seedval: ::std::os::raw::c_long); + pub fn mrand48() -> ::std::os::raw::c_long; } extern "C" { - pub fn seed48(__seed16v: *mut ::std::os::raw::c_ushort) -> *mut ::std::os::raw::c_ushort; + pub fn nrand48(arg1: *mut ::std::os::raw::c_ushort) -> ::std::os::raw::c_long; } extern "C" { - pub fn lcong48(__param: *mut ::std::os::raw::c_ushort); -} -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct drand48_data { - pub __x: [::std::os::raw::c_ushort; 3usize], - pub __old_x: [::std::os::raw::c_ushort; 3usize], - pub __c: ::std::os::raw::c_ushort, - pub __init: ::std::os::raw::c_ushort, - pub __a: ::std::os::raw::c_ulonglong, + pub fn posix_openpt(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of drand48_data"][::std::mem::size_of::() - 24usize]; - ["Alignment of drand48_data"][::std::mem::align_of::() - 8usize]; - ["Offset of field: drand48_data::__x"][::std::mem::offset_of!(drand48_data, __x) - 0usize]; - ["Offset of field: drand48_data::__old_x"][::std::mem::offset_of!(drand48_data, __old_x) - 6usize]; - ["Offset of field: drand48_data::__c"][::std::mem::offset_of!(drand48_data, __c) - 12usize]; - ["Offset of field: drand48_data::__init"][::std::mem::offset_of!(drand48_data, __init) - 14usize]; - ["Offset of field: drand48_data::__a"][::std::mem::offset_of!(drand48_data, __a) - 16usize]; -}; extern "C" { - pub fn drand48_r(__buffer: *mut drand48_data, __result: *mut f64) -> ::std::os::raw::c_int; + pub fn ptsname(arg1: ::std::os::raw::c_int) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn erand48_r( - __xsubi: *mut ::std::os::raw::c_ushort, - __buffer: *mut drand48_data, - __result: *mut f64, + pub fn ptsname_r( + fildes: ::std::os::raw::c_int, + buffer: *mut ::std::os::raw::c_char, + buflen: usize, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn lrand48_r(__buffer: *mut drand48_data, __result: *mut ::std::os::raw::c_long) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn nrand48_r( - __xsubi: *mut ::std::os::raw::c_ushort, - __buffer: *mut drand48_data, - __result: *mut ::std::os::raw::c_long, - ) -> ::std::os::raw::c_int; + pub fn putenv(arg1: *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; } extern "C" { - pub fn mrand48_r(__buffer: *mut drand48_data, __result: *mut ::std::os::raw::c_long) -> ::std::os::raw::c_int; + pub fn random() -> ::std::os::raw::c_long; } extern "C" { - pub fn jrand48_r( - __xsubi: *mut ::std::os::raw::c_ushort, - __buffer: *mut drand48_data, - __result: *mut ::std::os::raw::c_long, - ) -> ::std::os::raw::c_int; + pub fn rand_r(arg1: *mut ::std::os::raw::c_uint) -> ::std::os::raw::c_int; } extern "C" { - pub fn srand48_r(__seedval: ::std::os::raw::c_long, __buffer: *mut drand48_data) -> ::std::os::raw::c_int; + #[link_name = "\u{1}_realpath$DARWIN_EXTSN"] + pub fn realpath( + arg1: *const ::std::os::raw::c_char, + arg2: *mut ::std::os::raw::c_char, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn seed48_r(__seed16v: *mut ::std::os::raw::c_ushort, __buffer: *mut drand48_data) -> ::std::os::raw::c_int; + pub fn seed48(arg1: *mut ::std::os::raw::c_ushort) -> *mut ::std::os::raw::c_ushort; } extern "C" { - pub fn lcong48_r(__param: *mut ::std::os::raw::c_ushort, __buffer: *mut drand48_data) -> ::std::os::raw::c_int; + pub fn setenv( + __name: *const ::std::os::raw::c_char, + __value: *const ::std::os::raw::c_char, + __overwrite: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn malloc(__size: ::std::os::raw::c_ulong) -> *mut ::std::os::raw::c_void; + pub fn setkey(arg1: *const ::std::os::raw::c_char); } extern "C" { - pub fn calloc(__nmemb: ::std::os::raw::c_ulong, __size: ::std::os::raw::c_ulong) -> *mut ::std::os::raw::c_void; + pub fn setstate(arg1: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn realloc(__ptr: *mut ::std::os::raw::c_void, __size: ::std::os::raw::c_ulong) -> *mut ::std::os::raw::c_void; + pub fn srand48(arg1: ::std::os::raw::c_long); } extern "C" { - pub fn reallocarray(__ptr: *mut ::std::os::raw::c_void, __nmemb: usize, __size: usize) - -> *mut ::std::os::raw::c_void; + pub fn srandom(arg1: ::std::os::raw::c_uint); } extern "C" { - pub fn free(__ptr: *mut ::std::os::raw::c_void); + pub fn unlockpt(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } extern "C" { - pub fn alloca(__size: ::std::os::raw::c_ulong) -> *mut ::std::os::raw::c_void; + pub fn unsetenv(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } extern "C" { - pub fn valloc(__size: usize) -> *mut ::std::os::raw::c_void; + pub fn arc4random() -> u32; } extern "C" { - pub fn posix_memalign( - __memptr: *mut *mut ::std::os::raw::c_void, - __alignment: usize, - __size: usize, - ) -> ::std::os::raw::c_int; + pub fn arc4random_addrandom(arg1: *mut ::std::os::raw::c_uchar, arg2: ::std::os::raw::c_int); } extern "C" { - pub fn aligned_alloc(__alignment: usize, __size: usize) -> *mut ::std::os::raw::c_void; + pub fn arc4random_buf(__buf: *mut ::std::os::raw::c_void, __nbytes: usize); } extern "C" { - pub fn abort() -> !; + pub fn arc4random_stir(); } extern "C" { - pub fn atexit(__func: ::std::option::Option) -> ::std::os::raw::c_int; + pub fn arc4random_uniform(__upper_bound: u32) -> u32; } extern "C" { - pub fn at_quick_exit(__func: ::std::option::Option) -> ::std::os::raw::c_int; + pub fn atexit_b(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int; } extern "C" { - pub fn on_exit( - __func: ::std::option::Option< - unsafe extern "C" fn(__status: ::std::os::raw::c_int, __arg: *mut ::std::os::raw::c_void), - >, - __arg: *mut ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int; + pub fn bsearch_b( + __key: *const ::std::os::raw::c_void, + __base: *const ::std::os::raw::c_void, + __nel: usize, + __width: usize, + __compar: *mut ::std::os::raw::c_void, + ) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn exit(__status: ::std::os::raw::c_int) -> !; + pub fn cgetcap( + arg1: *mut ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + ) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn quick_exit(__status: ::std::os::raw::c_int) -> !; + pub fn cgetclose() -> ::std::os::raw::c_int; } extern "C" { - pub fn _Exit(__status: ::std::os::raw::c_int) -> !; + pub fn cgetent( + arg1: *mut *mut ::std::os::raw::c_char, + arg2: *mut *mut ::std::os::raw::c_char, + arg3: *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn getenv(__name: *const ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; + pub fn cgetfirst( + arg1: *mut *mut ::std::os::raw::c_char, + arg2: *mut *mut ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn putenv(__string: *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; + pub fn cgetmatch(arg1: *const ::std::os::raw::c_char, arg2: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } extern "C" { - pub fn setenv( - __name: *const ::std::os::raw::c_char, - __value: *const ::std::os::raw::c_char, - __replace: ::std::os::raw::c_int, + pub fn cgetnext( + arg1: *mut *mut ::std::os::raw::c_char, + arg2: *mut *mut ::std::os::raw::c_char, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn unsetenv(__name: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn clearenv() -> ::std::os::raw::c_int; + pub fn cgetnum( + arg1: *mut ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + arg3: *mut ::std::os::raw::c_long, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn mktemp(__template: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; + pub fn cgetset(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } extern "C" { - pub fn mkstemp(__template: *mut ::std::os::raw::c_char) -> ::std::os::raw::c_int; + pub fn cgetstr( + arg1: *mut ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + arg3: *mut *mut ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn mkstemps(__template: *mut ::std::os::raw::c_char, __suffixlen: ::std::os::raw::c_int) - -> ::std::os::raw::c_int; + pub fn cgetustr( + arg1: *mut ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + arg3: *mut *mut ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn mkdtemp(__template: *mut ::std::os::raw::c_char) -> *mut ::std::os::raw::c_char; + pub fn daemon(arg1: ::std::os::raw::c_int, arg2: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } extern "C" { - pub fn system(__command: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; + pub fn devname(arg1: dev_t, arg2: mode_t) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn realpath( - __name: *const ::std::os::raw::c_char, - __resolved: *mut ::std::os::raw::c_char, + pub fn devname_r( + arg1: dev_t, + arg2: mode_t, + buf: *mut ::std::os::raw::c_char, + len: ::std::os::raw::c_int, ) -> *mut ::std::os::raw::c_char; } -pub type __compar_fn_t = ::std::option::Option< - unsafe extern "C" fn( - arg1: *const ::std::os::raw::c_void, - arg2: *const ::std::os::raw::c_void, - ) -> ::std::os::raw::c_int, ->; -extern "C" { - pub fn bsearch( - __key: *const ::std::os::raw::c_void, - __base: *const ::std::os::raw::c_void, - __nmemb: usize, - __size: usize, - __compar: __compar_fn_t, - ) -> *mut ::std::os::raw::c_void; -} -extern "C" { - pub fn qsort(__base: *mut ::std::os::raw::c_void, __nmemb: usize, __size: usize, __compar: __compar_fn_t); -} extern "C" { - pub fn abs(__x: ::std::os::raw::c_int) -> ::std::os::raw::c_int; + pub fn getbsize(arg1: *mut ::std::os::raw::c_int, arg2: *mut ::std::os::raw::c_long) -> *mut ::std::os::raw::c_char; } extern "C" { - pub fn labs(__x: ::std::os::raw::c_long) -> ::std::os::raw::c_long; + pub fn getloadavg(arg1: *mut f64, arg2: ::std::os::raw::c_int) -> ::std::os::raw::c_int; } extern "C" { - pub fn llabs(__x: ::std::os::raw::c_longlong) -> ::std::os::raw::c_longlong; + pub fn getprogname() -> *const ::std::os::raw::c_char; } extern "C" { - pub fn div(__numer: ::std::os::raw::c_int, __denom: ::std::os::raw::c_int) -> div_t; + pub fn setprogname(arg1: *const ::std::os::raw::c_char); } extern "C" { - pub fn ldiv(__numer: ::std::os::raw::c_long, __denom: ::std::os::raw::c_long) -> ldiv_t; + pub fn heapsort( + __base: *mut ::std::os::raw::c_void, + __nel: usize, + __width: usize, + __compar: ::std::option::Option< + unsafe extern "C" fn( + arg1: *const ::std::os::raw::c_void, + arg2: *const ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int, + >, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn lldiv(__numer: ::std::os::raw::c_longlong, __denom: ::std::os::raw::c_longlong) -> lldiv_t; + pub fn heapsort_b( + __base: *mut ::std::os::raw::c_void, + __nel: usize, + __width: usize, + __compar: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn ecvt( - __value: f64, - __ndigit: ::std::os::raw::c_int, - __decpt: *mut ::std::os::raw::c_int, - __sign: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; + pub fn mergesort( + __base: *mut ::std::os::raw::c_void, + __nel: usize, + __width: usize, + __compar: ::std::option::Option< + unsafe extern "C" fn( + arg1: *const ::std::os::raw::c_void, + arg2: *const ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int, + >, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn fcvt( - __value: f64, - __ndigit: ::std::os::raw::c_int, - __decpt: *mut ::std::os::raw::c_int, - __sign: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; + pub fn mergesort_b( + __base: *mut ::std::os::raw::c_void, + __nel: usize, + __width: usize, + __compar: *mut ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int; } extern "C" { - pub fn gcvt( - __value: f64, - __ndigit: ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; + pub fn psort( + __base: *mut ::std::os::raw::c_void, + __nel: usize, + __width: usize, + __compar: ::std::option::Option< + unsafe extern "C" fn( + arg1: *const ::std::os::raw::c_void, + arg2: *const ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int, + >, + ); } extern "C" { - pub fn qecvt( - __value: u128, - __ndigit: ::std::os::raw::c_int, - __decpt: *mut ::std::os::raw::c_int, - __sign: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; + pub fn psort_b( + __base: *mut ::std::os::raw::c_void, + __nel: usize, + __width: usize, + __compar: *mut ::std::os::raw::c_void, + ); } extern "C" { - pub fn qfcvt( - __value: u128, - __ndigit: ::std::os::raw::c_int, - __decpt: *mut ::std::os::raw::c_int, - __sign: *mut ::std::os::raw::c_int, - ) -> *mut ::std::os::raw::c_char; + pub fn psort_r( + __base: *mut ::std::os::raw::c_void, + __nel: usize, + __width: usize, + arg1: *mut ::std::os::raw::c_void, + __compar: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *const ::std::os::raw::c_void, + arg3: *const ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int, + >, + ); } extern "C" { - pub fn qgcvt( - __value: u128, - __ndigit: ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_char, - ) -> *mut ::std::os::raw::c_char; + pub fn qsort_b( + __base: *mut ::std::os::raw::c_void, + __nel: usize, + __width: usize, + __compar: *mut ::std::os::raw::c_void, + ); } extern "C" { - pub fn ecvt_r( - __value: f64, - __ndigit: ::std::os::raw::c_int, - __decpt: *mut ::std::os::raw::c_int, - __sign: *mut ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_char, - __len: usize, - ) -> ::std::os::raw::c_int; + pub fn qsort_r( + __base: *mut ::std::os::raw::c_void, + __nel: usize, + __width: usize, + arg1: *mut ::std::os::raw::c_void, + __compar: ::std::option::Option< + unsafe extern "C" fn( + arg1: *mut ::std::os::raw::c_void, + arg2: *const ::std::os::raw::c_void, + arg3: *const ::std::os::raw::c_void, + ) -> ::std::os::raw::c_int, + >, + ); } extern "C" { - pub fn fcvt_r( - __value: f64, - __ndigit: ::std::os::raw::c_int, - __decpt: *mut ::std::os::raw::c_int, - __sign: *mut ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_char, - __len: usize, + pub fn radixsort( + __base: *mut *const ::std::os::raw::c_uchar, + __nel: ::std::os::raw::c_int, + __table: *const ::std::os::raw::c_uchar, + __endbyte: ::std::os::raw::c_uint, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn qecvt_r( - __value: u128, - __ndigit: ::std::os::raw::c_int, - __decpt: *mut ::std::os::raw::c_int, - __sign: *mut ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_char, - __len: usize, - ) -> ::std::os::raw::c_int; + pub fn rpmatch(arg1: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; } extern "C" { - pub fn qfcvt_r( - __value: u128, - __ndigit: ::std::os::raw::c_int, - __decpt: *mut ::std::os::raw::c_int, - __sign: *mut ::std::os::raw::c_int, - __buf: *mut ::std::os::raw::c_char, - __len: usize, + pub fn sradixsort( + __base: *mut *const ::std::os::raw::c_uchar, + __nel: ::std::os::raw::c_int, + __table: *const ::std::os::raw::c_uchar, + __endbyte: ::std::os::raw::c_uint, ) -> ::std::os::raw::c_int; } extern "C" { - pub fn mblen(__s: *const ::std::os::raw::c_char, __n: usize) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn mbtowc(__pwc: *mut wchar_t, __s: *const ::std::os::raw::c_char, __n: usize) -> ::std::os::raw::c_int; + pub fn sranddev(); } extern "C" { - pub fn wctomb(__s: *mut ::std::os::raw::c_char, __wchar: wchar_t) -> ::std::os::raw::c_int; + pub fn srandomdev(); } extern "C" { - pub fn mbstowcs(__pwcs: *mut wchar_t, __s: *const ::std::os::raw::c_char, __n: usize) -> usize; + pub fn reallocf(__ptr: *mut ::std::os::raw::c_void, __size: usize) -> *mut ::std::os::raw::c_void; } extern "C" { - pub fn wcstombs(__s: *mut ::std::os::raw::c_char, __pwcs: *const wchar_t, __n: usize) -> usize; + pub fn strtonum( + __numstr: *const ::std::os::raw::c_char, + __minval: ::std::os::raw::c_longlong, + __maxval: ::std::os::raw::c_longlong, + __errstrp: *mut *const ::std::os::raw::c_char, + ) -> ::std::os::raw::c_longlong; } extern "C" { - pub fn rpmatch(__response: *const ::std::os::raw::c_char) -> ::std::os::raw::c_int; + pub fn strtoq( + __str: *const ::std::os::raw::c_char, + __endptr: *mut *mut ::std::os::raw::c_char, + __base: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_longlong; } extern "C" { - pub fn getsubopt( - __optionp: *mut *mut ::std::os::raw::c_char, - __tokens: *const *mut ::std::os::raw::c_char, - __valuep: *mut *mut ::std::os::raw::c_char, - ) -> ::std::os::raw::c_int; + pub fn strtouq( + __str: *const ::std::os::raw::c_char, + __endptr: *mut *mut ::std::os::raw::c_char, + __base: ::std::os::raw::c_int, + ) -> ::std::os::raw::c_ulonglong; } extern "C" { - pub fn getloadavg(__loadavg: *mut f64, __nelem: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -#[repr(C)] -#[repr(align(16))] -#[derive(Debug, Copy, Clone)] -pub struct max_align_t { - pub __clang_max_align_nonce1: ::std::os::raw::c_longlong, - pub __bindgen_padding_0: u64, - pub __clang_max_align_nonce2: u128, + pub static mut suboptarg: *mut ::std::os::raw::c_char; } -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of max_align_t"][::std::mem::size_of::() - 32usize]; - ["Alignment of max_align_t"][::std::mem::align_of::() - 16usize]; - ["Offset of field: max_align_t::__clang_max_align_nonce1"] - [::std::mem::offset_of!(max_align_t, __clang_max_align_nonce1) - 0usize]; - ["Offset of field: max_align_t::__clang_max_align_nonce2"] - [::std::mem::offset_of!(max_align_t, __clang_max_align_nonce2) - 16usize]; -}; +pub type max_align_t = f64; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct km_stat_t { @@ -3293,129 +4767,125 @@ pub type khint_t = khint32_t; pub type khiter_t = khint_t; pub const __ac_HASH_UPPER: f64 = 0.77; pub type kh_cstr_t = *const ::std::os::raw::c_char; -pub const _ISupper: _bindgen_ty_1 = 256; -pub const _ISlower: _bindgen_ty_1 = 512; -pub const _ISalpha: _bindgen_ty_1 = 1024; -pub const _ISdigit: _bindgen_ty_1 = 2048; -pub const _ISxdigit: _bindgen_ty_1 = 4096; -pub const _ISspace: _bindgen_ty_1 = 8192; -pub const _ISprint: _bindgen_ty_1 = 16384; -pub const _ISgraph: _bindgen_ty_1 = 32768; -pub const _ISblank: _bindgen_ty_1 = 1; -pub const _IScntrl: _bindgen_ty_1 = 2; -pub const _ISpunct: _bindgen_ty_1 = 4; -pub const _ISalnum: _bindgen_ty_1 = 8; -pub type _bindgen_ty_1 = ::std::os::raw::c_uint; -extern "C" { - pub fn __ctype_b_loc() -> *mut *const ::std::os::raw::c_ushort; -} -extern "C" { - pub fn __ctype_tolower_loc() -> *mut *const __int32_t; -} -extern "C" { - pub fn __ctype_toupper_loc() -> *mut *const __int32_t; -} -extern "C" { - pub fn isalnum(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn isalpha(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn iscntrl(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn isdigit(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn islower(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn isgraph(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn isprint(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn ispunct(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn isspace(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn isupper(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn isxdigit(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn tolower(__c: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn toupper(__c: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn isblank(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn isascii(__c: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn toascii(__c: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _toupper(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn _tolower(arg1: ::std::os::raw::c_int) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn isalnum_l(arg1: ::std::os::raw::c_int, arg2: locale_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn isalpha_l(arg1: ::std::os::raw::c_int, arg2: locale_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn iscntrl_l(arg1: ::std::os::raw::c_int, arg2: locale_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn isdigit_l(arg1: ::std::os::raw::c_int, arg2: locale_t) -> ::std::os::raw::c_int; -} -extern "C" { - pub fn islower_l(arg1: ::std::os::raw::c_int, arg2: locale_t) -> ::std::os::raw::c_int; +pub type wint_t = __darwin_wint_t; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _RuneEntry { + pub __min: __darwin_rune_t, + pub __max: __darwin_rune_t, + pub __map: __darwin_rune_t, + pub __types: *mut __uint32_t, } -extern "C" { - pub fn isgraph_l(arg1: ::std::os::raw::c_int, arg2: locale_t) -> ::std::os::raw::c_int; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _RuneEntry"][::std::mem::size_of::<_RuneEntry>() - 24usize]; + ["Alignment of _RuneEntry"][::std::mem::align_of::<_RuneEntry>() - 8usize]; + ["Offset of field: _RuneEntry::__min"][::std::mem::offset_of!(_RuneEntry, __min) - 0usize]; + ["Offset of field: _RuneEntry::__max"][::std::mem::offset_of!(_RuneEntry, __max) - 4usize]; + ["Offset of field: _RuneEntry::__map"][::std::mem::offset_of!(_RuneEntry, __map) - 8usize]; + ["Offset of field: _RuneEntry::__types"][::std::mem::offset_of!(_RuneEntry, __types) - 16usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _RuneRange { + pub __nranges: ::std::os::raw::c_int, + pub __ranges: *mut _RuneEntry, } -extern "C" { - pub fn isprint_l(arg1: ::std::os::raw::c_int, arg2: locale_t) -> ::std::os::raw::c_int; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _RuneRange"][::std::mem::size_of::<_RuneRange>() - 16usize]; + ["Alignment of _RuneRange"][::std::mem::align_of::<_RuneRange>() - 8usize]; + ["Offset of field: _RuneRange::__nranges"][::std::mem::offset_of!(_RuneRange, __nranges) - 0usize]; + ["Offset of field: _RuneRange::__ranges"][::std::mem::offset_of!(_RuneRange, __ranges) - 8usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _RuneCharClass { + pub __name: [::std::os::raw::c_char; 14usize], + pub __mask: __uint32_t, } -extern "C" { - pub fn ispunct_l(arg1: ::std::os::raw::c_int, arg2: locale_t) -> ::std::os::raw::c_int; +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _RuneCharClass"][::std::mem::size_of::<_RuneCharClass>() - 20usize]; + ["Alignment of _RuneCharClass"][::std::mem::align_of::<_RuneCharClass>() - 4usize]; + ["Offset of field: _RuneCharClass::__name"][::std::mem::offset_of!(_RuneCharClass, __name) - 0usize]; + ["Offset of field: _RuneCharClass::__mask"][::std::mem::offset_of!(_RuneCharClass, __mask) - 16usize]; +}; +#[repr(C)] +#[derive(Debug, Copy, Clone)] +pub struct _RuneLocale { + pub __magic: [::std::os::raw::c_char; 8usize], + pub __encoding: [::std::os::raw::c_char; 32usize], + pub __sgetrune: ::std::option::Option< + unsafe extern "C" fn( + arg1: *const ::std::os::raw::c_char, + arg2: __darwin_size_t, + arg3: *mut *const ::std::os::raw::c_char, + ) -> __darwin_rune_t, + >, + pub __sputrune: ::std::option::Option< + unsafe extern "C" fn( + arg1: __darwin_rune_t, + arg2: *mut ::std::os::raw::c_char, + arg3: __darwin_size_t, + arg4: *mut *mut ::std::os::raw::c_char, + ) -> ::std::os::raw::c_int, + >, + pub __invalid_rune: __darwin_rune_t, + pub __runetype: [__uint32_t; 256usize], + pub __maplower: [__darwin_rune_t; 256usize], + pub __mapupper: [__darwin_rune_t; 256usize], + pub __runetype_ext: _RuneRange, + pub __maplower_ext: _RuneRange, + pub __mapupper_ext: _RuneRange, + pub __variable: *mut ::std::os::raw::c_void, + pub __variable_len: ::std::os::raw::c_int, + pub __ncharclasses: ::std::os::raw::c_int, + pub __charclasses: *mut _RuneCharClass, } +#[allow(clippy::unnecessary_operation, clippy::identity_op)] +const _: () = { + ["Size of _RuneLocale"][::std::mem::size_of::<_RuneLocale>() - 3208usize]; + ["Alignment of _RuneLocale"][::std::mem::align_of::<_RuneLocale>() - 8usize]; + ["Offset of field: _RuneLocale::__magic"][::std::mem::offset_of!(_RuneLocale, __magic) - 0usize]; + ["Offset of field: _RuneLocale::__encoding"][::std::mem::offset_of!(_RuneLocale, __encoding) - 8usize]; + ["Offset of field: _RuneLocale::__sgetrune"][::std::mem::offset_of!(_RuneLocale, __sgetrune) - 40usize]; + ["Offset of field: _RuneLocale::__sputrune"][::std::mem::offset_of!(_RuneLocale, __sputrune) - 48usize]; + ["Offset of field: _RuneLocale::__invalid_rune"][::std::mem::offset_of!(_RuneLocale, __invalid_rune) - 56usize]; + ["Offset of field: _RuneLocale::__runetype"][::std::mem::offset_of!(_RuneLocale, __runetype) - 60usize]; + ["Offset of field: _RuneLocale::__maplower"][::std::mem::offset_of!(_RuneLocale, __maplower) - 1084usize]; + ["Offset of field: _RuneLocale::__mapupper"][::std::mem::offset_of!(_RuneLocale, __mapupper) - 2108usize]; + ["Offset of field: _RuneLocale::__runetype_ext"][::std::mem::offset_of!(_RuneLocale, __runetype_ext) - 3136usize]; + ["Offset of field: _RuneLocale::__maplower_ext"][::std::mem::offset_of!(_RuneLocale, __maplower_ext) - 3152usize]; + ["Offset of field: _RuneLocale::__mapupper_ext"][::std::mem::offset_of!(_RuneLocale, __mapupper_ext) - 3168usize]; + ["Offset of field: _RuneLocale::__variable"][::std::mem::offset_of!(_RuneLocale, __variable) - 3184usize]; + ["Offset of field: _RuneLocale::__variable_len"][::std::mem::offset_of!(_RuneLocale, __variable_len) - 3192usize]; + ["Offset of field: _RuneLocale::__ncharclasses"][::std::mem::offset_of!(_RuneLocale, __ncharclasses) - 3196usize]; + ["Offset of field: _RuneLocale::__charclasses"][::std::mem::offset_of!(_RuneLocale, __charclasses) - 3200usize]; +}; extern "C" { - pub fn isspace_l(arg1: ::std::os::raw::c_int, arg2: locale_t) -> ::std::os::raw::c_int; + pub static mut _DefaultRuneLocale: _RuneLocale; } extern "C" { - pub fn isupper_l(arg1: ::std::os::raw::c_int, arg2: locale_t) -> ::std::os::raw::c_int; + pub static mut _CurrentRuneLocale: *mut _RuneLocale; } extern "C" { - pub fn isxdigit_l(arg1: ::std::os::raw::c_int, arg2: locale_t) -> ::std::os::raw::c_int; + pub fn ___runetype(arg1: __darwin_ct_rune_t) -> ::std::os::raw::c_ulong; } extern "C" { - pub fn isblank_l(arg1: ::std::os::raw::c_int, arg2: locale_t) -> ::std::os::raw::c_int; + pub fn ___tolower(arg1: __darwin_ct_rune_t) -> __darwin_ct_rune_t; } extern "C" { - pub fn __tolower_l(__c: ::std::os::raw::c_int, __l: locale_t) -> ::std::os::raw::c_int; + pub fn ___toupper(arg1: __darwin_ct_rune_t) -> __darwin_ct_rune_t; } extern "C" { - pub fn tolower_l(__c: ::std::os::raw::c_int, __l: locale_t) -> ::std::os::raw::c_int; + pub fn __maskrune(arg1: __darwin_ct_rune_t, arg2: ::std::os::raw::c_ulong) -> ::std::os::raw::c_int; } extern "C" { - pub fn __toupper_l(__c: ::std::os::raw::c_int, __l: locale_t) -> ::std::os::raw::c_int; + pub fn __toupper(arg1: __darwin_ct_rune_t) -> __darwin_ct_rune_t; } extern "C" { - pub fn toupper_l(__c: ::std::os::raw::c_int, __l: locale_t) -> ::std::os::raw::c_int; + pub fn __tolower(arg1: __darwin_ct_rune_t) -> __darwin_ct_rune_t; } #[repr(C)] #[derive(Debug, Copy, Clone)] @@ -3687,26 +5157,11 @@ extern "C" { ) -> ::std::os::raw::c_int; } extern "C" { - pub fn __assert_fail( - __assertion: *const ::std::os::raw::c_char, - __file: *const ::std::os::raw::c_char, - __line: ::std::os::raw::c_uint, - __function: *const ::std::os::raw::c_char, - ) -> !; -} -extern "C" { - pub fn __assert_perror_fail( - __errnum: ::std::os::raw::c_int, - __file: *const ::std::os::raw::c_char, - __line: ::std::os::raw::c_uint, - __function: *const ::std::os::raw::c_char, - ) -> !; -} -extern "C" { - pub fn __assert( - __assertion: *const ::std::os::raw::c_char, - __file: *const ::std::os::raw::c_char, - __line: ::std::os::raw::c_int, + pub fn __assert_rtn( + arg1: *const ::std::os::raw::c_char, + arg2: *const ::std::os::raw::c_char, + arg3: ::std::os::raw::c_int, + arg4: *const ::std::os::raw::c_char, ) -> !; } #[repr(C)] @@ -4323,25 +5778,7 @@ extern "C" { buf: *mut sdust_buf_t, ) -> *const u64; } -pub type __builtin_va_list = [__va_list_tag; 1usize]; -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __va_list_tag { - pub gp_offset: ::std::os::raw::c_uint, - pub fp_offset: ::std::os::raw::c_uint, - pub overflow_arg_area: *mut ::std::os::raw::c_void, - pub reg_save_area: *mut ::std::os::raw::c_void, -} -#[allow(clippy::unnecessary_operation, clippy::identity_op)] -const _: () = { - ["Size of __va_list_tag"][::std::mem::size_of::<__va_list_tag>() - 24usize]; - ["Alignment of __va_list_tag"][::std::mem::align_of::<__va_list_tag>() - 8usize]; - ["Offset of field: __va_list_tag::gp_offset"][::std::mem::offset_of!(__va_list_tag, gp_offset) - 0usize]; - ["Offset of field: __va_list_tag::fp_offset"][::std::mem::offset_of!(__va_list_tag, fp_offset) - 4usize]; - ["Offset of field: __va_list_tag::overflow_arg_area"] - [::std::mem::offset_of!(__va_list_tag, overflow_arg_area) - 8usize]; - ["Offset of field: __va_list_tag::reg_save_area"][::std::mem::offset_of!(__va_list_tag, reg_save_area) - 16usize]; -}; +pub type __builtin_va_list = *mut ::std::os::raw::c_char; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct mm_idx_bucket_s { @@ -4352,8 +5789,4 @@ pub struct mm_idx_bucket_s { pub struct mm_idx_intv_s { pub _address: u8, } -#[repr(C)] -#[derive(Debug, Copy, Clone)] -pub struct __locale_data { - pub _address: u8, -} +pub type __uint128_t = u128; diff --git a/packages/minimap2/Cargo.toml b/packages/minimap2/Cargo.toml index 8f7eba8d..0c15bdad 100644 --- a/packages/minimap2/Cargo.toml +++ b/packages/minimap2/Cargo.toml @@ -18,66 +18,19 @@ workspace = true crate-type = ["lib"] [dependencies] -approx = { workspace = true } -auto_ops = { workspace = true } -bio = { workspace = true } -bio-types = { workspace = true } -chrono = { workspace = true } -clap = { workspace = true } -clap_complete = { workspace = true } -clap_complete_fig = { workspace = true } -cmd_lib = { workspace = true } -color-eyre = { workspace = true } -csv = { workspace = true } -ctor = { workspace = true } -derive_more = { workspace = true } -env_logger = { workspace = true } eyre = { workspace = true } -flate2 = { workspace = true } -gcollections = { workspace = true } -getset = { workspace = true } -intervallum = { workspace = true } itertools = { workspace = true } -lazy_static = { workspace = true } -log = { workspace = true } -maplit = { workspace = true } -memoize = { workspace = true } minimap2-sys = { workspace = true } -ndarray = { workspace = true } -ndarray-rand = { workspace = true } -ndarray-stats = { workspace = true } -noodles = { workspace = true } -num = { workspace = true } -num-integer = { workspace = true } -num-traits = { workspace = true } -num_cpus = { workspace = true } ordered-float = { workspace = true } -parking_lot = { workspace = true } -pretty_dtoa = { workspace = true } -rand = { workspace = true } -rand_distr = { workspace = true } -rand_isaac = { workspace = true } -rayon = { workspace = true } serde = { workspace = true, optional = true } -serde-aux = { workspace = true } -serde_json = { workspace = true } -serde_stacker = { workspace = true } -smart-default = { workspace = true } -strum = { workspace = true } -strum_macros = { workspace = true } -tempfile = { workspace = true } -twox-hash = { workspace = true } -[target.'cfg(not(target_arch = "wasm32"))'.dependencies] -atty = { workspace = true } -bzip2 = { workspace = true } -xz2 = { workspace = true } -zstd = { workspace = true } +#[target.'cfg(not(target_arch = "wasm32"))'.dependencies] +#atty = { workspace = true } +#bzip2 = { workspace = true } +#xz2 = { workspace = true } +#zstd = { workspace = true } [dev-dependencies] -pretty_assertions = { workspace = true } -rstest = { workspace = true } -rstest_reuse = { workspace = true } [features] serde = ["dep:serde"] diff --git a/tests/in/randseqs.fa b/tests/in/randseqs.fa deleted file mode 100644 index 2022569d..00000000 --- a/tests/in/randseqs.fa +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e2654c22a3fd522167f284a0ececb3c8a00e3e5f135a70e8a64548576439fe1a -size 182316 diff --git a/tests/run-cli-tests.sh b/tests/run-cli-tests.sh deleted file mode 100755 index cb485ed0..00000000 --- a/tests/run-cli-tests.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env bash - -set -euxo pipefail - -: "${1:? ${0}: Path to pangraph executable is required}" - -function abspath() { - readlink -m "$1" -} - -# shellcheck disable=SC2155 -export THIS_DIR=$( - cd "$(dirname "${BASH_SOURCE[0]}")" - pwd -) - -# shellcheck disable=SC2155 -export PROJECT_ROOT_DIR="$(abspath "${THIS_DIR}/..")" - -PANGRAPH="${1}" -IN_DIR="${PROJECT_ROOT_DIR}/tests/in" -OUT_DIR="${PROJECT_ROOT_DIR}/tests/out" - -mkdir -p "$OUT_DIR" - -# Test version -${PANGRAPH} --version - -# Test long help -${PANGRAPH} --help -${PANGRAPH} build --help -${PANGRAPH} export --help -${PANGRAPH} generate --help -${PANGRAPH} marginalize --help -${PANGRAPH} polish --help - -# Test short help -${PANGRAPH} -h -${PANGRAPH} build -h -${PANGRAPH} export -h -${PANGRAPH} generate -h -${PANGRAPH} marginalize -h -${PANGRAPH} polish -h - -# Test pangraph generate -${PANGRAPH} generate -v -s 100 -r 1e-1 -m 1e-3 -d 5e-2 -i 1e-2 -t 5 "$IN_DIR/randseqs.fa" >"$OUT_DIR/input.fa" - -# Test pangraph build - minimap asm20 no energy -${PANGRAPH} build -v -c -k minimap2 -s 20 -a 0 -b 0 "$OUT_DIR/input.fa" >"$OUT_DIR/test1.json" - -# Test pangraph build - mash -${PANGRAPH} build -v -c -d mash "$OUT_DIR/input.fa" >"$OUT_DIR/test2.json" - -# Test pangraph build - mmseqs -${PANGRAPH} build -v -c -k mmseqs -K 8 "$OUT_DIR/input.fa" >"$OUT_DIR/test3.json" - -# "Test pangraph polish -${PANGRAPH} polish -v -c -l 10000 "$OUT_DIR/test1.json" >"$OUT_DIR/polished.json" - -# Test pangraph GFA export -${PANGRAPH} export -v -o "$OUT_DIR/export" "$OUT_DIR/test1.json" - -# Test pangraph PanX export -${PANGRAPH} export -v --ng --px -o "$OUT_DIR/export" "$OUT_DIR/test1.json" - -# Test pangraph marginalize -${PANGRAPH} marginalize -v -o "$OUT_DIR/marginalize" "$OUT_DIR/test1.json"