From 47b1e9b3d8f5f957fa12a8738f53d7710020afe4 Mon Sep 17 00:00:00 2001 From: Quinton Miller Date: Fri, 16 Feb 2024 20:31:28 +0800 Subject: [PATCH] Change some line endings from CRLF to LF --- .gitattributes | 60 ++--- .github/workflows/win_build_portable.yml | 300 +++++++++++------------ spec/compiler/data/visibility.h | 14 +- 3 files changed, 187 insertions(+), 187 deletions(-) diff --git a/.gitattributes b/.gitattributes index f616edb09d75..179a307af12c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,30 +1,30 @@ -## Sources - -*.cr text eol=lf - -## Sourced-in dependencies - -lib/** linguist-vendored - -## Generated files - -# produced by scripts/generate_windows_zone_names.cr -src/crystal/system/win32/zone_names.cr linguist-generated -# produced by scripts/generate_html_entities.cr -src/html/entities.cr linguist-generated -# produced by scripts/generate_ssl_server_defaults.cr -src/openssl/ssl/defaults.cr linguist-generated -# produced by scripts/generate_grapheme_properties.cr -src/string/grapheme/properties.cr linguist-generated -# produced by scripts/generate_unicode_data.cr -src/unicode/data.cr linguist-generated -# produced by spec/generate_interpreter_spec.sh -spec/interpreter_std_spec.cr linguist-generated -# produced by scripts/generate_grapheme_break_specs.cr -spec/std/string/grapheme_break_spec.cr linguist-generated -# produced by spec/generate_wasm32_spec.sh -spec/wasm32_std_spec.cr linguist-generated - -## Syntax highlighting - -Makefile.win linguist-language=makefile +## Sources + +*.cr text eol=lf + +## Sourced-in dependencies + +lib/** linguist-vendored + +## Generated files + +# produced by scripts/generate_windows_zone_names.cr +src/crystal/system/win32/zone_names.cr linguist-generated +# produced by scripts/generate_html_entities.cr +src/html/entities.cr linguist-generated +# produced by scripts/generate_ssl_server_defaults.cr +src/openssl/ssl/defaults.cr linguist-generated +# produced by scripts/generate_grapheme_properties.cr +src/string/grapheme/properties.cr linguist-generated +# produced by scripts/generate_unicode_data.cr +src/unicode/data.cr linguist-generated +# produced by spec/generate_interpreter_spec.sh +spec/interpreter_std_spec.cr linguist-generated +# produced by scripts/generate_grapheme_break_specs.cr +spec/std/string/grapheme_break_spec.cr linguist-generated +# produced by spec/generate_wasm32_spec.sh +spec/wasm32_std_spec.cr linguist-generated + +## Syntax highlighting + +Makefile.win linguist-language=makefile diff --git a/.github/workflows/win_build_portable.yml b/.github/workflows/win_build_portable.yml index bab89e04685e..257d5fadc0c2 100644 --- a/.github/workflows/win_build_portable.yml +++ b/.github/workflows/win_build_portable.yml @@ -1,150 +1,150 @@ -name: Windows CI / Build Portable Package - -on: - workflow_call: - inputs: - release: - required: true - type: boolean - llvm_version: - required: true - type: string - -jobs: - build: - runs-on: windows-2022 - steps: - - name: Disable CRLF line ending substitution - run: | - git config --global core.autocrlf false - - - name: Enable Developer Command Prompt - uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 - - - name: Install Crystal - uses: crystal-lang/install-crystal@v1 - with: - crystal: "1.11.2" - - - name: Download Crystal source - uses: actions/checkout@v4 - - - name: Restore libraries - uses: actions/cache/restore@v4 - with: - path: | - libs/pcre.lib - libs/pcre2-8.lib - libs/iconv.lib - libs/gc.lib - libs/ffi.lib - libs/z.lib - libs/mpir.lib - libs/yaml.lib - libs/xml2.lib - key: win-libs-${{ hashFiles('.github/workflows/win.yml', 'etc/win-ci/*.ps1') }}-msvc - fail-on-cache-miss: true - - name: Restore OpenSSL - uses: actions/cache/restore@v4 - with: - path: | - libs/crypto.lib - libs/ssl.lib - libs/openssl_VERSION - key: win-openssl-libs-3.1.0-${{ hashFiles('etc/win-ci/build-openssl.ps1') }}-msvc - fail-on-cache-miss: true - - name: Restore DLLs - uses: actions/cache/restore@v4 - with: - path: | - libs/pcre-dynamic.lib - libs/pcre2-8-dynamic.lib - libs/iconv-dynamic.lib - libs/gc-dynamic.lib - libs/ffi-dynamic.lib - libs/z-dynamic.lib - libs/mpir-dynamic.lib - libs/yaml-dynamic.lib - libs/xml2-dynamic.lib - dlls/pcre.dll - dlls/pcre2-8.dll - dlls/libiconv.dll - dlls/gc.dll - dlls/libffi.dll - dlls/zlib1.dll - dlls/mpir.dll - dlls/yaml.dll - dlls/libxml2.dll - key: win-dlls-${{ hashFiles('.github/workflows/win.yml', 'etc/win-ci/*.ps1') }}-msvc - fail-on-cache-miss: true - - name: Restore OpenSSL DLLs - uses: actions/cache/restore@v4 - with: - path: | - libs/crypto-dynamic.lib - libs/ssl-dynamic.lib - dlls/libcrypto-3-x64.dll - dlls/libssl-3-x64.dll - key: win-openssl-dlls-3.1.0-${{ hashFiles('etc/win-ci/build-openssl.ps1') }}-msvc - fail-on-cache-miss: true - - name: Restore LLVM - uses: actions/cache/restore@v4 - with: - path: llvm - key: llvm-libs-${{ inputs.llvm_version }}-msvc - fail-on-cache-miss: true - - name: Restore LLVM DLLs - uses: actions/cache/restore@v4 - with: - path: | - libs/llvm_VERSION - libs/llvm-dynamic.lib - dlls/LLVM-C.dll - key: llvm-dlls-${{ inputs.llvm_version }}-${{ hashFiles('etc/win-ci/build-llvm.ps1') }}-msvc - fail-on-cache-miss: true - - - name: Set up environment - run: | - echo "CRYSTAL_LIBRARY_PATH=$(pwd)\libs" >> ${env:GITHUB_ENV} - echo "LLVM_CONFIG=$(pwd)\llvm\bin\llvm-config.exe" >> ${env:GITHUB_ENV} - - - name: Build LLVM extensions - run: make -f Makefile.win deps - - - name: Build Crystal - run: | - bin/crystal.bat env - make -f Makefile.win -B ${{ inputs.release && 'release=1' || '' }} - - - name: Download shards release - uses: actions/checkout@v4 - with: - repository: crystal-lang/shards - ref: v0.17.4 - path: shards - - - name: Download molinillo release - uses: actions/checkout@v4 - with: - repository: crystal-lang/crystal-molinillo - ref: v0.2.0 - path: shards/lib/molinillo - - - name: Build shards release - working-directory: ./shards - run: ../bin/crystal.bat build ${{ inputs.release && '--release' || '' }} src/shards.cr - - - name: Gather Crystal binaries - run: | - make -f Makefile.win install prefix=crystal - mkdir crystal/lib - cp shards/shards.exe crystal/ - cp libs/* crystal/lib/ - cp dlls/* crystal/ - cp README.md crystal/ - - - name: Upload Crystal binaries - uses: actions/upload-artifact@v4 - with: - name: ${{ inputs.release && 'crystal-release' || 'crystal' }} - path: crystal +name: Windows CI / Build Portable Package + +on: + workflow_call: + inputs: + release: + required: true + type: boolean + llvm_version: + required: true + type: string + +jobs: + build: + runs-on: windows-2022 + steps: + - name: Disable CRLF line ending substitution + run: | + git config --global core.autocrlf false + + - name: Enable Developer Command Prompt + uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 + + - name: Install Crystal + uses: crystal-lang/install-crystal@v1 + with: + crystal: "1.11.2" + + - name: Download Crystal source + uses: actions/checkout@v4 + + - name: Restore libraries + uses: actions/cache/restore@v4 + with: + path: | + libs/pcre.lib + libs/pcre2-8.lib + libs/iconv.lib + libs/gc.lib + libs/ffi.lib + libs/z.lib + libs/mpir.lib + libs/yaml.lib + libs/xml2.lib + key: win-libs-${{ hashFiles('.github/workflows/win.yml', 'etc/win-ci/*.ps1') }}-msvc + fail-on-cache-miss: true + - name: Restore OpenSSL + uses: actions/cache/restore@v4 + with: + path: | + libs/crypto.lib + libs/ssl.lib + libs/openssl_VERSION + key: win-openssl-libs-3.1.0-${{ hashFiles('etc/win-ci/build-openssl.ps1') }}-msvc + fail-on-cache-miss: true + - name: Restore DLLs + uses: actions/cache/restore@v4 + with: + path: | + libs/pcre-dynamic.lib + libs/pcre2-8-dynamic.lib + libs/iconv-dynamic.lib + libs/gc-dynamic.lib + libs/ffi-dynamic.lib + libs/z-dynamic.lib + libs/mpir-dynamic.lib + libs/yaml-dynamic.lib + libs/xml2-dynamic.lib + dlls/pcre.dll + dlls/pcre2-8.dll + dlls/libiconv.dll + dlls/gc.dll + dlls/libffi.dll + dlls/zlib1.dll + dlls/mpir.dll + dlls/yaml.dll + dlls/libxml2.dll + key: win-dlls-${{ hashFiles('.github/workflows/win.yml', 'etc/win-ci/*.ps1') }}-msvc + fail-on-cache-miss: true + - name: Restore OpenSSL DLLs + uses: actions/cache/restore@v4 + with: + path: | + libs/crypto-dynamic.lib + libs/ssl-dynamic.lib + dlls/libcrypto-3-x64.dll + dlls/libssl-3-x64.dll + key: win-openssl-dlls-3.1.0-${{ hashFiles('etc/win-ci/build-openssl.ps1') }}-msvc + fail-on-cache-miss: true + - name: Restore LLVM + uses: actions/cache/restore@v4 + with: + path: llvm + key: llvm-libs-${{ inputs.llvm_version }}-msvc + fail-on-cache-miss: true + - name: Restore LLVM DLLs + uses: actions/cache/restore@v4 + with: + path: | + libs/llvm_VERSION + libs/llvm-dynamic.lib + dlls/LLVM-C.dll + key: llvm-dlls-${{ inputs.llvm_version }}-${{ hashFiles('etc/win-ci/build-llvm.ps1') }}-msvc + fail-on-cache-miss: true + + - name: Set up environment + run: | + echo "CRYSTAL_LIBRARY_PATH=$(pwd)\libs" >> ${env:GITHUB_ENV} + echo "LLVM_CONFIG=$(pwd)\llvm\bin\llvm-config.exe" >> ${env:GITHUB_ENV} + + - name: Build LLVM extensions + run: make -f Makefile.win deps + + - name: Build Crystal + run: | + bin/crystal.bat env + make -f Makefile.win -B ${{ inputs.release && 'release=1' || '' }} + + - name: Download shards release + uses: actions/checkout@v4 + with: + repository: crystal-lang/shards + ref: v0.17.4 + path: shards + + - name: Download molinillo release + uses: actions/checkout@v4 + with: + repository: crystal-lang/crystal-molinillo + ref: v0.2.0 + path: shards/lib/molinillo + + - name: Build shards release + working-directory: ./shards + run: ../bin/crystal.bat build ${{ inputs.release && '--release' || '' }} src/shards.cr + + - name: Gather Crystal binaries + run: | + make -f Makefile.win install prefix=crystal + mkdir crystal/lib + cp shards/shards.exe crystal/ + cp libs/* crystal/lib/ + cp dlls/* crystal/ + cp README.md crystal/ + + - name: Upload Crystal binaries + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.release && 'crystal-release' || 'crystal' }} + path: crystal diff --git a/spec/compiler/data/visibility.h b/spec/compiler/data/visibility.h index 1817591c23ae..51db5113b4fa 100644 --- a/spec/compiler/data/visibility.h +++ b/spec/compiler/data/visibility.h @@ -1,7 +1,7 @@ -#ifdef _WIN32 - #define EXPORT __declspec(dllexport) - #define LOCAL -#else - #define EXPORT __attribute__ ((visibility ("default"))) - #define LOCAL __attribute__ ((visibility ("hidden"))) -#endif +#ifdef _WIN32 + #define EXPORT __declspec(dllexport) + #define LOCAL +#else + #define EXPORT __attribute__ ((visibility ("default"))) + #define LOCAL __attribute__ ((visibility ("hidden"))) +#endif