tweag / opam-nix

Turn opam-based OCaml projects into Nix derivations
MIT License
111 stars 33 forks source link

Don't skip empty arguments in build commands #78

Closed Julow closed 8 months ago

Julow commented 8 months ago

On top of https://github.com/tweag/opam-nix/pull/76 but also fix the handling of optional arguments.

The calling convention becomes quite heavy but seems to work. It looks like this:

args=()
args+=("abc")
if foo; then args+=("$(bar)"); fi
"${args[@]}

It's totally possible to use a shorter form when the command do not contain an optional argument but I figure that could also hide some bugs so I kept it simple.

This works for compiling my project, though my project compiled fine with https://github.com/tweag/opam-nix/pull/76 already. How to test this more reliably ?

balsoft commented 8 months ago

I feel like this should work. I'll run it through the whole test suite.

balsoft commented 8 months ago

Seems to work fine on existing test cases. Thanks!

Julow commented 8 months ago

Thanks!