fetchTarball with multiple top-level directories fails

I’m trying to create a binary package from a tarball, because the source is really hard to build (maven with tycho plug-in, a eclipse repo using osgi with maven on top of it) and I failed miserably. I thought, what if just use the provided builds which are tar.gzs, but with multiple directories in the archive. fetchZip lets us fix that with stripRoot, but it seems to me fetchTarball does not. Is there any work around of this?

Example tar: https://download.eclipse.org/jdtls/milestones/1.12.0/jdt-language-server-1.12.0-202206011637.tar.gz

Fetching such a tar fails with ‘some text, multiple output directories, some text’.

Moreover, what is the reason that this fetch has to fail?

I don’t know about the reasons, though using fetchurl instead and manually unpacking should work as a workaround.

1 Like