stefan-hoeck / idris2-pack

BSD 3-Clause "New" or "Revised" License
90 stars 23 forks source link

Add --cg flag to build command #244

Closed ccfontes closed 1 year ago

ccfontes commented 1 year ago

Can we have --cg flag for build command?

I have a use case where a user would need to pass codegen to both: conditionally build codegen tools, and inform pack of the codegen to be used by Idris. To do this, user needs to configure codegen in two places: docker and pack.toml config. Being able to pass --cg to build command would remove this duplication. Use case docker ARG, pack.toml, and pack call.

stefan-hoeck commented 1 year ago

Does the existing pack --cg node build ... not do what you want?

ccfontes commented 1 year ago

I'm getting:

pack --cg ${CODEGEN} build function.ipkg
[ fatal ] Unknown command: "function.ipkg"
stefan-hoeck commented 1 year ago

What happens if you replace ${CODEGEN} with an explicit codegen?

stefan-hoeck commented 1 year ago

Also, which version of pack are you using? You could print the output of pack info to get some more information on your pack version and the pack collection you are using.

I just checked, and pack --cg node build my.ipkg definitely works on my end.

ccfontes commented 1 year ago

Marvellous, it works.

pack info:

#27 0.736 Package Collection  : nightly-230330
#27 0.736 Idris2 URL          : https://github.com/idris-lang/Idris2
#27 0.736 Idris2 Version      : 0.6.0
#27 0.736 Idris2 Commit       : 6b38592b5ac12bb45d3fa825e143b3e838c064eb
#27 0.736 Scheme Executable   : chezscheme
#27 0.736 Pack Commit         : 6ff0f1ac46fd0d8ad13b827cb96ece7187730d8d
#27 0.736 Installed Libraries : base
#27 0.736                       contrib
#27 0.736                       filepath
#27 0.736                       idris2
#27 0.736                       linear
#27 0.736                       network
#27 0.736                       prelude
#27 0.736                       toml

I don't know why ${CODEGEN} isn't working, but give me a few minutes, otherwise, I'll close the issue. Thanks.

ccfontes commented 1 year ago

In my build, ${CODEGEN} is empty at the time of using from pack, which makes build the value of --cg, which then passes "function.ipkg" as pack command, which cannot be found. I'm using ARG incorrectly.

Thank you, and closing this issue.