Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project and package reference support #8

Open
alexrp opened this issue Jun 20, 2021 · 7 comments
Open

Project and package reference support #8

alexrp opened this issue Jun 20, 2021 · 7 comments
Assignees
Labels
area: samples Issues related to sample projects. area: sdk Issues related to the MSBuild SDK. area: tasks Issues related to MSBuild tasks. state: approved Enhancements and tasks that have been approved.
Milestone

Comments

@alexrp
Copy link
Member

alexrp commented Jun 20, 2021

Tracking issue for ProjectReference/PackageReference support.

@alexrp alexrp added type: feature state: deliberation Issues that require design work and/or discussion. area: sdk Issues related to the MSBuild SDK. area: samples Issues related to sample projects. area: tasks Issues related to MSBuild tasks. labels Jun 20, 2021
@alexrp alexrp self-assigned this Jun 20, 2021
@alexrp
Copy link
Member Author

alexrp commented Jun 20, 2021

Goals:

  • Managed projects should be able to reference Zig.Sdk projects.
    • Zig.Sdk projects should not be seen as managed (i.e. don't pass it to csc /reference:...).
    • Zig.Sdk projects must never be seen as RID-agnostic.
    • If the referencing project is doing a RID build, it should copy the output from the Zig.Sdk project to the root of the output directory.
    • If the referencing project is doing a RID-less build, it should copy the outputs from the Zig.Sdk project for all of its supported RIDs to runtimes/<rid>/native/ (tools/<rid>/native/ for an executable project) in the output directory.
      • This will require triggering multiple builds in the Zig.Sdk project.
  • Managed projects should be able to reference Zig.Sdk packages.
    • This should Just Work since native libraries are packed into runtimes/<rid>/native/.
    • Need to verify that in a Managed -> NativePackage1 -> NativePackage2 graph, NuGet flows NativePackage2 to Managed.
  • Zig.Sdk projects should be able to reference other Zig.Sdk projects.
    • We need to transitively pick up native libraries, include directories, and the Zig package directory.
    • If it's an executable project, we should include all dependent native libraries in the output directory, publish directory, and package.
    • A project referencing an executable project is not supported and should ideally produce an error.
  • Zig.Sdk projects should be able to reference managed projects.
    • Not for runtime consumption; mainly for tooling/build purposes (i.e. ReferenceOutputAssembly=false).
    • Embedding/hosting scenarios are very out of scope (for now, at least).
  • Zig.Sdk projects should be able to reference managed packages.
    • Not for runtime consumption; mainly for tooling/build purposes (e.g. Nerdbank.GitVersioning).
    • This should already Just Work, but needs testing in a sample project.
  • Zig.Sdk projects should be able to reference Zig.Sdk packages.
    • We need to pick up native libraries (runtimes/<rid>/native/), include directory (include/), and Zig package directory (zig/).
      • These also need to flow transitively to dependents.
    • No special logic for executables (tools/<rid>/native/ in the package).

Notes:

  • Managed -> Zig.Sdk project references will need to use this pattern.
  • Giving a helpful error for project reference cycles would be nice, but isn't essential.

@alexrp alexrp added state: approved Enhancements and tasks that have been approved. and removed state: deliberation Issues that require design work and/or discussion. labels Jun 21, 2021
@alexrp
Copy link
Member Author

alexrp commented Jun 27, 2021

Part of this work is going to be blocked by https://github.com/dotnet/runtime/issues/54645.

@alexrp
Copy link
Member Author

alexrp commented Jun 27, 2021

This is going to depend on ziglang/zig#9251 ziglang/zig#9347. Hopefully it (in some form) can be included in Zig 0.8.1.

@alexrp alexrp modified the milestones: 2.0.0, 2.0, 3.0 Jun 30, 2021
@alexrp
Copy link
Member Author

alexrp commented Jul 8, 2021

To make consumption of Zig.Sdk packages work, we will need to resolve their extracted location on disk to discover their C/C++ include directory and Zig package directory. This can only be done reliably by reading project.assets.json. We can either do that directly or by using the NuGet.ProjectModel.LockFileFormat API.

@alexrp
Copy link
Member Author

alexrp commented Aug 6, 2021

@alexrp alexrp modified the milestones: v3.0, v4.0 Sep 7, 2021
@alexrp
Copy link
Member Author

alexrp commented Sep 7, 2021

Changing milestone since ziglang/zig#9347 didn't make Zig 0.8.1.

@alexrp
Copy link
Member Author

alexrp commented Dec 20, 2021

Things should be in place to start work on this in Zig 0.9.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: samples Issues related to sample projects. area: sdk Issues related to the MSBuild SDK. area: tasks Issues related to MSBuild tasks. state: approved Enhancements and tasks that have been approved.
Development

No branches or pull requests

1 participant