Skip to content

Conversation

@DennisDyallo
Copy link
Collaborator

Description

This pull request updates the Libraries class in Yubico.Core/src/Yubico/PlatformInterop/macOS/Interop.Libraries.cs to use absolute paths for macOS framework references. This change ensures compatibility with the system's directory structure.
This is due to an ongoing issue at MSFT and dotnet, where the .NET runtime is no longer searching the correct framework paths since NET7. This fix works for NET6,7,8,9.

Updates to macOS framework paths:

  • Changed the CoreFoundation, IOKitFramework, and WinSCard constants to use absolute paths (/System/Library/Frameworks/...) instead of relative paths (.framework/...) to align with macOS system conventions.

Fixes: #205

Type of change

  • Refactor (non-breaking change which improves code quality or performance)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

Test configuration:

  • OS version: e.g. Windows 11
  • Firmware version: e.g. 5.7.2
  • Yubikey model1:

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have run dotnet format to format my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Footnotes

  1. See Yubikey models (Multi-protocol, Security Key, FIPS, Bio, YubiHSM, YubiHSM FIPS)

@DennisDyallo DennisDyallo requested a review from Copilot June 18, 2025 15:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes an issue with macOS framework resolution by updating framework path constants to use absolute paths.

  • Updates the constants for CoreFoundation, IOKitFramework, and WinSCard in the macOS interop library.
Comments suppressed due to low confidence (1)

Yubico.Core/src/Yubico/PlatformInterop/macOS/Interop.Libraries.cs:19

  • Consider adding an inline comment explaining why absolute paths are used here, including a reference to the runtime issue. This can help maintain clarity for future maintenance.
        internal const string CoreFoundation = "/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation";

@DennisDyallo DennisDyallo changed the title fix (macOS): hard code default frameworks path to resolve macOS frameworks fix (macOS): Hard coding the default frameworks path in order to resolve macOS frameworks Jun 18, 2025
@DennisDyallo DennisDyallo changed the title fix (macOS): Hard coding the default frameworks path in order to resolve macOS frameworks fix(macOS): Hard coding the default frameworks path in order to resolve macOS frameworks Jun 18, 2025
@DennisDyallo DennisDyallo requested a review from AdamVe June 18, 2025 15:15
@DennisDyallo
Copy link
Collaborator Author

@AdamVe Are you able to test this on NET6 and NET8 and confirm that it works?

@DennisDyallo DennisDyallo self-assigned this Jun 18, 2025
@github-actions
Copy link

Test Results: Windows

    2 files      2 suites   9s ⏱️
3 905 tests 3 905 ✅ 0 💤 0 ❌
3 907 runs  3 907 ✅ 0 💤 0 ❌

Results for commit 89d8e64.

@github-actions
Copy link

Test Results: Ubuntu

    2 files      2 suites   21s ⏱️
3 897 tests 3 897 ✅ 0 💤 0 ❌
3 899 runs  3 899 ✅ 0 💤 0 ❌

Results for commit 89d8e64.

@github-actions
Copy link

Test Results: MacOS

    2 files      2 suites   10s ⏱️
3 897 tests 3 897 ✅ 0 💤 0 ❌
3 899 runs  3 899 ✅ 0 💤 0 ❌

Results for commit 89d8e64.

@github-actions
Copy link

Code Coverage

Package Line Rate Branch Rate Complexity Health
Yubico.Core 40% 31% 4365
Yubico.YubiKey 51% 46% 20697
Summary 49% (35517 / 72522) 44% (8703 / 19845) 25062

Minimum allowed line rate is 40%

Copy link
Member

@AdamVe AdamVe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, the integration tests run on mac without needing to setup any extra env variables.

@DennisDyallo DennisDyallo merged commit 5fd9396 into develop Jun 19, 2025
12 checks passed
@DennisDyallo DennisDyallo deleted the bug/205 branch June 19, 2025 12:13
@DennisDyallo DennisDyallo mentioned this pull request Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants