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

fix for CLIv1/Extension bug #611

Merged
merged 1 commit into from
Dec 24, 2024
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
17 changes: 16 additions & 1 deletion Meadow.CLI.Core/Devices/MeadowLocalDevice.FileManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@
await SendTheEntireFile(command, true, cancellationToken);
}

public async Task WriteFileToEspFlash(string fileName,

Check warning on line 291 in Meadow.CLI.Core/Devices/MeadowLocalDevice.FileManager.cs

View workflow job for this annotation

GitHub Actions / build

Nullability of reference types in type of parameter 'fileName' of 'Task MeadowLocalDevice.WriteFileToEspFlash(string fileName, uint partition = 0, string? mcuDestAddress = null, CancellationToken cancellationToken = default(CancellationToken))' doesn't match implicitly implemented member 'Task IMeadowDevice.WriteFileToEspFlash(string? fileName, uint partition = 0, string? mcuDestAddress = null, CancellationToken cancellationToken = default(CancellationToken))' (possibly because of nullability attributes).
uint partition = 0,
string? mcuDestAddress = null,
CancellationToken cancellationToken = default)
Expand Down Expand Up @@ -641,7 +641,22 @@
var crc = CrcTools.Crc32part(bytes, len, 0); // 0x04C11DB7);

Logger.LogDebug("{file} crc is {crc:X8}", file, crc);
files.Add(file, crc);
if (files.ContainsKey(file))
{
// file already exists in our list?
// this feels like a bug, but for now we'll see if it has the same CRC
if (crc != files[file])
{
throw new Exception($"To differing (by CRC) versions of file '{file}' exist in the build output");
}

// same file CRC, just ignore the new call to add it
}
else
{
files.Add(file, crc);
}

if (includePdbs)
{
var pdbFile = Path.ChangeExtension(file, "pdb");
Expand Down
Loading