Skip to content

Makefile: switch to POSIX mode to handle errors#41741

Closed
thaJeztah wants to merge 1 commit intomoby:masterfrom
thaJeztah:makefail
Closed

Makefile: switch to POSIX mode to handle errors#41741
thaJeztah wants to merge 1 commit intomoby:masterfrom
thaJeztah:makefail

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

similar to docker/docker-ce-packaging#510 and moby/sys#19 (comment)

also see docker/docker-ce-packaging#504 (comment)

.POSIX

The application shall ensure that this special target is specified without prerequisites
or commands. If it appears as the first non-comment line in the makefile, make shall
process the makefile as specified by this section; otherwise, the behavior of make is
unspecified.

Running the makefile with .POSIX runs shells with the -e options, which helps with
handling errors; without this, make can complet "succesfully", even if shell commands
in a target fail.

Note that this patch does not change behavior on macOS, which runs an older version of
GNU make that does not support these options.

Signed-off-by: Sebastiaan van Stijn [email protected]

- What I did

- How I did it

- How to verify it

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

> .POSIX
>
> The application shall ensure that this special target is specified without prerequisites
> or commands. If it appears as the first non-comment line in the makefile, make shall
> process the makefile as specified by this section; otherwise, the behavior of make is
> unspecified.

Running the makefile with `.POSIX` runs shells with the `-e` options, which helps with
handling errors; without this, make can complet "succesfully", even if shell commands
in a target fail.

Note that this patch does not change behavior on macOS, which runs an older version of
GNU make that does not support these options.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah
Copy link
Copy Markdown
Member Author

@tianon @tiborvass PTAL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants