junegunn/fzf · error

error: profiling not supported: FZF must be built with '-tag

Error message

error: profiling not supported: FZF must be built with '-tags=pprof' to enable profiling

What it means

One of the profiling flags (--profile-cpu, --profile-mem, --profile-block, --profile-mutex) was used, but the running fzf binary was built without the 'pprof' build tag, so options_no_pprof.go's stub initProfiling rejects it. Profiling support is compile-time only; there is no runtime switch.

Source

Thrown at src/options_no_pprof.go:10

//go:build !pprof
// +build !pprof

package fzf

import "errors"

func (o *Options) initProfiling() error {
	if o.CPUProfile != "" || o.MEMProfile != "" || o.BlockProfile != "" || o.MutexProfile != "" {
		return errors.New("error: profiling not supported: FZF must be built with '-tags=pprof' to enable profiling")
	}
	return nil
}

View on GitHub (pinned to bd4efa277b)

Solutions

  1. Remove the --profile-* flags for normal usage; they are only for fzf development
  2. If you really need profiles, build from source with the tag: go build -tags=pprof (see BUILD.md in the repo)
  3. Confirm which build you have: a tagged build accepts the flags without this error

Example fix

# before
fzf --profile-cpu cpu.prof
# after (stock binary)
fzf
# after (development build)
go build -tags=pprof && ./fzf --profile-cpu cpu.prof
Defensive patterns

Strategy: validation

Validate before calling

# only pass profiling flags to a pprof-tagged build
FZF_BIN=fzf
# heuristic: dev builds usually live outside package managers
if [ "${FZF_PPROF:-0}" = 1 ]; then FZF_BIN=./fzf; fi   # built with -tags=pprof
$FZF_BIN --profile-cpu /tmp/cpu.prof   # omit flags for stock fzf

Prevention

When it happens

Trigger: Passing any profiling option to a stock fzf build (installed via brew, apt, or the official release tarballs, which are all built without -tags=pprof).

Common situations: Users copying profiling instructions from the fzf README or a developer blog onto a distribution binary; CI scripts that add profiling flags unconditionally.

Related errors


AI-assisted analysis of junegunn/fzf@bd4efa277b (2026-08-15). Data as JSON: /api/errors/a5d540e9df2cad53. Report an issue: GitHub.