From c2184a5d38530c8427858efdb224859fd9fcd60d Mon Sep 17 00:00:00 2001 From: Jorge Morante Date: Wed, 24 May 2023 08:58:23 +0200 Subject: [PATCH] wip --- Rakefile | 5 ++--- build_config.rb | 4 +++- lib/fingers/cli.rb | 3 ++- lib/main.rb | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Rakefile b/Rakefile index 8d90216..620b552 100644 --- a/Rakefile +++ b/Rakefile @@ -1,6 +1,5 @@ # frozen_string_literal: true -TARGET="x86_64-macos-none" MRUBY_REV= 'c32f7915fb567c73b78db10ebc13c38a617a75aa' MRUBY_ROOT = 'build/mruby' RUBY_FILES = [ @@ -39,13 +38,13 @@ end desc 'Compile mruby' task build_mruby: [MRUBY_ROOT] do Dir.chdir('build/mruby') do - sh "CC=\"zig cc -target #{TARGET}\" MRUBY_CONFIG=../../build_config.rb rake" + sh "MRUBY_CONFIG=../../build_config.rb rake" end end desc 'Compile tmux-fingers' task compile: ['build_mruby'] do sh "#{MRUBY_ROOT}/bin/mrbc -B main_ruby -o build/bytecode.c #{RUBY_FILES.join(' ')}" - sh "zig cc -target #{TARGET} -I#{MRUBY_ROOT}/include main.c -o build/tmux-fingers #{MRUBY_ROOT}/build/host/lib/libmruby.a -lm" + sh "cc -I#{MRUBY_ROOT}/include main.c -o build/tmux-fingers #{MRUBY_ROOT}/build/host/lib/libmruby.a -lm" sh 'echo tmux-fingers build complete' end diff --git a/build_config.rb b/build_config.rb index 8920d51..1a6be61 100644 --- a/build_config.rb +++ b/build_config.rb @@ -2,6 +2,8 @@ MRuby::Build.new do |conf| # load specific toolchain settings conf.toolchain + #conf.enable_debug + # Use mrbgems conf.gem :core => 'mruby-sleep' conf.gem :github => 'iij/mruby-env' @@ -84,7 +86,7 @@ MRuby::Build.new do |conf| # conf.file_separator = '/' # Turn on `enable_debug` for better debugging - # conf.enable_debug + conf.enable_debug conf.enable_bintest conf.enable_test end diff --git a/lib/fingers/cli.rb b/lib/fingers/cli.rb index cb8b5f8..b983c61 100755 --- a/lib/fingers/cli.rb +++ b/lib/fingers/cli.rb @@ -29,7 +29,8 @@ module Fingers command_class.new(args, cli_path).run rescue => e puts e - Fingers.logger.error(e) + puts e.backtrace + #Fingers.logger.error(e) end end diff --git a/lib/main.rb b/lib/main.rb index 09a8455..1e9f26f 100644 --- a/lib/main.rb +++ b/lib/main.rb @@ -6,7 +6,7 @@ module Kernel end begin - absolute_fingers_path = "/home/morantron/hacking/tmux-fingers/build/tmux-fingers" + absolute_fingers_path = File.expand_path(ARGV[0]) ARGV.shift Fingers::CLI.new(ARGV, absolute_fingers_path).run rescue StandardError => e