2 Replies Latest reply on Dec 3, 2009 12:43 PM by michael.walker

    Building on Windows

    michael.walker

      I've been able to build Teiid on fedora without any issues, working off the current trunk. I found that the same code does not build on windows without making some modifications to the tests. Has anyone else run into these issues?

      The majority of the errors were com due to line feed (\r) vs. newline (\n) comparison issues in the tests. This is easily fixed by stripping out the line feed characters here and there, which is already done in some parts of the test code. I've copied and added it where appropriate, and can commit these changes, though I'm interested to see if anyone else has encountered them before.

      One other oddity on Windows -- com/metamatrix/systemmodel/TestSystemVirtualModel.java:115 expects system.getVDBResourcePaths() to returns a value, but it returns none (on Windows). This is not true for linux. I see no reason why the behavior should be any different.

      Changing this last test allows my system to build successfully in full, but this would break the linux build if it were checked in. Any ideas why this test would behave differently?

        • 1. Re: Building on Windows
          rareddy

          I know we made sure the original code ported all worked on both environments. I have to agree I have not run on Windoze in a while. I suspect most of the issues might be from "test-integration" project, which has been introduced recently and still going though lot of changes.

          I say commit the tests with carriage return problems, and last one needs to be investigated as to why in Windoze that is not returning the results as Linux version.

          Ramesh..

          • 2. Re: Building on Windows
            michael.walker

            Great, I will commit the line feed fixes today.

            As for the issue with getVDBResourcePaths(), I found a bug in the implementation of EmbeddeVDBService.getFileVisibility that would occur on Windows only.

            The problem is on line 165, where we attempt to parse out the name of each file in an exploded VDB archive:

            String modelName = StringUtil.getFirstToken(StringUtil.getLastToken(pathInVDB, "/"), ".");


            The problem is that on Windows, "/" will not be present in the path, since it uses backslashes. We should instead use File.separator here to have platform-generic code:
            String modelName = StringUtil.getFirstToken(StringUtil.getLastToken(pathInVDB, File.separator), ".");


            I made that change, and had to add the same change to the TestSystemVirtualModel test to ensure we produce the test path correctly. The test now passes on Windows as well as Linux. I will commit this change as well, unless you see any issue here, thanks.