Skip to content

Ant must be installed to run rake targets, but we don't use ant anymore #2236

Open

Description

@headius

Several of our build targets in rake depend on 'ant' library, for example to exec a subprocess JVM for test runs. This is an additional build dependency above and beyond Maven, and ideally we'd get rid of it or have the bootstrap put ant somewhere we can use it.

Activity

  1. headius commented on Nov 24, 2014

    @headius
    MemberAuthor

    The error produced when you don't have ant installed is also rather cryptic. Here it is with full trace output: https://gist.github.com/headius/6c6d83229d5a979ae8cf

  2. perlun commented on Apr 13, 2018

    @perlun
    Contributor

    The error you get right now looks like this:

    $ rake spec:ruby
    could not load ant: #<Errno::ENOENT: No such file or directory - ant>
    MSPEC: {:compile_mode=>"OFF", :format=>"d", :jit_threshold=>20, :jit_max=>-1, :objectspace_enabled=>true, :thread_pooling=>false, :reflection=>false}
    rm -rf rubyspec_temp
    rake aborted!
    NameError: undefined local variable or method `ant' for main:Object
    /Volumes/git/3rd-party/jruby/rakelib/commands.rake:27:in `initialize_paths'
    /Volumes/git/3rd-party/jruby/rakelib/commands.rake:45:in `jruby'
    /Volumes/git/3rd-party/jruby/rakelib/commands.rake:90:in `mspec'
    /Volumes/git/3rd-party/jruby/rakelib/rubyspec.rake:63:in `block in (root)'
    /Users/plundberg/.rvm/gems/jruby-9.1.16.0/gems/rake-12.3.1/exe/rake:27:in `<main>'
    Tasks: TOP => spec:ruby => spec:ci_interpreted => spec:interpreted
    (See full trace by running task with --trace)
    

    (Also, worth mentioning is that if you are using macOS, a simple way to get a working ant command is brew install ant, if you have a working Homebrew install.)

  3. headius commented on Apr 13, 2018

    @headius
    MemberAuthor

    Yeah the main thing keeping Ant in the build is that we're using its Java-launching task throughout our test runs. We need a good replacement for that, one that allows us to customize JRuby and Java opts from callers.

  4. headius commented on Apr 13, 2018

    @headius
    MemberAuthor

    See rakelib/commands.rake for the primary calls to Ant we need to replace. Basically the java task in our Ant integration has a set of properties we can set, like classpath etc. Perhaps we fake them by making a look-alike Struct and then peeling out the piece and building our own command line?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions