@@ -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
438406pkg_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-
466432pkg_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
521474native_binary (
522475 name = "perses" ,
@@ -540,30 +493,6 @@ native_binary(
540493
541494exports_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-
567496platform (
568497 name = "x64_windows-clang-cl" ,
569498 constraint_values = [
0 commit comments