kong
kong copied to clipboard
fix(build): hermetic install of files after build
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_filterwhen install. - Add or modify a target to install is easier and doesn't involve bash-fu.
- Developer can use individual
//build:install-xxtarget to only build and install selectd components, like//build:install-openrestyonly install openresty and openssl and skip luarocks etc.
Other noticable changes:
- Also a new
//build:dev-make-openrestytarget is added so that developer can use it to invokemakedirectly for openresty development. - Lua files and C extensions that are not installed by luarocks are now installed into
PREFIX/openresty/site/lualibwhere 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
good run https://github.com/Kong/kong/actions/runs/8964918449/job/24617728938?pr=12882
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
This was cherrypicked in https://github.com/Kong/kong-ee/pull/8843