Skip to content

Commit cb5123b

Browse files
committed
pixie-uefi on stable
1 parent dfd5a41 commit cb5123b

7 files changed

Lines changed: 32 additions & 44 deletions

File tree

.github/workflows/docs.yml

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,47 +6,45 @@ on:
66
- master
77
workflow_dispatch:
88

9-
env:
10-
CARGO_TERM_COLOR: always
11-
129
jobs:
1310
docs:
1411
name: Build documentation
1512
runs-on: ubuntu-latest
1613
steps:
1714
- uses: actions/checkout@v4
18-
- name: Install Deps
19-
run: |
20-
rustup toolchain install stable nightly
21-
rustup component add rust-src --toolchain nightly
22-
rustup default stable
23-
cargo install doc-merge
15+
16+
- name: Install rust
17+
uses: actions-rust-lang/setup-rust-toolchain@v1
18+
with:
19+
components: rustfmt, clippy
20+
target: wasm32-unknown-unknown, x86_64-unknown-uefi
21+
cache-workspaces: |
22+
pixie-server
23+
pixie-shared
24+
pixie-uefi
25+
pixie-web
26+
27+
- name: Install doc-merge
28+
run: cargo install doc-merge
29+
2430
- name: cargo doc
2531
run: |
2632
for d in pixie-*; do
2733
pushd $d
2834
cargo doc \
29-
--color=always \
3035
--no-deps \
3136
--document-private-items \
3237
--all-features \
3338
--package $d \
3439
--package pixie-shared
40+
doc-merge --src target/**/doc --dest ../doc --create-dest
3541
popd
3642
done
37-
- name: Merge docs
38-
run: |
39-
for d in pixie-*/target/doc; do
40-
doc-merge --src $d --dest doc --create-dest
41-
done
42-
# doc-merge does not work with nightly
43-
# we merge pixie-uefi doc by hand by search is broken
44-
cp -r pixie-uefi/target/x86_64-unknown-uefi/doc/static.files doc/
45-
cp -r pixie-uefi/target/x86_64-unknown-uefi/doc/pixie_uefi doc/
46-
echo 'window.ALL_CRATES = ["pixie_server","pixie_shared","pixie_web","pixie_uefi"];' > doc/crates.js
43+
4744
- name: Make index.html
4845
run: |
4946
echo '<meta http-equiv="Refresh" content="0; url=./pixie_server/index.html">' > doc/index.html
47+
5048
- name: Publish
5149
uses: JamesIves/github-pages-deploy-action@v4.5.0
5250
with:

.github/workflows/rust.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,8 @@ jobs:
1313
- name: Install rust
1414
uses: actions-rust-lang/setup-rust-toolchain@v1
1515
with:
16-
toolchain: stable, nightly
17-
components: rustfmt, clippy, rust-src
18-
target: wasm32-unknown-unknown
16+
components: rustfmt, clippy
17+
target: wasm32-unknown-unknown, x86_64-unknown-uefi
1918
cache-workspaces: |
2019
pixie-server
2120
pixie-shared
@@ -47,9 +46,8 @@ jobs:
4746
- name: Install rust
4847
uses: actions-rust-lang/setup-rust-toolchain@v1
4948
with:
50-
toolchain: stable, nightly
51-
components: rustfmt, clippy, rust-src
52-
target: wasm32-unknown-unknown
49+
components: rustfmt, clippy
50+
target: wasm32-unknown-unknown, x86_64-unknown-uefi
5351
cache-workspaces: |
5452
pixie-server
5553
pixie-shared

pixie-uefi/.cargo/config.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
1-
[unstable]
2-
build-std = ["core", "compiler_builtins", "alloc"]
3-
build-std-features = ["compiler-builtins-mem"]
4-
51
[build]
62
target = "x86_64-unknown-uefi"

pixie-uefi/rust-toolchain.toml

Lines changed: 0 additions & 2 deletions
This file was deleted.

pixie-uefi/src/main.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![no_main]
22
#![no_std]
3-
#![feature(never_type)]
43
#![deny(unused_must_use)]
54

65
#[macro_use]
@@ -33,18 +32,14 @@ async fn server_discover(os: UefiOS) -> Result<SocketAddrV4> {
3332
let socket = os.udp_bind(None).await?;
3433

3534
let task1 = async {
36-
// TODO(virv): there must be a better way...
37-
if false {
38-
return Err::<!, _>(Error::Generic("".into()));
39-
}
40-
4135
let msg = postcard::to_allocvec(&UdpRequest::Discover).unwrap();
42-
loop {
36+
#[allow(unreachable_code)]
37+
Ok::<_, Error>(loop {
4338
socket
4439
.send(SocketAddrV4::new(Ipv4Addr::BROADCAST, ACTION_PORT), &msg)
4540
.await?;
4641
os.sleep_us(1_000_000).await;
47-
}
42+
})
4843
};
4944

5045
let task2 = async {
@@ -93,7 +88,7 @@ async fn complete_action(stream: &TcpStream) -> Result<()> {
9388
Ok(())
9489
}
9590

96-
async fn run(os: UefiOS) -> Result<!> {
91+
async fn run(os: UefiOS) -> Result<()> {
9792
let server = server_discover(os).await?;
9893

9994
let mut last_was_wait = false;

pixie-uefi/src/os/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ impl UefiOS {
157157
pub fn start<F, Fut>(mut f: F) -> !
158158
where
159159
F: FnMut(UefiOS) -> Fut + 'static,
160-
Fut: Future<Output = Result<!>>,
160+
Fut: Future<Output = Result<()>>,
161161
{
162162
// Never call this function twice.
163163
assert!(OS.borrow().is_none());
@@ -215,8 +215,9 @@ impl UefiOS {
215215

216216
os.spawn("init", async move {
217217
loop {
218-
let err = f(os).await.unwrap_err();
219-
log::error!("Error: {:?}", err);
218+
if let Err(err) = f(os).await {
219+
log::error!("Error: {:?}", err);
220+
}
220221
}
221222
});
222223

pixie-web/.cargo/config.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[build]
2+
target = "wasm32-unknown-unknown"

0 commit comments

Comments
 (0)