tianocore / edk2-pytool-extensions

Extensions to the edk2 build system allowing for a more robust and plugin based build system and tool execution environment
Other
60 stars 40 forks source link

nuget_dependency: Allow path override #871

Closed Javagedes closed 1 month ago

Javagedes commented 1 month ago

As described in external_dependency.py#L38, the name configuration is the name of the ext_dep, used to name the folder the ext_dep will be unpacked into. When the nuget external dependency was added, name also became the name of the package you are downloading, which tightly couples the name of the package and the folder path. This means there is no way to name the folder something other than the package name, which can be necessary in some situations.

This change provides a backwards compatible way to de-couple the package name from the folder name by introducing a new, optional config for nuget dependencies, package. package will be used as the package name to download while name will continue to be the name of the ext dep and the folder it is downloaded to. For backwards compatability, if package is not used in the configuration file, name will be used instead.

apop5 commented 1 month ago

Is there an example for this?

Javagedes commented 1 month ago

Is there an example for this?

@apop5 The example that brought about this requested change is header files that are downloaded via external dependency and are in a package's Include/* folder. There are two mutually exclusive external dependencies at this location, but only one exists at any point in time. In that package's dec file, you cannot simply add both folders to it, because one will exist and one will not, and the build will fail. So they need to be able to download one or the other extdep to the same folder.

Additionally, macros don't work in dec files, so we cannot set a build variable within the extedep then do something along the lines of:

[Includes]
$(VAR_NAME)
codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 78.71%. Comparing base (bf643b0) to head (767959e). Report is 100 commits behind head on master.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/tianocore/edk2-pytool-extensions/pull/871/graphs/tree.svg?width=650&height=150&src=pr&token=vVJxZexcTI&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tianocore)](https://app.codecov.io/gh/tianocore/edk2-pytool-extensions/pull/871?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tianocore) ```diff @@ Coverage Diff @@ ## master #871 +/- ## ========================================== - Coverage 78.75% 78.71% -0.05% ========================================== Files 49 41 -8 Lines 4909 5050 +141 ========================================== + Hits 3866 3975 +109 - Misses 1043 1075 +32 ``` | [Files with missing lines](https://app.codecov.io/gh/tianocore/edk2-pytool-extensions/pull/871?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tianocore) | Coverage Δ | | |---|---|---| | [...oolext/environment/extdeptypes/nuget\_dependency.py](https://app.codecov.io/gh/tianocore/edk2-pytool-extensions/pull/871?src=pr&el=tree&filepath=edk2toolext%2Fenvironment%2Fextdeptypes%2Fnuget_dependency.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tianocore#diff-ZWRrMnRvb2xleHQvZW52aXJvbm1lbnQvZXh0ZGVwdHlwZXMvbnVnZXRfZGVwZW5kZW5jeS5weQ==) | `87.50% <100.00%> (ø)` | | ... and [48 files with indirect coverage changes](https://app.codecov.io/gh/tianocore/edk2-pytool-extensions/pull/871/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=tianocore)