I tried on windows and it won?t even compile over there, but unclear why not - it cant find pins_arduino.h for reasons I cannot explain?
PlatformIO can be a brat sometimes. From helping others I've found one common problem is a missing or out-of-date python installation.
https://docs.platformio.org/en/latest/faq/install-python.html
When I run into problems I normally go to the PlatformIO GitHub Issue discussion area and look for a solution there. But I just did a Google search for platformio can't find pins_arduino.h and got a lot of hits. I suggest you do the same and review the search results for a solution.
- Thomas