Skip to content

Commit 43d4b84

Browse files
committed
removed the windows vs non_windows dll_deps split. No need for that. Updated multitool.lock.json file
1 parent 3083fcd commit 43d4b84

File tree

5 files changed

+63
-196
lines changed

5 files changed

+63
-196
lines changed

BUILD

Lines changed: 44 additions & 115 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ otel_cc_library(
7373
visibility = ["//visibility:private"],
7474
deps = [
7575
"@otel_sdk//exporters/elasticsearch:es_log_record_exporter",
76-
#"@otel_sdk//exporters/etw:etw_exporter",
7776
"@otel_sdk//exporters/memory:in_memory_data",
7877
"@otel_sdk//exporters/memory:in_memory_metric_data",
7978
"@otel_sdk//exporters/memory:in_memory_metric_exporter_factory",
@@ -117,17 +116,14 @@ otel_cc_library(
117116
)
118117

119118
# Expands to all transitive project dependencies, excluding external projects (repos)
120-
[genquery(
121-
name = "otel_sdk_all_deps_" + os,
119+
genquery(
120+
name = "otel_sdk_all_deps",
122121
# The crude '^(@+otel_sdk[+~]?)?//' ignores external to otel_sdk repositories (e.g. @curl//, etc.) for which it's assumed we don't export dll symbols
123122
# In addition we exclude some internal libraries, that may have to be relinked by tests (like //sdk/src/common:random and //sdk/src/common/platform:fork)
124-
expression = "kind('cc_library',filter('^(@+otel_sdk[+~]?)?//',deps(@otel_sdk//:otel_sdk_deps) except set(@otel_sdk//:otel_sdk_deps @otel_sdk//sdk/src/common:random @otel_sdk//sdk/src/common/platform:fork " + exceptions + ")))",
123+
expression = "kind('cc_library',filter('^(@+otel_sdk[+~]?)?//',deps(@otel_sdk//:otel_sdk_deps) except set(@otel_sdk//:otel_sdk_deps @otel_sdk//sdk/src/common:random @otel_sdk//sdk/src/common/platform:fork)))",
125124
scope = ["@otel_sdk//:otel_sdk_deps"],
126125
strict = True,
127-
) for (os, exceptions) in [
128-
("non_windows", ""), #"@otel_sdk//exporters/etw:etw_exporter"),
129-
("windows", ""),
130-
]]
126+
)
131127

132128
[otel_cc_library(
133129
name = otel_sdk_binary + "_restrict_compilation_mode",
@@ -340,68 +336,40 @@ pkg_files(
340336
]]
341337

342338
[run_binary(
343-
name = otel_sdk_binary + "_make_src_bundle" + "_windows",
344-
srcs = [otel_sdk_binary + "_pdb_file"],
345-
outs = [otel_sdk_binary + ".src.zip"],
346-
args = [
347-
"debug-files",
348-
"bundle-sources",
349-
"$(execpath " + otel_sdk_binary + "_pdb_file" + ")",
350-
],
351-
target_compatible_with = select({
352-
"@platforms//os:windows": None,
353-
"//conditions:default": ["@platforms//:incompatible"],
354-
}),
355-
tool = "@multitool//tools/sentry-cli",
356-
) for otel_sdk_binary in [
357-
"otel_sdk_r",
358-
"otel_sdk_d",
359-
"otel_sdk_rd",
360-
]]
361-
362-
[run_binary(
363-
name = otel_sdk_binary + "_make_src_bundle" + "_non_windows",
339+
name = otel_sdk_binary + "_make_src_bundle",
364340
srcs = select({
341+
"@platforms//os:windows": [otel_sdk_binary + "_pdb_file"],
365342
"@platforms//os:macos": [otel_sdk_binary + "_dsym_file"],
366343
"//conditions:default": [otel_sdk_binary],
367344
}),
368-
outs = ["lib" + otel_sdk_binary + ".src.zip"],
345+
outs = [otel_sdk_binary + ".src.zip"],
369346
args = [
370347
"debug-files",
371348
"bundle-sources",
372349
"--log-level=trace",
373350
] + select({
351+
"@platforms//os:windows": ["$(execpath " + otel_sdk_binary + "_pdb_file" + ")"],
374352
"@platforms//os:macos": ["$(execpath " + otel_sdk_binary + "_dsym_file" + ")"],
375353
"//conditions:default": ["$(execpath " + otel_sdk_binary + ")"],
376354
}),
377-
tags = ["no-sandbox"],
378355
target_compatible_with = select({
356+
"@platforms//os:windows": None,
357+
"@platforms//os:linux": None,
358+
# "@platforms//os:macos": None,
379359
"@platforms//os:macos": ["@platforms//:incompatible"],
380-
"@platforms//os:windows": ["@platforms//:incompatible"],
381-
"//conditions:default": None,
360+
"//conditions:default": ["@platforms//:incompatible"],
382361
}),
362+
tags = ["no-sandbox"],
383363
tool = "@multitool//tools/sentry-cli",
384364
) for otel_sdk_binary in [
385365
"otel_sdk_r",
386366
"otel_sdk_d",
387367
"otel_sdk_rd",
388368
]]
389369

390-
[alias(
391-
name = otel_sdk_binary + "_make_src_bundle",
392-
actual = select({
393-
"@platforms//os:windows": otel_sdk_binary + "_make_src_bundle" + "_windows",
394-
"//conditions:default": otel_sdk_binary + "_make_src_bundle" + "_non_windows",
395-
}),
396-
) for otel_sdk_binary in [
397-
"otel_sdk_r",
398-
"otel_sdk_d",
399-
"otel_sdk_rd",
400-
]]
401-
402370
[pkg_files(
403371
name = otel_sdk_binary + "_src_bundle",
404-
srcs = [otel_sdk_binary], # + "_src_bundle_force"],
372+
srcs = [otel_sdk_binary + "_src_bundle_force"],
405373
prefix = otel_sdk_prefix,
406374
strip_prefix = pkg_strip_prefix.from_pkg(),
407375
) for otel_sdk_binary in [
@@ -434,41 +402,36 @@ pkg_files(
434402
("otel_sdk_rd", "reldeb/"),
435403
]]
436404

437-
# Group all files into one group
405+
# Declare all package files to be zipped
438406
pkg_filegroup(
439-
name = "otel_sdk_files",
407+
name = "otel_sdk_pkg_files",
440408
srcs = [
441409
"otel_sdk_header_files",
442410
"otel_sdk_d_lib_files",
443411
"otel_sdk_r_lib_files",
444412
"otel_sdk_rd_lib_files",
445413
] + select({
414+
# TODO: Get src_bundle working on MacOS!
446415
"@platforms//os:macos": [],
447416
"//conditions:default": [
448417
"otel_sdk_d_src_bundle",
449418
"otel_sdk_r_src_bundle",
450419
"otel_sdk_rd_src_bundle",
451420
],
421+
}) + select({
422+
# On Windows, the shared files are in the "bin" folder.
423+
"@platforms//os:windows": [
424+
"otel_sdk_d_bin_files",
425+
"otel_sdk_r_bin_files",
426+
"otel_sdk_rd_bin_files",
427+
],
428+
"//conditions:default": [],
452429
}),
453430
)
454431

455-
# On windows we have .dll files in bin/, and import .lib files in lib/
456-
# On linux/mac we have only .so/.dylib files in lib/ only.
457-
pkg_filegroup(
458-
name = "otel_sdk_files_windows",
459-
srcs = [
460-
"otel_sdk_d_bin_files",
461-
"otel_sdk_r_bin_files",
462-
"otel_sdk_rd_bin_files",
463-
],
464-
)
465-
466432
pkg_zip(
467433
name = "otel_sdk_zip",
468-
srcs = ["otel_sdk_files"] + select({
469-
"@platforms//os:windows": ["otel_sdk_files_windows"],
470-
"//conditions:default": [],
471-
}),
434+
srcs = ["otel_sdk_pkg_files"],
472435
out = "otel_sdk.zip",
473436
tags = ["manual"],
474437
)
@@ -481,42 +444,32 @@ write_source_file(
481444
tags = ["manual"],
482445
)
483446

484-
[otel_cc_binary(
485-
name = "dll_deps_update_binary_" + os,
447+
otel_cc_binary(
448+
name = "dll_deps_update_binary",
486449
srcs = ["dll_deps_update.cc"],
487-
data = ["otel_sdk_all_deps_" + os],
488-
local_defines = ['DEPS_FILE=\\"$(rlocationpath otel_sdk_all_deps_' + os + ')\\"'],
450+
data = ["otel_sdk_all_deps"],
451+
local_defines = ['DEPS_FILE=\\"$(rlocationpath otel_sdk_all_deps)\\"'],
489452
deps = ["@bazel_tools//tools/cpp/runfiles"],
490-
) for os in [
491-
"non_windows",
492-
"windows",
493-
]]
453+
)
494454

495-
[run_binary(
496-
name = "dll_deps_update_run_" + os,
497-
srcs = [":otel_sdk_all_deps_" + os],
498-
outs = ["dll_deps_generated_internally_" + os + ".bzl"],
499-
args = ["$(execpath dll_deps_generated_internally_" + os + ".bzl)"],
500-
tool = "dll_deps_update_binary_" + os,
501-
) for os in [
502-
"non_windows",
503-
"windows",
504-
]]
455+
run_binary(
456+
name = "dll_deps_update_run",
457+
srcs = [":otel_sdk_all_deps"],
458+
outs = ["dll_deps_generated_internally.bzl"],
459+
args = ["$(execpath dll_deps_generated_internally.bzl)"],
460+
tool = "dll_deps_update_binary",
461+
)
505462

506463
# To update the dll_deps_generated.bzl files, do this:
507-
# bazel run dll_deps_update_windows
508-
# bazel run dll_deps_update_non_windows
509-
[write_source_file(
510-
name = "dll_deps_update_" + os,
511-
in_file = "dll_deps_generated_internally_" + os + ".bzl",
464+
# bazel run dll_deps_update
465+
write_source_file(
466+
name = "dll_deps_update",
467+
in_file = "dll_deps_generated_internally.bzl",
512468
# KLUDGE: Append repo.name() when this rule is ran outside of this repo, then it would be `otel_sdk+`
513469
# Having it this way, it'll allow dll_deps_generated_windows.bzl to be visible again.
514470
# When this target is used from another repo, then the "dll_deps_generated_windows.bzl" file can't be found
515-
out_file = repo_name().replace("+", "_") + "dll_deps_generated_" + os + ".bzl",
516-
) for os in [
517-
"non_windows",
518-
"windows",
519-
]]
471+
out_file = repo_name().replace("+", "_") + "dll_deps_generated.bzl",
472+
)
520473

521474
native_binary(
522475
name = "perses",
@@ -540,30 +493,6 @@ native_binary(
540493

541494
exports_files(["asan_ignorelist.txt"])
542495

543-
#exports_files("multitool.lock.json")
544-
545-
# copy_file(
546-
# name = "copy_multitool_json",
547-
# src = "multitool.json",
548-
# out = "multitool.lock.json",
549-
# )
550-
551-
# copy_to_bin(
552-
# name = "copy_to_bin",
553-
# srcs = ["multitool.lock.json"],
554-
# )
555-
556-
# run_binary(
557-
# name = "multitool-update",
558-
# outs = ["multitool.lock.json"],
559-
# args = [
560-
# # "--lockfile",
561-
# # "$(execpath multitool.lock.json)",
562-
# "update",
563-
# ],
564-
# tool = "@multitool//tools/multitool",
565-
# )
566-
567496
platform(
568497
name = "x64_windows-clang-cl",
569498
constraint_values = [

dll_deps.bzl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
load("@otel_sdk//:dll_deps_generated_windows.bzl", dll_deps_windows = "DLL_DEPS")
1+
load("@otel_sdk//:dll_deps_generated.bzl", "DLL_DEPS")
22

33
# Filter libs that were compiled into the the otel_sdk.dll already
44
def _filter_libs(deps):
55
""" Removes references to the api/sdk/exporters/ext static libraries """
66
filtered_dll_deps = []
7-
8-
#dll_deps = dll_deps_windows
97
for dep in deps:
108
label = native.package_relative_label(dep)
11-
if not label in dll_deps_windows:
9+
if not label in DLL_DEPS:
1210
filtered_dll_deps.append(dep)
1311
return filtered_dll_deps
1412

dll_deps_generated_windows.bzl

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

multitool.lock.json

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -270,38 +270,45 @@
270270
"binaries": [
271271
{
272272
"kind": "file",
273-
"url": "https://github.com/getsentry/sentry-cli/releases/download/3.0.0/sentry-cli-Linux-aarch64",
274-
"sha256": "815686a698e60e41a34035a00a0f11194db266e4b92259b979254a51eaf7bc12",
273+
"url": "https://github.com/getsentry/sentry-cli/releases/download/3.0.1/sentry-cli-Linux-aarch64",
274+
"sha256": "5eaa180ae11e63af80cab6303a8d223dddb7dcea7c0a7c933b26fa91b54c9cf6",
275275
"os": "linux",
276276
"cpu": "arm64"
277277
},
278278
{
279279
"kind": "file",
280-
"url": "https://github.com/getsentry/sentry-cli/releases/download/3.0.0/sentry-cli-Linux-x86_64",
281-
"sha256": "460d2053f273fdbd26d88ccb35965448447c4b3715ddc8c6b476a3d243e54430",
280+
"url": "https://github.com/getsentry/sentry-cli/releases/download/3.0.1/sentry-cli-Linux-x86_64",
281+
"sha256": "7cf53a2089fd5a6a9a0c2eb972d62c9c8eefea19dcdd5dd58604aa8bc4212538",
282282
"os": "linux",
283283
"cpu": "x86_64"
284284
},
285285
{
286286
"kind": "file",
287-
"url": "https://github.com/getsentry/sentry-cli/releases/download/3.0.0/sentry-cli-Darwin-arm64",
288-
"sha256": "3ef5233083cf2c6f37b3850bf6f970ef1770fb55d4911a1c36e53d0a540956f5",
287+
"url": "https://github.com/getsentry/sentry-cli/releases/download/3.0.1/sentry-cli-Darwin-arm64",
288+
"sha256": "bf6f18200b98f0a79bfbcff8b6b9a01b6960f52befb024616cb211f326f8ce23",
289289
"os": "macos",
290290
"cpu": "arm64"
291291
},
292292
{
293293
"kind": "file",
294-
"url": "https://github.com/getsentry/sentry-cli/releases/download/3.0.0/sentry-cli-Darwin-x86_64",
295-
"sha256": "627ee375b823459d31c1b3f84fed5a700d299cb34c699608379e57a43e8a7a3c",
294+
"url": "https://github.com/getsentry/sentry-cli/releases/download/3.0.1/sentry-cli-Darwin-x86_64",
295+
"sha256": "b641eb37c84993fbc4ef21b4bed499967c711035ecb85421f3ce9abe635b2499",
296296
"os": "macos",
297297
"cpu": "x86_64"
298298
},
299299
{
300300
"kind": "file",
301-
"url": "https://github.com/getsentry/sentry-cli/releases/download/3.0.0/sentry-cli-Windows-x86_64.exe",
302-
"sha256": "4acb63ef42e59f9e1aee920e0b399d1781a91f8f25b666b75313a4444ca6a3dc",
301+
"url": "https://github.com/getsentry/sentry-cli/releases/download/3.0.1/sentry-cli-Windows-x86_64.exe",
302+
"sha256": "a85b00f651ae73c345a75788378f31b210226193d54e421fe2d3974392af591b",
303303
"os": "windows",
304304
"cpu": "x86_64"
305+
},
306+
{
307+
"kind": "file",
308+
"url": "https://github.com/getsentry/sentry-cli/releases/download/3.0.1/sentry-cli-Windows-aarch64.exe",
309+
"sha256": "d57556d2e1cb4f52af367c1f23101dc30963e080c99cf670aec87001533265ed",
310+
"os": "windows",
311+
"cpu": "arm64"
305312
}
306313
]
307314
},

0 commit comments

Comments
 (0)