Comment 8 for bug 1753340

Revision history for this message
Colin Watson (cjwatson) wrote :

Incidentally, snapcraft's ant plugin already does pick up these environment variables and *attempt* to pass them on to ant, in the bit of code you quoted earlier (you just misidentified what environment variable names it's looking at). The problem is not to do with snapcraft using the wrong environment variable names; the problem is in getting ant to actually use everything properly.

It's been a while since I dug into this, but my memory is that ant's -autoproxy sets a system property and then trusts the JRE to do the right thing, but the JRE doesn't actually honour authenticated proxies and requires a java.net.Authenticator object to be instantiated manually. ant can do the latter, but only with explicit configuration that it's hard to stuff in from the snapcraft level.

The point of my local-snap-proxy branch was to arrange that individual build tools don't need to be aware of the authenticated nature of the proxy, but can instead rely on a secondary proxy running on the builder itself which has the necessary credentials and passes them on to an upstream proxy. That allows us to preserve our build farm security arrangements while keeping things simple for build tools, since in practice too many things don't cope very well with authenticated proxies. I'm slightly confused that you already referenced my merge proposal in your initial bug description but then we've been going through in the course of this bug rediscovering the lines of thought that led to me doing that work in the first place; but maybe I didn't explain its purpose very clearly before, in which case hopefully this will help. And I know that we need to get it actually reviewed and landed.