#include <Servo.h> compile error for Metro M4 Express #2354

#include <Servo.h> results in a compile error for the Metro M4 Express

#include <Servo.h>
int main(void) {}

What I’ve Tried
I have tried using the standard PlatformIO <Servo.h>. See logs below.
I have tried rebuilding the library from Adafruit’s version. See logs below.
This same header compiles fine on the Arduino IDE with the Adafruit BSP. Per this issue, the latest BSP has a working Servo library. See logs below.

Expected Outcome
#include <Servo.h> compiles without error. PlatformIO matches the Arduino IDE in header support for Metro M4.

Please see this issue for logs.

Works fine.

platform = atmelsam
board = adafruit_metro_m4
framework = arduino
#include <Arduino.h>
#include <Servo.h>

void setup() {
  // put your setup code here, to run once:

void loop() {
  // put your main code here, to run repeatedly:

leads to

CONFIGURATION: https://docs.platformio.org/page/boards/atmelsam/adafruit_metro_m4.html
PLATFORM: Atmel SAM (5.1.1) > Adafruit Metro M4       
HARDWARE: SAMD51J19A 120MHz, 192KB RAM, 512KB Flash   
DEBUG: Current (atmel-ice) External (atmel-ice, jlink)
 - framework-arduino-samd-adafruit 1.6.4
 - framework-cmsis 2.50400.181126 (5.4.0)
 - framework-cmsis-atmel 1.2.0
 - toolchain-gccarmnoneeabi 1.90301.200702 (9.3.1)    
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 13 compatible libraries
Scanning dependencies...     
Dependency Graph
|-- <Servo> 1.1.4 (C:\Users\Max\.platformio\packages\framework-arduino-samd-adafruit\libraries\Servo)
Building .pio\build\adafruit_metro_m4\firmware.bin
Checking size .pio\build\adafruit_metro_m4\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [          ]   1.4% (used 2664 bytes from 196608 bytes)
Flash: [          ]   2.2% (used 11296 bytes from 524288 bytes)
========================== [SUCCESS] Took 3.48 seconds ==========================

Make sure your PlatformIO core and platforms are up-to-date. You can e.g. do that in a CLI and by doing pio upgrade and pio platform update atmelsam.

If that does not work, post the library dependency graph in verbose mode (Project tasks → Default → Advanced → Verbose Build). It’s probably sourcing the library from somewhere else, possible a global library that you’ve installed previously.

Looks like pio platform update atmelsam did the trick.

Thank you for your time, @maxgerhardt.