diff options
author | Nikolay Perfilov <pnv1@yandex-team.ru> | 2024-10-02 10:32:12 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-02 10:32:12 +0300 |
commit | b9d03c8739244069a8f89740338d66fa08ec60b0 (patch) | |
tree | 9d980b14a2c3d301c3d11e43551368cde53a696a | |
parent | dcff71f700de5a073b6611f4738151573d9c2c75 (diff) | |
download | ydb-b9d03c8739244069a8f89740338d66fa08ec60b0.tar.gz |
Fix YDB CLI build for windows (#9944)
-rw-r--r-- | .github/workflows/build_ydb_cli.yml | 23 | ||||
-rw-r--r-- | build/internal/ya.conf | 4 |
2 files changed, 15 insertions, 12 deletions
diff --git a/.github/workflows/build_ydb_cli.yml b/.github/workflows/build_ydb_cli.yml index cc62ea766c..780caf3747 100644 --- a/.github/workflows/build_ydb_cli.yml +++ b/.github/workflows/build_ydb_cli.yml @@ -50,15 +50,15 @@ jobs: run: | MATRIX='{"include":[]}' if [ "${{ inputs.build-linux }}" == "true" ]; then - MATRIX=$(echo $MATRIX | jq -c '.include += [{"os": "linux", "runner": "ubuntu-latest", "shell": "bash"}]') + MATRIX=$(echo $MATRIX | jq -c '.include += [{"os": "linux", "runner": "ubuntu-latest", "shell": "bash", "binary": "ydb"}]') echo "Matrix after adding linux: $MATRIX" fi if [ "${{ inputs.build-darwin-amd }}" == "true" ]; then - MATRIX=$(echo $MATRIX | jq -c '.include += [{"os": "darwin-amd", "runner": "macos-13", "shell": "bash"}]') + MATRIX=$(echo $MATRIX | jq -c '.include += [{"os": "darwin-amd", "runner": "macos-13", "shell": "bash", "binary": "ydb"}]') echo "Matrix after adding darwin-amd: $MATRIX" fi if [ "${{ inputs.build-windows }}" == "true" ]; then - MATRIX=$(echo $MATRIX | jq -c '.include += [{"os": "windows", "runner": "windows-latest", "shell": "bash"}]') + MATRIX=$(echo $MATRIX | jq -c '.include += [{"os": "windows", "runner": "windows-latest", "shell": "bash", "binary": "ydb.exe"}]') echo "Matrix after adding windows: $MATRIX" fi @@ -71,7 +71,7 @@ jobs: build-platform-specific-binary: strategy: matrix: ${{ fromJSON(needs.build-matrix.outputs.matrix) }} - name: Build YDB CLI for ${{ matrix.os }} + name: Build ${{ matrix.os }} YDB CLI binary needs: build-matrix runs-on: ${{ matrix.runner }} defaults: @@ -87,13 +87,14 @@ jobs: run: | uname -a cat ydb/apps/ydb/version.txt - - - name: Build windows binary with ya make + + # Turns out it is crucial to prepare VS environment and build in one step due to env variable visibility + - name: Prepare Visual Studio environment and build windows binary with ya make if: ${{ matrix.os == 'windows' }} shell: cmd - run: python ya make ydb/apps/ydb -r -DUSE_SSE4=no + run: ${{ '"%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64' }} && python ya make ydb/apps/ydb -r -DUSE_SSE4=no -o ./ - - name: Build binary with ya make + - name: Build unix binary with ya make if: ${{ matrix.os != 'windows' }} run: ./ya make ydb/apps/ydb -r -DUSE_SSE4=no @@ -101,7 +102,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: ${{ matrix.os }}-binary - path: ydb/apps/ydb/ydb + path: ydb/apps/ydb/${{ matrix.binary }} if-no-files-found: error retention-days: 1 @@ -147,7 +148,7 @@ jobs: uses: actions/download-artifact@v4 with: name: windows-binary - path: ${{ steps.getver.outputs.cli_version }}/windows/amd64/unsigned + path: ${{ steps.getver.outputs.cli_version }}/windows/amd64/unsigned/ - name: Print resulting file hierarchy run: find ${{ steps.getver.outputs.cli_version }} | sed -e "s/[^-][^\/]*\// |/g" -e "s/|\([^ ]\)/|-\1/" @@ -163,5 +164,5 @@ jobs: cd .. - name: Upload to S3 - run: s3cmd --access_key=${{ secrets.CLI_S3_KEY_ID }} --secret_key=${{ secrets.CLI_S3_KEY_SECRET_ID }} --host=${{ inputs.s3_host }} --host-bucket=${{ inputs.s3_dns_host_bucket }} --region=${{ inputs.s3_region }} sync --recursive ${{ steps.getver.outputs.cli_version }} s3://${{ inputs.s3_bucket }}/release/ + run: s3cmd --access_key=${{ secrets.CLI_S3_KEY_ID }} --secret_key=${{ secrets.CLI_S3_KEY_SECRET_ID }} --host=${{ inputs.s3_host }} --host-bucket="${{ inputs.s3_dns_host_bucket }}" --region=${{ inputs.s3_region }} sync --recursive ${{ steps.getver.outputs.cli_version }} s3://${{ inputs.s3_bucket }}/release/ diff --git a/build/internal/ya.conf b/build/internal/ya.conf index 9fa4df0431..354b0820bd 100644 --- a/build/internal/ya.conf +++ b/build/internal/ya.conf @@ -14,6 +14,7 @@ USE_ICONV = "static" USE_IDN = "static" APPLE_SDK_LOCAL = "yes" CFLAGS = "-fno-omit-frame-pointer" +USE_CLANG_CL = "yes" [flags] OPENSOURCE = "yes" @@ -22,4 +23,5 @@ USE_AIO = "static" USE_ICONV = "static" USE_IDN = "static" APPLE_SDK_LOCAL = "yes" -CFLAGS = "-fno-omit-frame-pointer"
\ No newline at end of file +CFLAGS = "-fno-omit-frame-pointer" +USE_CLANG_CL = "yes" |