Browse Source

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 1 year ago
parent
commit
77996e73ee

+ 20 - 0
packaging/installer/methods/manual.md

@@ -22,6 +22,9 @@ To install the latest git version of Netdata, please follow these 2 steps:
 
 ## Prepare your system
 
+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](https://github.com/netdata/netdata/blob/master/packaging/installer/methods/manual.md#perform-a-cleanup-in-your-netdata-repo)
+
 Use our automatic requirements installer (_no need to be `root`_), which attempts to find the packages that
 should be installed on your system to build and run Netdata. It supports a large variety of major Linux distributions
 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
 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. 
 
 In most cases, you can do this by running `CC=gcc ./netdata-installer.sh`.
+
+
+### Perform a cleanup in your netdata repo
+
+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
+are no "leftover" artifacts from previous builds and that your submodules are up to date to the **corresponding checkouts**.
+
+> #### Important: Make sure that you have commited any work in progress, before you proceed the with the clean up instruction below
+
+
+```sh
+git clean -dfx && git submodule foreach 'git clean -dfx' && git submodule update --recursive --init
+```
+
+
+> Note: In previous builds, you may have created artifacts belonging to an another user (e.g root), so you may need to run
+> each of the _git clean_ commands as sudoer.

+ 4 - 0
packaging/installer/methods/source.md

@@ -50,7 +50,11 @@ which the the build system will link statically into Netdata. These
 libraries and their header files must be copied into specific locations
 in the source tree to be used.
 
+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](https://github.com/netdata/netdata/blob/master/packaging/installer/methods/manual.md#perform-a-cleanup-in-your-netdata-repo)
+
 ### Netdata cloud
+
 #### JSON-C
 
 Netdata requires the use of JSON-C for JSON parsing when using Netdata

+ 13 - 4
packaging/makeself/README.md

@@ -19,13 +19,20 @@ 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
 
-To build the static binary 64-bit distribution package, run:
+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](https://github.com/netdata/netdata/blob/master/packaging/installer/methods/manual.md#perform-a-cleanup-in-your-netdata-repo)
+
+
+To build the static binary 64-bit distribution package, into the root folder on the netdata repo, run:
 
 ```bash
-cd /path/to/netdata.git
-./packaging/makeself/build-x86_64-static.sh
+./packaging/makeself/build-static.sh x86_64
 ```
 
 The program will:
@@ -37,13 +44,15 @@ The program will:
 
 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:
 
 ```bash
 cd /path/to/netdata.git
-./packaging/makeself/build-x86_64-static.sh debug
+./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).