Skip to content

Commit

Permalink
Fix new ziglang version (keep-starknet-strange#486)
Browse files Browse the repository at this point in the history
  • Loading branch information
tcoratger authored Mar 21, 2024
1 parent f92480b commit af40526
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/integration_tests.zig
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ pub fn main() void {

pub fn cairo_run(allocator: std.mem.Allocator, pathname: []const u8, layout: []const u8, extensive_hints: bool) !void {
var buffer: [std.fs.MAX_PATH_BYTES]u8 = undefined;
const path = try std.os.realpath(pathname, &buffer);
const path = try std.posix.realpath(pathname, &buffer);

var parsed_program = try ProgramJson.parseFromFile(allocator, path);
defer parsed_program.deinit();
Expand Down
2 changes: 1 addition & 1 deletion src/vm/cairo_run.zig
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ test "EncodedMemory: can round trip from valid memory binary" {
var buffer: [std.fs.MAX_PATH_BYTES]u8 = undefined;
// where `cairo_memory_struct` is sourced (graciously) from
// https://github.com/lambdaclass/cairo-vm/blob/main/cairo_programs/trace_memory/cairo_trace_struct#L1
const path = try std.os.realpath("cairo_programs/trace_memory/cairo_memory_struct", &buffer);
const path = try std.posix.realpath("cairo_programs/trace_memory/cairo_memory_struct", &buffer);

const file = try std.fs.cwd().openFile(path, .{});
defer file.close();
Expand Down
18 changes: 9 additions & 9 deletions src/vm/types/programjson.zig
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ test "ProgramJson can be initialized from json file with correct program data" {
// Parse the ProgramJson from the JSON file for testing.
var parsed_program = try ProgramJson.parseFromFile(
allocator,
try std.os.realpath("cairo_programs/fibonacci.json", &buffer),
try std.posix.realpath("cairo_programs/fibonacci.json", &buffer),
);
defer parsed_program.deinit(); // Ensure deallocation after the test.

Expand Down Expand Up @@ -1003,7 +1003,7 @@ test "ProgramJson: parseFromFile should return a parsed ProgramJson instance fro
// Attempting to parse a ProgramJson instance from a JSON file
var parsed_program = try ProgramJson.parseFromFile(
std.testing.allocator,
try std.os.realpath(
try std.posix.realpath(
"cairo_programs/manually_compiled/valid_program_a.json",
&buffer,
),
Expand Down Expand Up @@ -1037,7 +1037,7 @@ test "ProgramJson: parseFromFile should return a parsed ProgramJson instance fro
// Attempting to parse a ProgramJson instance from a JSON file
var parsed_program = try ProgramJson.parseFromFile(
std.testing.allocator,
try std.os.realpath(
try std.posix.realpath(
"cairo_programs/manually_compiled/valid_program_b.json",
&buffer,
),
Expand Down Expand Up @@ -1277,7 +1277,7 @@ test "ProgramJson: parseFromString should return a parsed ProgramJson instance f
test "ProgramJson: parseProgramJson should parse a Cairo v0 JSON Program and convert it to a Program" {
// Get the absolute path of the current working directory.
var buffer: [std.fs.MAX_PATH_BYTES]u8 = undefined;
const path = try std.os.realpath("cairo_programs/fibonacci.json", &buffer);
const path = try std.posix.realpath("cairo_programs/fibonacci.json", &buffer);
// Parse the JSON file into a `ProgramJson` structure
var parsed_program = try ProgramJson.parseFromFile(std.testing.allocator, path);
defer parsed_program.deinit();
Expand Down Expand Up @@ -1382,7 +1382,7 @@ test "ProgramJson: parseProgramJson with missing entry point should return an er
var buffer: [std.fs.MAX_PATH_BYTES]u8 = undefined;

// Obtain the real path of the JSON file
const path = try std.os.realpath(
const path = try std.posix.realpath(
"cairo_programs/manually_compiled/valid_program_a.json",
&buffer,
);
Expand Down Expand Up @@ -1411,7 +1411,7 @@ test "ProgramJson: parseProgramJson should parse a valid manually compiled progr
var buffer: [std.fs.MAX_PATH_BYTES]u8 = undefined;

// Obtain the real path of the JSON file
const path = try std.os.realpath(
const path = try std.posix.realpath(
"cairo_programs/manually_compiled/valid_program_a.json",
&buffer,
);
Expand Down Expand Up @@ -1521,7 +1521,7 @@ test "ProgramJson: parseProgramJson should parse a valid manually compiled progr
var buffer: [std.fs.MAX_PATH_BYTES]u8 = undefined;

// Obtain the real path of the JSON file
const path = try std.os.realpath(
const path = try std.posix.realpath(
"cairo_programs/manually_compiled/valid_program_a.json",
&buffer,
);
Expand Down Expand Up @@ -1628,7 +1628,7 @@ test "ProgramJson: parseProgramJson with constant deserialization" {
var buffer: [std.fs.MAX_PATH_BYTES]u8 = undefined;

// Obtain the real path of the JSON file.
const path = try std.os.realpath(
const path = try std.posix.realpath(
"cairo_programs/manually_compiled/deserialize_constant_test.json",
&buffer,
);
Expand Down Expand Up @@ -2543,7 +2543,7 @@ test "ProgramJson should be able to parse a sample subset of cairo0 files" {
errdefer std.debug.print("cannot parse program: {s}\n", .{program_path});

var buffer: [std.fs.MAX_PATH_BYTES]u8 = undefined;
const path = try std.os.realpath(program_path, &buffer);
const path = try std.posix.realpath(program_path, &buffer);
var parsed_program = try ProgramJson.parseFromFile(allocator, path);
defer parsed_program.deinit();
}
Expand Down

0 comments on commit af40526

Please sign in to comment.