From 992735568ad43bc3063e8e976efecb18f151ca1e Mon Sep 17 00:00:00 2001 From: Dmitry Patsura Date: Mon, 8 Jul 2024 17:13:03 +0900 Subject: [PATCH 1/6] feat(cubesql): Use lld linker for linux --- .github/workflows/rust-cubesql.yml | 4 ++++ packages/cubejs-backend-native/.cargo/config.toml | 7 +++++++ packages/cubejs-backend-native/.gitignore | 3 +-- rust/cubesql/.cargo/config.toml | 11 +++++++++++ rust/cubesql/.gitignore | 1 - 5 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 packages/cubejs-backend-native/.cargo/config.toml create mode 100644 rust/cubesql/.cargo/config.toml diff --git a/.github/workflows/rust-cubesql.yml b/.github/workflows/rust-cubesql.yml index 1c214a7e4e92d..975d58d08ebf9 100644 --- a/.github/workflows/rust-cubesql.yml +++ b/.github/workflows/rust-cubesql.yml @@ -67,6 +67,10 @@ jobs: # default key key: cubesql-${{ runner.OS }}-x86_64-unknown-linux-gnu shared-key: cubesql-${{ runner.OS }}-x86_64-unknown-linux-gnu + - name: Install lld + run: | + # ubuntu 24.04 has lld-18 + sudo apt-get update && sudo apt install -y lld - name: Unit tests (Rewrite Engine) env: CUBESQL_TESTING_CUBE_TOKEN: ${{ secrets.CUBESQL_TESTING_CUBE_TOKEN }} diff --git a/packages/cubejs-backend-native/.cargo/config.toml b/packages/cubejs-backend-native/.cargo/config.toml new file mode 100644 index 0000000000000..82c8ed99a3d7b --- /dev/null +++ b/packages/cubejs-backend-native/.cargo/config.toml @@ -0,0 +1,7 @@ +# Please keep in sync this file with rust/cubesql! + +[target."x86_64-unknown-linux-gnu"] +rustflags = ["-C", "link-arg=-fuse-ld=lld"] + +[target."aarch64-unknown-linux-gnu"] +rustflags = ["-C", "link-arg=-fuse-ld=lld"] diff --git a/packages/cubejs-backend-native/.gitignore b/packages/cubejs-backend-native/.gitignore index 1e1106b5785f4..46a96f32f5b0c 100644 --- a/packages/cubejs-backend-native/.gitignore +++ b/packages/cubejs-backend-native/.gitignore @@ -5,5 +5,4 @@ target index.node **/node_modules **/.DS_Store -npm-debug.log* -.cargo \ No newline at end of file +npm-debug.log diff --git a/rust/cubesql/.cargo/config.toml b/rust/cubesql/.cargo/config.toml new file mode 100644 index 0000000000000..8d85301d2df7e --- /dev/null +++ b/rust/cubesql/.cargo/config.toml @@ -0,0 +1,11 @@ +# Please keep in sync this file with packages/cubejs-backend-native! + +[target."x86_64-unknown-linux-gnu"] +rustflags = ["-C", "link-arg=-fuse-ld=lld"] + +[target."aarch64-unknown-linux-gnu"] +rustflags = ["-C", "link-arg=-fuse-ld=lld"] + +# If you are going to use local fork, feel free to uncomment +#paths = ["../../../sqlparser-rs", "../../../arrow-datafusion/datafusion"] +#paths = ["../../../arrow-datafusion/datafusion"] diff --git a/rust/cubesql/.gitignore b/rust/cubesql/.gitignore index fb75eef2592d8..b5039a1d29689 100644 --- a/rust/cubesql/.gitignore +++ b/rust/cubesql/.gitignore @@ -2,7 +2,6 @@ /cubesql/target /.idea upstream -.cargo/config.toml dist node_modules .vscode From 30973e9a747f553305a9630d560cc67a0f3115bf Mon Sep 17 00:00:00 2001 From: Dmitry Patsura Date: Tue, 16 Jul 2024 00:34:09 +0900 Subject: [PATCH 2/6] chore: return back llvm-cov --- .github/workflows/rust-cubesql.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust-cubesql.yml b/.github/workflows/rust-cubesql.yml index 975d58d08ebf9..c337394d8070f 100644 --- a/.github/workflows/rust-cubesql.yml +++ b/.github/workflows/rust-cubesql.yml @@ -71,6 +71,11 @@ jobs: run: | # ubuntu 24.04 has lld-18 sudo apt-get update && sudo apt install -y lld + - name: Install cargo-llvm-cov@0.6.10 + uses: baptiste0928/cargo-install@v3 + with: + crate: cargo-llvm-cov + version: "0.6.10" - name: Unit tests (Rewrite Engine) env: CUBESQL_TESTING_CUBE_TOKEN: ${{ secrets.CUBESQL_TESTING_CUBE_TOKEN }} @@ -78,7 +83,16 @@ jobs: CUBESQL_SQL_PUSH_DOWN: true CUBESQL_REWRITE_CACHE: true CUBESQL_REWRITE_TIMEOUT: 60 - run: cd rust/cubesql && cargo test + run: | + cd rust/cubesql + cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info + - name: Upload code coverage + uses: codecov/codecov-action@v3 + with: + files: ./rust/cubesql/lcov.info + verbose: true + flags: cubesql + fail_ci_if_error: false native_linux: needs: [lint] From ec798d2b8e0ccb171501c1797df7673f837aee6e Mon Sep 17 00:00:00 2001 From: Dmitry Patsura Date: Tue, 16 Jul 2024 00:48:31 +0900 Subject: [PATCH 3/6] chore: bump action --- .github/workflows/rust-cubesql.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust-cubesql.yml b/.github/workflows/rust-cubesql.yml index c337394d8070f..e46d4d0498b02 100644 --- a/.github/workflows/rust-cubesql.yml +++ b/.github/workflows/rust-cubesql.yml @@ -87,7 +87,7 @@ jobs: cd rust/cubesql cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info - name: Upload code coverage - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: files: ./rust/cubesql/lcov.info verbose: true From b144d0f1be8c9d841504f9a1e5a7e015b4fc33cd Mon Sep 17 00:00:00 2001 From: Dmitry Patsura Date: Tue, 16 Jul 2024 00:59:05 +0900 Subject: [PATCH 4/6] chore: bump action --- .github/workflows/rust-cubesql.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rust-cubesql.yml b/.github/workflows/rust-cubesql.yml index e46d4d0498b02..57467d1f8c65f 100644 --- a/.github/workflows/rust-cubesql.yml +++ b/.github/workflows/rust-cubesql.yml @@ -89,6 +89,7 @@ jobs: - name: Upload code coverage uses: codecov/codecov-action@v4 with: + use_oidc: true files: ./rust/cubesql/lcov.info verbose: true flags: cubesql From 26a054bf729eba6e043c78fa5079cd880eb02c88 Mon Sep 17 00:00:00 2001 From: Dmitry Patsura Date: Tue, 16 Jul 2024 01:11:14 +0900 Subject: [PATCH 5/6] chore: try --- .github/workflows/rust-cubesql.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/rust-cubesql.yml b/.github/workflows/rust-cubesql.yml index 57467d1f8c65f..7e44a0d60cacc 100644 --- a/.github/workflows/rust-cubesql.yml +++ b/.github/workflows/rust-cubesql.yml @@ -14,6 +14,9 @@ on: - 'packages/cubejs-backend-native/**' - 'rust/cubesql/**' +permissions: + id-token: write + jobs: lint: runs-on: ubuntu-24.04 From c4328fe47de54bf2adcaa70b30fac1e0d376fbd7 Mon Sep 17 00:00:00 2001 From: Dmitry Patsura Date: Tue, 16 Jul 2024 01:48:41 +0900 Subject: [PATCH 6/6] chore: use CODECOV_TOKEN --- .github/workflows/rust-cubesql.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/rust-cubesql.yml b/.github/workflows/rust-cubesql.yml index 7e44a0d60cacc..93af6f81a6d75 100644 --- a/.github/workflows/rust-cubesql.yml +++ b/.github/workflows/rust-cubesql.yml @@ -14,9 +14,6 @@ on: - 'packages/cubejs-backend-native/**' - 'rust/cubesql/**' -permissions: - id-token: write - jobs: lint: runs-on: ubuntu-24.04 @@ -92,7 +89,7 @@ jobs: - name: Upload code coverage uses: codecov/codecov-action@v4 with: - use_oidc: true + token: ${{ secrets.CODECOV_TOKEN }} files: ./rust/cubesql/lcov.info verbose: true flags: cubesql