2
0
mirror of https://github.com/junegunn/fzf synced 2024-10-30 09:20:14 +00:00
fzf/BUILD.md
Charlie Vieth 3c877c504b
Enable profiling options when 'pprof' tag is set (#2813)
This commit enables cpu, mem, block, and mutex profling of the FZF
executable. To support flushing the profiles at program exit it adds
util.AtExit to register "at exit" functions and mandates that util.Exit
is used instead of os.Exit to stop the program.

Co-authored-by: Junegunn Choi <junegunn.c@gmail.com>
2024-04-13 14:58:11 +09:00

1.7 KiB

Building fzf

Build instructions

Prerequisites

  • Go 1.20 or above

Using Makefile

# Build fzf binary for your platform in target
make

# Build fzf binary and copy it to bin directory
make install

# Build fzf binaries and archives for all platforms using goreleaser
make build

# Publish GitHub release
make release

Warning

Makefile uses git commands to determine the version and the revision information for fzf --version. So if you're building fzf from an environment where its git information is not available, you have to manually set $FZF_VERSION and $FZF_REVISION.

e.g. FZF_VERSION=0.24.0 FZF_REVISION=tarball make

Tip

To build fzf with profiling options enabled, set TAGS=pprof

TAGS=pprof make clean install
fzf --profile-cpu /tmp/cpu.pprof --profile-mem /tmp/mem.pprof \
    --profile-block /tmp/block.pprof --profile-mutex /tmp/mutex.pprof

Third-party libraries used

License

MIT