Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 81 additions & 0 deletions docs/LINUX-TEST-BLOCKER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Linux Test Support Investigation

## Summary

Attempts to enable Linux support for the test project revealed a **blocking dependency** that prevents tests from running on Linux without significant code changes.

## The Blocker

The project depends on `FrameworkExtensions.System.Drawing` (version 1.0.0.36), which has a hard requirement for the `Microsoft.WindowsDesktop.App.WindowsForms` framework. This framework is **Windows-only** and cannot be installed or satisfied on Linux.

The error when attempting to build on Linux:
```
error NETSDK1073: The FrameworkReference 'Microsoft.WindowsDesktop.App.WindowsForms' was not recognized
```

## What Was Attempted

1. ✗ **Changed target framework** from `net8.0-windows` to `net8.0`
- Result: Dependency resolution fails for Windows Forms

2. ✗ **Multi-targeting** both `net8.0` and `net8.0-windows`
- Result: Still pulls in Windows Forms dependency

3. ✗ **Conditional package inclusion** based on target framework
- Result: Causes compilation errors (missing BitmapExtensions APIs)

4. ✗ **Platform check overrides** (`<NoPlatformCheck>true</NoPlatformCheck>`)
- Result: Doesn't bypass framework reference resolution

5. ✗ **Excluding framework references** via MSBuild properties
- Result: MSBuild still resolves and requires them

6. ✗ **Removing the package** entirely
- Result: 33 compilation errors (BitmapExtensions namespace missing)

## The Dependency Chain

```
AnythingToGif.Tests
└─> AnythingToGif
└─> FrameworkExtensions.System.Drawing (1.0.0.36)
└─> Microsoft.WindowsDesktop.App.WindowsForms (Windows-only)
```

The `BitmapExtensions` class methods from `System.Drawing.BitmapExtensions` namespace are used extensively throughout the dithering code (33+ references).

## Options for Linux Support

### Option 1: Contact Package Author
Ask the maintainer of `FrameworkExtensions.System.Drawing` to:
- Remove the Windows Forms dependency if not actually needed
- Create a cross-platform version of the package
- Package: https://www.nuget.org/packages/FrameworkExtensions.System.Drawing/

### Option 2: Replace the Dependency
Find or create a cross-platform alternative that provides:
- `BitmapExtensions` functionality
- Bitmap locking/unlocking APIs
- The specific extension methods used by ditherers

This would require:
- Identifying all APIs used from the package
- Finding/creating cross-platform equivalents
- Refactoring ~30+ ditherer files

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Recalculate the replacement scope from current sources

For anyone estimating Option 2, this describes a source layout that is not present in the reviewed tree. A repo-wide search at the parent commit finds no ditherer implementation files and only seven .Lock() call sites; the ditherers and quantizers live in the upstream dependency, while this repository consumes its registries and interfaces primarily from CLI/Options.cs and SingleImageHiColorGifConverter.cs. Consequently, replacing the package is not a refactor of “~30+ ditherer files” in this repository, and the document should inventory the actual consumed API surface instead.

Useful? React with 👍 / 👎.


### Option 3: Fork and Modify
- Fork the `FrameworkExtensions` library
- Remove Windows Forms dependency
- Rebuild as cross-platform package
- Reference the forked version

### Option 4: Accept Windows-Only Tests
Document that tests currently only run on Windows due to the dependency constraint.

## Current State

The test project remains at `net8.0-windows` target framework. The GitHub Actions CI workflow includes a test job, but it will **not succeed** until the Windows Forms dependency is resolved.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge State that only the proposed Linux CI leg fails

This incorrectly reports the existing PR gate as unable to succeed. The reviewed .github/workflows/ci.yml passes the test project to the shared workflow and explicitly selects runs-on: windows-latest at lines 18–21, where the Windows Forms framework is available; the blocker applies only to a proposed Linux test leg. As written, maintainers are told that the active Windows CI job is permanently broken, so clarify that the current job runs on Windows while a Linux variant cannot run.

Useful? React with 👍 / 👎.


## Recommendation

Contact the package author first (Option 1) as it's the least intrusive solution. If that's not viable, Option 2 (replace dependency) would provide the most maintainable long-term solution but requires significant refactoring effort.
Loading