diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 0000000..a188ba2 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[target.x86_64-unknown-linux-gnu] +rustflags = ["-Ctarget-cpu=skylake"] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eca84b1..ee0e1bd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,8 +13,6 @@ env: jobs: build: runs-on: ubuntu-latest - env: - RUSTFLAGS: "-C target-cpu=skylake" steps: - uses: actions/checkout@v4 - uses: rui314/setup-mold@v1 @@ -34,8 +32,6 @@ jobs: build_ui: runs-on: ubuntu-latest - env: - RUSTFLAGS: "-C target-cpu=skylake" steps: - uses: actions/checkout@v4 - uses: rui314/setup-mold@v1 @@ -54,8 +50,6 @@ jobs: database_test: runs-on: ubuntu-latest - env: - RUSTFLAGS: "-C target-cpu=skylake" steps: - uses: actions/checkout@v4 - uses: rui314/setup-mold@v1 @@ -74,8 +68,6 @@ jobs: object_store_memory_test: runs-on: ubuntu-latest - env: - RUSTFLAGS: "-C target-cpu=skylake" steps: - uses: actions/checkout@v4 - uses: rui314/setup-mold@v1 @@ -121,8 +113,6 @@ jobs: object_store_direct_test: runs-on: ubuntu-latest - env: - RUSTFLAGS: "-C target-cpu=skylake" steps: - uses: actions/checkout@v4 - uses: rui314/setup-mold@v1 diff --git a/.github/workflows/columnq_cli_release.yml b/.github/workflows/columnq_cli_release.yml index 768ecfb..6e0fde2 100644 --- a/.github/workflows/columnq_cli_release.yml +++ b/.github/workflows/columnq_cli_release.yml @@ -134,20 +134,17 @@ jobs: target: "x86_64-unknown-linux-musl" image_tag: "x86_64-musl" features: "rustls,database-sqlite" - rustflags: "-C target-cpu=skylake" name_suffix: "" upload: "true" # - manylinux: "2010" # target: "x86_64-unknown-linux-musl" # image_tag: "x86_64-musl" # features: "native-tls,database-sqlite" - # rustflags: "-C target-cpu=skylake" # name_suffix: "-openssl" # upload: "false" - manylinux: '2014' target: "aarch64-unknown-linux-musl" image_tag: "aarch64-musl" - rustflags: "" features: "rustls,database-sqlite" name_suffix: "" upload: "true" @@ -156,19 +153,16 @@ jobs: # image_tag: "aarch64-musl" # features: "native-tls,database-sqlite" # name_suffix: "-openssl" - # rustflags: "" # upload: "false" # - manylinux: '2014' # target: "armv7-unknown-linux-musleabihf" # image_tag: "armv7-musleabihf" - # rustflags: "" # features: "rustls,database-sqlite" # name_suffix: "" # upload: "true" # - manylinux: '2014' # target: "armv7-unknown-linux-musleabihf" # image_tag: "armv7-musleabihf" - # rustflags: "" # features: "native-tls,database-sqlite" # name_suffix: "-openssl" # upload: "false" @@ -194,7 +188,6 @@ jobs: - name: Build Wheels run: | sudo python3 -m pip install 'maturin<2' - export RUSTFLAGS='${{ matrix.platform.rustflags }}' maturin build -m columnq-cli/Cargo.toml -b bin --release -o dist \ --target ${{ matrix.platform.target }} --manylinux ${{ matrix.platform.manylinux }} \ --no-default-features --features=${{ matrix.platform.features }} diff --git a/.github/workflows/roapi_release.yml b/.github/workflows/roapi_release.yml index a987f02..175003c 100644 --- a/.github/workflows/roapi_release.yml +++ b/.github/workflows/roapi_release.yml @@ -142,41 +142,35 @@ jobs: image_tag: "x86_64-musl" features: "rustls,database-sqlite" name_suffix: "" - rustflags: "-C target-cpu=skylake" upload: "true" # - manylinux: "2010" # target: "x86_64-unknown-linux-musl" # image_tag: "x86_64-musl" # features: "native-tls" - # rustflags: "-C target-cpu=skylake" # name_suffix: "-openssl" # upload: "false" - manylinux: '2014' target: "aarch64-unknown-linux-musl" image_tag: "aarch64-musl" features: "rustls,database-sqlite" - rustflags: "" name_suffix: "" upload: "true" # - manylinux: '2014' # target: "aarch64-unknown-linux-musl" # image_tag: "aarch64-musl" # features: "native-tls" - # rustflags: "" # name_suffix: "-openssl" # upload: "false" # - manylinux: '2014' # target: "armv7-unknown-linux-musleabihf" # image_tag: "armv7-musleabihf" # features: "rustls,database-sqlite" - # rustflags: "" # name_suffix: "" # upload: "true" # - manylinux: '2014' # target: "armv7-unknown-linux-musleabihf" # image_tag: "armv7-musleabihf" # features: "native-tls" - # rustflags: "" # name_suffix: "-openssl" # upload: "false" container: @@ -207,7 +201,6 @@ jobs: - name: Build Wheels run: | sudo python3 -m pip install 'maturin<2' - export RUSTFLAGS='${{ matrix.platform.rustflags }}' maturin build -m roapi/Cargo.toml -b bin --release -o dist \ --target ${{ matrix.platform.target }} --manylinux ${{ matrix.platform.manylinux }} \ --no-default-features --features=${{ matrix.platform.features }},ui diff --git a/Dockerfile b/Dockerfile index 46bc4ac..51d752a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,4 @@ ARG RUST_VER=1.84.1-bookworm -ARG RUSTFLAGS='-C target-cpu=skylake' ARG FEATURES="database,ui" # Step 0: Install cargo-chef @@ -23,23 +22,19 @@ RUN cargo chef prepare --recipe-path recipe.json # Step 2: Cache project dependencies FROM chef AS cacher -ARG RUSTFLAGS ARG FEATURES WORKDIR /roapi_src COPY --from=planner /roapi_src/recipe.json recipe.json -RUN RUSTFLAGS=${RUSTFLAGS} \ - cargo chef cook --features ${FEATURES} --release --recipe-path recipe.json +RUN cargo chef cook --features ${FEATURES} --release --recipe-path recipe.json # Step 3: Build the release binary FROM chef AS builder -ARG RUSTFLAGS ARG FEATURES WORKDIR /roapi_src COPY ./ /roapi_src COPY --from=cacher /roapi_src/target target COPY --from=cacher /usr/local/cargo /usr/local/cargo -RUN RUSTFLAGS=${RUSTFLAGS} \ - cargo build --release --locked --bin roapi --features ${FEATURES} +RUN cargo build --release --locked --bin roapi --features ${FEATURES} # Step 4: Assemble the final image FROM debian:bookworm-slim