@@ -1669,6 +1669,9 @@ fn validate_distribution(
1669
1669
) ) ;
1670
1670
}
1671
1671
1672
+ let mut bin_python = None ;
1673
+ let mut bin_python3 = None ;
1674
+
1672
1675
for entry in entries {
1673
1676
let mut entry = entry. map_err ( |e| anyhow ! ( "failed to iterate over archive: {}" , e) ) ?;
1674
1677
let path = entry. path ( ) ?. to_path_buf ( ) ;
@@ -1743,6 +1746,53 @@ fn validate_distribution(
1743
1746
. errors
1744
1747
. push ( "python/PYTHON.json seen twice" . to_string ( ) ) ;
1745
1748
}
1749
+
1750
+ if path == PathBuf :: from ( "python/install/bin/python" ) {
1751
+ if let Some ( link) = entry. link_name ( ) ? {
1752
+ bin_python = Some ( link. to_string_lossy ( ) . to_string ( ) ) ;
1753
+ } else {
1754
+ context
1755
+ . errors
1756
+ . push ( "python/install/bin/python is not a symlink" . to_string ( ) ) ;
1757
+ }
1758
+ }
1759
+
1760
+ if path == PathBuf :: from ( "python/install/bin/python3" ) {
1761
+ if let Some ( link) = entry. link_name ( ) ? {
1762
+ bin_python3 = Some ( link. to_string_lossy ( ) . to_string ( ) ) ;
1763
+ } else {
1764
+ context
1765
+ . errors
1766
+ . push ( "python/install/bin/python3 is not a symlink" . to_string ( ) ) ;
1767
+ }
1768
+ }
1769
+ }
1770
+
1771
+ match ( bin_python, bin_python3) {
1772
+ ( None , None ) => {
1773
+ if !triple. contains ( "-windows-" ) {
1774
+ context
1775
+ . errors
1776
+ . push ( "install/bin/python and python3 entries missing" . to_string ( ) ) ;
1777
+ }
1778
+ }
1779
+ ( None , Some ( _) ) => {
1780
+ context
1781
+ . errors
1782
+ . push ( "install/bin/python symlink missing" . to_string ( ) ) ;
1783
+ }
1784
+ ( Some ( _) , None ) => {
1785
+ context
1786
+ . errors
1787
+ . push ( "install/bin/python3 symlink missing" . to_string ( ) ) ;
1788
+ }
1789
+ ( Some ( python) , Some ( python3) ) => {
1790
+ if python != python3 {
1791
+ context. errors . push ( format ! (
1792
+ "symlink targets of install/bin/python and python3 vary: {python} !+ {python3}"
1793
+ ) ) ;
1794
+ }
1795
+ }
1746
1796
}
1747
1797
1748
1798
// We've now read the contents of the archive. Move on to analyzing the results.
0 commit comments