Intro Hello, I'm Aaron

  • Name: Aaron Harris
  • Social: I'm aaron-harris on GitHub and AaronHarris on IRC
  • From: Minneapolis, Minnesota, USA
  • Skills / Tools: My current favored languages are Scala and Kotlin. I'm also familiar with Java, Haskell, and Emacs Lisp. I'm comfortable in IntelliJ and have my local Terasology workspace already set up there.
  • Found via: A web search on how to start contributing to open source projects.
  • Interests: I've played a whole lot of Minecraft, mostly heavily modded tech-heavy packs (my favorite setup is a Skyblock variant where you're confined to the inside of a Compact Machine).

    I don't have any particular thing that I'd like to work on, so point me at whatever needs doing. In the absence of input, I was planning on starting with Issue #3101, since that looks fairly straightforward and there's no indication that someone else has picked it up.
  • Extra: I'm a hobbyist programmer looking for my first job as a developer, so my ulterior motive here is to get some practical experience that I can put on my resume.
I just submitted my first PR, and ran into the following issues:
  • When I tried to run Checkstyle I got the error "Could not find tools.jar. Please check that C:\Program Files\Java\jre1.8.0_144 contains a valid JDK installation." I have no idea how to track this down. Anyone have any advice?
  • I also didn't add any unit tests, as much as I would have liked to, because I have no clue how to test UI code. The key element is that I don't see any way around instantiating NUIManagerInternal (since the thing to test is that the new lifecycle method is being called at the appropriate times), but that requires a CanvasRenderer object that I don't think I can get (trying to get it from the context associated with a TerasologyTestingEnvironment throws an NPE, which makes sense, since it's part of the graphics system). I did manual testing with log statements instead, but I'd like to know if there's a way to do this that I'm not seeing.


Org Co-Founder & Project Lead
Hi @Aaron Harris and welcome! :)

I just checked out the PR, very nice work. The Checkstyle issue is because whatever way you run Checkstyle is picking up a JRE on your system PATH rather than an SDK (as visible in your visible path there). You can install the Checkstyle plugin for IntelliJ to run it per file within the IDE (including its Java settings) rather than attempting everything with a Gradle execution on the command line. To fix it via Gradle tweak your PATH and/or JAVA_HOME :)

On unit testing there has been some recent progress (pinging @kaen and @oniatus) on running tests with a bigger game environment. It isn't quite to the point of running automated tests with a full game window. One day though!

Protip: We support both Scala and Kotlin for module development! Although we haven't had anybody start any such modules so our build system isn't quite prepared for it yet. I've got some related improvements in a local workspace.
@Cervator, thanks for the Checkstyle help. The plugin works fine (though I then ran into another minor issue).

I figured the next step for me was to move out to the modules and make sure I understand how to work with them. A couple questions:
  1. With the main repo, my fork is the origin and I have a separate branch for upstream. Within a module repo, the origin seems to be the module's upstream. Does that mean I need a separate fork for each module, or do I do something like submit my changes directly on feature branches and make an internal PR to get them merged?
  2. Running tests in any module seems to give me an error: gradle-resources-test:Core: java.lang.NoClassDefFoundError: org/apache/tools/ant/util/ReaderInputStream. I found this IntelliJ issue (that even mentions Terasology), but "Invalidate Caches / Restart" (as suggested there) didn't work; neither did rerunning gradlew idea. I don't get the same problem when running engine tests (maybe because they have a separate IntelliJ module associated with them?) Any ideas?
Also, thanks for the hearty welcome. I've been very impressed with how welcoming you guys are to new contributors, and with how detailed your "how do I get started" documentation is. In fact, the latter is why I picked this project in the first place.


Org Co-Founder & Project Lead
Appreciate the kind words! We still have a long way to go to improve our documentation and responsiveness, but at times we do decently :)

For module work if you're interested in a given module that isn't hugely active we often just hand out push rights to the repo so you don't have to worry about forks. At that point for any controversial/breaking changes you can use branches and internal PRs yep. If you do want to use forks (plenty do) then you just manually cd into modules/SomeModule and git remote add aaron https://github...., fetch, and push to the right place.

Neat to see our project listed in an IntelliJ issue :D I have never seen that error, that sounds really weird. Sometimes NoClassDefFoundError is caused by our module sandbox security, when a class not on the whitelist is used from a module. That class probably isn't on there - but based on the description in the issue I suspect it is more a path that Gradle takes while executing that somehow trips on the project. Have you done the "Link with Gradle" step by chance? Usually when we run unit tests they're pure IntelliJ, no Gradle involved. Linking with Gradle inside IntelliJ is currently more or less unsupported and might lead to quirks (maybe somehow Gradle + IntelliJ + unit testing modules hits the module sandboxing).

Do you get the same issue from pure command line running something like "gradlew test" ?
I haven't done "Link with Gradle", or at least I think I haven't. IntelliJ asked me when I first set the project up if I wanted to auto-sync, and I said no; other than that (and running gradlew idea) I haven't messed with Gradle at all.

I tried adding that class to the sandbox whitelist and still got the error, so I don't think I'm hitting the sandbox.

Running gradlew test got me a whole different set of problems. It could run the tests, but most of them failed due to path problems like this:

java.nio.file.InvalidPathException: Illegal char <:> at index 2:

I'm guessing that means my Cygwin setup is screwy somehow, but not running into the original error is progress, I suppose.


Org Co-Founder & Project Lead
Ooooh Cygwin. Yes, I wouldn't put much faith in that working honestly :)

Terasology's internals tends to use virtual file systems and other fun things, Gradle organizes file collections, and so on. Running that wrapped in Cygwin is probably likely to run into pathing issues like what you mention there.

I honestly don't know if anybody has ever tried to run from source using Cygwin before, or has gotten it to work fully.
Well, I haven't really used Cygwin for anything aside from bash in years, and there are other ways to get bash, so I went ahead and stripped it out. I don't think it was exactly related, but somehow the process got IntelliJ to run the tests. I had to move the project, so IntelliJ's treating it as a brand new project; maybe that did something. Anyway, I was still getting those path exceptions, but I eventually figured out that the cause there was needing to explicitly fetch a dependency module (MarkovChains) for the one I was running the tests on (NameGenerator). So, in conclusion, everything's fine now and I'm back to work.