Skip to content

Commit 7fd96cc

Browse files
committed
refactor: build default client if CACERTS_PATH is not populated
1 parent 485c017 commit 7fd96cc

File tree

2,301 files changed

+74920
-20033
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,301 files changed

+74920
-20033
lines changed

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ insert_final_newline = true
1515
indent_style = space
1616
indent_size = 2
1717

18-
[*.{rs, gleam, erl, hrl, ex, mjs, js, ts, sh}]
18+
[*.{gleam, erl, hrl, ex, mjs, js, ts, sh}]
1919
max_line_length = 80
2020

2121
[*.{rs, .erl, .hrl}]

.github/dependabot.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ version: 2
22
updates:
33
- package-ecosystem: github-actions
44
directory: "/"
5+
labels: []
56
schedule:
67
interval: monthly
78
open-pull-requests-limit: 10

.github/workflows/ci.yaml

+69-19
Original file line numberDiff line numberDiff line change
@@ -40,40 +40,47 @@ jobs:
4040
include:
4141
- os: ubuntu-latest
4242
target: x86_64-unknown-linux-gnu
43-
use-cross: false
43+
binary: x86-64
44+
cargo-tool: cargo
4445
run-integration-tests: true
4546
- os: ubuntu-latest
4647
target: x86_64-unknown-linux-musl
47-
use-cross: true
48+
binary: x86-64
49+
cargo-tool: cross
4850
run-integration-tests: true
4951
- os: ubuntu-latest
5052
target: aarch64-unknown-linux-gnu
51-
use-cross: true
53+
binary: aarch64
54+
cargo-tool: cross
5255
run-integration-tests: false # Cannot run aarch64 binaries on x86_64
5356
- os: ubuntu-latest
5457
target: aarch64-unknown-linux-musl
55-
use-cross: true
58+
binary: aarch64
59+
cargo-tool: cross
5660
run-integration-tests: false # Cannot run aarch64 binaries on x86_64
5761
# macos>=14 runs exclusively on aarch64 and will thus fail to execute properly for x64
5862
- os: macos-13 # intel
5963
target: x86_64-apple-darwin
60-
use-cross: false
64+
binary: x86_64
65+
cargo-tool: cargo
6166
run-integration-tests: true
6267
- os: macos-latest # aarch64
6368
toolchain: stable
6469
target: aarch64-apple-darwin
65-
use-cross: false
70+
binary: arm64
71+
cargo-tool: cargo
6672
run-integration-tests: true
6773
- os: windows-latest
6874
target: x86_64-pc-windows-msvc
69-
use-cross: false
75+
binary: x86-64
76+
cargo-tool: cargo
7077
run-integration-tests: true
7178
steps:
7279
- name: Checkout repository
7380
uses: actions/checkout@v4
7481

7582
- name: Install musl-tools incl. musl-gcc
76-
uses: awalsh128/cache-apt-pkgs-action@v1
83+
uses: awalsh128/cache-apt-pkgs-action@v1.4.3
7784
with:
7885
# musl-tools provide `musl-gcc` which is required for `ring` which is required for `rustls` et al.
7986
packages: musl-tools
@@ -106,19 +113,36 @@ jobs:
106113
key: v1-${{ matrix.target }}
107114

108115
- name: Install Gleam
109-
uses: clechasseur/rs-cargo@v2
116+
uses: clechasseur/rs-cargo@v3
110117
with:
111118
command: install
112-
args: "--path compiler-cli --target ${{ matrix.target }} --debug --locked"
113-
use-cross: ${{ matrix.use-cross }}
119+
args: "--path compiler-cli --target ${{ matrix.target }} --debug --locked --force"
120+
tool: ${{ matrix.cargo-tool }}
121+
if: ${{ matrix.run-integration-tests }}
122+
123+
- name: Verify binary architecture
124+
shell: bash
125+
run: |
126+
BINARY_PATH="${CARGO_HOME}/bin/gleam"
127+
if [[ "${{ matrix.target }}" == *"windows"* ]]; then
128+
BINARY_PATH="${BINARY_PATH}.exe"
129+
fi
130+
131+
if ! file -b "$BINARY_PATH" | grep -q "${{ matrix.binary }}"; then
132+
echo "error: Architecture mismatch"
133+
echo "Expected architecture: '${{ matrix.binary }}'"
134+
echo "Found binary type: '$(file -b "$BINARY_PATH")'"
135+
exit 1
136+
fi
137+
echo "ok: Architecture match"
114138
if: ${{ matrix.run-integration-tests }}
115139

116140
- name: Run tests
117-
uses: clechasseur/rs-cargo@v2
141+
uses: clechasseur/rs-cargo@v3
118142
with:
119143
command: test
120144
args: "--workspace --target ${{ matrix.target }}"
121-
use-cross: ${{ matrix.use-cross }}
145+
tool: ${{ matrix.cargo-tool }}
122146

123147
- name: test/project_erlang (non-windows)
124148
run: |
@@ -152,12 +176,19 @@ jobs:
152176
working-directory: ./test/project_erlang_windows
153177
if: ${{ runner.os == 'Windows' && matrix.run-integration-tests }}
154178

155-
- name: test/project_erlang export package-interface
179+
- name: test/project_erlang export package-interface (non-windows)
156180
run: |
157181
gleam export package-interface --out="interface.json"
158182
cat interface.json
159183
working-directory: ./test/project_erlang
160-
if: ${{ matrix.run-integration-tests }}
184+
if: ${{ runner.os != 'Windows' && matrix.run-integration-tests }}
185+
186+
- name: test/project_erlang export package-interface (windows)
187+
run: |
188+
gleam export package-interface --out="interface.json"
189+
cat interface.json
190+
working-directory: ./test/project_erlang_windows
191+
if: ${{ runner.os == 'Windows' && matrix.run-integration-tests }}
161192

162193
- name: test/external_only_javascript
163194
run: ./test.sh
@@ -173,6 +204,13 @@ jobs:
173204
env:
174205
GLEAM_COMMAND: gleam
175206

207+
- name: test/root_package_not_compiled_when_running_dep
208+
run: ./test.sh
209+
working-directory: ./test/root_package_not_compiled_when_running_dep
210+
if: ${{ matrix.run-integration-tests }}
211+
env:
212+
GLEAM_COMMAND: gleam
213+
176214
- name: test/project_javascript
177215
run: |
178216
gleam run
@@ -248,7 +286,7 @@ jobs:
248286

249287
- uses: actions/setup-node@v4
250288
with:
251-
node-version: "18"
289+
node-version: "20"
252290

253291
- name: Install wasm-pack
254292
run: |
@@ -282,7 +320,7 @@ jobs:
282320
uses: actions/checkout@v4
283321

284322
- name: Ensure no merge commits
285-
uses: NexusPHP/no-merge-commits@v2.1.0
323+
uses: NexusPHP/no-merge-commits@v2.2.1
286324
if: github.event_name == 'pull_request'
287325
with:
288326
token: ${{ secrets.GITHUB_TOKEN }}
@@ -342,9 +380,9 @@ jobs:
342380
uses: actions/checkout@v4
343381

344382
- name: Install Deno
345-
uses: denoland/setup-deno@v1
383+
uses: denoland/setup-deno@v2
346384
with:
347-
deno-version: v1.x
385+
deno-version: v2.x
348386

349387
- name: Install Bun
350388
uses: oven-sh/setup-bun@v2
@@ -405,3 +443,15 @@ jobs:
405443
- name: Test running modules
406444
run: make test
407445
working-directory: ./test/running_modules
446+
447+
- name: test/multi_namespace
448+
run: ./test.sh
449+
working-directory: ./test/multi_namespace
450+
451+
- name: Test FFI in subdirectories
452+
run: make
453+
working-directory: ./test/subdir_ffi
454+
455+
- name: test/unicode_path
456+
run: make
457+
working-directory: ./test/unicode_path ⭐

.github/workflows/release-containers.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ jobs:
1111
strategy:
1212
matrix:
1313
base-image:
14+
- scratch
1415
- erlang
1516
- erlang-slim
1617
- erlang-alpine

.github/workflows/release-nightly.yaml

+33-12
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: release-nightly
33
on:
44
workflow_dispatch:
55
schedule:
6-
- cron: '45 0 * * *'
6+
- cron: "45 0 * * *"
77

88
env:
99
CARGO_TERM_COLOR: always
@@ -29,7 +29,7 @@ jobs:
2929

3030
build-nightly-clean:
3131
runs-on: ubuntu-latest
32-
needs: [ nightly-last-run ]
32+
needs: [nightly-last-run]
3333
if: ${{ github.repository_owner == 'gleam-lang' && needs.nightly-last-run.outputs.should_run != 'false' }}
3434
steps:
3535
- name: Delete old release assets
@@ -48,7 +48,7 @@ jobs:
4848
build-nightly:
4949
name: build-release
5050
runs-on: ${{ matrix.os }}
51-
needs: [ build-nightly-clean ]
51+
needs: [build-nightly-clean]
5252
if: ${{ github.repository_owner == 'gleam-lang' }}
5353
strategy:
5454
matrix:
@@ -62,20 +62,25 @@ jobs:
6262
include:
6363
- os: ubuntu-latest
6464
target: x86_64-unknown-linux-musl
65-
use-cross: true
65+
binary: x86-64
66+
cargo-tool: cross
6667
- os: ubuntu-latest
6768
target: aarch64-unknown-linux-musl
68-
use-cross: true
69+
binary: aarch64
70+
cargo-tool: cross
6971
# macos>=14 runs exclusively on aarch64 and will thus fail to execute properly for x64
7072
- os: macos-13
7173
target: x86_64-apple-darwin
72-
use-cross: false
74+
binary: x86_64
75+
cargo-tool: cargo
7376
- os: macos-latest
7477
target: aarch64-apple-darwin
75-
use-cross: false
78+
binary: arm64
79+
cargo-tool: cargo
7680
- os: windows-latest
7781
target: x86_64-pc-windows-msvc
78-
use-cross: false
82+
binary: x86-64
83+
cargo-tool: cargo
7984
steps:
8085
- name: Checkout repository
8186
uses: actions/checkout@v4
@@ -97,11 +102,27 @@ jobs:
97102
key: v1-${{ matrix.target }}
98103

99104
- name: Build release binary
100-
uses: clechasseur/rs-cargo@v2
105+
uses: clechasseur/rs-cargo@v3
101106
with:
102107
command: build
103108
args: --release --target ${{ matrix.target }}
104-
use-cross: ${{ matrix.use-cross }}
109+
tool: ${{ matrix.cargo-tool }}
110+
111+
- name: Verify binary architecture
112+
shell: bash
113+
run: |
114+
BINARY_PATH="target/${{ matrix.target }}/release/gleam"
115+
if [[ "${{ matrix.target }}" == *"windows"* ]]; then
116+
BINARY_PATH="${BINARY_PATH}.exe"
117+
fi
118+
119+
if ! file -b "$BINARY_PATH" | grep -q "${{ matrix.binary }}"; then
120+
echo "error: Architecture mismatch"
121+
echo "Expected architecture: '${{ matrix.binary }}'"
122+
echo "Found binary type: '$(file -b "$BINARY_PATH")'"
123+
exit 1
124+
fi
125+
echo "ok: Architecture match"
105126
106127
- name: Build archive
107128
shell: bash
@@ -171,7 +192,7 @@ jobs:
171192

172193
build-nightly-container-images:
173194
runs-on: ubuntu-latest
174-
needs: [ build-nightly ]
195+
needs: [build-nightly]
175196
if: ${{ github.repository_owner == 'gleam-lang' && needs.nightly-last-run.outputs.should_run != 'false' }}
176197
strategy:
177198
matrix:
@@ -220,7 +241,7 @@ jobs:
220241
file: containers/${{ matrix.base-image }}.dockerfile
221242
push: true
222243
tags: ${{ steps.versions.outputs.container_tag }}
223-
ghcr.io/${{ github.repository }}:nightly-${{ matrix.base-image }}
244+
ghcr.io/${{ github.repository }}:nightly-${{ matrix.base-image }}
224245
labels: |
225246
org.opencontainers.image.title=gleam
226247
org.opencontainers.image.url=https://gleam.run

.github/workflows/release.yaml

+31-8
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,25 @@ jobs:
2424
include:
2525
- os: ubuntu-latest
2626
target: x86_64-unknown-linux-musl
27-
use-cross: true
27+
binary: x86-64
28+
cargo-tool: cross
2829
- os: ubuntu-latest
2930
target: aarch64-unknown-linux-musl
30-
use-cross: true
31+
binary: aarch64
32+
cargo-tool: cross
3133
# macos>=14 runs exclusively on aarch64 and will thus fail to execute properly for x64
3234
- os: macos-13
3335
target: x86_64-apple-darwin
34-
use-cross: false
36+
binary: x86_64
37+
cargo-tool: cargo
3538
- os: macos-latest
3639
target: aarch64-apple-darwin
37-
use-cross: false
40+
binary: arm64
41+
cargo-tool: cargo
3842
- os: windows-latest
3943
target: x86_64-pc-windows-msvc
40-
use-cross: false
44+
binary: x86-64
45+
cargo-tool: cargo
4146
steps:
4247
- name: Checkout repository
4348
uses: actions/checkout@v4
@@ -54,11 +59,27 @@ jobs:
5459
key: v1-${{ matrix.target }}
5560

5661
- name: Build release binary
57-
uses: clechasseur/rs-cargo@v2
62+
uses: clechasseur/rs-cargo@v3
5863
with:
5964
command: build
6065
args: --release --target ${{ matrix.target }}
61-
use-cross: ${{ matrix.use-cross }}
66+
tool: ${{ matrix.cargo-tool }}
67+
68+
- name: Verify binary architecture
69+
shell: bash
70+
run: |
71+
BINARY_PATH="target/${{ matrix.target }}/release/gleam"
72+
if [[ "${{ matrix.target }}" == *"windows"* ]]; then
73+
BINARY_PATH="${BINARY_PATH}.exe"
74+
fi
75+
76+
if ! file -b "$BINARY_PATH" | grep -q "${{ matrix.binary }}"; then
77+
echo "error: Architecture mismatch"
78+
echo "Expected architecture: '${{ matrix.binary }}'"
79+
echo "Found binary type: '$(file -b "$BINARY_PATH")'"
80+
exit 1
81+
fi
82+
echo "ok: Architecture match"
6283
6384
- name: Build archive
6485
shell: bash
@@ -96,7 +117,9 @@ jobs:
96117
esac
97118
98119
- name: Upload release archive
99-
uses: softprops/action-gh-release@v2
120+
# https://github.com/softprops/action-gh-release/issues/445
121+
# uses: softprops/action-gh-release@v2
122+
uses: softprops/action-gh-release@0bd7e8b279c9b5b36661d552472fbbfe671fe26e
100123
with:
101124
draft: true
102125
prerelease: false

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
erl_crash.dump
88
*.lock
99
node_modules/
10+
compiler-cli/build/

.well-known/funding-manifest-urls

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://gleam.run/funding.json

0 commit comments

Comments
 (0)