0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-03-31 11:45:06 +00:00
netdata_netdata/packaging/makeself
Austin S. Hemmelgarn 2db8a882e8
Large-scale cleanup of static build infrastructure. (#19852)
* Centralize cache path handling.

* Add better debugging support for static build infrastructure.

* Centralize handling of git repository fetching for static builds.

* Centralize build directory handling in the static build.

And quit using a sub-directory of packaging/makeself from the source
tree for it.

* Remove version numbers from static build jobs.

* Better organize static build jobs.

0x numbers for non-build prep-work
1x numbers for libraries that potentially impact multiple other things
we vendor.
2x numbers for libraries that are direct dependencies of Netdata
3x numbers for combined libraries and tooling used by Netdata
4x numbers for general tooling used by Netdata
5x numbers for tooling used by single specific components
6x numbers for non-build prep-work for the Netdata build
7x numbers for the actual build of Netdata
8x numbers for post-build checks
9x numbers for the actual packaging

* Clean up variable handling in Netdata build job.

* Split post-build handling steps to their own jobs.

This will make it easier to see what is actually going on in the build
process.

* Clean up CI messages.

* Split archive creation sub-steps into indivudal jobs.

* Disable shell tracing for archive creation job.

It’s not needed in 99.9% of cases, and should only be enabled locally if
it is needed.

* Assorted fixes for code restructuring.

* Tidy up paths for runtime check.

* Fix CI handling of artifacts.
2025-03-25 07:00:54 -04:00
..
jobs Large-scale cleanup of static build infrastructure. (#19852) 2025-03-25 07:00:54 -04:00
build-static.sh Large-scale cleanup of static build infrastructure. (#19852) 2025-03-25 07:00:54 -04:00
build-x86_64-static.sh fix static build, curl will be staict binary; extra args can be transfer (#11852) 2021-12-07 09:59:22 -05:00
build.sh Large-scale cleanup of static build infrastructure. (#19852) 2025-03-25 07:00:54 -04:00
bundled-packages.version Include libucontext in static builds to vendor libunwind even on POWER. (#19817) 2025-03-11 06:58:11 -04:00
functions.sh Large-scale cleanup of static build infrastructure. (#19852) 2025-03-25 07:00:54 -04:00
install-alpine-packages.sh enable libunwind in static builds (#19764) 2025-03-06 12:39:10 +02:00
install-or-update.sh detect the system ca bundle at runtime (#19622) 2025-02-12 16:28:01 +02:00
makeself-header.sh Prevent pager from preventing non-interactive install (#14950) 2023-04-25 07:50:19 -04:00
makeself-help-header.txt change the moto and the description of netdata (#19696) 2025-02-23 13:02:22 +02:00
makeself-license.txt change the moto and the description of netdata (#19696) 2025-02-23 13:02:22 +02:00
makeself.lsm Fix SIGSEGV on static installs due to dengine log (#19774) 2025-03-05 14:24:43 +02:00
makeself.sh Update the bundled version of makeself used to create static builds. (#14822) 2023-04-12 06:58:36 -04:00
post-installer.sh move makeself (#4688) 2019-01-02 10:12:24 +01:00
README.md Docs fixes (#18676) 2024-10-04 12:23:00 +03:00
run-all-jobs.sh Large-scale cleanup of static build infrastructure. (#19852) 2025-03-25 07:00:54 -04:00
uname2platform.sh Add ARMv6 static builds. (#16853) 2024-01-29 11:59:13 +02:00

Netdata static binary build

We publish pre-built static builds of Netdata for Linux systems. Currently, these are published for 64-bit x86, ARMv7, AArch64, and POWER8+ hardware. These static builds are able to operate in a mostly self-contained manner and only require a POSIX compliant shell and a supported init system. These static builds install under /opt/netdata. If you are on a platform which we provide static builds for but do not provide native packages for, a static build will be used by default for installation.

If you want to enforce the usage of a static build and have the installer return a failure if one is not available, you can do so by adding --static-only to the options you pass to the installer.

Requirements

  • Container runtime tool (Docker or Podman)

Building a static binary package

Before you begin, make sure that your repo and the repo's submodules are clean from any previous builds and up to date. Otherwise, perform a cleanup

To build the static binary 64-bit distribution package, into the root folder on the netdata repo, run:

./packaging/makeself/build-static.sh x86_64

The program will:

  1. setup a new docker container with Alpine Linux
  2. install the required alpine packages (the build environment, needed libraries, etc)
  3. download and compile third party apps that are packaged with Netdata (bash, curl, etc)
  4. compile Netdata

Once finished, a file named netdata-vX.X.X-gGITHASH-x86_64-DATE-TIME.run will be created in the current directory. This is the Netdata binary package that can be run to install Netdata on any other computer.

You can build static binaries for other architectures such as armv7l, aarch64, and ppc64le.

Building binaries with debug info

To build Netdata binaries with debugging / tracing information in them, use:

cd /path/to/netdata.git
./packaging/makeself/build-static.sh x86_64 debug

These binaries are not optimized (they are a bit slower), they have certain features disables (like log flood protection), other features enables (like debug flags) and are not stripped (the binary files are bigger, since they now include source code tracing information).

Debugging Netdata binaries

Once you have installed a binary package with debugging info, you will need to install valgrind and run this command to start Netdata:

PATH="/opt/netdata/bin:${PATH}" valgrind --undef-value-errors=no /opt/netdata/bin/srv/netdata -D

The above command, will run Netdata under valgrind. While Netdata runs under valgrind it will be 10x slower and use a lot more memory.

If Netdata crashes, valgrind will print a stack trace of the issue. Open a github issue to let us know.

To stop Netdata while it runs under valgrind, press Control-C on the console.

If you omit the parameter --undef-value-errors=no to valgrind, you will get hundreds of errors about conditional jumps that depend on uninitialized values. This is normal. Valgrind has heuristics to prevent it from printing such errors for system libraries, but for the static Netdata binary, all the required libraries are built into Netdata. So, valgrind cannot apply its heuristics and prints them.