@cryptotaxi247 / netdata-1 / commits / 77996e73e

Update packaging instructions (#16344)

1. Add repo clean up instructions for the netdata/netdata repo (clean up from previous builds) 2. Make the static build instruction to use the more generic script --------- Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> Co-authored-by: Austin S. Hemmelgarn <austin@netdata.cloud>

Tasos Katsoulas committed Nov 6, 2023 at 18:40 UTC 77996e73eedbcfba043b02902934f64d147a9c13
3 files changed +37 -4
packaging/installer/methods/manual.md
+20
@@ -22,6 +22,9 @@ To install the latest git version of Netdata, please follow these 2 steps:
22
23 ## Prepare your system
24
25 +Before you begin, make sure that your repo and the repo's submodules are clean from any previous builds and up to date.
26 +Otherwise, [perform a cleanup](https://github.com/netdata/netdata/blob/master/packaging/installer/methods/manual.md#perform-a-cleanup-in-your-netdata-repo)
27 +
28 Use our automatic requirements installer (_no need to be `root`_), which attempts to find the packages that
29 should be installed on your system to build and run Netdata. It supports a large variety of major Linux distributions
30 and other operating systems and is regularly tested. You can find this tool [here](https://raw.githubusercontent.com/netdata/netdata/master/packaging/installer/install-required-packages.sh) or run it directly with `bash <(curl -sSL https://raw.githubusercontent.com/netdata/netdata/master/packaging/installer/install-required-packages.sh)`. Otherwise read on for how to get requires packages manually:
@@ -226,3 +229,20 @@ Our current build process unfortunately has some issues when using certain confi
229 If the installation fails with errors like `/bin/ld: externaldeps/libwebsockets/libwebsockets.a(context.c.o): relocation R_X86_64_32 against '.rodata.str1.1' can not be used when making a PIE object; recompile with -fPIC`, and you are trying to build with `clang` on Linux, you will need to build Netdata using GCC to get a fully functional install.
230
231 In most cases, you can do this by running `CC=gcc ./netdata-installer.sh`.
232 +
233 +
234 +### Perform a cleanup in your netdata repo
235 +
236 +The Netdata repo consist of the main git tree and it's submodules. Either working on a fork or on the main repo you need to make sure that there
237 +are no "leftover" artifacts from previous builds and that your submodules are up to date to the **corresponding checkouts**.
238 +
239 +> #### Important: Make sure that you have commited any work in progress, before you proceed the with the clean up instruction below
240 +
241 +
242 +```sh
243 +git clean -dfx && git submodule foreach 'git clean -dfx' && git submodule update --recursive --init
244 +```
245 +
246 +
247 +> Note: In previous builds, you may have created artifacts belonging to an another user (e.g root), so you may need to run
248 +> each of the _git clean_ commands as sudoer.
packaging/installer/methods/source.md
+4
@@ -50,7 +50,11 @@ which the the build system will link statically into Netdata. These
50 libraries and their header files must be copied into specific locations
51 in the source tree to be used.
52
53 +Before you begin, make sure that your repo and the repo's submodules are clean from any previous builds and up to date.
54 +Otherwise, [perform a cleanup](https://github.com/netdata/netdata/blob/master/packaging/installer/methods/manual.md#perform-a-cleanup-in-your-netdata-repo)
55 +
56 ### Netdata cloud
57 +
58 #### JSON-C
59
60 Netdata requires the use of JSON-C for JSON parsing when using Netdata
packaging/makeself/README.md
+13 -4
@@ -19,13 +19,20 @@ will be used by default for installation.
19 If you want to enforce the usage of a static build and have the installer return a failure if one is not available,
20 you can do so by adding `--static-only` to the options you pass to the installer.
21
22 +## Requirements
23 +
24 +- Container runtime tool (Docker or Podman)
25 +
26 ## Building a static binary package
27
24 -To build the static binary 64-bit distribution package, run:
28 +Before you begin, make sure that your repo and the repo's submodules are clean from any previous builds and up to date.
29 +Otherwise, [perform a cleanup](https://github.com/netdata/netdata/blob/master/packaging/installer/methods/manual.md#perform-a-cleanup-in-your-netdata-repo)
30 +
31 +
32 +To build the static binary 64-bit distribution package, into the root folder on the netdata repo, run:
33
34 ```bash
27 -cd /path/to/netdata.git
28 -./packaging/makeself/build-x86_64-static.sh
35 +./packaging/makeself/build-static.sh x86_64
36 ```
37
38 The program will:
@@ -37,13 +44,15 @@ The program will:
44
45 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.
46
47 +You can build static binaries for other architectures such as `armv7l`, `aarch64`, and `ppc64le`.
48 +
49 ## Building binaries with debug info
50
51 To build Netdata binaries with debugging / tracing information in them, use:
52
53 ```bash
54 cd /path/to/netdata.git
46 -./packaging/makeself/build-x86_64-static.sh debug
55 +./packaging/makeself/build-static.sh x86_64 debug
56 ```
57
58 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).