hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 4ef0cf5bba13a1437a7f9b959a09822ead7adf8c
parent e283238e494b852ac1db567aa462d818b1aa99ad
Author: Autumn! <autumnull@posteo.net>
Date:   Mon, 16 Jan 2023 22:23:06 +0000

cmd/hare: Don't append .o/.a to output path of build -c

Signed-off-by: Autumn! <autumnull@posteo.net>

Diffstat:
Mcmd/hare/schedule.ha | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/cmd/hare/schedule.ha b/cmd/hare/schedule.ha @@ -281,7 +281,13 @@ fn sched_hare_object( let current = false; let output = if (output is str) { // TODO: Should we use the cache here? - yield fmt::asprintf("{}.{}", output, if (mixed) "a" else "o"); + const (_, ext) = path::extension(output as str); + const expected = if (mixed) ".a" else ".o"; + if (ext != expected) { + fmt::errorfln("Warning: Expected output file extension {}, found {}", + expected, output)!; + }; + yield strings::dup(output as str); } else if (len(namespace) != 0) { let version = hex::encodestr(ver.hash); let env = module::identuscore(namespace);