Skip to content

Commit 7f35eae

Browse files
authored
[vizdoom] remove legacy glibc version header hack (#364)
## Summary - Problem: ViZDoom still carried a legacy `glibc_version_header` shim that force-included a `glibc 2.17` header into multiple Bazel targets even though the current Linux release flow now targets `manylinux_2_28`. - Scope: Remove the external `glibc_version_header` repository, delete the local glue files under `third_party/glibc_version_header/`, and stop injecting that header throughout the ViZDoom third-party BUILD rules. This does not change the current manylinux baseline or broader release policy. - Outcome: ViZDoom builds no longer rely on the legacy glibc header hack, and the Bazel graph is smaller and easier to reason about. This diff removes an obsolete compatibility shim that no longer matches the repo's current Linux wheel baseline. ## Technical Details - Approach: Delete the `glibc_version_header` workspace dependency and strip all `@glibc_version_header//:glibc_2_17` src/tool references plus `-include ...glibc_2_17` copts from the ViZDoom BUILD graph. - Code pointers: - `third_party/vizdoom/vizdoom.BUILD`: removes all forced glibc header injection from ViZDoom helper binaries, libraries, and the main `vizdoom` target. - `envpool/workspace0.bzl`: removes the now-unused external archive for `glibc_version_header`. - Notes: The current release flow already builds Linux wheels in `manylinux_2_28`, so keeping a separate glibc-2.17 header shim was inconsistent with the actual supported baseline. ## Test Plan ### Automated - `buildifier envpool/workspace0.bzl third_party/vizdoom/vizdoom.BUILD`: passed - `bazel build @vizdoom//:zipdir`: passed - `bazel build @vizdoom//:vizdoom`: reached the SDL2 `rules_foreign_cc` build and then failed due to a pre-existing local macOS sandbox issue (`cmake: command not found` inside the Bazel sandbox), not due to missing `glibc_version_header` references ### Suggested Manual - `bazel build @vizdoom//:vizdoom` in Linux CI or a Linux dev environment with the expected foreign_cc toolchain available: verify the full ViZDoom binary still builds cleanly - Release wheel smoke on Linux: verify ViZDoom packaging still works without the removed header shim
1 parent 1fd578b commit 7f35eae

5 files changed

Lines changed: 10 additions & 146 deletions

File tree

envpool/workspace0.bzl

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -193,17 +193,6 @@ def workspace():
193193
],
194194
)
195195

