New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rakefile/rakelib depends on Ant, will not boot if not present #2965

Closed
headius opened this Issue May 20, 2015 · 7 comments

Comments

Projects
None yet
3 participants
@headius
Member

headius commented May 20, 2015

I guess I never noticed before that we can't even boot our rakefile without ant being available, since it is used for several of our test tasks. We should try to eliminate or ease this requirement:

  • We could fetch ant during bootstrap, like we do with other test requirements.
  • We could rewrite the parts of our rake build to not use ant targets.
@chrisarcand

This comment has been minimized.

chrisarcand commented Oct 5, 2017

I recently experienced this while setting up JRuby and trying to run the tests for activerecord-jdbc-adapter); doing any rake command results in Errno::ENOENT: No such file or directory - ant.

Installing ant is easy enough but it's pretty confusing for someone new to JRuby as searching around there's no gem that packages it (that is plainly obvious, anyway) and it's easy to expect it to just be packaged with JRuby since JRuby is what contains the ant integration.

As @headius mentioned on IRC, perhaps the best course of action is just to have a gem that pulls ant from maven (and maybe move the ant integration in core to there, too)

@kares

This comment has been minimized.

Member

kares commented Oct 6, 2017

@chrisarcand guess, for AR-JDBC that is simply a lot of heritage (technical debt) along the years...
master does not use ant anymore (does javac directly) but the rails-5 branch didn't start off master :)
... so it is what it is - still would say its not that crucial in this case - only a few would compile AR-JDBC

@headius

This comment has been minimized.

Member

headius commented Oct 9, 2017

@kares I don't think anything would be too severely affected if we moved the ant support to a gem. It could even be one we install by default. The main issue is really that we have this ant support but don't ship ant, so it depends on it being available on the system. With ant use fading away, that's less and less likely.

@headius

This comment has been minimized.

Member

headius commented Oct 10, 2017

I've opened PR #4811 to start addressing this. All it does right now is pull the rake/ant stuff out into a gem, but it works fine.

@headius

This comment has been minimized.

Member

headius commented Oct 10, 2017

So after chatting with @mkristian we realized a nasty wrinkle: the Ant integration depends on the ant executable being present, so it can retrieve an appropriate environment for ant, its plugins, etc. So it's not simply a matter of including the jar; we would need to also include the plugins and plumbing that are part of a full Ant dist.

Given that, it seems like it might be a better choice to just present a better error indicating that Ant should be installed on the local system. The user can generally figure out how to do that, and we get the full dist to use.

I considered the possibility of just creating an Ant gem that actually includes the full layout and bin dir, but installing that gem when JRuby is in PATH would take over the ant command from the system.

It might be possible to include a full Ant dist vendored in the rake-ant gem, but I didn't explore that possibility.

headius added a commit to jruby/rake-ant that referenced this issue Oct 10, 2017

headius added a commit that referenced this issue Oct 10, 2017

@headius

This comment has been minimized.

Member

headius commented Oct 10, 2017

I think this can be resolved once @enebo has a chance to review the PR and gem.

@headius headius added this to the JRuby 9.2.0.0 milestone Oct 10, 2017

@headius

This comment has been minimized.

Member

headius commented Oct 10, 2017

The rake/ant integration has been moved to the rake-ant gem and included as a default gem. The error message has been fixed to request that the user install ant.

@headius headius closed this Oct 10, 2017

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