kong icon indicating copy to clipboard operation
kong copied to clipboard

fix(build): hermetic install of files after build

Open fffonion opened this issue 1 year ago • 1 comments

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:
    • chore(cargo): release v1.6.1 by @dndx in kong/atc-router#216
    • chore(build): add a new target to include lua files by @fffonion in kong/atc-router#219

KAG-4290

Needs https://github.com/Kong/atc-router/pull/219

fffonion avatar Apr 19 '24 00:04 fffonion

good run https://github.com/Kong/kong/actions/runs/8964918449/job/24617728938?pr=12882

fffonion avatar May 06 '24 06:05 fffonion

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

team-gateway-bot avatar May 15 '24 09:05 team-gateway-bot

This was cherrypicked in https://github.com/Kong/kong-ee/pull/8843

kikito avatar May 28 '24 08:05 kikito