-
Notifications
You must be signed in to change notification settings - Fork 0
191 lines (160 loc) · 5.97 KB
/
Solaris.yml
File metadata and controls
191 lines (160 loc) · 5.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
name: Solaris+Fuchsia
on:
push:
branches: ["dev"]
pull_request:
branches: ["dev"]
env:
CARGO_TERM_COLOR: always
SCCACHE_GHA_ENABLED: "on"
RUSTC_WRAPPER: "sccache"
jobs:
Linux:
name: Solaris+Fuchsia
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Rust Toolchain
uses: dtolnay/rust-toolchain@nightly
with:
components: rust-src
targets: x86_64-fortanix-unknown-sgx
- name: Rust Cache
uses: Swatinem/rust-cache@v2
with:
cache-all-crates: "true"
cache-workspace-crates: "true"
- name: Run sccache-cache
uses: mozilla-actions/sccache-action@main
- name: Cross-rs
run: |
# cargo install cross --git https://github.com/cross-rs/cross --branch main -q
if [ ! -f ~/.cargo/bin/cross ]; then
wget -qO- https://github.com/cross-rs/cross/releases/latest/download/cross-x86_64-unknown-linux-gnu.tar.gz | tar -xz
sudo mv cross ~/.cargo/bin/
fi
cross --version
- name: Cache Fuchsia
uses: actions/cache@v5
with:
path: /home/runner/Fuchsia
key: Fuchsia
restore-keys: Fuchsia
- name: Ubuntu apt update and install
run: |
# sudo apt install -y protobuf-compiler
# sudo apt install -y zfsutils-linux
- name: Install LLVM
run: |
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" -- 22
sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-22 200
sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-22 200
sudo update-alternatives --install /usr/bin/lld lld /usr/bin/lld-22 200
# - name: Cache Illumos/Solaris
# uses: actions/cache@v5
# with:
# path: /home/runner/Illumos
# key: Illomos-${{ runner.os }}-${{ runner.arch }}
# restore-keys: Illomos-${{ runner.os }}-${{ runner.arch }}
- name: Build Release
run: |
cargo update
set +e -x
# mkdir -p /home/runner/Illumos
# ln -sfn /home/runner/Illumos Illumos
# if [ ! -f Illumos/omnios-r151056.zfs ]; then
# mkdir -p Illumos/omnios
# curl -fsSL https://downloads.omnios.org/media/stable/omnios-r151056.zfs.xz | xz -d > Illumos/omnios-r151056.zfs
# fi
# sudo truncate -s 1G /tmp/omnios.img
# sudo zpool create -f solaris /tmp/omnios.img
# sudo zfs recv -o mountpoint=/home/runner/Illumos/omnios solaris/omnios < Illumos/omnios-r151056.zfs
# zpool status
# zfs list
if [ ! -d /home/runner/Fuchsia ]; then
curl -LsSf 'https://chrome-infra-packages.appspot.com/client?platform=linux-amd64&version=latest' -o cipd
chmod +x cipd
sudo mv cipd /usr/local/bin/
mkdir -p /home/runner/Fuchsia
cipd install fuchsia/sdk/core/linux-amd64 latest -root /home/runner/Fuchsia
fi
ln -sf /home/runner/Fuchsia fuchsia
# cargo install fortanix-sgx-tools sgxs-tools -q
# sudo snap install zig --classic --beta
targets=(
aarch64-unknown-hermit
riscv64gc-unknown-hermit
x86_64-unknown-hermit
)
mv .cargo/config.toml .cargo/config.toml.bak
mv .cargo/hermit.toml .cargo/config.toml
for target in ${targets[@]}; do
time cargo s $target
done
mv .cargo/config.toml .cargo/hermit.toml
mv .cargo/config.toml.bak .cargo/config.toml
time cargo s x86_64-fortanix-unknown-sgx
targets=(
aarch64-unknown-fuchsia
riscv64gc-unknown-fuchsia
x86_64-unknown-fuchsia
)
for target in ${targets[@]}; do
time cargo b -q --profile src -Zbuild-std=std,panic_abort -Zbuild-std-features=optimize_for_size,backtrace --target $target
done
targets=(
x86_64-unknown-illumos
x86_64-sun-solaris
x86_64-pc-solaris
sparcv9-sun-solaris
)
for target in ${targets[@]}; do
export CROSS_IMAGE=ghcr.io/cross-rs/${target}:main
time cross build -q --config 'build.rustc-wrapper=""' --profile src -Zbuild-std=std,panic_abort -Zbuild-std-features=optimize_for_size --target $target
done
# sudo zfs destroy -r solaris/omnios
# sudo zpool destroy solaris
find ./target -iname img -type f | xargs ls -hl
lscpu
free -m
- name: Rust Versions
run: rustup -V; cargo -Vv; rustc -Vv
- uses: actions/upload-artifact@v7
with:
name: build-output
path: |
target/**/img*
!target/**/*.d
if-no-files-found: ignore
- name: Upload binaries to a GitHub release
env:
GH_TOKEN: ${{ github.token }}
run: |
targets=(
aarch64-unknown-hermit
riscv64gc-unknown-hermit
x86_64-unknown-hermit
x86_64-unknown-illumos
aarch64-unknown-fuchsia
riscv64gc-unknown-fuchsia
x86_64-unknown-fuchsia
x86_64-fortanix-unknown-sgx
x86_64-pc-solaris
sparcv9-sun-solaris
)
for target in "${targets[@]}"; do
IFS='-' read -r arch vendor os abi <<< "$target"
if [[ -n "$abi" ]]; then
if [[ "$os" == "unknown" ]]; then
name="${vendor^}-${abi}"
else
name="${os^}-${arch}-${abi}"
fi
else
name="${os^}-${arch}"
fi
echo "Uploading $name..."
mv target/$target/src/img target/$target/src/$name || true
gh release upload Nightly target/$target/src/$name --clobber || true
done