alire-project / alire

Command-line tool from the Alire project and supporting library
GNU General Public License v3.0
288 stars 49 forks source link

alr init with project name being a keyword fails #1321

Open kondor6c opened 1 year ago

kondor6c commented 1 year ago

Hello, getting started with Ada and alr I naively tried to create a crate project name of "new" (simply going for something fast and easy to begin working on exercises). While an experienced Ada developer might avoid such a minor issue, I opted to report it. Before I submitted I tried with alr init --lib accept and alr init --bin for and found the same issue. Perhaps it could fail similar to how creating a crate with an uppercase character results in an error or maybe it could be a warning (and that there are valid use cases?)?

lib

 info: ⓘ Building accept/accept.gpr...
detail: Spawning: ["gprbuild", "-v", "-s", "-j0", "-p", "-P", "/home/kondor6c/dev/ada/accept/accept.gpr"]

==============Messages for file: /home/kondor6c/dev/ada/accept/accept.gpr
     2. project Accept is
                |
        >>> identifier expected
gprbuild: "/home/kondor6c/dev/ada/accept/accept.gpr" processing failed
error: Command ["gprbuild", "-s", "-j0", "-p", "-P", "/home/kondor6c/dev/ada/accept/accept.gpr"] exited with code 4
error: Compilation failed.
detail: alr build unsuccessful

bin

detail: Env: Alire sets 'True' to 'ALIRE'
info: ⓘ Building new/new.gpr...
detail: Spawning: ["gprbuild", "-v", "-s", "-j0", "-p", "-P", "/home/kondor6c/dev/ada/new/new.gpr"]

==============Messages for file: /home/kondor6c/dev/ada/new/new.gpr
     2. project New is
                |
        >>> identifier expected
gprbuild: "/home/kondor6c/dev/ada/new/new.gpr" processing failed
error: Command ["gprbuild", "-s", "-j0", "-p", "-P", "/home/kondor6c/dev/ada/new/new.gpr"] exited with code 4
error: Compilation failed.
detail: alr build unsuccessful

If this is intended I apologize for the noise :-)

mosteo commented 1 year ago

Thanks for the report, @kondor6c. I think this is something we want to avoid.