When we pass the name of dependencies to Zig through build.zig and build.zig.zon, not all names are safe. Like the dependency name is literally used in build.zig, so Zig source code. I'm not sure exactly what is allowed there but at the least - doesn't work since it is the minus operator and cannot be part of a name.
I opted to just allowed plain ascii names, that must start with a letter and then followed by letters, numbers and underscore.
The user now gets an error if a disallowed name is used, via acton pkg add, acton zig-pkg add/remove as well as if it is read from build.act.json (in which case it needs to be manually edited).
I briefly considered rewriting names, but it leads to other problems, and so I ultimately decided to just error out instead.
When we pass the name of dependencies to Zig through build.zig and build.zig.zon, not all names are safe. Like the dependency name is literally used in build.zig, so Zig source code. I'm not sure exactly what is allowed there but at the least - doesn't work since it is the minus operator and cannot be part of a name.
I opted to just allowed plain ascii names, that must start with a letter and then followed by letters, numbers and underscore.
The user now gets an error if a disallowed name is used, via acton pkg add, acton zig-pkg add/remove as well as if it is read from build.act.json (in which case it needs to be manually edited).
I briefly considered rewriting names, but it leads to other problems, and so I ultimately decided to just error out instead.
Fixes #1886