diff --git a/Makefile b/Makefile index fe714d2ba393..c15648d7fc37 100644 --- a/Makefile +++ b/Makefile @@ -39,9 +39,9 @@ override FLAGS += -D strict_multi_assign -D preview_overload_order $(if $(releas SPEC_WARNINGS_OFF := --exclude-warnings spec/std --exclude-warnings spec/compiler --exclude-warnings spec/primitives SPEC_FLAGS := $(if $(verbose),-v )$(if $(junit_output),--junit_output $(junit_output) )$(if $(order),--order=$(order) ) CRYSTAL_CONFIG_LIBRARY_PATH := '$$ORIGIN/../lib/crystal' -CRYSTAL_CONFIG_BUILD_COMMIT := $(shell git rev-parse --short HEAD 2> /dev/null) +CRYSTAL_CONFIG_BUILD_COMMIT ?= $(shell git rev-parse --short HEAD 2> /dev/null) CRYSTAL_CONFIG_PATH := '$$ORIGIN/../share/crystal/src' -SOURCE_DATE_EPOCH := $(shell (git show -s --format=%ct HEAD || stat -c "%Y" Makefile || stat -f "%m" Makefile) 2> /dev/null) +SOURCE_DATE_EPOCH ?= $(shell (git show -s --format=%ct HEAD || stat -c "%Y" Makefile || stat -f "%m" Makefile) 2> /dev/null) ifeq ($(shell command -v ld.lld >/dev/null && uname -s),Linux) EXPORT_CC ?= CC="$(CC) -fuse-ld=lld" endif diff --git a/src/compiler/crystal/config.cr b/src/compiler/crystal/config.cr index eb77b9e8886f..2f71aa49815c 100644 --- a/src/compiler/crystal/config.cr +++ b/src/compiler/crystal/config.cr @@ -15,13 +15,17 @@ module Crystal end def self.description - formatted_sha = "[#{build_commit}] " if build_commit - <<-DOC - Crystal #{version} #{formatted_sha}(#{date}) + String.build do |io| + io << "Crystal " << version + io << " [" << build_commit << "]" if build_commit + io << " (" << date << ")" unless date.empty? - LLVM: #{llvm_version} - Default target: #{self.host_target} - DOC + io << "\n\nThe compiler was not built in release mode." unless release_mode? + + io << "\n\nLLVM: " << llvm_version + io << "\nDefault target: " << host_target + io << "\n" + end end def self.build_commit @@ -40,6 +44,10 @@ module Crystal end end + def self.release_mode? + {{ flag?(:release) }} + end + @@host_target : Crystal::Codegen::Target? def self.host_target : Crystal::Codegen::Target