public inbox for goredo-devel@lists.cypherpunks.su
Atom feed
* Arguments to redo-if*
@ 2023-10-01 12:15 goredo
  2023-10-07 15:54 ` Sergey Matveev
  0 siblings, 1 reply; 2+ messages in thread
From: goredo @ 2023-10-01 12:15 UTC (permalink / raw)
  To: Goredo Devel

Hello!

I have noticed an issue with redo-ifchange and redo-ifcreate which is hard to work with.

I am building a generalised toolchain based on redo, which provides a framework for which the actual project is not yet known. It provides many redo targets which take dependencies as user input. There, I noticed the following discrepancy between goredo and apenwarr redo: I cannot, in general avoid that a user might provide, ever in error, a dependency that starts with a dash. In apenwarr redo, redo-if* commands don't take any options but take the whole argument list as targets. goredo chokes on those arguments trying to interpret them as options. Now the issue: apenwarr redo-if* commands also don't treat a double dash argument specially (which you can use to end the option list). It treats it as a target name and chokes on it. So, for me, building this toolchain, it's impossible to secure my calls to redo-if* properly, because I would have to know whether the user uses goredo or apenwarr redo.

My suggestion is to either get rid of arguments to redo-if* commands entirely or to let them check whether they are executed in a running redo chain, e.g. by existence of certain environment variables, and ignore any options and treat them as targets.

In my understanding, the contract always was: Any target name is allowed unless it contains a newline character. So this includes targets that look like command line options. And it is certainly helpful when building general toolchains with redo, when the primary internal commands redo-if* allow for maximum freedom in their arguments.

Kind regards,
–Michael

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Arguments to redo-if*
  2023-10-01 12:15 Arguments to redo-if* goredo
@ 2023-10-07 15:54 ` Sergey Matveev
  0 siblings, 0 replies; 2+ messages in thread
From: Sergey Matveev @ 2023-10-07 15:54 UTC (permalink / raw)
  To: goredo-devel

[-- Attachment #1: Type: text/plain, Size: 593 bytes --]

Greetings!

*** goredo [2023-10-01 14:15]:
>My suggestion is to either get rid of arguments to redo-if* commands entirely or to let them check whether they are executed in a running redo chain, e.g. by existence of certain environment variables, and ignore any options and treat them as targets.

Fully agreed! Made a commit where it won't parse options if
REDO_BUILD_UUID environment variable is set (it is set by the "top"
invoked redo). Will appear in the next release.

-- 
Sergey Matveev (http://www.stargrave.org/)
OpenPGP: 12AD 3268 9C66 0D42 6967  FD75 CB82 0563 2107 AD8A

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-07 15:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-01 12:15 Arguments to redo-if* goredo
2023-10-07 15:54 ` Sergey Matveev