Skip to content

.NET Source-build instructions #2602

Closed

Description

@lbussell

There should be easily accessible instructions for building .NET 6.0 from source in the dotnet/installer readme.

The instructions should address everything you need to build .NET from source, including dependencies. Ideally, this would be something we can point Linux distros and package maintainers to for instructions on how to build .NET for their distro.

Activity

  1. added this to the 6.0 milestone on Nov 3, 2021
  2. self-assigned this
    on Nov 3, 2021
  3. ghost added
    area-product-experience
    on Nov 3, 2021
  4. added
    area-doc
    and removed
    area-product-experience
    on Nov 3, 2021
  5. omajid commented on Nov 3, 2021

    @omajid
    Member

    Hey, @alucryd @loqs @cerebrate @directhex , what documentation would you find helpful?

    From my point of view, as a maintain for .NET in Fedora, a doc that covers the following would be useful to have:

    • Where can I find the latest releases?
    • Where can I find the source code for latest releases?
    • How do I build those releases? What dependencies are required?
    • Can I bootstrap .NET (so it doesn't download anything at build time but only uses things I have already on disk)? If so, how?
    • What architectures can I build .NET on? How do I do that for anything non-x64?
    • What are the suggested packages names and their contents? What should the dependencies between packages look like? (Distros are free to deviate, but source-build can make suggestions).
  6. alucryd commented on Nov 5, 2021

    @alucryd

    @omajid That's pretty much what I would ask for, thanks for making this list. Speaking from past experience, compatibility with nspawn and capability needs (if any) would be nice to have as well, this was troublesome in the 2.x era. And the dependency version information as well, minimum and/or maximum version, like how the current dotnet releases don't work with lttng-ust >= 2.13.0.

  7. sec commented on Nov 5, 2021

    @sec

    Also what about OS'es that are not supported atm? Like for example, FreeBSD, we're able to crosscompile working SDK, then native build SDK using that as bootstrap - would it be possible to use the same path using source-build? I've tried that, but at some stage it was missing runtime's nupkg specific for FreeBSD - any info how to also include those into tarball for offline build would be nice for ex. :)

  8. alucryd commented on Nov 12, 2021

    @alucryd

    FYI, I tried building 6.0 using the instructions on the installer repository, and it fails during the runtime compilation, the errors seem to stem from error MSB4018: System.MissingMethodException: Method not found: 'Int32 Microsoft.CodeAnalysis.ISymbol.get_MetadataToken()'.

    @omajid I see you ran into this before, I'll try disabling package validation like you did.

  9. alucryd commented on Nov 12, 2021

    @alucryd

    Disabling package validation allowed it to progress further, but it still crashed after an hour and a half of compilation... Segfault while building aspnetcore. @omajid can you get past aspnetcore on fedora?

  10. omajid commented on Nov 12, 2021

    @omajid
    Member

    On Fedora 34, the build works end to end. On 35, my builds are hanging (not crashing, just hanging) while trying to build aspnetcore. The actual hang appears to be in the crossgen process.

  11. alucryd commented on Nov 12, 2021

    @alucryd

    Got it. What versions of lttng-ust do you have on 34 vs 35? Wondering if that's the culprit, I'll try to create a lttng-ust2.12 compat package here.

    Edit: Nevermind, looked it up on repology. Looks like even using 2.12.2 might not cut it, I'll start with 2.12.0.

  12. omajid commented on Nov 12, 2021

    @omajid
    Member

    Fedora 34 is lttng-ust-2.12.0-4.fc34.x86_64. Fedora 35 is lttng-ust-2.12.2-5.fc35.x86_64.

    If it's really lttng, perhaps a export COMPlus_LTTng=0 will workaround the issue? It disables loading lttng at runtime.

  13. 8 remaining items

  14. alucryd commented on Nov 12, 2021

    @alucryd

    @alucryd export COMPlus_LTTng=0 did not fix my issues :(

    Meh, that's too bad. Do you have a way to force lttng-ust to 2.12.0 on 35?

    The build succeeded with 2.12.0 here, I'll give 2.12.2 a try later then so we can confirm whether it's the culprit.

  15. alucryd commented on Nov 14, 2021

    @alucryd

    @omajid Oh well, our clang was updated to 13 yesterday, which caused a lot of build errors in the runtime. Unlike what the readme seems to indicate, EXTRA_CFLAGS are not respected at all and I had to patch quite a few CMake files to add the various -Wno- flags.
    Now I'm faced with the same error as you, it hangs on aspnetcore, and I'm pretty sure the only difference compared to the day before yesterday is the clang update. I see you have a clang12 package in fedora 35, did you try building with that one?

    Edit: Going back to clang 12 gets past the aspnetcore hang indeed.

  16. omajid commented on Nov 15, 2021

    @omajid
    Member

    Thanks for the pointers, @alucryd !

    dotnet/runtime#61442 should fix the -Werror issues. It was a release oversight, I think.

    Thanks for the tip on clang 12 vs 13. Looking at Fedora 35, we have a compatiblity package for clang 12 - there are libraries, but not the actual compiler itself. I am going to build llvm/clang 12 from source and see if that works.

  17. DmitryJustDmitry commented on Jan 11, 2022

    @DmitryJustDmitry

    asbjornu - Starting in 6.0, source-build is going to be produced from dotnet/installer. You can use the 6.0.101 tag to build .NET 6 from. You can refer to the building instructions.

    Excuse me, looks like a typo - the link is to the tag/v6.0.100, but the text is 6.0.101. 101 is inaccessible without credentials:

    Username for 'https://dev.azure.com':
    Password for 'https://dev.azure.com':
    
  18. asbjornu commented on Jan 12, 2022

    @asbjornu
    Member

    @DmitryJustDmitry, thanks for providing that essential piece of information! With version 6.0.101 I got stuck on the missing credentials as described in #2719 (comment), but with version 6.0.100 everything builds successfully and I've managed to submit Homebrew/homebrew-core#92991 to Homebrew.

  19. omajid commented on Jan 12, 2022

    @omajid
    Member

    AFAIK, the 6.0.101 release accidentally included some non-public URLs (it wasn't really accidental, it was just a bit-by-bit copy of how the internal builds are done, I think). It might be worth trying to apply dotnet/installer#12852 on the local checkout of 6.0.101 to see if that fixes it.

  20. asbjornu commented on Jan 12, 2022

    @asbjornu
    Member

    @omajid, thanks, but if 6.0.100 passes, I think we'll just await a new public release that works without any patches applied.

  21. asbjornu commented on Jan 13, 2022

    @asbjornu
    Member

    Alas, 6.0.100 does not work either. As I write in #2719 (comment), the nuget-client step fails. 😕

  22. moved this from 6.0 BackLog to 7.0 Backlog in .NET Source Buildon Apr 28, 2022
  23. changed the title [-].NET 6.0 Source-build instructions[/-] [+].NET Source-build instructions[/+] on Jun 21, 2022
  24. lbussell commented on Jun 21, 2022

    @lbussell
    MemberAuthor

    Coming back to this, I think we should update dotnet/installer's readme to point to the dotnet/source-build readme for instructions on how to build source build. The installer readme's instructions aren't the most up-to-date. Either that or we should move all the instructions to installer and point to them from source-build. The current set of instructions we have are different between the repos. This goes for main and supported release/6.0.xxx branches.

  25. Repository owner moved this from 7.0 Backlog to Done in .NET Source Buildon Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-doc

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions