Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update the -v build rev hash every build.

Punts and uses the existing Rake stuff for now. Soon the rest of this will be
migrated to daedalus.
  • Loading branch information...
commit 5b275684586d90736b255e65ca6e49ca82421d75 1 parent 088bec7
@brixen brixen authored
View
2  Rakefile
@@ -33,7 +33,7 @@ end
require config_rb
BUILD_CONFIG = Rubinius::BUILD_CONFIG
-unless BUILD_CONFIG[:config_version] == 32
+unless BUILD_CONFIG[:config_version] == 33
STDERR.puts "Your configuration is outdated, please run ./configure first"
exit 1
end
View
9 configure
@@ -88,13 +88,7 @@ class Configure
@libversion = "1.2"
@version = "#{@libversion}.3dev"
@release_date = "yyyy-mm-dd"
- @config_version = 32
-
- if !ENV['RELEASE'] and File.directory?(root + "/.git")
- @buildrev = `git rev-list --all | head -n1`.chomp
- else
- @buildrev = "release"
- end
+ @config_version = 33
# TODO: add conditionals for platforms
if RbConfig::CONFIG["build_os"] =~ /darwin/
@@ -868,7 +862,6 @@ end
#define RBX_VENDOR_PATH "#{@vendordir}"
#define RBX_VERSION "#{@version}"
#define RBX_LIB_VERSION "#{@libversion}"
-#define RBX_BUILD_REV "#{@buildrev}"
#define RBX_LDSHARED "#{@ldshared}"
#define RBX_RELEASE_DATE "#{@release_date}"
#define RBX_SIZEOF_LONG #{@sizeof_long}
View
23 rakelib/vm.rake
@@ -28,6 +28,8 @@ TYPE_GEN = %w[ vm/gen/includes.hpp
vm/gen/primitives_declare.hpp
vm/gen/primitives_glue.gen.cpp ]
+GENERATED = %w[ vm/gen/revision.h ] + TYPE_GEN + INSN_GEN
+
# Files are in order based on dependencies. For example,
# CompactLookupTable inherits from Tuple, so the header
# for compactlookuptable.hpp has to come after tuple.hpp
@@ -149,14 +151,28 @@ end
files TYPE_GEN, field_extract_headers + %w[vm/codegen/field_extract.rb] + [:run_field_extract] do
end
+task 'vm/gen/revision.h' do |t|
+ git_dir = File.expand_path "../../.git", __FILE__
+
+ if !ENV['RELEASE'] and File.directory? git_dir
+ buildrev = `git rev-list --max-count=1 --all`.chomp
+ else
+ buildrev = "release"
+ end
+
+ File.open t.name, "wb" do |f|
+ f.puts %[#define RBX_BUILD_REV "#{buildrev}"]
+ end
+end
+
require 'projects/daedalus/daedalus'
blueprint = Daedalus.load "rakelib/blueprint.rb"
-task 'vm/vm' => TYPE_GEN + INSN_GEN do
+task 'vm/vm' => GENERATED do
blueprint.build "vm/vm"
end
-task 'vm/test/runner' => TYPE_GEN + INSN_GEN do
+task 'vm/test/runner' => GENERATED do
blueprint.build "vm/test/runner"
end
@@ -238,8 +254,7 @@ namespace :vm do
desc "Clean up vm build files"
task :clean do
files = FileList[
- TYPE_GEN,
- INSN_GEN,
+ GENERATED,
'vm/gen/*',
'vm/test/runner',
'vm/test/runner.cpp',
View
1  vm/ontology.cpp
@@ -44,6 +44,7 @@
#include "configuration.hpp"
#include "config.h"
+#include "revision.h"
#define SPECIAL_CLASS_MASK 0x1f
#define SPECIAL_CLASS_SIZE 32
View
1  vm/revision.h
@@ -0,0 +1 @@
+#include "vm/gen/revision.h"
Please sign in to comment.
Something went wrong with that request. Please try again.