Add a way to pass the context CFLAGS to foreign build sandboxing
Hi there,
I am trying to compile some C code, using the foreign build sandboxing. This is working nicely, but now I would like to be able to tweak the C flags (for instance to use the ones defined in the current workspace context).
Is there a way to do that properly?
I've tried various things, but I only succeeded to make dune explode:
$ echo dune
(rule
(target foo)
(action (setenv X %{c_flags} (run echo 1))))
$ dune build ./foo
Error: exception { exn =
("Pform.Map.expand_exn",
{ t =
{ vars =
map
{ "-verbose" : No_info Values []
; "<" :
Deleted_in
"First_dep",(1, 0),[ "Use a named dependency instead:\n\
\n\
\ (deps (:x <dep>) ...)\n\
\ ... %{x}\n\
..."
]
[...]
Same for:
(rule
(target foo)
(action (run echo %{c_flags})))
Or with (with is what I wanted to use to pass %{c_flags} to the sandboxed ./configure script):
(rule
(target foo)
(action (bash "echo %{c_flags}")))
Just to clarify, you'd like to print the c_flags so that some script can process them?
Just to clarify, you'd like to print the c_flags so that some script can process them?
Yes. I found a way by printing %{cc} and removing the first word, so it's not blocking (just a bit surprising that it failed like that).
@samoht Thanks for reporting! I can look into this issue but probably not this/next week.
Any luck with this?
I'm not aware of anyone working on this at the moment. (Alas, I never found time to look.)