Skip to content

Linux + Windows dependency builds #203

@ericmehl

Description

@ericmehl

With pieces of Gaffer for Windows slowly getting merged into Cortex and soon Gaffer, I suppose it's time to face the terrifying idea of how we are going to get the Windows dependencies organized and maintainable.

Especially for the "maintainable" part I'm guessing we all agree that it's best to have as few differences between the Linux and Windows configs, correct? Alternatively we could go with parallel configurations and maintain them separately. That's pretty much how I have them building now, but I think it's worth an effort to get them combined as much as possible.

A while back we were converting Linux syntax to Windows for things like file copying but it eventually grew into a mess of special case handling that was getting less and less reliable. Now I'm thinking it might be better to extend the configuration file scheme with more "semantic" commands that take the place of the system commands. Something like {"copy": ("source", "destination")} to replace cp source destination. Then the config.py script can do the right thing based on the platform.

Scanning through the configs, it doesn't look there would be too many commandlets to make: cp, mv, rm, mkdir, cd, and a couple for the build systems look like it would take care of almost all of it?

The other big issue is getting the different build commands in sync. I've resorted to a "just get it to work" approach for now, where I create totally separate Windows configurations. Not ideal, but as an intermediate step it has the advantage of easily being able to see what parameters are common to both platforms.

For example, cmake commands seem to often need to include additional parameters on Windows. I'm not 100% sure those are really always needed so some can come out. For the others I'm thinking it might be useful to have a cumulative set of parameters passed to cmake that build.py compiles. All the parameters in common can go in the main configuration, then each platform can have additional parameters that config.py adds on to the common parameters. This would probably benefit also from the semantic style as well such as {"cmake": ["all", "parameters", "here"]}. Then it would be easy for config.py to combine the lists.

That would make the differences between platforms more explicit and easier to figure out where something is going wrong when upgrading packages. Hopefully?

Another more out-there idea I had was converting the config files to yaml, which has some built-in functionality for things like combining lists. I personally find yaml to be kind of esoteric, but maybe I'd warm to it if I worked with it more often. It would also add a dependency to the dependency builder (as far as I know yaml parsing isn't built in to Python) which makes me a little sad.

I'm certainly open to other ideas...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions