-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support pre-package commands with arguments #395
base: main
Are you sure you want to change the base?
Conversation
Thanks for the PR. I'm on the fence about this. It adds some complexity with the shell parsing library. I think the intent is for that to point to a script, though, so if you needed to set args you'd put those in your script. For paketo buildpacks, we have a Can you expand on your situation/use case? Is there a reason you couldn't add a wrapper script that includes your custom arguments? The arguments are going to be static in the buildpack.toml, so I don't think it would be any more flexible to have them in the toml file as opposed to a script. Thanks |
Can you maybe better explain where you see the complexity. Without using a library, I would totally see your point. But we use the same library as paketo-buildpacks/procfile in the exact same way.
But being able to call a script only without arguments, sounds kinda like a bug. Doesn't it?
That would be an easy workaround for sure. But @pacostas Any thoughts on this?
It is all in the linked issue, but basically it is as simple as being able to call
They are not really custom arguments, but the way the
But what if I want to add a target or (more likely) remove one for local use. I would have to touch 2 places. Right? |
Shell parsing is a dangerous task, IMHO. It seems simple on the surface but has a lot of corner cases and risk. I think it's something we should avoid attempting to do if there are other options. The procfile buildpack doesn't really have a choice since the Procfile format is something out of our control. I agree with what the buildpack spec did with getting rid of direct=false though. It's far better to have the user to split command and args, where possible. I also have doubts about the library, as it is not actively maintained. If we need it, like Procfile, we don't have a lot of choice, as there's not another library in Go that I've seen. It's a risk using it, though. If we don't need to, then I'd rather avoid it.
It's perspective, and I can see yours, but it depends on intent and what's documented. There was never intent for this to work that way, nor is it documented as working that way either, so the fact that it doesn't work that way is not a bug. It just doesn't work that way.
This would be another area where there's some gray area. The Using jam to build this seems like it would be the best path, which is what I suspect the authors of the buildpack test and do. I recognize that this is not a great user experience, having two packaging tools, but it's where we are at right now. Hopefully, it won't always be that way. |
I wouldn't call it dangerous. The worst think that can happen is that it dos not work. But it is not simple for sure. Even if it only works for 80% of the cases, that is 80% more as without.
An option could be to shell out and let the shell take care of it. Do you think that might be an option?
It is really a coincidence that this buildpack is |
#fixes paketo-buildpacks/npm-install#856
Summary
The
create-package
command will invoke thepre-package
command from thebuildpack.toml
.Use Cases
The build script might receive some arguments for multiarch (e.g. here)
Checklist