Skip to content

Commit ea1e24e

Browse files
committed
Fix build issues
1 parent ea28b7e commit ea1e24e

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

cobalt-build/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ use std::io::{self, prelude::*, ErrorKind};
1818
use std::path::{Path, PathBuf};
1919
use thiserror::Error;
2020

21+
pub const HOST_TRIPLE: &str = env!("HOST");
22+
2123
#[derive(Debug, Clone, Copy, Error)]
2224
#[error("build failed because of {0} compiler error{}", if *.0 == 1 {""} else {"s"})]
2325
pub struct CompileErrors(pub usize);

cobalt-cli/src/tests/hello_world.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,22 +52,23 @@ fn test_hello_world_aot() {
5252
fn test_hello_world_aot_linked() {
5353
let input_main_path_str = "src/tests/inputs/hello_world_linked_main.co";
5454
let input_lib_path_str = "src/tests/inputs/hello_world_linked_lib.co";
55-
let output_lib_path_str = "src/tests/outputs/libhello_world_linked.o";
5655
let output_main_path_str = "src/tests/outputs/hello_world_linked";
57-
56+
let output_lib_path_str = Path::new("src/tests/outputs").join(cobalt_build::libs::format_lib("hello_world_linked", cobalt_build::HOST_TRIPLE, true));
5857
// ---
5958

6059
let input_lib = clio::Input::new(input_lib_path_str);
6160
assert!(
6261
input_lib.is_ok(),
6362
"(clio) failed to load input: {:?}",
64-
&input_lib.err()
63+
&input_lib.unwrap_err()
6564
);
66-
let output_lib = clio::OutputPath::new(output_lib_path_str);
65+
66+
67+
let output_lib = clio::OutputPath::new(&output_lib_path_str);
6768
assert!(
6869
output_lib.is_ok(),
6970
"(clio) failed to load output: {:?}",
70-
&output_lib.err()
71+
&output_lib.unwrap_err()
7172
);
7273

7374
let cli_lib = Cli::Aot {
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@C(extern) fn puts(str: *u8);
22

3-
fn hello_world() = {
3+
@export fn hello_world() = {
44
puts("Hello, world!"c);
5-
};
5+
};

0 commit comments

Comments
 (0)