diff --git a/Dockerfile b/Dockerfile index 2e5c3d0ab3..b4e1a9d016 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,7 +49,7 @@ COPY lib lib COPY src src COPY include include -ARG NAT_BUILD_MODE=debug +ARG NAT_BUILD_MODE=release RUN rake build_${NAT_BUILD_MODE} COPY spec spec diff --git a/README.md b/README.md index e903129a18..da1fb4fa7a 100644 --- a/README.md +++ b/README.md @@ -73,9 +73,6 @@ rake - If you get an error about missing `bundler`, then your operating system probably didn't install it alongside Ruby. You can run `gem install bundler` to get it. -**NOTE:** Currently, the default build is the "debug" build, since Nataile is in active development. -But you can build in release mode with `rake build_release`. - ## Usage **REPL:** diff --git a/Rakefile b/Rakefile index 29f90c09a5..15a9c8b492 100644 --- a/Rakefile +++ b/Rakefile @@ -2,7 +2,7 @@ require_relative './lib/natalie/compiler/flags' task default: :build -DEFAULT_BUILD_TYPE = 'debug'.freeze +DEFAULT_BUILD_TYPE = 'release'.freeze DL_EXT = RbConfig::CONFIG['DLEXT'] SO_EXT = RbConfig::CONFIG['SOEXT'] SRC_DIRECTORIES = Dir.new('src').children.select { |p| File.directory?(File.join('src', p)) } @@ -13,7 +13,12 @@ task :build do Rake::Task["build_#{type}"].invoke end -desc 'Build Natalie with no optimization and all warnings (default)' +desc 'Build Natalie with release optimizations enabled and warnings off (default)' +task build_release: %i[set_build_release libnatalie prism_c_ext] do + puts 'Build mode: release' +end + +desc 'Build Natalie with no optimization and all warnings' task build_debug: %i[set_build_debug libnatalie prism_c_ext ctags] do puts 'Build mode: debug' end @@ -23,11 +28,6 @@ task build_asan: %i[set_build_asan libnatalie prism_c_ext] do puts 'Build mode: asan' end -desc 'Build Natalie with release optimizations enabled and warnings off' -task build_release: %i[set_build_release libnatalie prism_c_ext] do - puts 'Build mode: release' -end - desc 'Remove temporary files created during build' task :clean do SRC_DIRECTORIES.each do |subdir| @@ -300,17 +300,6 @@ task :docker_build_clang do '.' end -task :docker_build_clang_release do - sh "docker build -t natalie_clang_#{ruby_version_string}_release " \ - "--build-arg IMAGE='ruby:#{ruby_version_number}' " \ - '--build-arg NAT_CXX_FLAGS=-DNAT_GC_GUARD ' \ - '--build-arg CC=clang ' \ - '--build-arg CXX=clang++ ' \ - '--build-arg NAT_CXX_FLAGS=-DNAT_GC_GUARD ' \ - '--build-arg NAT_BUILD_MODE=release ' \ - '.' -end - task docker_bash: :docker_build_clang do sh "docker run -it --rm --entrypoint bash natalie_clang_#{ruby_version_string}" end @@ -391,7 +380,7 @@ task docker_test_all_ruby_spec_nightly: :docker_build_clang do "natalie_clang_#{ruby_version_string} test_all_ruby_spec_nightly" end -task docker_test_perf: :docker_build_clang_release do +task docker_test_perf: :docker_build_clang do sh "docker run #{docker_run_flags} " \ "-e STATS_API_SECRET=#{(ENV['STATS_API_SECRET'] || '').inspect} " \ "-e GIT_SHA=#{(ENV['LAST_COMMIT_SHA'] || '').inspect} " \