diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 35c5b4f..b57d420 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,6 +15,10 @@ jobs: os: - ubuntu-latest - macos-latest + version: + - 3.82 + - 4.2.1 + - 4.3 runs-on: ${{ matrix.os }} steps: - name: Set output @@ -26,3 +30,4 @@ jobs: with: command: make --version gitref: ${{ steps.vars.outputs.short_ref }} + version: ${{ matrix.version }} diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..bf810a0 --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ +TEST_VERSIONS := $(shell bin/list-all) +TEST_PREFIX := test- +TEST_GOALS := $(addprefix $(TEST_PREFIX), $(TEST_VERSIONS)) +TEST_CACHE_DIR := .test_cache + +TEST_DOWNLOAD_DIR := downloads +TEST_INSTALL_DIR := installs +TEST_COMMAND := $(TEST_INSTALL_DIR)/bin/make --version + +all: + +$(TEST_GOALS): + $(eval TEST_VERSION := $(subst $(TEST_PREFIX),,$@)) + $(eval TEST_DIR := $(PWD)/$(TEST_CACHE_DIR)/$(TEST_VERSION)) + mkdir -p $(TEST_CACHE_DIR)/$(TEST_VERSION) + + ASDF_INSTALL_VERSION=$(TEST_VERSION) \ + ASDF_DOWNLOAD_PATH=$(TEST_DIR)/$(TEST_DOWNLOAD_DIR) \ + bin/download + + ASDF_INSTALL_VERSION=$(TEST_VERSION) \ + ASDF_DOWNLOAD_PATH=$(TEST_DIR)/$(TEST_DOWNLOAD_DIR) \ + ASDF_INSTALL_TYPE=version \ + ASDF_INSTALL_PATH=$(TEST_DIR)/$(TEST_INSTALL_DIR) \ + bin/install + + $(TEST_DIR)/$(TEST_COMMAND) + +test-all: $(TEST_GOALS) + +clean: $(TEST_CACHE_DIR) diff --git a/lib/utils.bash b/lib/utils.bash index 632e79a..bd65d88 100644 --- a/lib/utils.bash +++ b/lib/utils.bash @@ -75,7 +75,7 @@ install_version() { cd "$ASDF_DOWNLOAD_PATH" echo "* Installing $TOOL_NAME release $version..." - # If the make command is not installed on system, may get an error like the following: + # If the make command is not installed on system old version, may get an error like the following: # # config.status: error: Something went wrong bootstrapping makefile fragments # for automatic dependency tracking. Try re-running configure with the @@ -85,22 +85,16 @@ install_version() { # If try to make install in this state, the installation will fail because the # Makefile of the po directory does not exist. # - # So, if make is not installed on system, first run configure to generate build.sh. + # Will not use make, which is installed on the system, to ensure a reliable build. + # First run configure to generate build.sh. # Then, configure to use the make generated by build.sh and run configure again. # At this time, can speed up second time configure by enabling configure caching (-C). - if hash make; then - { - ./configure --prefix="$install_path" - make && make install - } &>"$install_log" - else - { - ./configure -C --prefix="$install_path" - ./build.sh && - PATH=$ASDF_DOWNLOAD_PATH:$PATH /configure -C --prefix="$install_path" && - ./make install - } &>"$install_log" - fi + { + ./configure -C --prefix="$install_path" + ./build.sh && + PATH=$ASDF_DOWNLOAD_PATH:$PATH ./configure -C --prefix="$install_path" && + ./make install + } &>"$install_log" local tool_cmd tool_cmd="$(echo "$TOOL_TEST" | cut -d' ' -f1)"