Skip to content

Design for unified behavior controls #2974

Closed

Description

@mmitche

Describe the Problem

Right now, there is a rough assumption that the DotNetBuildFromSource property means building from source on Linux. This property is used to trim away package references, sources, target frameworks, and behaviors that should not be present when building from source on Linux (in offline mode).

The eventual goal is that Windows and Mac will use the same approach as Linux source build for building (a single all-up build per platforms), however the behavior and requirements will likely differ per platform. Examples:

  • Mac and Windows source builds may use pre-builts not allowable on Linux
  • Mac and Windows source builds may not trim away certain sources or package references not allowable on Linux.

Because the current source build schema is focused on Linux, we will need to redesign it to support multiple platforms.

In addition to this, improvements to the way that .NET builds will allow more organizations to build the product, and more organizations to include code or behavior in the source base that is not active during other builds. For instance, Microsoft may use specific functionality to sign binaries for its distribution, while other organizations may use another, Today, this pivot is largely represented by DotNetBuildFromSource

Describe the Solution

We need a coherent design for source build on other platforms. This design should:

  • Allow for an arbitrary set of platforms
  • Allow for different pre-built sets.
  • Allow for online vs. offline behavior.
  • Allow for different organizational behavior.
  • Allow for trimming of TFM targets (e.g. don't target net472 on Linux). This ideally does not involve conditionalization in a vast number of projects.
  • Still allow for platform-agnostic source build behavior (maybe use the existing properties)
  • Provide a rollout plan that is a smooth offramp from the current design and into the new one. It would be ideal if this was a scriptable, mechanical change.

Additional Context

Sub-issues

Activity

  1. mmitche commented on Aug 9, 2022

    @mmitche
    MemberAuthor
  2. jkotas commented on Aug 10, 2022

    @jkotas
    Member

    Mac and Windows source builds may not trim away certain sources or package references not allowable on Linux.

    Not allowable in Linux distros. These dependencies can be perfectly fine when building for Linux in less stringent environments. There are number of reasons why it should be ok to allow these dependencies in less stringent environments. For example, some tests have dependencies like that.

    We should decouple full stack build and offline build. Full stack build means that we are building the whole thing from VMR. Offline build means that everything has to be built from sources, no binary-only external packages allowed.

  3. mmitche commented on Aug 10, 2022

    @mmitche
    MemberAuthor

    Mac and Windows source builds may not trim away certain sources or package references not allowable on Linux.

    Not allowable in Linux distros. These dependencies can be perfectly fine when building for Linux in less stringent environments. There are number of reasons why it should be ok to allow these dependencies in less stringent environments. For example, some tests have dependencies like that.

    We should decouple full stack build and offline build. Full stack build means that we are building the whole thing from VMR. Offline build means that everything has to be built from sources, no binary-only external packages allowed.

    Good points. So there are a few pivots:

    • Platform - Differentiates what platform we're building for
    • Source-build enabled? (eventually most of these switches go away) - These would go away in most repos (some repos with dual insertions like roslyn may keep them) after the current official build methodology is removed.
    • Offline vs. Online - Switches allowable pre-builts and build behavior. This would not be functional on certain platforms, like Mac and Windows.

    Maybe Offline vs. Online isn't the right terminology for this. Perhaps it should be Strict vs. Non-strict, or Full vs Source-Only?

  4. changed the title [-].NET 8: Design support to build multiple source-build platforms[/-] [+].NET 8: Design support to build multiple source-build platforms and organizations[/+] on Aug 10, 2022
  5. changed the title [-].NET 8: Design support to build multiple source-build platforms and organizations[/-] [+].NET 8: Redesign source-build behavior controls[/+] on Aug 10, 2022
  6. added
    area-infraSource-build infrastructure and reporting
    and removed on Aug 11, 2022
  7. MichaelSimons commented on Jun 15, 2023

    @MichaelSimons
    Member

    @mmitche - is this something that is still in scope for .NET 8?

  8. mmitche commented on Jun 15, 2023

    @mmitche
    MemberAuthor

    Unsure whether we'd implement, but we'll get to the design in the .NET 8 timeframe. This is what we put on the schedule yesterday.

  9. moved this from Needs Review to 8.0 Backlog in .NET Source Buildon Jun 15, 2023
  10. changed the title [-].NET 8: Redesign source-build behavior controls[/-] [+].NET 9: Redesign source-build behavior controls[/+] on Jul 20, 2023
  11. 3 remaining items

  12. moved this to In Progress in .NET Unified Buildon Jan 3, 2024
  13. mmitche commented on Jan 3, 2024

    @mmitche
    MemberAuthor

    T Shirt size (remaining): Small

  14. changed the title [-].NET 9: Redesign source-build behavior controls[/-] [+]Design for source-build behavior controls[/+] on Jan 12, 2024
  15. changed the title [-]Design for source-build behavior controls[/-] [+]Design for unified behavior controls[/+] on Jan 12, 2024
  16. mmitche commented on Jan 17, 2024

    @mmitche
    MemberAuthor

    Unless there are additional comments here, I am going to md-ify this doc and put it in the UnifiedBuild docs and call it done.

  17. mmitche commented on Jan 23, 2024

    @mmitche
    MemberAuthor

    Completed when dotnet/arcade#14407 is merged

  18. moved this from In Progress to Ready in .NET Unified Buildon Jan 25, 2024
  19. moved this from Ready to Done in .NET Unified Buildon Jan 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area-infraSource-build infrastructure and reporting

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions