This is already the case today for the Swift Standard Library. Note that Foundation and Dispatch are not considered part of the Swift Standard library and instead separate frameworks.
If you use platform specific features you can just use docker to build and run swift on linux locally on your mac. After you have downloaded and installed docker you can just run the following command:
docker run \
--rm -it \
--volume "$(pwd)/:/src" \
--workdir "/src/" \
swift:5.7-focal
and afterwards swift build
or swift run name-of-exectuable
to build or run your code on ubuntu linux.
Cross Compilation from macOS to Linux will be possible with this pitch: Pitch: Cross-Compilation Destination Bundles. You will then no longer need docker to build your code for linux. If you want to run it you will still need a Linux VM after all.
More server specific guides are available on Swift.org - Swift on Server Guides