Skip to content

Commit

Permalink
Merge pull request #1951 from actonlang/deps-prefer-path
Browse files Browse the repository at this point in the history
Flip order of preference, use path first!
  • Loading branch information
plajjan authored Oct 15, 2024
2 parents 35bf854 + b45b179 commit 2772754
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions cli/src/acton.act
Original file line number Diff line number Diff line change
Expand Up @@ -176,22 +176,23 @@ actor BuildProject(process_cap, env, args, on_build_success: action(str) -> None
for dep_name, dep in build_config.dependencies.items():
hash = dep.hash
path = dep.path
if hash is not None:
search_paths.append(file.join_path([zig_global_cache_dir, "p", hash, "out", "types"]))
elif path is not None:
if path is not None:
# TODO: deconstruct and put together to get OS independent path? i.e. flip / to \ on windows
if len(path) == 0:
pass
elif path[0] == "/":
search_paths.append(file.join_path([path, "out", "types"]))
else:
search_paths.append(file.join_path([fs.cwd(), path, "out", "types"]))
elif hash is not None:
search_paths.append(file.join_path([zig_global_cache_dir, "p", hash, "out", "types"]))
else:
raise ValueError("Dependency %s has no hash" % dep_name)
search_path_arg = []
for sp in search_paths:
search_path_arg.extend(["--searchpath", sp])
cr = CompilerRunner(process_cap,
cr = CompilerRunner(
process_cap,
env,
cmdargs + ["--deppath", file.join_path([fs.cwd(), ".build", "deps"])] + search_path_arg,
None,
Expand Down

0 comments on commit 2772754

Please sign in to comment.