From db45048d8ef4b527e60c56858a8589be4af59b0a Mon Sep 17 00:00:00 2001 From: Yuji Yamano Date: Fri, 28 Feb 2020 17:37:25 +0000 Subject: [PATCH 1/3] Remove mruby/build/* if mruby source is newer. Fix #448 --- .gitignore | 1 + Makefile.in | 13 ++++++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 94e6fe6d..24664d3a 100644 --- a/.gitignore +++ b/.gitignore @@ -16,4 +16,5 @@ build_dynamic/ autom4te.cache/ .openssl_build_done .openssl_configure_done +.mruby_version .vagrant/ diff --git a/Makefile.in b/Makefile.in index 2d782413..e504c231 100644 --- a/Makefile.in +++ b/Makefile.in @@ -61,15 +61,26 @@ clean: -rm -rf mrbgems_config mrbgems_config_dynamic clobber: clean_mruby clean - -rm -rf tmp autom4te.cache config config.status config.log $(BUILD_DIR) .openssl_build_done .openssl_configure_done + -rm -rf tmp autom4te.cache config config.status config.log $(BUILD_DIR) .openssl_build_done .openssl_configure_done .mruby_version # # mruby # build_mruby: $(MRUBY_BUILD_DEPEND_TARGETS) + @if [ -f .mruby_version ]; then \ + built_version=`cat .mruby_version`; \ + current_version=`git log -1 --format="%H" mruby`; \ + if [ $$built_version != $$current_version ]; then \ + echo $$current_version > .mruby_version; \ + cd $(MRUBY_ROOT) && rm -rf build; \ + fi; \ + else \ + git log -1 --format="%H" mruby > .mruby_version; \ + fi cd $(MRUBY_ROOT) && $(RAKE) MRUBY_CONFIG=$(NGX_MRUBY_ROOT)/build_config.rb NGX_MRUBY_CFLAGS="$(NGX_MRUBY_CFLAGS)" clean_mruby: + rm -f .mruby_version cd $(MRUBY_ROOT) && $(RAKE) deep_clean && rm -rf build $(MRUBY_MAK_FILE): build_mruby From 807dc2e31e982b9c0546bf9c9f4ad3c4f3336aa0 Mon Sep 17 00:00:00 2001 From: Yuji Yamano Date: Fri, 28 Feb 2020 17:49:23 +0000 Subject: [PATCH 2/3] Don't remove mruby/build/*. It is done by Makefile if necessary. See my last commit. --- build.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/build.sh b/build.sh index 9c6daccd..eb2eabc1 100755 --- a/build.sh +++ b/build.sh @@ -87,13 +87,6 @@ else OPENSSL_BUILD_OPT='' fi -# FIXME: not sure if we really need this. even if we do, it should be moved to mruby/Rakefile -if [ -d "./mruby/${BUILD_DIR}" ]; then - echo "mruby Cleaning ..." - (cd mruby && rake clean MRUBY_CONFIG=../build_config.rb) - echo "mruby Cleaning ... Done" -fi - echo "ngx_mruby configure ..." ./configure ${CONFIG_OPT} --with-ngx-src-root=${NGINX_SRC} --with-ngx-config-opt="${NGINX_CONFIG_OPT}" ${OPENSSL_BUILD_OPT} $@ echo "ngx_mruby configure ... Done" From 30cbfe6815dbcb0f5cdff5d0be047cd84ce06341 Mon Sep 17 00:00:00 2001 From: Yuji Yamano Date: Fri, 28 Feb 2020 17:51:49 +0000 Subject: [PATCH 3/3] Invoke rake with our own build_config.rb. --- Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index e504c231..29dd8360 100644 --- a/Makefile.in +++ b/Makefile.in @@ -81,7 +81,7 @@ build_mruby: $(MRUBY_BUILD_DEPEND_TARGETS) clean_mruby: rm -f .mruby_version - cd $(MRUBY_ROOT) && $(RAKE) deep_clean && rm -rf build + cd $(MRUBY_ROOT) && $(RAKE) MRUBY_CONFIG=$(NGX_MRUBY_ROOT)/build_config.rb deep_clean && rm -rf build $(MRUBY_MAK_FILE): build_mruby