fables-tales/rubyfmt

rubyfmt build fails, macOS 12.6, Apple M1 Pro, failed to run custom build command for `rubyfmt v0.6.8-pre

Closed this issue · 2 comments

system:

% sysinfo
Software:

    System Software Overview:

      System Version: macOS 12.6 (21G115)
      Kernel Version: Darwin 21.6.0
      Time since boot: 5 days 23:47

Hardware:

    Hardware Overview:

      Model Name: MacBook Pro
      Model Identifier: MacBookPro18,3
      Chip: Apple M1 Pro
      Total Number of Cores: 10 (8 performance and 2 efficiency)
      Memory: 32 GB
      System Firmware Version: 7459.141.1
      OS Loader Version: 7459.141.1

partial console log (complete log included as attachment):

cd temp
temp ruby-3.1.2  % git clone git@github.com:penelopezone/rubyfmt.git
Cloning into 'rubyfmt'...
remote: Enumerating objects: 7922, done.
remote: Counting objects: 100% (2207/2207), done.
remote: Compressing objects: 100% (762/762), done.
remote: Total 7922 (delta 1408), reused 2124 (delta 1352), pack-reused 5715
Receiving objects: 100% (7922/7922), 1.48 MiB | 7.70 MiB/s, done.
Resolving deltas: 100% (4414/4414), done.
temp ruby-3.1.2  % cd rubyfmt

rubyfmt ruby-3.1.2 trunk % which cargo
/opt/homebrew/bin/cargo
rubyfmt ruby-3.1.2 trunk % cargo --version
cargo 1.64.0 (387270bc7 2022-09-16)

rubyfmt ruby-3.1.2 trunk % make all
bash -c "find target/release | grep -i 'librubyfmt-.*\.a' | xargs rm; exit 0"
find: target/release: No such file or directory
cargo build --release
  Downloaded walkdir v2.3.2
  Downloaded chunked_transfer v1.4.0
  Downloaded untrusted v0.7.1
  Downloaded heck v0.4.0
  Downloaded proc-macro-error v1.0.4
  Downloaded proc-macro-error-attr v1.0.4
  Downloaded chrono v0.4.21
  Downloaded iana-time-zone v0.1.41
  Downloaded clap v3.2.16
  Downloaded serde v1.0.143
  Downloaded clap_derive v3.2.15
  Downloaded clap_lex v0.2.4
  Downloaded webpki v0.22.0
  Downloaded simplelog v0.8.0
  Downloaded globset v0.4.9
  Downloaded os_str_bytes v6.2.0
  Downloaded rustc-demangle v0.1.21
  Downloaded serde_derive v1.0.143
  Downloaded sct v0.7.0
  Downloaded ignore v0.4.18
  Downloaded semver v1.0.13
  Downloaded object v0.29.0
  Downloaded once_cell v1.13.0
  Downloaded fs_extra v1.2.0
  Downloaded jemallocator v0.3.2
  Downloaded addr2line v0.17.0
  Downloaded thread_local v1.1.4
  Downloaded same-file v1.0.6
  Downloaded rustls v0.20.6
  Downloaded strsim v0.10.0
  Downloaded similar v2.2.0
  Downloaded serde_json v1.0.83
  Downloaded ureq v2.5.0
  Downloaded backtrace v0.3.66
  Downloaded textwrap v0.15.0
  Downloaded webpki-roots v0.22.4
  Downloaded bstr v0.2.17
  Downloaded libc v0.2.127
  Downloaded gimli v0.26.2
  Downloaded jemalloc-sys v0.3.2
  Downloaded ring v0.16.20
  Downloaded 41 crates (10.3 MB) in 1.22s (largest was `ring` at 5.1 MB)
   Compiling cc v1.0.73
   Compiling libc v0.2.127
   Compiling proc-macro2 v1.0.43
   Compiling unicode-ident v1.0.3
   Compiling quote v1.0.21
   Compiling autocfg v1.1.0
   Compiling cfg-if v1.0.0
   Compiling syn v1.0.99
   Compiling memchr v2.5.0
   Compiling version_check v0.9.4
   Compiling log v0.4.17
   Compiling core-foundation-sys v0.8.3
   Compiling serde_derive v1.0.143
   Compiling untrusted v0.7.1
   Compiling adler v1.0.2
   Compiling tinyvec_macros v0.1.0
   Compiling once_cell v1.13.0
   Compiling serde v1.0.143
   Compiling fs_extra v1.2.0
   Compiling matches v0.1.9
   Compiling serde_json v1.0.83
   Compiling crc32fast v1.3.2
   Compiling crossbeam-utils v0.8.11
   Compiling rustls v0.20.6
   Compiling percent-encoding v2.1.0
   Compiling unicode-bidi v0.3.8
   Compiling gimli v0.26.2
   Compiling regex-syntax v0.6.27
   Compiling termcolor v1.1.3
   Compiling itoa v1.0.3
   Compiling ryu v1.0.11
   Compiling semver v1.0.13
   Compiling fnv v1.0.7
   Compiling heck v0.4.0
   Compiling os_str_bytes v6.2.0
   Compiling same-file v1.0.6
   Compiling rustc-demangle v0.1.21
   Compiling hashbrown v0.12.3
   Compiling chunked_transfer v1.4.0
   Compiling strsim v0.10.0
   Compiling rubyfmt-main v0.6.8-pre (/Users/stephen/dev/temp/rubyfmt)
   Compiling textwrap v0.15.0
   Compiling base64 v0.13.0
   Compiling lazy_static v1.4.0
   Compiling bitflags v1.3.2
   Compiling glob v0.3.0
   Compiling similar v2.2.0
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling num-traits v0.2.15
   Compiling num-integer v0.1.45
   Compiling indexmap v1.9.1
   Compiling tinyvec v1.6.0
   Compiling miniz_oxide v0.5.3
   Compiling thread_local v1.1.4
   Compiling form_urlencoded v1.0.1
   Compiling ring v0.16.20
   Compiling jemalloc-sys v0.3.2
   Compiling backtrace v0.3.66
   Compiling rubyfmt v0.6.8-pre (/Users/stephen/dev/temp/rubyfmt/librubyfmt)
   Compiling clap_lex v0.2.4
   Compiling walkdir v2.3.2
   Compiling addr2line v0.17.0
   Compiling unicode-normalization v0.1.21
   Compiling aho-corasick v0.7.18
   Compiling bstr v0.2.17
   Compiling object v0.29.0
   Compiling core-foundation v0.9.3
   Compiling time v0.1.44
   Compiling atty v0.2.14
   Compiling dirs-sys v0.3.7
   Compiling filetime v0.2.17
   Compiling flate2 v1.0.24
   Compiling idna v0.2.3
   Compiling regex v1.6.0
   Compiling iana-time-zone v0.1.41
   Compiling dirs v3.0.2
   Compiling url v2.2.2
   Compiling globset v0.4.9
   Compiling chrono v0.4.21
   Compiling ignore v0.4.18
   Compiling simplelog v0.8.0
   Compiling ripper_deserialize v0.1.0 (/Users/stephen/dev/temp/rubyfmt/librubyfmt/ripper_deserialize)
   Compiling clap_derive v3.2.15
   Compiling webpki v0.22.0
   Compiling sct v0.7.0
   Compiling webpki-roots v0.22.4
   Compiling clap v3.2.16
   Compiling ureq v2.5.0
   Compiling jemallocator v0.3.2
error: failed to run custom build command for `rubyfmt v0.6.8-pre (/Users/stephen/dev/temp/rubyfmt/librubyfmt)`

Caused by:
  process didn't exit successfully: `/Users/stephen/dev/temp/rubyfmt/target/release/build/rubyfmt-1ff3db1d42d221cd/build-script-build` (exit status: 1)

rubyfmt-make-all-20221108.txt

reese commented

I just merged #350 which included some fixes for M1 builds, does this issue still reproduce if you pull the current trunk?

Compiles and appears to run fine. Thanks!

% make all
bash -c "find target/release | grep -i 'librubyfmt-.*\.a' | xargs rm; exit 0"
cargo build --release
   Compiling rubyfmt v0.6.8-pre (/Users/stephen/dev/temp/rubyfmt/librubyfmt)
   Compiling rubyfmt-main v0.6.8-pre (/Users/stephen/dev/temp/rubyfmt)
    Finished release [optimized] target(s) in 1m 29s
bash -c "find target/debug | grep -i 'librubyfmt-.*\.a' | xargs rm; exit 0"
find: target/debug: No such file or directory
cargo build
   Compiling cc v1.0.73
   Compiling libc v0.2.127
   Compiling proc-macro2 v1.0.43
   Compiling quote v1.0.21
   Compiling autocfg v1.1.0
   Compiling unicode-ident v1.0.3
   Compiling cfg-if v1.0.0
   Compiling syn v1.0.99
   Compiling memchr v2.5.0
   Compiling log v0.4.17
   Compiling version_check v0.9.4
   Compiling core-foundation-sys v0.8.3
   Compiling untrusted v0.7.1
   Compiling serde_derive v1.0.143
   Compiling adler v1.0.2
   Compiling fs_extra v1.2.0
   Compiling once_cell v1.13.0
   Compiling serde v1.0.143
   Compiling tinyvec_macros v0.1.0
   Compiling matches v0.1.9
   Compiling serde_json v1.0.83
   Compiling crc32fast v1.3.2
   Compiling gimli v0.26.2
   Compiling termcolor v1.1.3
   Compiling regex-syntax v0.6.27
   Compiling crossbeam-utils v0.8.11
   Compiling percent-encoding v2.1.0
   Compiling unicode-bidi v0.3.8
   Compiling itoa v1.0.3
   Compiling ryu v1.0.11
   Compiling rustls v0.20.6
   Compiling heck v0.4.0
   Compiling same-file v1.0.6
   Compiling rustc-demangle v0.1.21
   Compiling fnv v1.0.7
   Compiling os_str_bytes v6.2.0
   Compiling semver v1.0.13
   Compiling hashbrown v0.12.3
   Compiling lazy_static v1.4.0
   Compiling textwrap v0.15.0
   Compiling rubyfmt-main v0.6.8-pre (/Users/stephen/dev/temp/rubyfmt)
   Compiling bitflags v1.3.2
   Compiling strsim v0.10.0
   Compiling chunked_transfer v1.4.0
   Compiling base64 v0.13.0
   Compiling similar v2.2.0
   Compiling glob v0.3.0
   Compiling miniz_oxide v0.5.3
   Compiling tinyvec v1.6.0
   Compiling thread_local v1.1.4
   Compiling num-traits v0.2.15
   Compiling num-integer v0.1.45
   Compiling indexmap v1.9.1
   Compiling proc-macro-error-attr v1.0.4
   Compiling proc-macro-error v1.0.4
   Compiling form_urlencoded v1.0.1
   Compiling walkdir v2.3.2
   Compiling clap_lex v0.2.4
   Compiling ring v0.16.20
   Compiling jemalloc-sys v0.3.2
   Compiling backtrace v0.3.66
   Compiling rubyfmt v0.6.8-pre (/Users/stephen/dev/temp/rubyfmt/librubyfmt)
   Compiling addr2line v0.17.0
   Compiling unicode-normalization v0.1.21
   Compiling aho-corasick v0.7.18
   Compiling bstr v0.2.17
   Compiling object v0.29.0
   Compiling core-foundation v0.9.3
   Compiling time v0.1.44
   Compiling dirs-sys v0.3.7
   Compiling atty v0.2.14
   Compiling filetime v0.2.17
   Compiling flate2 v1.0.24
   Compiling idna v0.2.3
   Compiling regex v1.6.0
   Compiling dirs v3.0.2
   Compiling iana-time-zone v0.1.41
   Compiling url v2.2.2
   Compiling chrono v0.4.21
   Compiling globset v0.4.9
   Compiling ignore v0.4.18
   Compiling simplelog v0.8.0
   Compiling webpki v0.22.0
   Compiling sct v0.7.0
   Compiling webpki-roots v0.22.4
   Compiling clap_derive v3.2.15
   Compiling ripper_deserialize v0.1.0 (/Users/stephen/dev/temp/rubyfmt/librubyfmt/ripper_deserialize)
   Compiling clap v3.2.16
   Compiling ureq v2.5.0
   Compiling jemallocator v0.3.2
    Finished dev [unoptimized + debuginfo] target(s) in 19.63s

Simple test ...

trunk % ls -l target/release
total 19440
drwxr-xr-x   50 stephen  staff     1600 Nov  8 14:22 build
drwxr-xr-x  267 stephen  staff     8544 Nov 12 19:55 deps
drwxr-xr-x    2 stephen  staff       64 Nov  8 14:22 examples
drwxr-xr-x    2 stephen  staff       64 Nov  8 14:22 incremental
-rwxr-xr-x    1 stephen  staff  9945194 Nov 12 19:55 rubyfmt-main
-rw-r--r--    1 stephen  staff     1852 Nov 12 19:55 rubyfmt-main.d

trunk % target/release/rubyfmt-main -- fixtures/large/concurrent_ruby_future_actual.rb
require "thread"
require "concurrent/constants"
require "concurrent/errors"
require "concurrent/ivar"
require "concurrent/executor/safe_task_executor"

require "concurrent/options"

# TODO (pitr-ch 14-Mar-2017): deprecate, Future, Promise, etc.

module Concurrent

  # {include:file:docs-source/future.md}
  #
  # @!macro copy_options
  #
  # @see http://ruby-doc.org/stdlib-2.1.1/libdoc/observer/rdoc/Observable.html Ruby Observable module
  # @see http://clojuredocs.org/clojure_core/clojure.core/future Clojure's future function
  # @see http://docs.oracle.com/javase/7/docs/api/java/util/concurrent/Future.html java.util.concurrent.Future
  class Future < IVar

    # Create a new `Future` in the `:unscheduled` state.
    #
    # @yield the asynchronous operation to perform
    #
    # @!macro executor_and_deref_options
    #
    # @option opts [object, Array] :args zero or more arguments to be passed the task
    #   block on execution
    #
    # @raise [ArgumentError] if no block is given
    def initialize(opts = {}, &block)
      raise ArgumentError.new("no block given") unless block_given?
      super(NULL, opts.merge(__task_from_block__: block), &nil)
    end

    # Execute an `:unscheduled` `Future`. Immediately sets the state to `:pending` and
    # passes the block to a new thread/thread pool for eventual execution.
    # Does nothing if the `Future` is in any state other than `:unscheduled`.
    #
    # @return [Future] a reference to `self`
    #
    # @example Instance and execute in separate steps
    #   future = Concurrent::Future.new{ sleep(1); 42 }
    #   future.state #=> :unscheduled
    #   future.execute
    #   future.state #=> :pending
    #
    # @example Instance and execute in one line
    #   future = Concurrent::Future.new{ sleep(1); 42 }.execute
    #   future.state #=> :pending
    def execute
      if compare_and_set_state(:pending, :unscheduled)
        @executor.post { safe_execute(@task, @args) }
        self
      end
    end

    # Create a new `Future` object with the given block, execute it, and return the
    # `:pending` object.
    #
    # @yield the asynchronous operation to perform
    #
    # @!macro executor_and_deref_options
    #
    # @option opts [object, Array] :args zero or more arguments to be passed the task
    #   block on execution
    #
    # @raise [ArgumentError] if no block is given
    #
    # @return [Future] the newly created `Future` in the `:pending` state
    #
    # @example
    #   future = Concurrent::Future.execute{ sleep(1); 42 }
    #   future.state #=> :pending
    def self.execute(opts = {}, &block)
      Future.new(opts, &block).execute
    end

    # @!macro ivar_set_method
    def set(value = NULL, &block)
      check_for_block_or_value!(block_given?, value)
      synchronize do
        if @state != :unscheduled
          raise MultipleAssignmentError
        else
          @task = block || Proc.new { value }
        end
      end

      execute
    end

    # Attempt to cancel the operation if it has not already processed.
    # The operation can only be cancelled while still `pending`. It cannot
    # be cancelled once it has begun processing or has completed.
    #
    # @return [Boolean] was the operation successfully cancelled.
    def cancel
      if compare_and_set_state(:cancelled, :pending)
        complete(false, nil, CancelledOperationError.new)
        true
      else
        false
      end
    end

    # Has the operation been successfully cancelled?
    #
    # @return [Boolean]
    def cancelled?
      state == :cancelled
    end

    # Wait the given number of seconds for the operation to complete.
    # On timeout attempt to cancel the operation.
    #
    # @param [Numeric] timeout the maximum time in seconds to wait.
    # @return [Boolean] true if the operation completed before the timeout
    #   else false
    def wait_or_cancel(timeout)
      wait(timeout)
      if complete?
        true
      else
        cancel
        false
      end
    end

    protected

    def ns_initialize(value, opts)
      super
      @state = :unscheduled
      @task = opts[:__task_from_block__]
      @executor = Options.executor_from_options(opts) || Concurrent.global_io_executor
      @args = get_arguments_from(opts)
    end
  end
end