Skip to content

Commit

Permalink
chore(ci): separate build profile (#16855)
Browse files Browse the repository at this point in the history
* z

* z

* z

* z

* z

* z

* Update mutable.rs

---------

Co-authored-by: sundyli <[email protected]>
  • Loading branch information
everpcpc and sundy-li authored Nov 15, 2024
1 parent 182b744 commit f9a004d
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 56 deletions.
32 changes: 4 additions & 28 deletions .github/actions/build_linux/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,49 +64,25 @@ runs:
target=${{ inputs.target }}
echo "BUILD_ARCH=${target/-unknown-linux-*}" >> $GITHUB_ENV
# build all binaries for debug
- name: Build Debug
if: env.BUILD_PROFILE == 'debug' && inputs.artifacts == 'all'
shell: bash
run: |
artifacts="meta,metactl,metabench,query,sqllogictests"
for artifact in ${artifacts//,/ }; do
echo "==> building databend-$artifact ..."
cargo -Zgitoxide=fetch -Zgit=shallow-index,shallow-deps build --target ${{ inputs.target }} --features ${{ inputs.features }} --bin databend-$artifact
done
cargo -Zgitoxide=fetch -Zgit=shallow-index,shallow-deps build --target ${{ inputs.target }} --features ${{ inputs.features }}
ls -lh ./target/${{ inputs.target }}/${{ env.BUILD_PROFILE }}/databend-*
- name: Build Debug for specific artifacts
if: env.BUILD_PROFILE == 'debug' && inputs.artifacts != 'all'
shell: bash
run: |
artifacts="${{ inputs.artifacts }}"
for artifact in ${artifacts//,/ }; do
echo "==> building databend-$artifact ..."
cargo -Zgitoxide=fetch -Zgit=shallow-index,shallow-deps build --target ${{ inputs.target }} --features ${{ inputs.features }} --bin databend-$artifact
done
ls -lh ./target/${{ inputs.target }}/${{ env.BUILD_PROFILE }}/databend-$artifact
- name: Build Release
if: env.BUILD_PROFILE == 'release' && inputs.artifacts == 'all'
if: inputs.artifacts == 'all'
shell: bash
run: |
artifacts="meta,metactl,metabench,query,sqllogictests"
for artifact in ${artifacts//,/ }; do
echo "==> building databend-$artifact ..."
cargo -Zgitoxide=fetch -Zgit=shallow-index,shallow-deps build --target ${{ inputs.target }} --features ${{ inputs.features }} --release --bin databend-$artifact
cargo -Zgitoxide=fetch -Zgit=shallow-index,shallow-deps build --target ${{ inputs.target }} --features ${{ inputs.features }} --profile ${{ env.BUILD_PROFILE }} --bin databend-$artifact
done
ls -lh ./target/${{ inputs.target }}/${{ env.BUILD_PROFILE }}/databend-$artifact
- name: Build Release for specific artifacts
if: env.BUILD_PROFILE == 'release' && inputs.artifacts != 'all'
if: inputs.artifacts != 'all'
shell: bash
run: |
artifacts="${{ inputs.artifacts }}"
for artifact in ${artifacts//,/ }; do
echo "==> building databend-$artifact ..."
cargo -Zgitoxide=fetch -Zgit=shallow-index,shallow-deps build --target ${{ inputs.target }} --features ${{ inputs.features }} --release --bin databend-$artifact
cargo -Zgitoxide=fetch -Zgit=shallow-index,shallow-deps build --target ${{ inputs.target }} --features ${{ inputs.features }} --profile ${{ env.BUILD_PROFILE }} --bin databend-$artifact
done
ls -lh ./target/${{ inputs.target }}/${{ env.BUILD_PROFILE }}/databend-$artifact
Expand Down
25 changes: 3 additions & 22 deletions .github/actions/build_macos/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ runs:
echo "JEMALLOC_SYS_WITH_LG_PAGE=14" >> $GITHUB_ENV
echo "JEMALLOC_SYS_WITH_MALLOC_CONF=oversize_threshold:0,dirty_decay_ms:5000,muzzy_decay_ms:5000" >> $GITHUB_ENV
- name: Setup build env
shell: bash
run: |
Expand All @@ -41,33 +40,15 @@ runs:
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
- name: Build Debug for all artifacts
if: env.BUILD_PROFILE == 'debug' && inputs.artifacts == 'all'
shell: bash
run: cargo -Zgitoxide=fetch -Zgit=shallow-index,shallow-deps build --target ${{ inputs.target }}

- name: Build Debug for specific artifacts
if: env.BUILD_PROFILE == 'debug' && inputs.artifacts != 'all'
shell: bash
run: |
artifacts="${{ inputs.artifacts }}"
echo "==> building libs ..."
cargo -Zgitoxide=fetch -Zgit=shallow-index,shallow-deps build --target ${{ inputs.target }} --lib
for artifact in ${artifacts//,/ }; do
echo "==> building databend-$artifact ..."
cargo -Zgitoxide=fetch -Zgit=shallow-index,shallow-deps build --target ${{ inputs.target }} --bin databend-$artifact
done
- name: Build Release
if: env.BUILD_PROFILE == 'release'
- name: Build
shell: bash
run: |
artifacts="${{ inputs.artifacts }}"
echo "==> building libs ..."
cargo -Zgitoxide=fetch -Zgit=shallow-index,shallow-deps build --target ${{ inputs.target }} --release --lib
cargo -Zgitoxide=fetch -Zgit=shallow-index,shallow-deps build --target ${{ inputs.target }} --profile ${{ env.BUILD_PROFILE }} --lib
for artifact in ${artifacts//,/ }; do
echo "==> building databend-$artifact ..."
cargo -Zgitoxide=fetch -Zgit=shallow-index,shallow-deps build --target ${{ inputs.target }} --release --bin databend-$artifact
cargo -Zgitoxide=fetch -Zgit=shallow-index,shallow-deps build --target ${{ inputs.target }} --profile ${{ env.BUILD_PROFILE }} --bin databend-$artifact
done
- name: Upload artifact
Expand Down
4 changes: 2 additions & 2 deletions .github/scripts/bump_version.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ module.exports = async ({ github, context, core }) => {
core.setFailed("Stable release must be triggered with a nightly tag");
}
} else {
core.setOutput("sha", context.sha);
if (TAG) {
core.setOutput("tag", TAG);
core.info(`Release create manually with tag ${TAG}`);
core.info(`Release create manually with tag ${TAG} (${context.sha})`);
} else {
let releases = await github.rest.repos.listReleases({
owner: context.repo.owner,
Expand All @@ -52,7 +53,6 @@ module.exports = async ({ github, context, core }) => {
let patch = (parseInt(result[3]) + 1).toString();
let next_tag = `v${major}.${minor}.${patch}-nightly`;
core.setOutput("tag", next_tag);
core.setOutput("sha", context.sha);
core.info(`Nightly release ${next_tag} from ${tag} (${context.sha})`);
}
}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
uses: ./.github/workflows/reuse.linux.yml
secrets: inherit
with:
build_profile: release
build_profile: ci
runner_provider: aws
license_type: trial

Expand All @@ -60,7 +60,7 @@ jobs:
uses: ./.github/workflows/reuse.linux.hive.yml
secrets: inherit
with:
build_profile: release
build_profile: ci
runner_provider: aws

ready:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/merge_group.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
uses: ./.github/workflows/reuse.linux.yml
secrets: inherit
with:
build_profile: release
build_profile: ci
runner_provider: aws
license_type: enterprise

Expand Down
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,12 @@ overflow-checks = false
opt-level = "s" ## defaults to be 3
incremental = true

[profile.ci]
inherits = "release"
overflow-checks = false
incremental = false
debug-assertions = true

# [profile.release.package]
# databend-common-arrow = { codegen-units = 16 }
# databend-query = { codegen-units = 4 }
Expand Down
2 changes: 1 addition & 1 deletion src/common/arrow/src/arrow/array/binview/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ impl MutableBinaryViewArray<str> {
let value = unsafe { self.value_unchecked(self.len() - 1).to_string() };

self.views.pop();

self.total_bytes_len -= value.len();
Some(value)
}
}
Expand Down

0 comments on commit f9a004d

Please sign in to comment.