Skip to content

Commit

Permalink
Update the -v build rev hash every build.
Browse files Browse the repository at this point in the history
Punts and uses the existing Rake stuff for now. Soon the rest of this will be
migrated to daedalus.
  • Loading branch information
Brian Ford committed Mar 10, 2011
1 parent 088bec7 commit 5b27568
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ end
require config_rb require config_rb
BUILD_CONFIG = Rubinius::BUILD_CONFIG 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" STDERR.puts "Your configuration is outdated, please run ./configure first"
exit 1 exit 1
end end
Expand Down
9 changes: 1 addition & 8 deletions configure
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -88,13 +88,7 @@ class Configure
@libversion = "1.2" @libversion = "1.2"
@version = "#{@libversion}.3dev" @version = "#{@libversion}.3dev"
@release_date = "yyyy-mm-dd" @release_date = "yyyy-mm-dd"
@config_version = 32 @config_version = 33

if !ENV['RELEASE'] and File.directory?(root + "/.git")
@buildrev = `git rev-list --all | head -n1`.chomp
else
@buildrev = "release"
end


# TODO: add conditionals for platforms # TODO: add conditionals for platforms
if RbConfig::CONFIG["build_os"] =~ /darwin/ if RbConfig::CONFIG["build_os"] =~ /darwin/
Expand Down Expand Up @@ -868,7 +862,6 @@ end
#define RBX_VENDOR_PATH "#{@vendordir}" #define RBX_VENDOR_PATH "#{@vendordir}"
#define RBX_VERSION "#{@version}" #define RBX_VERSION "#{@version}"
#define RBX_LIB_VERSION "#{@libversion}" #define RBX_LIB_VERSION "#{@libversion}"
#define RBX_BUILD_REV "#{@buildrev}"
#define RBX_LDSHARED "#{@ldshared}" #define RBX_LDSHARED "#{@ldshared}"
#define RBX_RELEASE_DATE "#{@release_date}" #define RBX_RELEASE_DATE "#{@release_date}"
#define RBX_SIZEOF_LONG #{@sizeof_long} #define RBX_SIZEOF_LONG #{@sizeof_long}
Expand Down
23 changes: 19 additions & 4 deletions rakelib/vm.rake
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ TYPE_GEN = %w[ vm/gen/includes.hpp
vm/gen/primitives_declare.hpp vm/gen/primitives_declare.hpp
vm/gen/primitives_glue.gen.cpp ] 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, # Files are in order based on dependencies. For example,
# CompactLookupTable inherits from Tuple, so the header # CompactLookupTable inherits from Tuple, so the header
# for compactlookuptable.hpp has to come after tuple.hpp # for compactlookuptable.hpp has to come after tuple.hpp
Expand Down Expand Up @@ -149,14 +151,28 @@ end
files TYPE_GEN, field_extract_headers + %w[vm/codegen/field_extract.rb] + [:run_field_extract] do files TYPE_GEN, field_extract_headers + %w[vm/codegen/field_extract.rb] + [:run_field_extract] do
end 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' require 'projects/daedalus/daedalus'
blueprint = Daedalus.load "rakelib/blueprint.rb" blueprint = Daedalus.load "rakelib/blueprint.rb"


task 'vm/vm' => TYPE_GEN + INSN_GEN do task 'vm/vm' => GENERATED do
blueprint.build "vm/vm" blueprint.build "vm/vm"
end end


task 'vm/test/runner' => TYPE_GEN + INSN_GEN do task 'vm/test/runner' => GENERATED do
blueprint.build "vm/test/runner" blueprint.build "vm/test/runner"
end end


Expand Down Expand Up @@ -238,8 +254,7 @@ namespace :vm do
desc "Clean up vm build files" desc "Clean up vm build files"
task :clean do task :clean do
files = FileList[ files = FileList[
TYPE_GEN, GENERATED,
INSN_GEN,
'vm/gen/*', 'vm/gen/*',
'vm/test/runner', 'vm/test/runner',
'vm/test/runner.cpp', 'vm/test/runner.cpp',
Expand Down
1 change: 1 addition & 0 deletions vm/ontology.cpp
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@


#include "configuration.hpp" #include "configuration.hpp"
#include "config.h" #include "config.h"
#include "revision.h"


#define SPECIAL_CLASS_MASK 0x1f #define SPECIAL_CLASS_MASK 0x1f
#define SPECIAL_CLASS_SIZE 32 #define SPECIAL_CLASS_SIZE 32
Expand Down
1 change: 1 addition & 0 deletions vm/revision.h
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1 @@
#include "vm/gen/revision.h"

0 comments on commit 5b27568

Please sign in to comment.