196-
maybe(
197-
http_archive,
198-
name = "glibc_version_header",
199-
sha256 = "57db74f933b7a9ea5c653498640431ce0e52aaef190d6bb586711ec4f8aa2b9e",
200-
strip_prefix = "glibc_version_header-0.1/version_headers/",
201-
urls = [
202-
"https://github.com/wheybags/glibc_version_header/archive/refs/tags/0.1.tar.gz",
203-
],
204-
build_file = "//third_party/glibc_version_header:glibc_version_header.BUILD",
205-
)
206-
207196
maybe(
208197
http_archive,
209198
name = "concurrentqueue",

third_party/glibc_version_header/BUILD

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

third_party/glibc_version_header/glibc_version_header.BUILD

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

third_party/glibc_version_header/noop.h

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

third_party/vizdoom/vizdoom.BUILD

Lines changed: 10 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,7 @@ config_setting(
3030

3131
cc_binary(
3232
name = "arithchk",
33-
srcs = [
34-
"gdtoa/arithchk.c",
35-
"@glibc_version_header//:glibc_2_17",
36-
],
37-
copts = [
38-
"-include $(execpath @glibc_version_header//:glibc_2_17)",
39-
],
33+
srcs = ["gdtoa/arithchk.c"],
4034
)
4135

4236
genrule(
@@ -52,10 +46,6 @@ cc_binary(
5246
srcs = [
5347
"gdtoa/qnan.c",
5448
":arith.h",
55-
"@glibc_version_header//:glibc_2_17",
56-
],
57-
copts = [
58-
"-include $(execpath @glibc_version_header//:glibc_2_17)",
5949
],
6050
)
6151

@@ -75,17 +65,13 @@ cc_library(
7565
"gdtoa/misc.c",
7666
":arith.h",
7767
":gd_qnan.h",
78-
] + select({
79-
"@envpool//:windows": [],
80-
"//conditions:default": ["@glibc_version_header//:glibc_2_17"],
81-
}),
68+
],
8269
hdrs = glob(["gdtoa/*.h"]),
8370
copts = select({
8471
"@envpool//:windows": [],
8572
"//conditions:default": [
8673
"-Wall",
8774
"-Wextra",
88-
"-include $(execpath @glibc_version_header//:glibc_2_17)",
8975
],
9076
}) + [
9177
"-DINFNAN_CHECK",
@@ -104,10 +90,7 @@ cc_library(
10490
"bzip2/decompress.c",
10591
"bzip2/huffman.c",
10692
"bzip2/randtable.c",
107-
] + select({
108-
"@envpool//:windows": [],
109-
"//conditions:default": ["@glibc_version_header//:glibc_2_17"],
110-
}),
93+
],
11194
hdrs = glob([
11295
"bzip2/*.h",
11396
]),
@@ -119,7 +102,6 @@ cc_library(
119102
"-Wall",
120103
"-Wextra",
121104
"-fomit-frame-pointer",
122-
"-include $(execpath @glibc_version_header//:glibc_2_17)",
123105
],
124106
}),
125107
strip_include_prefix = "bzip2",
@@ -150,7 +132,7 @@ cc_library(
150132
"lzma/C/LzFindMt.c",
151133
"lzma/C/Threads.c",
152134
],
153-
"//conditions:default": ["@glibc_version_header//:glibc_2_17"],
135+
"//conditions:default": [],
154136
}),
155137
hdrs = glob([
156138
"lzma/C/*.h",
@@ -164,7 +146,6 @@ cc_library(
164146
"-Wall",
165147
"-Wextra",
166148
"-fomit-frame-pointer",
167-
"-include $(execpath @glibc_version_header//:glibc_2_17)",
168149
],
169150
}),
170151
strip_include_prefix = "lzma/C",
@@ -182,23 +163,13 @@ cc_binary(
182163
"tools/re2c/scanner.cc",
183164
"tools/re2c/substr.cc",
184165
"tools/re2c/translate.cc",
185-
"@glibc_version_header//:glibc_2_17",
186166
] + glob(["tools/re2c/*.h"]),
187-
copts = [
188-
"-DHAVE_CONFIG_H",
189-
"-include $(execpath @glibc_version_header//:glibc_2_17)",
190-
],
167+
copts = ["-DHAVE_CONFIG_H"],
191168
)
192169

193170
cc_binary(
194171
name = "lemon",
195-
srcs = [
196-
"tools/lemon/lemon.c",
197-
"@glibc_version_header//:glibc_2_17",
198-
],
199-
copts = [
200-
"-include $(execpath @glibc_version_header//:glibc_2_17)",
201-
],
172+
srcs = ["tools/lemon/lemon.c"],
202173
)
203174

204175
genrule(
@@ -244,10 +215,7 @@ cc_library(
244215
"dumb/**/*.h",
245216
"dumb/**/*.c",
246217
"dumb/**/*.inc",
247-
]) + select({
248-
"@envpool//:windows": [],
249-
"//conditions:default": ["@glibc_version_header//:glibc_2_17"],
250-
}),
218+
]),
251219
hdrs = glob([
252220
"dumb/include/*.h",
253221
]),
@@ -260,7 +228,6 @@ cc_library(
260228
"-Wno-pointer-sign",
261229
"-Wno-uninitialized",
262230
"-Wno-unused-but-set-variable",
263-
"-include $(execpath @glibc_version_header//:glibc_2_17)",
264231
],
265232
}),
266233
includes = [
@@ -273,10 +240,7 @@ cc_library(
273240
srcs = glob([
274241
"game-music-emu/gme/*.cpp",
275242
"game-music-emu/gme/*.h",
276-
]) + select({
277-
"@envpool//:windows": [],
278-
"//conditions:default": ["@glibc_version_header//:glibc_2_17"],
279-
}),
243+
]),
280244
hdrs = [
281245
"game-music-emu/gme/gme.h",
282246
],
@@ -286,7 +250,6 @@ cc_library(
286250
"-DLIBGME_VISIBILITY",
287251
"-fvisibility=hidden",
288252
"-fvisibility-inlines-hidden",
289-
"-include $(execpath @glibc_version_header//:glibc_2_17)",
290253
],
291254
}),
292255
strip_include_prefix = "game-music-emu",
@@ -382,16 +345,12 @@ cc_library(
382345
"src/*.h",
383346
]) + [
384347
"src/oplsynth/fmopl.cpp",
385-
] + select({
386-
"@envpool//:windows": [],
387-
"//conditions:default": ["@glibc_version_header//:glibc_2_17"],
388-
}),
348+
],
389349
copts = select({
390350
"@envpool//:windows": [],
391351
"//conditions:default": [
392352
"-Dstricmp=strcasecmp",
393353
"-Dstrnicmp=strncasecmp",
394-
"-include $(execpath @glibc_version_header//:glibc_2_17)",
395354
],
396355
}) + select({
397356
"@envpool//:windows": [],
@@ -410,7 +369,6 @@ genrule(
410369
name = "iwadpicker_cocoa_o",
411370
srcs = glob(["src/**"]) + [
412371
":viz_version",
413-
"@glibc_version_header//:glibc_2_17",
414372
"@sdl2//:srcs",
415373
],
416374
outs = ["iwadpicker_cocoa.o"],
@@ -430,7 +388,6 @@ generated_dir=$$(dirname "$(execpath :viz_version)")
430388
-Iexternal/vizdoom/src/posix/sdl \
431389
-Iexternal/sdl2/include \
432390
-I"$${generated_dir}" \
433-
-include "$(execpath @glibc_version_header//:glibc_2_17)" \
434391
"$(location src/posix/osx/iwadpicker_cocoa.mm)" \
435392
-o "$@"
436393
""",
@@ -444,7 +401,6 @@ genrule(
444401
name = "i_system_mm_o",
445402
srcs = glob(["src/**"]) + [
446403
":viz_version",
447-
"@glibc_version_header//:glibc_2_17",
448404
"@sdl2//:srcs",
449405
],
450406
outs = ["i_system.mm.o"],
@@ -464,7 +420,6 @@ generated_dir=$$(dirname "$(execpath :viz_version)")
464420
-Iexternal/vizdoom/src/posix/sdl \
465421
-Iexternal/sdl2/include \
466422
-I"$${generated_dir}" \
467-
-include "$(execpath @glibc_version_header//:glibc_2_17)" \
468423
"$(location src/posix/sdl/i_system.mm)" \
469424
-o "$@"
470425
""",
@@ -491,14 +446,7 @@ cc_binary(
491446
name = "zipdir",
492447
srcs = [
493448
"tools/zipdir/zipdir.c",
494-
] + select({
495-
"@envpool//:windows": [],
496-
"//conditions:default": ["@glibc_version_header//:glibc_2_17"],
497-
}),
498-
copts = select({
499-
"@envpool//:windows": [],
500-
"//conditions:default": ["-include $(execpath @glibc_version_header//:glibc_2_17)"],
501-
}),
449+
],
502450
deps = [
503451
":bzip2",
504452
":lzma",
@@ -914,9 +862,6 @@ cc_binary(
914862
] + select({
915863
"@envpool//:windows": _VIZDOOM_WINDOWS_SRCS,
916864
"//conditions:default": _VIZDOOM_POSIX_SRCS,
917-
}) + select({
918-
"@envpool//:windows": [],
919-
"//conditions:default": ["@glibc_version_header//:glibc_2_17"],
920865
}),
921866
copts = [
922867
"-DNO_GTK=1",
@@ -943,7 +888,6 @@ cc_binary(
943888
"-Wno-deprecated-copy",
944889
"-Wno-stringop-truncation",
945890
"-Wno-cast-function-type",
946-
"-include $(execpath @glibc_version_header//:glibc_2_17)",
947891
],
948892
}) + select({
949893
"@envpool//:windows": [],

0 commit comments

Comments
 (0)