SNAPCRAFT_PYTHON_INTERPRETER doesn't work for cross-compilation

When using custom Python version, the build process fails

om26er@HomePC:~/scm/simplethings/core$ snapcraft --enable-experimental-target-arch --target-arch arm64 --destructive-mode
*EXPERIMENTAL* --target-arch for core20 enabled.
Setting target machine to 'arm64'
Get:1 file:/var/lib/preinstalled-pool focal InRelease                                                                                                                          
Ign file:/var/lib/preinstalled-pool focal InRelease                                                                                                                            
Get:2 file:/var/lib/preinstalled-pool focal Release [3949 B]                                                                                                                   
Get:3 file:/var/lib/preinstalled-pool focal Release [3949 B]                                                                                                                   
Hit http://archive.ubuntu.com/ubuntu focal InRelease                                                                                                                           
Hit http://ports.ubuntu.com/ubuntu-ports focal InRelease                                                                                                                       
Hit http://security.ubuntu.com/ubuntu focal-security InRelease                                                                                                                 
Hit http://packages.microsoft.com/repos/edge stable InRelease                                                                                                                  
Hit http://archive.ubuntu.com/ubuntu focal-updates InRelease                                                                                                                   
Hit http://ports.ubuntu.com/ubuntu-ports focal-security InRelease                                                                                                              
Hit http://ports.ubuntu.com/ubuntu-ports focal-updates InRelease                                                                                                               
Get:4 http://archive.neon.kde.org/user focal InRelease [166 kB]                                                                                                                
Fetched 166 kB in 0s (0 B/s)                                                                                                                                                   
Get:1 libpython3.9-minimal_3.9.5-3~20.04.1_arm64.deb [751 kB]                                                                                                                  
Fetched 0 B in 0s (0 B/s)                                                                                                                                                      
Get:1 libpython3.9-stdlib_3.9.5-3~20.04.1_arm64.deb [1751 kB]                                                                                                                  
Fetched 0 B in 0s (0 B/s)                                                                                                                                                      
Get:1 python3.9_3.9.5-3~20.04.1_arm64.deb [423 kB]                                                                                                                             
Fetched 0 B in 0s (0 B/s)                                                                                                                                                      
Get:1 python3.9-minimal_3.9.5-3~20.04.1_arm64.deb [1941 kB]                                                                                                                    
Fetched 0 B in 0s (0 B/s)                                                                                                                                                      
Get:1 python3.9-venv_3.9.5-3~20.04.1_arm64.deb [5444 B]                                                                                                                        
Fetched 0 B in 0s (0 B/s)                                                                                                                                                      
Get:1 python-pip-whl_20.0.2-5ubuntu1.6_all.deb [1805 kB]                                                                                                                       
Fetched 0 B in 0s (0 B/s)                                                                                                                                                      
Pulling alarm 
+ snapcraftctl pull
Pulling scripts 
+ snapcraftctl pull
Building alarm 
+ rm -rf /home/om26er/scm/simplethings/core/parts/alarm/install/usr/lib/python3.9/distutils
+ ln -s /usr/lib/python3.9/distutils /home/om26er/scm/simplethings/core/parts/alarm/install/usr/lib/python3.9/distutils
+ mkdir -p /home/om26er/scm/simplethings/core/parts/alarm/install/usr/include/
+ ln -s /usr/include/python3.9 /home/om26er/scm/simplethings/core/parts/alarm/install/usr/include/python3.9
+ snapcraftctl build
+ python3.9 -m venv /home/om26er/scm/simplethings/core/parts/alarm/install
/home/om26er/scm/simplethings/core/parts/alarm/run/build.sh: line 33: /home/om26er/scm/simplethings/core/parts/alarm/install/usr/bin/python3.9: cannot execute binary file: Exec format error
Failed to build 'alarm'.

Recommended resolution:
Check the build logs and ensure the part's configuration and sources are correct.

I would expect cross compiling python to be a non-trivial task, I’m curious if you came up with a solution?

I didn’t. In any case, I would expect there to be changes needed in Snapcraft itself