Skip to content

Commit 6d2ec95

Browse files
Jens-Gclaude
andcommitted
Tune make dist: drop generated/build artifacts, add missing sources
Adjust what "make dist" ships in the release tarball. Dropped (build output and generated code that a built tree leaves behind, swept in via whole-directory EXTRA_DIST entries and pruned in dist-hook; none of it is tracked, so a clean checkout never contained it): - lib/haxe/test/{bin,gen-haxe}, lib/javame/gen-javame - lib/netstd bin/obj/gen-netstd across the test and benchmark projects - test/netstd/{Client,Server}/ThriftTest - tutorial/netstd/Interfaces/{shared,tutorial} (tracked project scaffolding is kept so the tutorial still builds from the tarball) - test/cpp/gen-cpp* (nodist generated sources) - build/__pycache__ and stray *.pyc Also no longer shipped: the .github/ CI configuration and doc/thrift-threat-model.md. Added (tracked sources that were missing from EXTRA_DIST): - lib/lua/test/{RecursionDepth.thrift,test_recursion_depth.lua} - lib/netstd/Tests/codegen/run-NetStd-Codegen-Tests.ps1 - test/JsRecursionDepthTest.thrift - lib/php/{phpstan.neon,phpstan-baseline.neon} - SECURITY.md Verified end-to-end with make dist in a clean container: 4317 -> 3480 tarball entries, and the only tracked files removed are .github/* and doc/thrift-threat-model.md. Client: netstd,haxe,javame,lua,php,cpp Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 4f303a2 commit 6d2ec95

9 files changed

Lines changed: 38 additions & 8 deletions

File tree

‎Makefile.am‎

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ dist-hook:
6666
find $(distdir) -type d \( -iname ".deps" -or -iname ".libs" \) | xargs rm -rf
6767
find $(distdir) -type d \( -iname ".svn" -or -iname ".git" \) | xargs rm -rf
6868
find $(distdir) -type d -name node_modules -prune -exec rm -rf {} +
69+
find $(distdir) -type d -name __pycache__ -prune -exec rm -rf {} +
70+
find $(distdir) -type f -name "*.pyc" -exec rm -f {} +
71+
rm -f $(distdir)/doc/thrift-threat-model.md
6972

7073
print-version:
7174
@echo $(PACKAGE_VERSION)
@@ -143,13 +146,6 @@ EXTRA_DIST = \
143146
.flake8 \
144147
.gitattributes \
145148
.gitignore \
146-
.github/dependabot.yml \
147-
.github/pull_request_template.md \
148-
.github/stale.yml \
149-
.github/workflows/build.yml \
150-
.github/workflows/cmake.yml \
151-
.github/workflows/pypi.yml \
152-
.github/workflows/release_rust.yml \
153149
.travis.yml \
154150
ApacheThrift.nuspec \
155151
AGENTS.md \
@@ -178,5 +174,6 @@ EXTRA_DIST = \
178174
package-lock.json \
179175
phpcs.xml.dist \
180176
README.md \
177+
SECURITY.md \
181178
rust-toolchain \
182179
sonar-project.properties

‎lib/Makefile.am‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,12 @@ endif
101101
distdir:
102102
$(MAKE) $(AM_MAKEFLAGS) distdir-am
103103

104+
# The libs below ship as whole directories, which sweeps in generated code and
105+
# build output present in a built tree. Strip those from the distribution.
106+
dist-hook:
107+
rm -rf $(distdir)/haxe/test/bin $(distdir)/haxe/test/gen-haxe
108+
rm -rf $(distdir)/javame/gen-javame
109+
104110
EXTRA_DIST = \
105111
d \
106112
dart \

‎lib/lua/Makefile.am‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,6 @@ EXTRA_DIST = \
7373
TProtocol.lua \
7474
TServer.lua \
7575
TSocket.lua \
76-
TTransport.lua
76+
TTransport.lua \
77+
test/RecursionDepth.thrift \
78+
test/test_recursion_depth.lua

‎lib/netstd/Makefile.am‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,16 @@ clean-local:
6767
distdir:
6868
$(MAKE) $(AM_MAKEFLAGS) distdir-am
6969

70+
# Several test/benchmark projects ship as whole directories; strip the build
71+
# output and generated code that a built tree leaves behind.
72+
dist-hook:
73+
find $(distdir) -type d \( -name bin -o -name obj -o -name gen-netstd \) -prune -exec rm -rf {} +
74+
7075
EXTRA_DIST = \
7176
README.md \
7277
Directory.Build.props \
7378
Benchmarks/Thrift.Benchmarks \
79+
Tests/codegen/run-NetStd-Codegen-Tests.ps1 \
7480
Tests/Thrift.IntegrationTests/Protocols \
7581
Tests/Thrift.IntegrationTests/Thrift.IntegrationTests.csproj \
7682
Tests/Thrift.Compile.Tests \

‎lib/php/Makefile.am‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ EXTRA_DIST = \
140140
src/ext/thrift_protocol/php_thrift_protocol_arginfo.h \
141141
coding_standards.md \
142142
thrift_protocol.ini \
143+
phpstan.neon \
144+
phpstan-baseline.neon \
143145
phpunit.xml \
144146
README.apache.md \
145147
README.md \

‎test/Makefile.am‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ EXTRA_DIST = \
158158
index.html \
159159
Int64Test.thrift \
160160
JsDeepConstructorTest.thrift \
161+
JsRecursionDepthTest.thrift \
161162
keys/keygen/.gitignore \
162163
known_failures_Linux.json \
163164
ManyOptionals.thrift \

‎test/cpp/Makefile.am‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,10 @@ style-local:
260260
distdir:
261261
$(MAKE) $(AM_MAKEFLAGS) distdir-am
262262

263+
# The gen-cpp* trees are nodist generated sources; drop them from the dist.
264+
dist-hook:
265+
find $(distdir) -type d -name 'gen-cpp*' -prune -exec rm -rf {} +
266+
263267
EXTRA_DIST = \
264268
src/TestClient.cpp \
265269
src/TestServer.cpp \

‎test/netstd/Makefile.am‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ clean-local:
3535
distdir:
3636
$(MAKE) $(AM_MAKEFLAGS) distdir-am
3737

38+
# Client and Server ship as whole directories; strip the generated code and
39+
# build output a built tree leaves behind.
40+
dist-hook:
41+
rm -rf $(distdir)/Client/ThriftTest $(distdir)/Server/ThriftTest
42+
find $(distdir) -type d \( -name bin -o -name obj \) -prune -exec rm -rf {} +
43+
3844
EXTRA_DIST = \
3945
Client \
4046
README.md \

‎tutorial/netstd/Makefile.am‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ clean-local:
3434
distdir:
3535
$(MAKE) $(AM_MAKEFLAGS) distdir-am
3636

37+
# The projects ship as whole directories; strip the generated code and build
38+
# output a built tree leaves behind, keeping the tracked project scaffolding.
39+
dist-hook:
40+
rm -rf $(distdir)/Interfaces/shared $(distdir)/Interfaces/tutorial
41+
find $(distdir) -type d \( -name bin -o -name obj \) -prune -exec rm -rf {} +
42+
3743
EXTRA_DIST = \
3844
Client \
3945
Interfaces \

0 commit comments

Comments
 (0)