Skip to content

Commit

Permalink
set target-cpu to skylake for x86 builds (roapi#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
houqp authored Oct 12, 2021
1 parent b382249 commit 5ffdf09
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
env:
# NOTE: this env is also defined in roapi_http_release.yml and columnq_cli_release.yml
RUST_TC_NIGHTLY_VER: "2021-09-25"
RUSTFLAGS: "-C target-cpu=native"

jobs:
build:
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/columnq_cli_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ on:
env:
# NOTE: this env is also defined in build.yml
RUST_TC_NIGHTLY_VER: "2021-09-25"
RUSTFLAGS: "-C target-cpu=skylake"

jobs:
# skip tag version validation on non-release branch run
Expand Down Expand Up @@ -51,6 +52,7 @@ jobs:
run: pip3 install 'maturin<0.12'
- name: Build wheels - x86_64
run: |
export RUSTFLAGS='-C target-cpu=skylake'
maturin build -m columnq-cli/Cargo.toml -b bin --target x86_64-apple-darwin --release --out dist --cargo-extra-args="--features=simd"
pip install columnq-cli --no-index --find-links dist --force-reinstall
- name: Build wheels - universal2
Expand Down Expand Up @@ -105,6 +107,7 @@ jobs:
run: pip3 install 'maturin<0.12'
- name: Build wheels
run: |
export RUSTFLAGS='-C target-cpu=skylake'
maturin build -m columnq-cli/Cargo.toml -b bin --release --out dist --no-sdist --target ${{ matrix.platform.target }} --cargo-extra-args="--features=${{ matrix.platform.features }}"
pip install columnq-cli --no-index --find-links dist --force-reinstall
columnq --help
Expand Down Expand Up @@ -146,6 +149,7 @@ jobs:
- name: Build Wheels
run: |
sudo python3 -m pip install 'maturin<0.12'
export RUSTFLAGS='-C target-cpu=skylake'
maturin build -m columnq-cli/Cargo.toml -b bin --no-sdist --release -o dist \
--target ${{ matrix.platform.target }} --manylinux ${{ matrix.platform.manylinux }} \
--cargo-extra-args="--no-default-features --features=${{ matrix.platform.features }}"
Expand Down Expand Up @@ -185,4 +189,4 @@ jobs:
TWINE_PASSWORD: ${{ secrets.COLUMNQ_CLI_PYPI_TOKEN }}
run: |
pip install --upgrade twine
twine upload --skip-existing *
twine upload --skip-existing *
3 changes: 3 additions & 0 deletions .github/workflows/roapi_http_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ jobs:
run: pip3 install 'maturin<0.12'
- name: Build wheels - x86_64
run: |
export RUSTFLAGS='-C target-cpu=skylake'
maturin build -m roapi-http/Cargo.toml -b bin --target x86_64-apple-darwin --release --out dist --cargo-extra-args="--features=simd"
pip install roapi-http --no-index --find-links dist --force-reinstall
- name: Build wheels - universal2
Expand Down Expand Up @@ -106,6 +107,7 @@ jobs:
run: pip3 install 'maturin<0.12'
- name: Build wheels
run: |
export RUSTFLAGS='-C target-cpu=skylake'
maturin build -m roapi-http/Cargo.toml -b bin --release --out dist --no-sdist --target ${{ matrix.platform.target }} --cargo-extra-args="--features=${{ matrix.platform.features }}"
pip install roapi-http --no-index --find-links dist --force-reinstall
roapi-http --help
Expand Down Expand Up @@ -147,6 +149,7 @@ jobs:
- name: Build Wheels
run: |
sudo python3 -m pip install 'maturin<0.12'
export RUSTFLAGS='-C target-cpu=skylake'
maturin build -m roapi-http/Cargo.toml -b bin --no-sdist --release -o dist \
--target ${{ matrix.platform.target }} --manylinux ${{ matrix.platform.manylinux }} \
--cargo-extra-args="--no-default-features --features=${{ matrix.platform.features }}"
Expand Down
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ WORKDIR /roapi_src
COPY ./ /roapi_src
RUN apt-get update \
&& apt-get install --no-install-recommends -y cmake
RUN cargo install --locked --features simd --path ./roapi-http --bin roapi-http

RUN RUSTFLAGS='-C target-cpu=skylake' \
cargo install --locked --features simd --path ./roapi-http --bin roapi-http

FROM debian:bullseye-slim
LABEL org.opencontainers.image.source https://github.com/roapi/roapi
Expand Down

0 comments on commit 5ffdf09

Please sign in to comment.