Skip to content

Commit 8a993c3

Browse files
authored
chore: remove vendor subdir (#1012)
With the use of containerized build platforms, there's no need to vendor agent's build dependencies.
1 parent 1aeb4a4 commit 8a993c3

File tree

2,466 files changed

+78
-928409
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,466 files changed

+78
-928409
lines changed

.github/workflows/codeql.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@ jobs:
5252
# ℹ️ Command-line programs to run using the OS shell.
5353
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
5454

55+
- name: Provision agent's build dependencies
56+
if: ${{ matrix.language == 'c-cpp' }}
57+
run: |
58+
sudo apt-get update
59+
sudo apt-get install -y libprotobuf-c-dev protobuf-c-compiler
60+
5561
- name: Build
5662
run: |
5763
make ${{ matrix.language == 'go' && 'daemon' || 'agent' }}

Makefile

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ bin/:
227227
#
228228

229229
.PHONY: axiom
230-
axiom: vendor
230+
axiom: protobuf-c
231231
$(MAKE) -C axiom
232232

233233
#
@@ -238,15 +238,15 @@ axiom: vendor
238238
# TESTARGS =
239239

240240
.PHONY: axiom-tests
241-
axiom-tests: vendor
241+
axiom-tests: protobuf-c
242242
$(MAKE) -C axiom tests
243243

244244
.PHONY: axiom-check axiom-run-tests
245-
axiom-check axiom-run-tests: vendor axiom/tests/cross_agent_tests
245+
axiom-check axiom-run-tests: protobuf-c axiom/tests/cross_agent_tests
246246
$(MAKE) -C axiom run_tests
247247

248248
.PHONY: axiom-valgrind
249-
axiom-valgrind: vendor axiom/tests/cross_agent_tests
249+
axiom-valgrind: protobuf-c axiom/tests/cross_agent_tests
250250
$(MAKE) -C axiom valgrind
251251

252252
.PHONY: tests
@@ -279,9 +279,7 @@ axiom-clean:
279279
daemon-protobuf: daemon/internal/newrelic/infinite_tracing/com_newrelic_trace_v1/v1.pb.go
280280

281281
daemon/internal/newrelic/infinite_tracing/com_newrelic_trace_v1/v1.pb.go: protocol/infinite_tracing/v1.proto
282-
$(MAKE) vendor # Only build vendor stuff if v1.proto has changed. Otherwise
283-
# this rule will be triggered every time the daemon is built.
284-
$(VENDOR_PREFIX)/bin/protoc \
282+
protoc \
285283
-I=./protocol/infinite_tracing \
286284
--go_out="paths=source_relative,plugins=grpc:daemon/internal/newrelic/infinite_tracing/com_newrelic_trace_v1" \
287285
protocol/infinite_tracing/v1.proto
@@ -403,7 +401,7 @@ coverage:
403401
#
404402

405403
.PHONY: clean
406-
clean: agent-clean axiom-clean daemon-clean package-clean coverage-clean vendor-clean
404+
clean: agent-clean axiom-clean daemon-clean package-clean coverage-clean
407405
rm -rf releases
408406
rm -f agent/newrelic.map agent/LicenseData/license_errors.txt
409407

@@ -441,21 +439,14 @@ lasp-test-all:
441439
$(MAKE) lasp-test SUITE_LASP=suite-random-3
442440

443441
#
444-
# Vendored libraries
442+
# Check for protobuf-c (HAVE_PROTOBUF_C):
443+
# - axiom build needs protoc-c (protobuf-c-compiler)
444+
# - agent build needs protobuf-c static library (protobuf-c-devel)
445445
#
446-
export GIT
447-
448-
.PHONY: vendor vendor-clean
446+
.PHONY: protobuf-c
447+
protobuf-c:
449448
ifeq (0,$(HAVE_PROTOBUF_C))
450-
vendor:
451-
$(MAKE) -C vendor all
452-
453-
vendor-clean:
454-
$(MAKE) -C vendor clean
455-
else
456-
vendor: ;
457-
458-
vendor-clean: ;
449+
$(error Build dependency 'protobuf-c' not found.)
459450
endif
460451

461452
#

THIRD_PARTY_NOTICES.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ by e-mailing [[email protected]](mailto:[email protected]).
2323
* [PCRE](#pcre)
2424
* [PHP](#php)
2525
* [Portable OpenSSH](#portable-openssh)
26+
* [protobuf-c](#protobuf-c)
2627
* [TSRM](#tsrm)
2728
* [Symfony](#symfony)
2829

@@ -895,6 +896,46 @@ under
895896
*/
896897
```
897898

899+
## protobuf-c
900+
901+
This product includes [protobuf-c]https://github.com/protobuf-c/protobuf-c) ([v1.3.3](https://github.com/protobuf-c/protobuf-c/tree/v1.3.3)),
902+
distributed under the [protobuf-c license](https://github.com/protobuf-c/protobuf-c/blob/v1.3.3/LICENSE):
903+
904+
```
905+
Copyright (c) 2008-2016, Dave Benson and the protobuf-c authors.
906+
All rights reserved.
907+
908+
Redistribution and use in source and binary forms, with or without
909+
modification, are permitted provided that the following conditions are
910+
met:
911+
912+
* Redistributions of source code must retain the above copyright
913+
notice, this list of conditions and the following disclaimer.
914+
915+
* Redistributions in binary form must reproduce the above
916+
copyright notice, this list of conditions and the following disclaimer
917+
in the documentation and/or other materials provided with the
918+
distribution.
919+
920+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
921+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
922+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
923+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
924+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
925+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
926+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
927+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
928+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
929+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
930+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
931+
932+
The code generated by the protoc-gen-c code generator and by the
933+
protoc-c compiler is owned by the owner of the input files used when
934+
generating it. This code is not standalone and requires a support
935+
library to be linked with it. This support library is covered by the
936+
above license.
937+
```
938+
898939
## TSRM
899940

900941
This product includes source derived from

axiom/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ nr_config.h: configure Makefile
195195
#
196196
# Build the 8T protobuf code.
197197
#
198-
v1.pb-c.c: v1.proto
198+
v1.pb-c.c: v1.proto protobuf-c
199199
$(PROTOBUF_C_PREFIX)/bin/protoc-c --c_out=. $<
200200

201201
#
@@ -205,6 +205,12 @@ v1.pb-c.c: v1.proto
205205
v1.pb-c.o: v1.pb-c.c
206206
$(CC) $(AXIOM_CPPFLAGS) $(CPPFLAGS) $(AXIOM_CFLAGS) $(PCRE_CFLAGS) $(VENDOR_CFLAGS) $(CFLAGS) -MMD -MP -Wno-cast-qual -c $< -o $@
207207

208+
.PHONY: protobuf-c
209+
protobuf-c:
210+
ifeq (0,$(HAVE_PROTOBUF_C))
211+
$(error Build dependency 'protobuf-c' not found.)
212+
endif
213+
208214
#
209215
# Track the flags passed to the compiler to force a rebuild when they change.
210216
# This ensures a rebuild occurs when the version number or commit are updated.

docs/development.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,14 @@ Currently, the PHP agent has only been developed and compiled on Linux systems.
1212

1313
#### Operating Systems
1414
- Fully supported for building from source
15-
- Ubuntu 16.04+
16-
- CentOS/RHEL 7+
17-
- Supported in binary form only (may require experimentation to build)
18-
- FreeBSD
15+
- Debian/Ubuntu LTS
1916
- Alpine Linux
20-
- AWS Linux 2
21-
- Any Linux with Kernel >=2.6.26 and `glibc` >=2.5 (or `musl libc` >= 1.1)
17+
- CentOS/RHEL 7+
2218

2319
#### Build system dependencies
2420
- `build-essential` on Debian systems, `"Development Tools"` group on RHEL systems, equivalent packages on other supported systems for `make`, `cmake`, `gcc`, etc.
2521
- `valgrind` is extensively in the test suite
22+
- `protoc-c` (protobuf-c-compiler) is needed to build the agent
2623

2724
#### Go
2825

@@ -42,6 +39,7 @@ Install the [latest version of Go](https://golang.org/dl/). Typically it's insta
4239
- `libxslt`
4340
- `openssl`
4441
- `pcre`
42+
- `protobuf-c` (`libprotobuf-c-dev` on Debian systems, `protobuf-c-devel` on RHEL systems)
4543
- `zlib`
4644

4745
#### Application development headers
@@ -54,6 +52,7 @@ _(most operating systems package these with `-dev` or `-devel` suffixes)_
5452
- `php`
5553
- `postgresql`
5654
- `sqlite`
55+
- `protobuf-c` (`libprotobuf-c-dev` on Debian systems, `protobuf-c-devel` on RHEL systems)
5756

5857

5958
### PHP

files/Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
4444
libmcrypt-dev \
4545
libonig-dev \
4646
libpcre3 libpcre3-dev \
47+
# 8T protobuf code in axiom depends on libprotobuf-c library
48+
libprotobuf-c-dev \
4749
libreadline-dev \
4850
libssl-dev \
4951
libsqlite3-dev \
@@ -52,6 +54,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
5254
locales \
5355
locales-all \
5456
netcat-openbsd \
57+
# needed to generate 8T protobuf code in daemon
58+
protobuf-compiler \
59+
# needed to generate 8T protobuf code in axiom
60+
protobuf-c-compiler \
5561
python3-yaml \
5662
${PHP_USER_SPECIFIED_PACKAGES} \
5763
zlib1g-dev

make/config.mk

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,6 @@ ifneq ($(findstring environment,$(origin PROTOBUF_C_PREFIX)), )
5959
ifeq ($(HAVE_PROTOBUF_C), 0)
6060
$(error User provided 'protobuf-c' installation is not valid!)
6161
endif
62-
else
63-
ifeq ($(HAVE_PROTOBUF_C), 0)
64-
$(info 'protobuf-c' installation not found, falling back to building from vendor subdir.)
65-
endif
6662
endif
6763

6864

make/vendor.mk

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,8 @@
1111
# It is recommended to use the VENDOR_... variables.
1212
#
1313

14-
# We need to find where the project's vendored dependencies live for these
15-
# variables.
16-
ifeq (0,$(HAVE_PROTOBUF_C))
17-
PROTOBUF_C_PREFIX := $(realpath $(dir $(abspath $(lastword $(MAKEFILE_LIST))))../vendor)/local
18-
endif
19-
20-
#
21-
# protobuf-c
2214
#
23-
# Note that this does not require protobuf, which is a build time dependency
24-
# only.
15+
# protobuf-c: 8T protobuf code from axiom needs protobuf-c library
2516
#
2617
PROTOBUF_C_CFLAGS := -I$(PROTOBUF_C_PREFIX)/include
2718
PROTOBUF_C_LDFLAGS := -L$(PROTOBUF_C_PREFIX)/lib

trivy.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ scan:
66
scanners:
77
- vuln
88
- misconfig
9-
skip-dirs: vendor
109

1110
severities:
1211
- CRITICAL

vendor/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)