<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/54716>54716</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Package subprojects + CMake files without mangling subproject name
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          h-vetinari
      </td>
    </tr>
</table>

<pre>
    As a follow-up to #53281, the following came up in the [discussion](https://discourse.llvm.org/t/rfc-stand-alone-build-support/61291/15) on discourse about the subproject builds:

> > > > @h-vetinari: Sidenote: it would be really nice if the subproject sources didn’t mangle the folder names. I completely agree that the _tarball_ should be versioned - e.g. `clang-14.0.0.src.tar.xz`, but it would be nice if the contained folder would be called `clang` rather than `clang-14.0.0.src` (reason being that we would otherwise need manual editing of the patches we carry for every single release and release-candidate; it wasn’t an issue before LLVM 14 because there was only one folder, but following the [addition](https://github.com/llvm/llvm-project/issues/53281) of the shared cmake folder there are now two).
> > >
> > > @jyknight: ISTM it would be good for the subproject sources to look like a filtered version of the whole repository extracted under a single toplevel directory. Having a tarfile extract to multiple toplevel directories is a bit unusual/unexpected. E.g. `clang-14.0.0.src.tar.xz` should extract to `clang-14.0.0.src/clang/{lib,include,...}` and `clang-14.0.0.src/cmake/...` rather than the current `clang-14.0.0.src/{lib,include,...}` and (unnumbered separate toplevel dir) `cmake/...`.
> >
> > @h-vetinari: That would be equally good and help a lot! [...] @tstellar would you be willing to accept a backport for such a patch to release/14.x?
>
> @tstellar: Yes, I think that would be worth backporting.

Note that this was based on the state of things before https://github.com/llvm/llvm-project/commit/23d08271a4b24f21a88bfe73a5ea31c1e2c6365c was merged to `release/14.x`, but AFAICT, that commit doesn't change the folder layout.

CC @kwk @aaronpuchert
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJylVttu2zgQ_Rr5hbAgyXZsP_ghlwZboF0s0G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