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

[Bug]: EDK Build Does Not Give an Error on Invalid Library Class Mapping #314

Closed
1 task done
makubacki opened this issue Mar 15, 2023 · 1 comment · Fixed by #452
Closed
1 task done

[Bug]: EDK Build Does Not Give an Error on Invalid Library Class Mapping #314

makubacki opened this issue Mar 15, 2023 · 1 comment · Fixed by #452
Assignees
Labels
complexity:intermediate Requires intermediate background information and effort to accomplish state:backlog In the backlog state:needs-triage Needs to triaged to determine next steps type:bug Something isn't working urgency:medium Important with a moderate impact

Comments

@makubacki
Copy link
Member

Is there an existing issue for this?

  • I have searched existing issues

Current Behavior

A single library instance for a given library class (as defined in the instance INF file) can be mapped to other library class strings in a DSC and an error is not raised.

Expected Behavior

If a library instance with a well-defined library class, as defined in the INF file, is mapped to a different library class in a DSC, a user visible error (or warning) should be raised.

Steps To Reproduce

  1. Find a module in a DSC file
  2. Add a <LibraryClasses> section
  3. Change the class name for a library used by the module to an invalid name

Note: I haven't experimented with this, but I'd expect a higher scoped library class assignment needs to resolve correctly so the build finds a library to link so the build works.

For example, the library class is correctly specified in the overall [LibraryClasses] section of the DSC but invalid in a more specific override section (like the <LibraryClasses> override area).

Build Environment

- OS(s): Windows 11 (tested)
- Tool Chain(s): VS2022 (tested)
- Targets Impacted: All

Version Information

Branch: release/202208

Urgency

Medium

Are you going to fix this?

Someone else needs to fix it

Do you need maintainer feedback?

No maintainer feedback needed

Anything else?

No response

@makubacki makubacki added state:needs-triage Needs to triaged to determine next steps type:bug Something isn't working labels Mar 15, 2023
@github-actions github-actions bot added urgency:medium Important with a moderate impact state:needs-owner Needs an issue owner to be assigned labels Mar 15, 2023
@makubacki makubacki added the complexity:intermediate Requires intermediate background information and effort to accomplish label Mar 15, 2023
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had activity in 45 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions.

@github-actions github-actions bot added the state:stale Has not been updated in a long time label Apr 29, 2023
@makubacki makubacki added state:backlog In the backlog and removed state:stale Has not been updated in a long time labels May 1, 2023
@github-actions github-actions bot removed the state:needs-owner Needs an issue owner to be assigned label Jun 1, 2023
Javagedes added a commit that referenced this issue Jun 14, 2023
## Description

Ensures LIBRARY_CLASS as specified in the library override INF defines
section is the same value as the library class specified in the override
line.

## Example of mismatch
``` cmd
ERROR - EDK2 #2 from c:\src\mu_tiano_platforms\Platforms\QemuQ35Pkg\QemuQ35Pkg.dsc(...): LIBRARY_CLASS for override: [c:\src\mu_tiano_platforms\MU_BASECORE\MdePkg\Library\BasePcdLibNull\BasePcdLibNull.inf] does not match the library class being overridden: [DevicePathLib]
```

closes #314

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Ensured mismatched library override was caught, and INF's with multiple
LIBRARY_CLASS definitions will not raise an error if one of the
definitions matches.

## Integration Instructions

N/A
kenlautner pushed a commit that referenced this issue Oct 17, 2023
## Description

Ensures LIBRARY_CLASS as specified in the library override INF defines
section is the same value as the library class specified in the override
line.

## Example of mismatch
``` cmd
ERROR - EDK2 #2 from c:\src\mu_tiano_platforms\Platforms\QemuQ35Pkg\QemuQ35Pkg.dsc(...): LIBRARY_CLASS for override: [c:\src\mu_tiano_platforms\MU_BASECORE\MdePkg\Library\BasePcdLibNull\BasePcdLibNull.inf] does not match the library class being overridden: [DevicePathLib]
```

closes #314

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Ensured mismatched library override was caught, and INF's with multiple
LIBRARY_CLASS definitions will not raise an error if one of the
definitions matches.

## Integration Instructions

N/A
kenlautner pushed a commit that referenced this issue Oct 17, 2023
## Description

Ensures LIBRARY_CLASS as specified in the library override INF defines
section is the same value as the library class specified in the override
line.

## Example of mismatch
``` cmd
ERROR - EDK2 #2 from c:\src\mu_tiano_platforms\Platforms\QemuQ35Pkg\QemuQ35Pkg.dsc(...): LIBRARY_CLASS for override: [c:\src\mu_tiano_platforms\MU_BASECORE\MdePkg\Library\BasePcdLibNull\BasePcdLibNull.inf] does not match the library class being overridden: [DevicePathLib]
```

closes #314

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Ensured mismatched library override was caught, and INF's with multiple
LIBRARY_CLASS definitions will not raise an error if one of the
definitions matches.

## Integration Instructions

N/A
kenlautner pushed a commit that referenced this issue Oct 18, 2023
## Description

Ensures LIBRARY_CLASS as specified in the library override INF defines
section is the same value as the library class specified in the override
line.

## Example of mismatch
``` cmd
ERROR - EDK2 #2 from c:\src\mu_tiano_platforms\Platforms\QemuQ35Pkg\QemuQ35Pkg.dsc(...): LIBRARY_CLASS for override: [c:\src\mu_tiano_platforms\MU_BASECORE\MdePkg\Library\BasePcdLibNull\BasePcdLibNull.inf] does not match the library class being overridden: [DevicePathLib]
```

closes #314

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Ensured mismatched library override was caught, and INF's with multiple
LIBRARY_CLASS definitions will not raise an error if one of the
definitions matches.

## Integration Instructions

N/A
kenlautner pushed a commit that referenced this issue Oct 18, 2023
## Description

Ensures LIBRARY_CLASS as specified in the library override INF defines
section is the same value as the library class specified in the override
line.

## Example of mismatch
``` cmd
ERROR - EDK2 #2 from c:\src\mu_tiano_platforms\Platforms\QemuQ35Pkg\QemuQ35Pkg.dsc(...): LIBRARY_CLASS for override: [c:\src\mu_tiano_platforms\MU_BASECORE\MdePkg\Library\BasePcdLibNull\BasePcdLibNull.inf] does not match the library class being overridden: [DevicePathLib]
```

closes #314

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Ensured mismatched library override was caught, and INF's with multiple
LIBRARY_CLASS definitions will not raise an error if one of the
definitions matches.

## Integration Instructions

N/A
kenlautner pushed a commit that referenced this issue Oct 19, 2023
## Description

Ensures LIBRARY_CLASS as specified in the library override INF defines
section is the same value as the library class specified in the override
line.

## Example of mismatch
``` cmd
ERROR - EDK2 #2 from c:\src\mu_tiano_platforms\Platforms\QemuQ35Pkg\QemuQ35Pkg.dsc(...): LIBRARY_CLASS for override: [c:\src\mu_tiano_platforms\MU_BASECORE\MdePkg\Library\BasePcdLibNull\BasePcdLibNull.inf] does not match the library class being overridden: [DevicePathLib]
```

closes #314

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Ensured mismatched library override was caught, and INF's with multiple
LIBRARY_CLASS definitions will not raise an error if one of the
definitions matches.

## Integration Instructions

N/A
kenlautner pushed a commit that referenced this issue Oct 20, 2023
## Description

Ensures LIBRARY_CLASS as specified in the library override INF defines
section is the same value as the library class specified in the override
line.

## Example of mismatch
``` cmd
ERROR - EDK2 #2 from c:\src\mu_tiano_platforms\Platforms\QemuQ35Pkg\QemuQ35Pkg.dsc(...): LIBRARY_CLASS for override: [c:\src\mu_tiano_platforms\MU_BASECORE\MdePkg\Library\BasePcdLibNull\BasePcdLibNull.inf] does not match the library class being overridden: [DevicePathLib]
```

closes #314

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Ensured mismatched library override was caught, and INF's with multiple
LIBRARY_CLASS definitions will not raise an error if one of the
definitions matches.

## Integration Instructions

N/A
kenlautner pushed a commit that referenced this issue Oct 23, 2023
## Description

Ensures LIBRARY_CLASS as specified in the library override INF defines
section is the same value as the library class specified in the override
line.

## Example of mismatch
``` cmd
ERROR - EDK2 #2 from c:\src\mu_tiano_platforms\Platforms\QemuQ35Pkg\QemuQ35Pkg.dsc(...): LIBRARY_CLASS for override: [c:\src\mu_tiano_platforms\MU_BASECORE\MdePkg\Library\BasePcdLibNull\BasePcdLibNull.inf] does not match the library class being overridden: [DevicePathLib]
```

closes #314

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Ensured mismatched library override was caught, and INF's with multiple
LIBRARY_CLASS definitions will not raise an error if one of the
definitions matches.

## Integration Instructions

N/A
kenlautner pushed a commit that referenced this issue Dec 16, 2023
## Description

Ensures LIBRARY_CLASS as specified in the library override INF defines
section is the same value as the library class specified in the override
line.

## Example of mismatch
``` cmd
ERROR - EDK2 #2 from c:\src\mu_tiano_platforms\Platforms\QemuQ35Pkg\QemuQ35Pkg.dsc(...): LIBRARY_CLASS for override: [c:\src\mu_tiano_platforms\MU_BASECORE\MdePkg\Library\BasePcdLibNull\BasePcdLibNull.inf] does not match the library class being overridden: [DevicePathLib]
```

closes #314

For each item, place an "x" in between `[` and `]` if true. Example:
`[x]`.
_(you can also check items in the GitHub UI)_

- [ ] Impacts functionality?
- **Functionality** - Does the change ultimately impact how firmware
functions?
- Examples: Add a new library, publish a new PPI, update an algorithm,
...
- [ ] Impacts security?
- **Security** - Does the change have a direct security impact on an
application,
    flow, or firmware?
  - Examples: Crypto algorithm change, buffer overflow fix, parameter
    validation improvement, ...
- [] Breaking change?
- **Breaking change** - Will anyone consuming this change experience a
break
    in build or boot behavior?
- Examples: Add a new library class, move a module to a different repo,
call
    a function in a new library class in a pre-existing module, ...
- [ ] Includes tests?
  - **Tests** - Does the change include any explicit test code?
  - Examples: Unit tests, integration tests, robot tests, ...
- [ ] Includes documentation?
- **Documentation** - Does the change contain explicit documentation
additions
    outside direct code modifications (and comments)?
- Examples: Update readme file, add feature readme file, link to
documentation
    on an a separate Web page, ...

## How This Was Tested

Ensured mismatched library override was caught, and INF's with multiple
LIBRARY_CLASS definitions will not raise an error if one of the
definitions matches.

## Integration Instructions

N/A
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
complexity:intermediate Requires intermediate background information and effort to accomplish state:backlog In the backlog state:needs-triage Needs to triaged to determine next steps type:bug Something isn't working urgency:medium Important with a moderate impact
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants