Commit d860036
authored
feat(csharp): add map type support (#1603)
* feat(csharp): add map type support
Dictionary<K,V> provides a familiar, zero-dependency host representation
for WIT maps in C#, and unblocks runtime interop with components that
use them without requiring a custom collection type.
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
* fix(csharp): emit component_type.o for linker
The `map<K, V>` WIT syntax is a gated feature that the default wit-parser
used by wasm-component-ld's `--component-type` flag cannot parse, so the
text-based component type path was blocking any world that uses maps.
Switching to the same object-file approach already used by the C and C++
backends lets the component type flow through as a custom section without
round-tripping through the text parser.
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
* fix(csharp): embed component type via binary WIT package
Earlier attempt used `NativeFileReference` on the component-type object,
but NativeAOT's LLVM pipeline did not propagate the custom section into
the final module, leaving every C# component import unresolvable. Using
a binary-encoded WIT package (which `wasm-component-ld --component-type`
accepts alongside the text form) preserves the existing linker path and
also lets map<K,V> round-trip since decoding skips the default WIT
parser that rejects gated features.
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
* fix(csharp): force-link component-type object for NativeAOT
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
* fix(csharp): defer map runtime tests until toolchain support lands
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
* refactor(csharp): drop unused component-type object plumbing
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
* chore(csharp): revert unrelated Cargo.lock drift
No Cargo.toml changed on this branch, so the lockfile should match main.
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
---------
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>1 parent 6f489db commit d860036
4 files changed
Lines changed: 205 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1017 | 1017 | | |
1018 | 1018 | | |
1019 | 1019 | | |
| 1020 | + | |
1020 | 1021 | | |
1021 | 1022 | | |
1022 | 1023 | | |
| |||
1491 | 1492 | | |
1492 | 1493 | | |
1493 | 1494 | | |
| 1495 | + | |
1494 | 1496 | | |
1495 | 1497 | | |
1496 | 1498 | | |
| |||
1756 | 1758 | | |
1757 | 1759 | | |
1758 | 1760 | | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
| 1767 | + | |
| 1768 | + | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
| 1876 | + | |
| 1877 | + | |
| 1878 | + | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
| 1886 | + | |
| 1887 | + | |
| 1888 | + | |
| 1889 | + | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
| 1893 | + | |
| 1894 | + | |
| 1895 | + | |
| 1896 | + | |
| 1897 | + | |
| 1898 | + | |
| 1899 | + | |
| 1900 | + | |
| 1901 | + | |
| 1902 | + | |
| 1903 | + | |
| 1904 | + | |
| 1905 | + | |
| 1906 | + | |
| 1907 | + | |
| 1908 | + | |
| 1909 | + | |
| 1910 | + | |
| 1911 | + | |
| 1912 | + | |
| 1913 | + | |
| 1914 | + | |
| 1915 | + | |
| 1916 | + | |
| 1917 | + | |
| 1918 | + | |
| 1919 | + | |
| 1920 | + | |
| 1921 | + | |
| 1922 | + | |
| 1923 | + | |
| 1924 | + | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
| 1930 | + | |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
1759 | 1941 | | |
1760 | 1942 | | |
1761 | 1943 | | |
1762 | 1944 | | |
1763 | 1945 | | |
1764 | 1946 | | |
1765 | | - | |
1766 | | - | |
1767 | | - | |
1768 | | - | |
1769 | | - | |
1770 | | - | |
| 1947 | + | |
1771 | 1948 | | |
1772 | 1949 | | |
1773 | 1950 | | |
| |||
1843 | 2020 | | |
1844 | 2021 | | |
1845 | 2022 | | |
| 2023 | + | |
| 2024 | + | |
1846 | 2025 | | |
1847 | 2026 | | |
1848 | 2027 | | |
| |||
1853 | 2032 | | |
1854 | 2033 | | |
1855 | 2034 | | |
| 2035 | + | |
| 2036 | + | |
1856 | 2037 | | |
1857 | 2038 | | |
1858 | 2039 | | |
1859 | 2040 | | |
1860 | 2041 | | |
1861 | 2042 | | |
1862 | 2043 | | |
| 2044 | + | |
| 2045 | + | |
1863 | 2046 | | |
1864 | 2047 | | |
1865 | 2048 | | |
| |||
1940 | 2123 | | |
1941 | 2124 | | |
1942 | 2125 | | |
| 2126 | + | |
| 2127 | + | |
1943 | 2128 | | |
1944 | 2129 | | |
1945 | 2130 | | |
| |||
1951 | 2136 | | |
1952 | 2137 | | |
1953 | 2138 | | |
| 2139 | + | |
| 2140 | + | |
1954 | 2141 | | |
1955 | 2142 | | |
1956 | 2143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
138 | 138 | | |
139 | 139 | | |
140 | 140 | | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
141 | 144 | | |
142 | 145 | | |
143 | 146 | | |
| |||
1297 | 1300 | | |
1298 | 1301 | | |
1299 | 1302 | | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
1300 | 1310 | | |
1301 | 1311 | | |
1302 | 1312 | | |
| |||
1916 | 1926 | | |
1917 | 1927 | | |
1918 | 1928 | | |
1919 | | - | |
1920 | | - | |
| 1929 | + | |
| 1930 | + | |
1921 | 1931 | | |
1922 | 1932 | | |
1923 | 1933 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
825 | 825 | | |
826 | 826 | | |
827 | 827 | | |
828 | | - | |
829 | | - | |
830 | | - | |
831 | | - | |
832 | | - | |
833 | | - | |
834 | | - | |
835 | | - | |
836 | 828 | | |
837 | 829 | | |
838 | 830 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | 52 | | |
54 | 53 | | |
55 | 54 | | |
| |||
0 commit comments