MIRROR: javascript for ๐Ÿœ's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

introduce configurable TLS library support in build workflows

+67 -52
-33
.github/versions.json
··· 18 18 "artifact_name": "ant-linux-x64", 19 19 "binary_name": "ant", 20 20 "deps": [], 21 - "tls_library": "openssl", 22 21 "static_link": false, 23 22 "cmake_generator": null, 24 23 "extra_meson_args": null ··· 31 30 "artifact_name": "ant-linux-aarch64", 32 31 "binary_name": "ant", 33 32 "deps": [], 34 - "tls_library": "openssl", 35 33 "static_link": false, 36 34 "cmake_generator": null, 37 35 "extra_meson_args": null ··· 44 42 "artifact_name": "ant-linux-x64-musl", 45 43 "binary_name": "ant", 46 44 "deps": ["zlib"], 47 - "tls_library": "openssl", 48 45 "static_link": true, 49 46 "cmake_generator": "Ninja", 50 47 "extra_meson_args": null ··· 57 54 "artifact_name": "ant-linux-aarch64-musl", 58 55 "binary_name": "ant", 59 56 "deps": ["zlib"], 60 - "tls_library": "openssl", 61 57 "static_link": true, 62 58 "cmake_generator": "Ninja", 63 59 "extra_meson_args": null ··· 70 66 "artifact_name": "ant-darwin-x64", 71 67 "binary_name": "ant", 72 68 "deps": ["libsodium"], 73 - "tls_library": "openssl", 74 69 "static_link": false, 75 70 "cmake_generator": null, 76 71 "extra_meson_args": null ··· 83 78 "artifact_name": "ant-darwin-aarch64", 84 79 "binary_name": "ant", 85 80 "deps": ["libsodium"], 86 - "tls_library": "openssl", 87 - "static_link": false, 88 - "cmake_generator": null, 89 - "extra_meson_args": null 90 - }, 91 - "macos-x64-mbedtls": { 92 - "os_type": "macos", 93 - "arch": "x86_64", 94 - "zig_target": "x86_64-macos", 95 - "rust_target": "x86_64-apple-darwin", 96 - "artifact_name": "ant-darwin-x64-mbedtls", 97 - "binary_name": "ant", 98 - "deps": ["libsodium", "mbedtls"], 99 - "tls_library": "mbedtls", 100 - "static_link": false, 101 - "cmake_generator": null, 102 - "extra_meson_args": null 103 - }, 104 - "macos-aarch64-mbedtls": { 105 - "os_type": "macos", 106 - "arch": "aarch64", 107 - "zig_target": "aarch64-macos", 108 - "rust_target": "aarch64-apple-darwin", 109 - "artifact_name": "ant-darwin-aarch64-mbedtls", 110 - "binary_name": "ant", 111 - "deps": ["libsodium", "mbedtls"], 112 - "tls_library": "mbedtls", 113 81 "static_link": false, 114 82 "cmake_generator": null, 115 83 "extra_meson_args": null ··· 122 90 "artifact_name": "ant-windows-x64", 123 91 "binary_name": "ant.exe", 124 92 "deps": [], 125 - "tls_library": "openssl", 126 93 "static_link": true, 127 94 "cmake_generator": "MinGW Makefiles", 128 95 "extra_meson_args": "-Dc_std=gnu2x"
+24 -8
.github/workflows/build-platform.yml
··· 7 7 description: 'Platform key from versions.json targets' 8 8 required: true 9 9 type: string 10 + tls_library: 11 + description: 'TLS library (openssl or mbedtls)' 12 + required: false 13 + type: string 14 + default: 'openssl' 10 15 build_timestamp: 11 16 required: true 12 17 type: string ··· 27 32 inputs.platform == 'linux-musl-x64', 'ubuntu-24.04', 28 33 inputs.platform == 'linux-musl-aarch64', 'ubuntu-24.04-arm', 29 34 inputs.platform == 'macos-x64', 'macos-15-intel', 30 - inputs.platform == 'macos-x64-mbedtls', 'macos-15-intel', 31 35 inputs.platform == 'macos-aarch64', 'macos-15', 32 - inputs.platform == 'macos-aarch64-mbedtls', 'macos-15', 33 36 inputs.platform == 'windows-x64', 'windows-latest', 34 37 'ubuntu-24.04' 35 38 ) }} ··· 95 98 for pkg in meson ninja llvm jq; do 96 99 brew list "$pkg" &>/dev/null || brew install "$pkg" 97 100 done 98 - if [[ "${{ inputs.platform }}" != *"mbedtls"* ]]; then 101 + if [[ "${{ inputs.tls_library }}" != "mbedtls" ]]; then 99 102 brew list openssl@3 &>/dev/null || brew install openssl@3 100 103 fi 101 104 ··· 140 143 echo "arch=$(echo $CONFIG | jq -r '.arch')" >> $GITHUB_OUTPUT 141 144 echo "zig_target=$(echo $CONFIG | jq -r '.zig_target')" >> $GITHUB_OUTPUT 142 145 echo "rust_target=$(echo $CONFIG | jq -r '.rust_target')" >> $GITHUB_OUTPUT 143 - echo "artifact_name=$(echo $CONFIG | jq -r '.artifact_name')" >> $GITHUB_OUTPUT 144 146 echo "binary_name=$(echo $CONFIG | jq -r '.binary_name')" >> $GITHUB_OUTPUT 145 - echo "tls_library=$(echo $CONFIG | jq -r '.tls_library')" >> $GITHUB_OUTPUT 146 147 echo "static_link=$(echo $CONFIG | jq -r '.static_link')" >> $GITHUB_OUTPUT 147 148 echo "cmake_generator=$(echo $CONFIG | jq -r '.cmake_generator // empty')" >> $GITHUB_OUTPUT 148 149 echo "extra_meson_args=$(echo $CONFIG | jq -r '.extra_meson_args // empty')" >> $GITHUB_OUTPUT 149 150 150 - # Deps as space-separated string 151 - echo "deps=$(echo $CONFIG | jq -r '.deps | join(" ")')" >> $GITHUB_OUTPUT 151 + # TLS library from workflow input (overrides versions.json) 152 + TLS_LIBRARY="${{ inputs.tls_library }}" 153 + echo "tls_library=$TLS_LIBRARY" >> $GITHUB_OUTPUT 154 + 155 + # Artifact name: append -mbedtls suffix when using mbedtls 156 + ARTIFACT_NAME=$(echo $CONFIG | jq -r '.artifact_name') 157 + if [[ "$TLS_LIBRARY" == "mbedtls" ]]; then 158 + ARTIFACT_NAME="${ARTIFACT_NAME}-mbedtls" 159 + fi 160 + echo "artifact_name=$ARTIFACT_NAME" >> $GITHUB_OUTPUT 161 + 162 + # Deps: add mbedtls to deps list when using mbedtls 163 + DEPS_LIST=$(echo $CONFIG | jq -r '.deps | join(" ")') 164 + if [[ "$TLS_LIBRARY" == "mbedtls" ]]; then 165 + DEPS_LIST="$DEPS_LIST mbedtls" 166 + fi 167 + echo "deps=$DEPS_LIST" >> $GITHUB_OUTPUT 152 168 153 169 # Dep versions 154 170 echo "libsodium_version=$(echo $DEPS | jq -r '.libsodium')" >> $GITHUB_OUTPUT ··· 229 245 - name: Upload version info 230 246 uses: actions/upload-artifact@v4 231 247 with: 232 - name: version-${{ inputs.platform }} 248 + name: version-${{ steps.config.outputs.artifact_name }} 233 249 path: version.txt 234 250 retention-days: 1
+9 -2
.github/workflows/build-single.yml
··· 14 14 - linux-musl-aarch64 15 15 - macos-x64 16 16 - macos-aarch64 17 - - macos-x64-mbedtls 18 - - macos-aarch64-mbedtls 19 17 - windows-x64 18 + tls_library: 19 + description: 'TLS library' 20 + required: false 21 + type: choice 22 + default: 'openssl' 23 + options: 24 + - openssl 25 + - mbedtls 20 26 21 27 jobs: 22 28 prepare: ··· 32 38 uses: ./.github/workflows/build-platform.yml 33 39 with: 34 40 platform: ${{ inputs.platform }} 41 + tls_library: ${{ inputs.tls_library }} 35 42 build_timestamp: ${{ needs.prepare.outputs.timestamp }}
+2 -2
.github/workflows/build.yml
··· 38 38 - linux-musl-aarch64 39 39 - macos-x64 40 40 - macos-aarch64 41 - - macos-x64-mbedtls 42 - - macos-aarch64-mbedtls 43 41 - windows-x64 42 + tls: [openssl, mbedtls] 44 43 uses: ./.github/workflows/build-platform.yml 45 44 with: 46 45 platform: ${{ matrix.platform }} 46 + tls_library: ${{ matrix.tls }} 47 47 build_timestamp: ${{ needs.prepare.outputs.timestamp }} 48 48 49 49 summary:
+1 -1
README.md
··· 21 21 ```bash 22 22 curl -fsSL https://ant.themackabu.com/install | bash 23 23 24 - # or with MbedTLS (darwin only) 24 + # or with MbedTLS 25 25 curl -fsSL https://ant.themackabu.com/install | MBEDTLS=1 bash 26 26 ``` 27 27
+31 -6
meson/deps/meson.build
··· 59 59 subprojects_src = src_root / 'vendor' 60 60 subprojects_build = meson.project_build_root() / 'vendor' 61 61 62 + llhttp = subproject('llhttp').get_variable('llhttp_dep') 63 + 62 64 tlsuv_opts = cmake.subproject_options() 63 65 tlsuv_opts.set_override_option('warning_level', '0') 64 66 tlsuv_opts.append_compile_args('c', ['-w']) ··· 68 70 'BUILD_TESTING': 'OFF', 69 71 'TLSUV_TLSLIB': tls_lib, 70 72 'CMAKE_WARN_DEV': 'OFF', 71 - 72 73 'CMAKE_POLICY_DEFAULT_CMP0200': 'NEW', 73 74 'CMAKE_POLICY_DEFAULT_CMP0156': 'NEW', 74 75 'CMAKE_POLICY_DEFAULT_CMP0179': 'NEW', 75 - 76 76 'llhttp_DIR': subprojects_src / deps_info['llhttp']['dir'] / 'cmake', 77 77 'libuv_DIR': subprojects_src / deps_info['libuv']['dir'] / 'cmake', 78 78 } ··· 90 90 '-Wno-sometimes-uninitialized', 91 91 '-Wno-cast-function-type-mismatch', 92 92 '-Wno-missing-field-initializers', 93 - 94 93 '-I' + subprojects_src / deps_info['libuv']['dir'] / deps_info['libuv']['inc'], 95 94 '-I' + subprojects_src / deps_info['llhttp']['dir'] / deps_info['llhttp']['inc'], 96 - '-I' + openssl_dep.get_variable(pkgconfig: 'includedir', default_value: ''), 97 95 ] 98 96 97 + if tls_lib == 'openssl' 98 + tlsuv_compile_args += ['-I' + openssl_dep.get_variable(pkgconfig: 'includedir')] 99 + endif 100 + 99 101 if cmake_prefix != '' 100 102 tlsuv_compile_args += ['-I' + cmake_prefix / 'include'] 101 103 endif ··· 103 105 tlsuv_opts.append_compile_args('c', tlsuv_compile_args) 104 106 tlsuv_dep = cmake.subproject('tlsuv', options: tlsuv_opts).dependency('tlsuv') 105 107 106 - llhttp_dep = subproject('llhttp').get_variable('llhttp_dep') 107 108 libuv_dep = subproject('libuv').get_variable('libuv_dep') 108 109 uthash_dep = subproject('uthash').get_variable('uthash_dep') 109 110 yyjson_dep = subproject('yyjson').get_variable('yyjson_dep') ··· 168 169 oxc_dep = declare_dependency(link_with: oxc_lib) 169 170 zig = find_program('zig', required: true) 170 171 172 + deps_info = { 173 + 'lmdb': { 174 + 'dir': 'openldap-LMDB_0.9.33', 175 + 'inc': 'libraries/liblmdb', 176 + }, 177 + 'yyjson': { 178 + 'dir': 'yyjson-0.12.0', 179 + 'inc': 'src', 180 + }, 181 + 'libuv': { 182 + 'dir': 'libuv-v1.52.0', 183 + 'inc': 'include', 184 + }, 185 + 'llhttp': { 186 + 'dir': 'llhttp-release-v9.3.1', 187 + 'inc': 'include', 188 + }, 189 + 'zlib-ng': { 190 + 'dir': 'zlib-ng-2.3.3', 191 + 'inc': '', 192 + 'build_dir': true, 193 + }, 194 + } 195 + 171 196 subprojects_src = src_root / 'vendor' 172 197 subprojects_build = meson.project_build_root() / 'vendor' 173 198 ··· 182 207 183 208 ant_deps = [ 184 209 libffi_dep, uuid_dep, crprintf_dep, 185 - llhttp_dep, pcre2_dep, libuv_dep, 210 + llhttp, pcre2_dep, libuv_dep, 186 211 argtable3_dep, tlsuv_dep, libsodium_dep, 187 212 yyjson_dep, minicoro_dep, uuidv7_dep, 188 213 openssl_dep, zlib_dep, uthash_dep,