On 4 April 2016 at 14:17, Andrew Wilkins <andrew.wilk...@canonical.com> wrote:
> Hi,
>
> I would like to write a charm that should be mostly identical on Windows and
> Linux, so I think it would make sense to have common code in the form of a
> layer.
>
> Is anyone working on getting "charm build", layers, and friends to work with
> Windows workloads? If not, I may look into it myself.

I think you could do it right now if you added explicit powershell
hook stubs that a) ensure Python is installed on the path and b) kick
off the Python hooks. https://github.com/juju/charm-tools/issues/98 is
about having 'charm build' generate the required hook stubs from
layer.yaml instead of embedding them, which will help here in the
future.

You will need two root layers for the two charms, one for Ubuntu and
one for Windows, since you can't list both Windows and Ubuntu releases
as supported series in the same metadata.yaml.

A source of potential problems is charmhelpers as it is not tested
under Windows and there are likely linuxisms burried in there.
charms.reactive doesn't need much of it though, so it is likely to be
fine. I haven't seen anything obviously platform dependent apart from
the obvious stuff like wrappers around apt. There might be some linux
specific imports at the top level that need to be moved to import on
demand (import apt, import distro_info etc).

-- 
Stuart Bishop <stuart.bis...@canonical.com>

-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju

Reply via email to