Skip to content

Commit

Permalink
rock: override built-in checks
Browse files Browse the repository at this point in the history
The ability to override built-in modules was introduced with [1].
After [1], checks is embedded to the core Tarantool. The ability to
override them with installed rock will make it possible to use old
Tarantool with new checks. Core Tarantool tests for master should be
fine after this patch, see [3].

1. tarantool/tarantool#7774
2. tarantool/tarantool#7726
3. tarantool/tarantool#8475
  • Loading branch information
DifferentialOrange committed Apr 19, 2023
1 parent 488d663 commit e7c507f
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 6 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ jobs:
with:
module-name: checks
version-pre-extraction-hook: |
local rock_utils = require('test.rock_utils')
rock_utils.remove_builtin('checks')
rock_utils.assert_nonbuiltin('checks')
require('test.rock_utils').assert_nonbuiltin('checks')
package:
# Skip pull request jobs when the source branch is in the same
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/push_rockspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ jobs:
with:
module-name: checks
version-pre-extraction-hook: |
local rock_utils = require('test.rock_utils')
rock_utils.remove_builtin('checks')
rock_utils.assert_nonbuiltin('checks')
require('test.rock_utils').assert_nonbuiltin('checks')
push-scm-rockspec:
runs-on: [ ubuntu-20.04 ]
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
### Changed

- Build rock with cmake.
- Override built-in checks, if installed.

## [3.2.0] - 2023-01-27
### Added
Expand Down
10 changes: 10 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,13 @@ install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}
DESTINATION ${TARANTOOL_INSTALL_LUADIR}
)

install(
FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.lua
DESTINATION ${TARANTOOL_INSTALL_LUADIR}/override
)

install(
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}
DESTINATION ${TARANTOOL_INSTALL_LUADIR}/override
)
2 changes: 2 additions & 0 deletions debian/tarantool-checks.install
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
checks.lua usr/share/tarantool/
checks usr/share/tarantool/
checks.lua usr/share/tarantool/override
checks usr/share/tarantool/override
6 changes: 6 additions & 0 deletions rpm/tarantool-checks.spec
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,18 @@ Easy, terse, readable and fast function arguments type checking.

%install
mkdir -p %{br_luapkgdir}
mkdir -p %{br_luapkgdir}/override
cp -av checks.lua %{br_luapkgdir}
cp -rv checks %{br_luapkgdir}
cp -av checks.lua %{br_luapkgdir}/override
cp -rv checks %{br_luapkgdir}/override

%files
%{luapkgdir}/checks.lua
%{luapkgdir}/checks
%{luapkgdir}/override/checks.lua
%{luapkgdir}/override/checks

%doc README.md
%{!?_licensedir:%global license %doc}
%license LICENSE
Expand Down

0 comments on commit e7c507f

Please sign in to comment.