Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bazel: foundation #20849

Merged
merged 169 commits into from
Jul 11, 2024
Merged

bazel: foundation #20849

merged 169 commits into from
Jul 11, 2024

Conversation

dotnwat
Copy link
Member

@dotnwat dotnwat commented Jul 4, 2024

Bazel build foundation.

This builds all dependencies from source, along with a solid chunk of our foundational libraries (container, bytes, model, utils, net, rpc, etc...), but doesn't build the final redpanda binary.

The idea behind merging this now is that with CI running (see GHA checks) we can lock-in the progress here. If we were to not merge, then as build coverage increased in the development branch, we would be increasingly chasing and fixing regressions created in upstream.

Best to review all commits combined. The argument for not squashing all these commits is that they contain quite a lot of good information, including some work that was replaced as development proceeded (e.g. openssl replacing dependencies) but which is useful to have in the historical log.

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v24.1.x
  • v23.3.x
  • v23.2.x

Release Notes

  • none

Signed-off-by: Noah Watkins <[email protected]>
Signed-off-by: Noah Watkins <[email protected]>
Signed-off-by: Noah Watkins <[email protected]>
Useful for passing in BOOST_TEST_MODULE=foo to add a main().

Signed-off-by: Noah Watkins <[email protected]>
Signed-off-by: Noah Watkins <[email protected]>
The config option `--@seastar//:numa=True` didn't read very intuitively,
so changed it to `numactl`.

Signed-off-by: Noah Watkins <[email protected]>
Signed-off-by: Noah Watkins <[email protected]>
@dotnwat dotnwat requested review from michael-redpanda and a team as code owners July 9, 2024 04:23
@dotnwat dotnwat requested review from gousteris, mmaslankaprv, StephanDollberg, rockwotj, andrwng and c4milo and removed request for a team and gousteris July 9, 2024 04:23
exit 1
fi

deb_deps=(
Copy link
Member

@c4milo c4milo Jul 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For these is where rules-nixpkg/nixpkgs_package or devenv/devbox could be handy in terms of determinism.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah right on. is anyone using these?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We use devenv in Cloud to stand up the entire stack in our laptops. DevProd is using devbox.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH it's better to move all tools into Bazel - I don't think that's a huge lift for this list. nixpkg is a fair amount of complexity, and I've had problems with clang toolchains and such not having a good development environment because of all the extra flags they inject to make things hermetic.

dotnwat and others added 5 commits July 10, 2024 07:00
Copy link
Contributor

@rockwotj rockwotj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks really nice, first full round of review/feedback.

MODULE.bazel Show resolved Hide resolved
MODULE.bazel Show resolved Hide resolved
MODULE.bazel Show resolved Hide resolved
use_repo(non_module_dependencies, "numactl")
use_repo(non_module_dependencies, "openssl")
use_repo(non_module_dependencies, "openssl-fips")
use_repo(non_module_dependencies, "rapidjson")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The published version appears to be too old. I added a note into MODULE.bazel.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SG - FWIW you can override the version much like we are doing for the compilation commands database generator

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SG - FWIW you can override the version much like we are doing for the compilation commands database generator

i see this pattern, and it always seems super sketchy. like, IIUC, it effectively uses the BUILD files from BCR and source files from whatever version you swap in for the override? i mean, it works fine for a header-only library, assuming that the BUILD uses globbing. Generally I'd want the BUILD to be perfectly in sync with the source...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, maybe we should just be proposing updates upstream. Let me read about how dependency resolution works with non modules

MODULE.bazel Show resolved Hide resolved
src/v/crypto/BUILD Show resolved Hide resolved
src/v/ssx/BUILD Outdated Show resolved Hide resolved
src/v/ssx/BUILD Outdated Show resolved Hide resolved
src/v/ssx/BUILD Outdated Show resolved Hide resolved
src/v/utils/BUILD Outdated Show resolved Hide resolved
@vbotbuildovich
Copy link
Collaborator

new failures in https://buildkite.com/redpanda/redpanda/builds/51320#01909d77-59ec-4b8b-9a11-2f7f47141d4d:

"rptest.transactions.tx_admin_api_test.TxAdminTest.test_mark_transaction_expired"

@vbotbuildovich
Copy link
Collaborator

Copy link
Contributor

@rockwotj rockwotj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

"include/bytes/iobuf.h",
],
strip_include_prefix = "include",
visibility = ["//visibility:public"],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW instead of making everything public, you can also make public the default.

package(
  default_visibility = ["//visibility:public"],
)

https://bazel.build/reference/be/functions#package

Also at somepoint we probably want to limit visibility, but it's probably fine for now.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ahh right. honestly after this PR merges I think it's gonna be open season on evolving the Bazel build. Hopefully we put down a solid foundation!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a good foundation - I am happy to merge and help tweak stuff as we go along.

@dotnwat dotnwat merged commit 42ebcfc into dev Jul 11, 2024
21 checks passed
@dotnwat dotnwat deleted the bazel branch July 11, 2024 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants