Development Setup

Hey there, just wanted to see if there was going to be some sort of movement towards fixing this? I know that some work was done before the OH3 release in regards to fixing this for binding development, but core is pretty broken on a fresh install. (109 errors, and if you try to fix them you only seem to make it worse)

I’ve been looking for things to chip into in regards to the issues lists on Github and most that I think I could track down and try to resolve seem to be core related(or at the least would be helpful if I had a debuggable core). I’m not a mvn or karaf pro, but I think I(and many others) would be more inclined to help chip away at issues if something was working w/ the IDE.

I have yet to move my “production” install to OH3 as there are things I need to work that don’t or can’t in it’s current state and instead of complaining about it, I’d love to help fix it but I’m sort of strapped without a working build environment.

I recently put out a release of the PLEX binding for OH3 which I’ll be doing a PR for in the next few days or so, and I’d like to be able to contribute a bit more but I’m stuck. There are a bunch of things that are “show stoppers” for me moving to OH3, and I have a bunch of various hardware here so I could possibly help with a lot of issues, certainly considering most of them seem somewhat minor.

I did search for some resolutions to these build issues, and all recommendations I have seen(and I have tried about 1/2 dozen) seem to either do nothing but waste my time or make issues worse. There was also a post back in November with someone asking the same exact thing, no response on that one. Ideally we’d be able to run the installer and select Core, Dev, and Addons(then obviously import any bindings you want to work on).

I don’t want to seem like I am being pushy, I just really want to see if I can help here. I know everyone is working for free, no one is paid, but I’d think if someone could document this a bit more as it might be easier to review pull requests than it is to track down a bunch of these issues.

There is certainly room for documentation improvement. But if you do binding development you do not need or require to import core.

Understood, and I have done binding development. I get that, and it works fine. So does the webUI stuff, works and builds fine.

I’m looking more into trying to fix(or at least identify and help fix) some of the larger problems as they affect the most people. It would seem that a lot of those dip into the core.

An example would be the issue where Images don’t work in a sitemap, which is obviously a problem. They work when using a file based sitemap, but not through the GUI. I’ve tracked that into a core component as a possibility(actually org.eclipse.emf.ecore.EObject), though it’s very difficult to continue the effort when you can’t actually build core(or even have it in your environment) without breaking other things.

Even to debug core you don’t need to import core. You can still open core classes and it should download source jars for core (although I think this doesn’t always triggers) or have the sources locally and point Eclipse to it. If you than want to modify something, just import what you want to modify. This is probably a lean approach, and having all of core in eclipse in some cases can be preferred.

I think if you run you need to run a maven build on core the first time to generate some of the missing classes it complains about.

With regards to the image problem. EObject is not part of core, but a library used by core. I doubt the problem is in that class, but I haven’t seen the details. Given the ui is completely new, I would expect the issue to be in how the new ui creates the sitemap.

I get what you’re saying here is that it’s not “required”, but I don’t see how it wouldn’t be preferred other than the build time once you change something. That’s all I ever seem to see when people ask about it is the excuse “you don’t need it to do XYZ”. And while that might be true, it certainly makes life quite a bit easier.

Running a clean build on a freshly checked out core fails both in windows and linux, I’ve tried just about every approach I can come up with along with 3 different versions of java.

As far as the image problem, I completely agree it’s most likely in the UI. Though as someone who wanted to look into it, not having a full environment that would actually build is a problem. Maybe it’s not for some people. And it’s not always about something you want to modify, sometimes it’s helpful to be able to throw a breakpoint in somewhere(certainly for someone like me who is trying to learn more about OH) and without being able to have core in Eclipse along with the WebUI that’s a show stopper.

I’m sure someone out there has a build environment that works. I can’t think it would be that bad to want to have more people willing to help. I’m ready, willing, and well, unable.

1 Like

If you think there is a build problem, please report. I just did a check and compiled core with a empty maven cache. I used java 11 (which is the only version that is supported at the moment) and ran with:
mvn install -DskipTests -DskipChecks=true

Yes if you clone the branch and then build it, that works fine. But go ahead so follow the process for setting up an environment in Eclipse, looking to target Core. I’ve done just Core, Core and Dev, Core w/ Dev and WebUI and every single combination of the above with and without addons. It doesn’t build. Lowest I have gotten it to is 59 errors.

Can you check it out separately and then build it, sure. But the documentation (Eclipse IDE | openHAB) doesn’t say a word about that. That also doesn’t give you a development environment, that gives you a built directory with no documentation what-so-ever on what to do from there.

And if you let Eclipse do it’s thing, close it(so it doesn’t auto build something) and then take to mvn and such in the cli you wind up with :

[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.0.3:check (codestyle_check) on project org.openhab.core.features.karaf.openhab-tp: The following files had format violations:

It’s somewhat obvious it may have something to do with the line endings on a file, and says to run mvn spotless on it. Doing that does absolutely nothing and actually makes things worse. Then I tried to change the line endings on the specific file it’s complaining about(all three options, windows, linux, and mac) and that makes no difference either.

So there is obviously some major difference between how the process is done in Eclipse vs how it is done just checking it out and building it. All I’m asking is for what that might be. Someone helps with that and I’ll do the documentation.

Or just give up, seems like an up hill battle here.

I did a new installation of core. And it does have some problems with relation to the model projects. I’ve created a issue 2121 about this in openhab-core. In short it doesn’t add the generated directories correctly to the eclipse environment causing it to not be able to find the sources in those directories. See the issue for more details.

3 Likes

Thank you very much, greatly appreciated!