Skip to content

Commit d82fc89

Browse files
ifreundbakpakin
authored andcommitted
cc/pkg-config: handle tuple *cflags* and *ldflags*
Currently using :pkg-config-libs with declare-executable gives the following error: error: bad slot #0, expected array, got <tuple 0x7C2127E0CE00> in array/concat [src/core/array.c] on line 250 in pkg-config [/home/ifreund/.local/lib/janet/spork/cc.janet] (tail call) on line 749, column 3 in target [/home/ifreund/.local/lib/janet/spork/declare-cc.janet] on line 828, column 11 in edefer [/home/ifreund/.local/lib/janet/spork/build-rules.janet] on line 118, column 22 in _while [/home/ifreund/.local/lib/janet/spork/build-rules.janet] on line 112, column 7 in worker [/home/ifreund/.local/lib/janet/spork/build-rules.janet] on line 105, column 5 in defer [/home/ifreund/.local/lib/janet/spork/build-rules.janet] on line 19, column 11 in wait-for-fibers [/home/ifreund/.local/lib/janet/spork/build-rules.janet] on line 12, column 3 in run-rules [/home/ifreund/.local/lib/janet/spork/build-rules.janet] (tail call) on line 132, column 3 in run-main [boot.janet] on line 4523, column 16 in cli-main [boot.janet] on line 4745, column 17 We could try to ensure that *cflags*/*ldflags* are always an array, but simply guarding against the chance that they could be a tuple in cc/pkg-config seems more robust.
1 parent cc70972 commit d82fc89

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spork/cc.janet

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -746,8 +746,8 @@
746746
(def leftovers (search-libraries ;libs))
747747
(unless (empty? leftovers)
748748
(errorf "could not find libraries %j" leftovers))
749-
(array/concat (getsetdyn *cflags*) cflags)
750-
(array/concat (getsetdyn *lflags*) lflags)
749+
(array/concat @[] (getsetdyn *cflags*) cflags)
750+
(array/concat @[] (getsetdyn *lflags*) lflags)
751751
nil)
752752

753753
###

0 commit comments

Comments
 (0)