Description: webasm rtl. (active) Revisions in this set 33e25a3dfed57b58ba8576e846e63779e8d6c9a0,73bc8edef3ad66e208cfb30fd0df3e13f3b9fbdf,91f0f1a86c293dbf972ed684ff196244f5292af4,3836b0be04762387513cd7f6b95246cd5fc5e295,02745b0b83f9ea4e1fc98a44f753d513dfebfe62,77ca8ba16d0a5ab9aa1b261b4d1b44c94a1aa2b3,30b503abc4e628dc3c2299595ee76dba48d308fc,d9eb8d75b9f6005cc36f66da635c46f3d4aad250,387c80cc57b691c887303cc224ee01dd46684a0d,d134fc1ddfb6158945bc1751e0d2df1657f89a64,7533496505e52d2df2fa7bb3291c23adb91046c7,e078408dcf76a282a7336afeb5476c75779817cd,d45915b6ba0f99a70c51243377471bd834a5f541,bae50d80d246622a958d57c8dc70c3eff91b1b53,85ebd2c94c5fdad806ea96a1cdc3ff3400692dab,0d6b5338d0541b6a844d1d832b09b7709fe2948b,a62c7555d78f049c711cfd594455f73fa04b6620,64db584eefebcc5e5faeb287a9d10977adb4a886,25ac1380921c96b933673c8ec9f3e10da66f47d5,13c344a3a078430d212f2f523822c5810157a3d8,d7755a56f6fe705c8edfb955e0f071ac55ea5865,60d350f06788a6da9c2054f2dc2083066d9b10b7,a0e7882692432d6487acf60ae54218335f709233,27df4e98d2f1bf8e64b6037edd8d4643bd764809,aa4070ca8a2c27b818269b42c7470e5b7b03ddad,62846f54adbc08323ce660fbba6b33e1e0275d07,0bbc5a75280fa0ad0ee39e046dedd9d6d97ab90e,305393a9c11b8768a2aaa89ca8f1ff0e852ed94b,977b2f2a4bf7bda09554b034f2112d761d680517,09e61201d221bf098a42d5f994592f7df51a203f,14f361e13f82eceabe67317ba5e243d404419233,4c89eaa6cf12074ffed3b01cdcf30a6aa507aafd,05c6937fd9dd592eb643bc94d1e16c1f95dc6e82,c8d5bd77a31e088d4f5345a8294a27a75b3bf6c7,2a93340bcc22c2f6c45c22569b10a6d81ddadc56,8f95c14827ec62cfe7435e485825dff98b72a8f4,38075ac30c61c95b9371b07312eede596bf0bd22,94d8c22c6ac229faf084188fe25bc04966a47d7a,068f781c7a21335ae04ed8e63a5c18f1a841280e,00d5bb5bbc52baad3f2e268c2d51ceba4b266b04,4dc0c37678ca9102dc0de687cf27963124bf9bdf,aafb471bc880fc20a9b73cf0d60f109163793794,1e5ecccdc663ca646632cbd46a1fe5905cba99ab,809277d2b15b2c4e713cf7fc81d284429e935c2b,7f7c5785fc77b0e697c15c69be56ba7c84bf2fc9,00aa7b8ab3843aa3d5521ffc1f15cd01c4814685,4e605fb7643902e82de03ef4b43aaa166c30a42f,ca242e9ad0e3ba047fcca8cc95fb8e41599d2d0b,c4d7773c0ed87047041bbf32d8773b70b75709aa,a55980bfb85a47c711b31f6ca6ccf3ad74c66d94,099a92733113b683be425b3400f744394ae2897d,0934df505cdf94d24ff93dcd6c23eefac8799795,34587a647f791f29c0ac26fec13059e516507c40,21d843128d02fffcb8126811c16846420d570c32,b2a0df0d10aa701c4e21d215c42fb78cfdf96f62,de3ab7e46b6c7f50723da61aa992b04145cb2472,78c4585b535666f6c2f99af64dcae76c5bbc1f30,6cd88575c63e91afaf914f9ff9a1c67e60c4408a,0ead28c1e05b6eaaf53455be86d8cb3dfc97c669,090cc8fa8f7e60f2bb0fa6fa6d21d17509f39564,8e730d20db57219db3aa63bb97301a0a1591d1f1,8c39213d39eca0bfe89168734159f86bebbcbb4a,6921b968f1cdba59d2403a81c2950336ec2839af,03513720a3bab8b168cbb9707417c915d9654608 commit 33e25a3dfed57b58ba8576e846e63779e8d6c9a0 Author: Nikolay Nikolov Date: Sat Sep 18 03:08:48 2021 +0300 + added except_native.inc include file (empty for now, but will provide RTL support for the native wasm exceptions in the future) A rtl/wasm32/except_native.inc M rtl/wasm32/makefile.cpu M rtl/wasm32/wasm32.inc --- commit 73bc8edef3ad66e208cfb30fd0df3e13f3b9fbdf Author: Nikolay Nikolov Date: Tue Sep 28 03:31:04 2021 +0300 + RTL support for raising exceptions in native wasm exceptions mode M rtl/wasm32/except_native.inc --- commit 91f0f1a86c293dbf972ed684ff196244f5292af4 Author: Nikolay Nikolov Date: Tue Sep 28 03:46:30 2021 +0300 * don't include except.inc if wasm32 native exception is turned on, instead replace it with except_native.inc M rtl/inc/objpas.inc M rtl/wasm32/except_native.inc M rtl/wasm32/wasm32.inc --- commit 3836b0be04762387513cd7f6b95246cd5fc5e295 Author: Nikolay Nikolov Date: Tue Sep 28 04:02:52 2021 +0300 * longjmp in fpc_reraise changed to a throw instruction intrinsic in wasm native exceptions mode M rtl/wasm32/except_native.inc --- commit 02745b0b83f9ea4e1fc98a44f753d513dfebfe62 Author: Nikolay Nikolov Date: Fri Oct 1 06:34:52 2021 +0300 + implemented GetDate, GetTime and WeekDay in the WASI dos unit. They return UTC time (I don't know how to obtain the local time zone from within WASI). M rtl/wasi/dos.pp --- commit 77ca8ba16d0a5ab9aa1b261b4d1b44c94a1aa2b3 Author: Nikolay Nikolov Date: Sun Oct 3 01:08:52 2021 +0300 * always return error in SysUtils.FindFirst and .FindNext on the WASI platform, in order to prevent infinite loops in tests M rtl/wasi/sysutils.pp --- commit 30b503abc4e628dc3c2299595ee76dba48d308fc Author: Nikolay Nikolov Date: Tue Oct 5 00:49:29 2021 +0300 * instead of using the 'throw' intrinsic, set a boolean flag, in the branchful exceptions support code M rtl/wasm32/except_branchful.inc --- commit d9eb8d75b9f6005cc36f66da635c46f3d4aad250 Author: Nikolay Nikolov Date: Tue Oct 5 04:44:52 2021 +0300 + return a small, fake backtrace for WebAssembly, so that in case of a runtime error, the message 'Runtime error XXX at $EEEEEEEE' appears. M rtl/wasm32/wasm32.inc --- commit 387c80cc57b691c887303cc224ee01dd46684a0d Author: Nikolay Nikolov Date: Tue Oct 5 08:02:39 2021 +0300 + default exception handling in WebAssembly native exceptions mode M rtl/wasi/si_prc.pp M rtl/wasm32/except_native.inc --- commit d134fc1ddfb6158945bc1751e0d2df1657f89a64 Author: Nikolay Nikolov Date: Wed Oct 6 04:46:44 2021 +0300 + implemented SysUtils.GetTickCount64 for WASI M rtl/wasi/sysutils.pp --- commit 7533496505e52d2df2fa7bb3291c23adb91046c7 Author: Nikolay Nikolov Date: Wed Oct 6 05:39:11 2021 +0300 + implemented SysUtils.Sleep for WASI M rtl/wasi/sysutils.pp --- commit e078408dcf76a282a7336afeb5476c75779817cd Author: Nikolay Nikolov Date: Wed Oct 6 06:12:58 2021 +0300 + implemented SysUtils.GetEnvironmentVariable, GetEnvironmentVariableCount and GetEnvironmentString for WASI M rtl/wasi/sysutils.pp --- commit d45915b6ba0f99a70c51243377471bd834a5f541 Author: Nikolay Nikolov Date: Wed Oct 6 07:44:04 2021 +0300 * preopened dirs structure in the system unit modified to be a pointer to an array of records M rtl/wasi/system.pp --- commit bae50d80d246622a958d57c8dc70c3eff91b1b53 Author: Nikolay Nikolov Date: Sun Oct 10 09:11:19 2021 +0300 * preopen fd names and current dir changed to use ansistring, as well as the parameters and result of ConvertToFdRelativePath. This will allow easier implementation of ChDir. M rtl/wasi/dos.pp M rtl/wasi/sysdir.inc M rtl/wasi/sysfile.inc M rtl/wasi/system.pp --- commit 85ebd2c94c5fdad806ea96a1cdc3ff3400692dab Author: Nikolay Nikolov Date: Sun Oct 10 09:48:54 2021 +0300 * fixed handling of relative paths that are not directly relative to a preopened dir in ConvertToFdRelativePath. This is a preparation for ChDir support. M rtl/wasi/system.pp --- commit 0d6b5338d0541b6a844d1d832b09b7709fe2948b Author: Nikolay Nikolov Date: Sun Oct 10 12:17:35 2021 +0300 + implemented ChDir() for WASI M rtl/wasi/sysdir.inc M rtl/wasi/system.pp --- commit a62c7555d78f049c711cfd594455f73fa04b6620 Author: Nikolay Nikolov Date: Sun Oct 10 12:28:56 2021 +0300 - removed the DebugWriteXXX functions from the WASI system unit, since console output is now quite stable and can be used for debugging M rtl/wasi/system.pp M rtl/wasm32/setjump.inc --- commit 64db584eefebcc5e5faeb287a9d10977adb4a886 Author: Nikolay Nikolov Date: Sun Oct 10 12:33:36 2021 +0300 * moved the preopened dir and current dir handling types and variables to the implementation part of the system unit, so their implementation is not exposed and can be changed in the future (e.g. for thread safety when WebAssembly gets multithreading support, etc.) M rtl/wasi/system.pp --- commit 25ac1380921c96b933673c8ec9f3e10da66f47d5 Author: Nikolay Nikolov Date: Mon Oct 11 08:38:33 2021 +0300 * keep the drive string separate in the preopen and the current dir records on the WASI platform M rtl/wasi/sysdir.inc M rtl/wasi/system.pp --- commit 13c344a3a078430d212f2f523822c5810157a3d8 Author: Nikolay Nikolov Date: Mon Oct 11 08:45:42 2021 +0300 * replaced ['/','\'] with AllowDirectorySeparators in the WASI directory parsing code M rtl/wasi/dos.pp M rtl/wasi/sysdir.inc M rtl/wasi/system.pp --- commit d7755a56f6fe705c8edfb955e0f071ac55ea5865 Author: Nikolay Nikolov Date: Mon Oct 11 08:51:39 2021 +0300 * replaced '/' with DirectorySeparator in the WASI directory parsing code M rtl/wasi/sysdir.inc M rtl/wasi/system.pp --- commit 60d350f06788a6da9c2054f2dc2083066d9b10b7 Author: Nikolay Nikolov Date: Mon Oct 11 08:56:16 2021 +0300 * another instance of ['/','\'] replaced with AllowDirectorySeparators M rtl/wasi/sysdir.inc --- commit a0e7882692432d6487acf60ae54218335f709233 Author: Nikolay Nikolov Date: Mon Oct 11 09:04:32 2021 +0300 * use AllowDirectorySeparators, instead of checking for '/' and '\' M rtl/wasi/system.pp --- commit 27df4e98d2f1bf8e64b6037edd8d4643bd764809 Author: Nikolay Nikolov Date: Mon Oct 11 09:25:01 2021 +0300 * use rawbytestring instead of ansistring for the WASI file name handling M rtl/wasi/dos.pp M rtl/wasi/sysdir.inc M rtl/wasi/sysfile.inc M rtl/wasi/system.pp --- commit aa4070ca8a2c27b818269b42c7470e5b7b03ddad Author: Nikolay Nikolov Date: Mon Oct 11 09:52:09 2021 +0300 + implemented SysUtils.FileClose for WASI M rtl/wasi/sysutils.pp --- commit 62846f54adbc08323ce660fbba6b33e1e0275d07 Author: Nikolay Nikolov Date: Mon Oct 11 10:11:07 2021 +0300 + implemented SysUtils.FileOpen for WASI M rtl/wasi/sysutils.pp --- commit 0bbc5a75280fa0ad0ee39e046dedd9d6d97ab90e Author: Nikolay Nikolov Date: Mon Oct 11 10:24:36 2021 +0300 + implemented SysUtils.FileCreate for WASI M rtl/wasi/sysutils.pp --- commit 305393a9c11b8768a2aaa89ca8f1ff0e852ed94b Author: Nikolay Nikolov Date: Mon Oct 11 10:26:06 2021 +0300 - removed the zero constants from the implementation of SysUtils.FileOpen for WASI M rtl/wasi/sysutils.pp --- commit 977b2f2a4bf7bda09554b034f2112d761d680517 Author: Nikolay Nikolov Date: Mon Oct 11 10:32:50 2021 +0300 + implemented SysUtils.FileRead for WASI M rtl/wasi/sysutils.pp --- commit 09e61201d221bf098a42d5f994592f7df51a203f Author: Nikolay Nikolov Date: Mon Oct 11 10:33:54 2021 +0300 * fixed WASI bug in do_read, where the result of the __wasi_fd_read syscall function was ignored M rtl/wasi/sysfile.inc --- commit 14f361e13f82eceabe67317ba5e243d404419233 Author: Nikolay Nikolov Date: Mon Oct 11 10:37:11 2021 +0300 + implemented SysUtils.FileWrite for WASI M rtl/wasi/sysutils.pp --- commit 4c89eaa6cf12074ffed3b01cdcf30a6aa507aafd Author: Nikolay Nikolov Date: Mon Oct 11 10:50:44 2021 +0300 + implemented SysUtils.FileSeek for WASI M rtl/wasi/sysutils.pp --- commit 05c6937fd9dd592eb643bc94d1e16c1f95dc6e82 Author: Nikolay Nikolov Date: Mon Oct 11 11:14:05 2021 +0300 + implemented SysUtils.RenameFile for WASI M rtl/wasi/sysutils.pp --- commit c8d5bd77a31e088d4f5345a8294a27a75b3bf6c7 Author: Nikolay Nikolov Date: Mon Oct 11 11:21:33 2021 +0300 - don't call ToSingleByteFileSystemEncodedFileName in SysUtils.FileOpen and .FileCreate, because ConvertToFdRelativePath already calls it M rtl/wasi/sysutils.pp --- commit 2a93340bcc22c2f6c45c22569b10a6d81ddadc56 Author: Nikolay Nikolov Date: Mon Oct 11 11:27:57 2021 +0300 + implemented SysUtils.DeleteFile for WASI M rtl/wasi/sysutils.pp --- commit 8f95c14827ec62cfe7435e485825dff98b72a8f4 Author: Nikolay Nikolov Date: Mon Oct 11 15:08:48 2021 +0300 + implemented SysUtils.FileGetDate for WASI M rtl/objpas/sysutils/dati.inc M rtl/wasi/sysutils.pp --- commit 38075ac30c61c95b9371b07312eede596bf0bd22 Author: Nikolay Nikolov Date: Mon Oct 11 15:26:55 2021 +0300 + implemented SysUtils.FileAge for WASI M rtl/wasi/sysutils.pp --- commit 94d8c22c6ac229faf084188fe25bc04966a47d7a Author: Nikolay Nikolov Date: Mon Oct 11 15:51:13 2021 +0300 + implemented SysUtils.FileSetDate for WASI M rtl/wasi/sysutils.pp --- commit 068f781c7a21335ae04ed8e63a5c18f1a841280e Author: Nikolay Nikolov Date: Mon Oct 11 17:51:13 2021 +0300 + also implemented FileSetDate(FileName) for WASI, via the __wasi_path_filestat_set_times API call M rtl/wasi/sysutils.pp --- commit 00d5bb5bbc52baad3f2e268c2d51ceba4b266b04 Author: Nikolay Nikolov Date: Tue Oct 12 01:41:14 2021 +0300 * fixed off-by-one error when initializing current_drive in the WASI system unit M rtl/wasi/system.pp --- commit 4dc0c37678ca9102dc0de687cf27963124bf9bdf Author: Nikolay Nikolov Date: Tue Oct 12 03:08:18 2021 +0300 + implemented SysUtils.FileExists for WASI M rtl/wasi/sysutils.pp --- commit aafb471bc880fc20a9b73cf0d60f109163793794 Author: Nikolay Nikolov Date: Tue Oct 12 03:27:08 2021 +0300 * don't set InOutRes in ConvertToFdRelativePath, but return it instead. This fixes issues in places where this function is used in a way that should not set IOResult. M rtl/wasi/dos.pp M rtl/wasi/sysdir.inc M rtl/wasi/sysfile.inc M rtl/wasi/system.pp M rtl/wasi/sysutils.pp --- commit 1e5ecccdc663ca646632cbd46a1fe5905cba99ab Author: Nikolay Nikolov Date: Tue Oct 12 03:50:23 2021 +0300 + implemented SysUtils.DirectoryExists for WASI M rtl/wasi/sysutils.pp --- commit 809277d2b15b2c4e713cf7fc81d284429e935c2b Author: Nikolay Nikolov Date: Tue Oct 12 05:32:53 2021 +0300 + implemented SysUtils.FileGetSymLinkTarget for WASI M rtl/wasi/sysutils.pp --- commit 7f7c5785fc77b0e697c15c69be56ba7c84bf2fc9 Author: Nikolay Nikolov Date: Tue Oct 12 05:38:16 2021 +0300 * always return an error in SysUtils.FileSetAttr on WASI - this function is not supported by the WASI API M rtl/wasi/sysutils.pp --- commit 00aa7b8ab3843aa3d5521ffc1f15cd01c4814685 Author: Nikolay Nikolov Date: Tue Oct 12 05:50:24 2021 +0300 + implemented SysUtils.FileGetAttr for WASI M rtl/wasi/sysutils.pp --- commit 4e605fb7643902e82de03ef4b43aaa166c30a42f Author: Nikolay Nikolov Date: Tue Oct 12 07:08:32 2021 +0300 + dummy implementation of dos.SetFAttr for WASI, based on the Unix version M rtl/wasi/dos.pp --- commit ca242e9ad0e3ba047fcca8cc95fb8e41599d2d0b Author: Nikolay Nikolov Date: Tue Oct 12 09:14:14 2021 +0300 + implemented DOS.GetFAttr for WASI M rtl/wasi/dos.pp --- commit c4d7773c0ed87047041bbf32d8773b70b75709aa Author: Nikolay Nikolov Date: Tue Oct 12 10:33:28 2021 +0300 + added platform-specific helper function dos.DTToWasiDate, similar to DTToUnixDate on Unix M rtl/wasi/dos.pp --- commit a55980bfb85a47c711b31f6ca6ccf3ad74c66d94 Author: Nikolay Nikolov Date: Tue Oct 12 11:06:16 2021 +0300 + implemented dos.SetFTime for WASI M rtl/wasi/dos.pp --- commit 099a92733113b683be425b3400f744394ae2897d Author: Nikolay Nikolov Date: Tue Oct 12 11:27:27 2021 +0300 * fix for the WASI datetime to epoch conversion M rtl/wasi/dos.pp M rtl/wasi/sysutils.pp --- commit 0934df505cdf94d24ff93dcd6c23eefac8799795 Author: Nikolay Nikolov Date: Wed Oct 13 01:28:45 2021 +0300 + implemented SysUtils.GetLocalTime for WASI M rtl/wasi/sysutils.pp --- commit 34587a647f791f29c0ac26fec13059e516507c40 Author: Nikolay Nikolov Date: Wed Oct 13 06:39:42 2021 +0300 + init the ansistring upper and lower case tables in the WASI SysUtils unit initialization M rtl/wasi/sysutils.pp --- commit 21d843128d02fffcb8126811c16846420d570c32 Author: Nikolay Nikolov Date: Fri Oct 15 14:33:43 2021 +0300 + added a wrapper function around __wasi_path_readlink that calls it iteratively with doubling buffer sizes, starting with 64 bytes, until it reaches 16384 bytes, and reads the link into a rawbytestring. Use that function in all places in the WASI rtl that need to read a symlink. M rtl/wasi/sysdir.inc M rtl/wasi/system.pp M rtl/wasi/sysutils.pp --- commit b2a0df0d10aa701c4e21d215c42fb78cfdf96f62 Author: Nikolay Nikolov Date: Tue Oct 19 09:06:56 2021 +0300 * ConvertToFdRelativePath removed from the interface part of the WASI system unit (to avoid cluttering the WASI system unit interface with platform dependent routines) and added to a new unit, called wasiutil M rtl/wasi/Makefile M rtl/wasi/Makefile.fpc M rtl/wasi/dos.pp M rtl/wasi/system.pp M rtl/wasi/sysutils.pp A rtl/wasi/wasiutil.pp --- commit de3ab7e46b6c7f50723da61aa992b04145cb2472 Author: Nikolay Nikolov Date: Tue Oct 19 09:39:25 2021 +0300 * added the fpc_wasi_path_readlink_ansistring helper function to unit wasiutil M rtl/wasi/Makefile M rtl/wasi/Makefile.fpc M rtl/wasi/sysutils.pp M rtl/wasi/wasiutil.pp --- commit 78c4585b535666f6c2f99af64dcae76c5bbc1f30 Author: Nikolay Nikolov Date: Tue Oct 19 11:36:01 2021 +0300 * the FNMatch private helper function moved from unit DOS to unit WasiUtil, and changed to have rawbytestring parameters, so it can be used from SysUtils as well. M rtl/wasi/dos.pp M rtl/wasi/wasiutil.pp --- commit 6cd88575c63e91afaf914f9ff9a1c67e60c4408a Author: Nikolay Nikolov Date: Tue Oct 19 11:51:25 2021 +0300 - removed unused, commented out fields from the RtlInfoType record M rtl/wasi/dos.pp --- commit 0ead28c1e05b6eaaf53455be86d8cb3dfc97c669 Author: Nikolay Nikolov Date: Tue Oct 19 12:01:14 2021 +0300 - removed the RtlInfoType record, because it is only used only once in a local variable. Use an anonymous record instead. M rtl/wasi/dos.pp --- commit 090cc8fa8f7e60f2bb0fa6fa6d21d17509f39564 Author: Nikolay Nikolov Date: Tue Oct 19 13:39:20 2021 +0300 * moved the FindFirst/FindNext/FindClose code from unit DOS to WasiUtil, using RawByteString. This will allow to reuse the same implementation in SysUtils. M rtl/wasi/dos.pp M rtl/wasi/wasiutil.pp --- commit 8e730d20db57219db3aa63bb97301a0a1591d1f1 Author: Nikolay Nikolov Date: Tue Oct 19 15:39:59 2021 +0300 + implemented FindFirst, FindNext and FindClose in SysUtils for the WASI platform M rtl/objpas/sysutils/filutilh.inc M rtl/wasi/sysutils.pp --- commit 8c39213d39eca0bfe89168734159f86bebbcbb4a Author: Nikolay Nikolov Date: Tue Oct 19 16:24:43 2021 +0300 + implemented DOS.FSearch for WASI M rtl/wasi/dos.pp --- commit 6921b968f1cdba59d2403a81c2950336ec2839af Author: Nikolay Nikolov Date: Tue Oct 19 17:31:02 2021 +0300 - removed TWasiSearchRec.Mode, because it was unused M rtl/wasi/dos.pp M rtl/wasi/wasiutil.pp --- commit 03513720a3bab8b168cbb9707417c915d9654608 Author: Nikolay Nikolov Date: Wed Oct 20 11:58:50 2021 +0300 * fixed range check error in the DOS unit M rtl/wasi/dos.pp