Skip to content

Commit 0f6e461

Browse files
committed
userland: build userland using our custom rust toolchain
1 parent 9e8541c commit 0f6e461

File tree

5 files changed

+26
-13
lines changed

5 files changed

+26
-13
lines changed

aero.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -193,13 +193,13 @@ def extract_artifacts(stdout):
193193
return result
194194

195195

196-
def build_cargo_workspace(cwd, command, args):
197-
code, _, _ = run_command(['cargo', command, *args], cwd=cwd)
196+
def build_cargo_workspace(cwd, command, args, cargo='cargo'):
197+
code, _, _ = run_command([cargo, command, *args], cwd=cwd)
198198

199199
if code != 0:
200200
return None
201201

202-
_, stdout, _ = run_command(['cargo', command, *args, '--message-format=json'],
202+
_, stdout, _ = run_command([cargo, command, *args, '--message-format=json'],
203203
stdout=subprocess.PIPE,
204204
stderr=subprocess.DEVNULL,
205205
cwd=cwd)
@@ -279,10 +279,13 @@ def build_userland(args):
279279
if args.check:
280280
command = 'check'
281281

282+
cargo = '../sysroot/tools/host-cargo/bin/cargo'
283+
cmd_args += ['--target', 'x86_64-unknown-aero-system']
284+
282285
if args.test:
283-
return build_cargo_workspace('userland', 'build', ['--package', 'utest', *cmd_args])
286+
return build_cargo_workspace('userland', 'build', ['--package', 'utest', *cmd_args], cargo)
284287
else:
285-
return build_cargo_workspace('userland', command, cmd_args)
288+
return build_cargo_workspace('userland', command, cmd_args, cargo)
286289

287290
# TODO: Userland check
288291
# elif args.check:

userland/.cargo/config.toml

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1-
[unstable]
2-
build-std = ["core", "compiler_builtins", "alloc"]
3-
build-std-features = ["compiler-builtins-mem"]
4-
51
[build]
6-
target = "./.cargo/x86_64-unknown-none.json"
2+
rustc = "/home/czapek/Development/aero/sysroot/tools/host-rust/bin/rustc"
3+
target = "x86_64-unknown-aero-system"
4+
rustflags = ["-C", "link-args=-no-pie", "-lc"]
5+
6+
[target.x86_64-unknown-aero-system]
7+
linker = "/home/czapek/Development/aero/sysroot/tools/host-gcc/bin/x86_64-aero-gcc"
8+
9+
[patch.crates-io]
10+
libc = { path = "/home/czapek/Development/aero/bundled/rust-libc" }
11+
num_cpus = { path = "/home/czapek/Development/aero/bundled/rust-num-cpus" }
12+
users = { path = "/home/czapek/Development/aero/bundled/rust-users" }
13+
14+
# [unstable]
15+
# build-std = ["core", "compiler_builtins", "alloc"]
16+
# build-std-features = ["compiler-builtins-mem"]
17+
18+
# [build]
19+
# target = "./.cargo/x86_64-unknown-none.json"

userland/aero_shell/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ edition = "2021"
66

77
[dependencies]
88
aero_syscall = { path = "../../src/aero_syscall" }
9-
std = { path = "../aero_std" }

userland/init/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ edition = "2021"
66

77
[dependencies]
88
aero_syscall = { path = "../../src/aero_syscall" }
9-
std = { path = "../aero_std" }

userland/utest/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ edition = "2021"
55
authors = ["Anhad Singh <[email protected]>"]
66

77
[dependencies]
8-
std = { path = "../aero_std" }
98
aero_syscall = { path = "../../src/aero_syscall" }
109
utest-proc = { path = "../utest-proc" }

0 commit comments

Comments
 (0)