Skip to content

Bug: Makefile fails with '@unset' – not recognized across all environments #2831

@nintran52

Description

@nintran52

What were you trying to achieve?

I wanted to unset a Makefile variable (GRPC_TLS or GRPC_MTLS) when the other is enabled, to ensure mutual exclusivity before running Docker Compose via the make run target.

What are the expected results?

  • When GRPC_MTLS=true, the @Unset GRPC_TLS command should remove the variable.

  • The make run command should complete without errors, with only one of GRPC_TLS or GRPC_MTLS being active.

What are the received results?

When running make run, I get the following error:

make run

make: unset: No such file or directory
make: *** [check_mtls] Error 1

This error is due to @Unset being used, which is:

  • Not available in Windows environments (e.g., CMD or PowerShell)

  • Executed in a subshell in Unix-based systems (Linux/macOS), making it ineffective across lines

Steps To Reproduce

Run:

make run

Error occurs:

make: unset: No such file or directory
make: *** [check_mtls] Error 1

In what environment did you encounter the issue?

  • OS: macOS Ventura / Ubuntu 22.04 / Windows 10

  • Make: GNU Make 4.3+

  • Shell: Bash 5.x / CMD / PowerShell / Git Bash

Additional information you deem important

  • unset is a shell builtin (not an external command), and does not persist in Makefile since each line is executed in a separate shell.

  • On Windows, unset is not recognized in CMD or PowerShell.

  • Recommended fix: avoid @Unset; use $(eval GRPC_TLS=) instead:

    $(eval GRPC_TLS=)

  • Or enforce logic using conditional $(error ...) to catch mutual conflict.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions