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

refactor(build): hermetic install of files after build #12882

Merged
merged 3 commits into from May 15, 2024
Merged

Conversation

fffonion
Copy link
Contributor

@fffonion fffonion commented Apr 19, 2024

Refactor the giant bash blob in //build:kong target to Bazel rules that each output files are tracked. So that:

  • We won't accidently copy extra files if upstream projects change.
  • We don't accidently overwrite files between targets (error will occur).
  • Use the actual Output files lists (from foreign_cc rule or genrule as the source) truth to determine what files to install. For example, we simply don't output headers if not needed, instead of copy_with_filter when install.
  • Add or modify a target to install is easier and doesn't involve bash-fu.
  • Developer can use individual //build:install-xx target to only build and install selectd components, like //build:install-openresty only install openresty and openssl and skip luarocks etc.

Other noticable changes:

  • Also a new //build:dev-make-openresty target is added so that developer can use it to invoke make directly for openresty development.
  • Lua files and C extensions that are not installed by luarocks are now installed into PREFIX/openresty/site/lualib where typically PREFIX is /usr/local. This is to avoid collide with openresty bundled files (PREFIX/openresty/lualib), where those files used to be installed under.
  • Bumps atc-router to v1.6.2:

KAG-4290

Needs Kong/atc-router#219

@github-actions github-actions bot added build/bazel cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee labels Apr 19, 2024
@fffonion fffonion force-pushed the bazel-install branch 2 times, most recently from bece329 to 13a5b62 Compare April 19, 2024 00:48
@github-actions github-actions bot added the chore Not part of the core functionality of kong, but still needed label Apr 19, 2024
@fffonion fffonion changed the base branch from master to bazel-improv April 19, 2024 01:22
@fffonion fffonion force-pushed the bazel-install branch 6 times, most recently from bf3e516 to be904bb Compare April 19, 2024 03:24
Base automatically changed from bazel-improv to master April 19, 2024 05:50
build/build_system.bzl Outdated Show resolved Hide resolved
build/build_system.bzl Outdated Show resolved Hide resolved
build/build_system.bzl Outdated Show resolved Hide resolved
build/build_system.bzl Show resolved Hide resolved
.requirements Outdated Show resolved Hide resolved
@fffonion fffonion force-pushed the bazel-install branch 5 times, most recently from 2b6950f to cb1b021 Compare April 22, 2024 14:27
@fffonion fffonion force-pushed the bazel-install branch 3 times, most recently from d49b409 to ba8774d Compare April 25, 2024 11:52
@fffonion fffonion force-pushed the bazel-install branch 2 times, most recently from bbc175b to 56fb9f9 Compare May 6, 2024 03:35
@fffonion
Copy link
Contributor Author

fffonion commented May 6, 2024

@fffonion fffonion changed the title fix(build): hermetic install of files after build refactor(build): hermetic install of files after build May 13, 2024
@fffonion fffonion force-pushed the bazel-install branch 2 times, most recently from 5926569 to 02badc6 Compare May 15, 2024 08:25
@fffonion fffonion merged commit 3f7b381 into master May 15, 2024
25 checks passed
@fffonion fffonion deleted the bazel-install branch May 15, 2024 08:59
@team-gateway-bot
Copy link
Collaborator

Cherry-pick failed for master, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally.

git remote add upstream https://github.com/kong/kong-ee
git fetch upstream master
git worktree add -d .worktree/cherry-pick-12882-to-master-to-upstream upstream/master
cd .worktree/cherry-pick-12882-to-master-to-upstream
git checkout -b cherry-pick-12882-to-master-to-upstream
ancref=$(git merge-base 204dd8ddb406399473073e0bb263c4531f409a43 c014a3397c64a7bc9a515fb5cd520e38087a454f)
git cherry-pick -x $ancref..c014a3397c64a7bc9a515fb5cd520e38087a454f

@github-actions github-actions bot added the incomplete-cherry-pick A cherry-pick was incomplete and needs manual intervention label May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build/bazel cherry-pick kong-ee schedule this PR for cherry-picking to kong/kong-ee chore Not part of the core functionality of kong, but still needed incomplete-cherry-pick A cherry-pick was incomplete and needs manual intervention size/XL skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants