Skip to content

Added something useful (CI, docs)#57

Open
zhangxuan2011 wants to merge 63 commits intorust9x:rust9xfrom
zhangxuan2011:rust9x
Open

Added something useful (CI, docs)#57
zhangxuan2011 wants to merge 63 commits intorust9x:rust9xfrom
zhangxuan2011:rust9x

Conversation

@zhangxuan2011
Copy link

@zhangxuan2011 zhangxuan2011 commented Feb 23, 2026

Preface

Lately i saw this project, and found that there're some conveinent features that didn't used in upstream repository. So this PR is to add these features, which is very useful

Changes

I did these changes in this forked repository:

  • Added an GitHub Actions workflow, it will automatically build the toolchain, and publish 5 targets onto the releases page when you push a tag or used workflow_dispatch, so that i dont need waste time compile it;
  • Updated the documents, especially README.md, almost no change, and INSTALL.md is not the currect step in building the toolchain, so i adapt README.md to this project and removed INSTALL.md, so everyone can know what does this project do
  • Removed some unuseful workflows, because they only used in official repository. The fork repository is non-needed.

Suggestions

I advise you do these after merge:

  • If you sure this commit is the version you want to push, just run git tag v1.93.0-x, the x is an integer, which starts from 1;
  • Each tag must start with v, or the workflow won't run;
  • Do more adaptions in documents

Suffix

I fully hope you can accept this changes, because it can really improve the effective of using this project!!

Also, this took me a very long time (about 4d), worked soo hard, and please have a review, thanks

btw, this is my first pr :)

BoxyUwU and others added 30 commits December 8, 2025 10:08
[beta] prepare rust 1.93.0

r? `@ghost`
…=lnicola

[beta] Backport rust-analyzer proc macro server "disable postcard use temporarily"
…hanglo

[beta-1.93] Backport Cargo bug fix for 1.93

2 commits in 2c283a9a5c5968eeb9a8f12313f04feb1ff8dfac..083ac5135f967fd9dc906ab057a2315861c7a80d
2025-12-04 16:47:28 +0000 to 2025-12-11 23:19:46 -0500
- [beta-1.93] Backport locking fixes (rust-lang/cargo#16386)
- [beta-1.93] Downgrade curl-sys to 0.4.83 (rust-lang/cargo/pull/16399)
(cherry picked from commit f33abb1)
…owedBuf` and `BorrowedCursor`)

This caused several performance regressions because of existing code
which uses `Read::read` and therefore requires full buffer
initialization. This is particularly a problem when the same buffer is
re-used for multiple read calls since this means it needs to be fully
re-initialized each time.

There is still some benefit to landing the API changes, but we will have
to add private APIs so that the existing infrastructure can
track and avoid redundant initialization.

(cherry picked from commit 4b07875)
[beta] backports

- attempt to fix unreachable code regression rust-lang#149664
- Update to LLVM 21.1.8 rust-lang#150057
- Revert rust-lang#148937 -- rust-lang#150096

r? cuviper
This will be necessary for some APIs that exist on both
platforms but with different behavior/capabilities.
- Bring back "Generic" thread parker
- Add checks for Win8 and WinXP APIs to decide which thread parker impl to use
- Use `queue::RwLock` for rust9x. Now that the thread parker is available, we get this high-quality `RwLock` implementation on all API levels, without any extra fallback impls!
- Same for `Once`
- `GetSystemTimePreciseAsFileTime`: fall back to `GetSystemTimeAsFileTime`
- `GetSystemTimeAsFileTime`: fall back to `GetSystemTime` and `SystemTimeToFileTime`
  - (only necessary for NT 3.1)
- `SwitchToThread`: fall back to `Sleep(0)`
- `CreateWaitableTimerExW`: optional import, fallback already in place
- Fallback for `SetFilePointerEx` based on `SetFilePointer`
- Fallback for file truncation (`SetFileInformationByHandle` with `FileEndOfFileInfo`)
  based on `SetFilePointerEx` and `SetEndOfFile`
- file_attr: Don't query reparse tag if API is not available (`GetFileInformationByHandleEx` with `FileAttributeTagInfo`)
…NameByHandleW`

- `CreateSymbolicLinkW` is used in `std::fs::soft_link`. Fails on unsupported systems.
- `CreateHardLinkW` is used in `std::fs::hard_link`. Fails on unsupported systems.
- `GetFinalPathNameByHandleW` is used in `std::fs::canonicalize`. Systems that don't support `GetFinalPathNameByHandleW` also don't support symlinks, so the fallback uses `GetFullPathNameW` instead.
Down to Win95IE3.02/Win95OSR2/NT4 we get a somewhat reasonable implementation based on CryptGenRandom, before that we fall back to a non-cryptographic PRNG instead.
… on 95

At least on Windows 95 RTM, the TLS variables are only aligned to a 4 byte boundary. Unclear if this affects other systems, but NT4 is fine.
just returns `None` if unsupported
Add fallback implementations for `getaddrinfo` and `freeaddrinfo`

    These fall back to wship6.dll (NT4/2000) if available, or are impl'd via a translation
    of the header-only wspiapi.h implementations (IPv4 only, all Windows versions with
    WS2 support).

Fall back to `gethostname` if `GetHostNameW` is not available

Stub `SetHandleInformation`/`Socket::set_no_inherit`

    SetHandleInformation is exported by kernel32 on Win9X/ME, but is just
    stubbed, returning `ERROR_CALL_NOT_IMPLEMENTED`. Sockets are
    non-inheritable on these systems anyways, so we "fail successfully".
    https://www.betaarchive.com/wiki/index.php/Microsoft_KB_Archive/150523#MORE_INFORMATION

    SetHandleInformation is also unavailable on WinNT before 3.51. This is
    fine, however, because MS did not supply WinSock 2 for Windows NT before
    4.0, so this function is not called.
seritools and others added 21 commits January 2, 2026 00:16
- Skip `maybe_verbatim` handling on 9x/ME
- 9x/ME only supports a limited number of access rights. This means that
  we can't use the special append-only behavior (atomic appends).
  Additionally, files opened with `append(true)` *will* be able to seek
  back and overwrite existing data on these systems.
- 9x/ME does not support `FILE_SHARE_DELETE`. Opened files cannot be
  opened to request a delete at the same time.

Implement fallbacks for functions needing `FILE_FLAG_BACKUP_SEMANTICS` (not available on 9x/ME)

- Implement fallback for `metadata` to work on directories on
  9x/ME
- Implement fallback for `exists` to work on directories on 9x/ME

Implement fallback for File::try_lock

- `try_lock` can just use `LockFile` instead of `LockFileEx` (= 9x/ME support)
- `try_lock_shared` will just fail on 9x/ME as shared locks are not supported
- blocking lock is not supported on 9x/ME either. We try `try_lock` in hopes of getting the lock instead, and then fall back to the proper lock impl, which will fail on 9x/ME
- Allow dropping unknown characters. unicows just doesn't understand emojis :(
- Ignore mismatched lengths when writing to console on non-Unicode Windows. (workaround for rust9x#13)
…eInformationByHandle`

Reimplement them on-top of native NT APIs as done in `fileextd.lib`.
This allows more file system APIs to work on XP and below.

Affected APIs:
- File truncation (can now set end of file without multiple SetFilePointerEx calls on NT)
- Cleaner fallback impl for reparse tags
- remove_dir_all: Modern impl now supported on all NT-based systems
- Get rid of RtlCaptureContext import, manually implement it
- Add support for older dbghelp versions. With this, backtraces on XP+
  are supported out of the box. It seems that the "best" version for old
  systems is the one from VS2005, found in
  "Microsoft Visual Studio 8\Common7\IDE\dbghelp.dll".
  This one is compiled with 9x support (unlike the VS2003 one!).
 - Update README.md to adapt the rust9x
 - Remove INSTALL.md and CODE_OF_CONDUCT.md to remove the unnessary docs
 - Added some comments of the bootstrap
 - Enabled some extended tools
 - Enabled incremental build
 - Uses UTF-8 always to read config file
 - Friendly in Chinese/otherlang PC [including me :) ]
- Added a upstream after check out
- Removed 3 workflows which is from official repo, they are unuseful
- Set the `GITHUB_ACTIONS` to none to avoid bootstrap get wrong commit hash
 - Added `CARGO_TERM_COLOR`, which is `always`
- Specified the packing dir
 - Removed the check of `build` directory
 - Removed the `rustdoc`, because the official one provided.
 - Use `rustfmt` instead of `rustdoc`
 - Disable building `llvm-tools`.
- Uses `build-toolchain` instead of `build-target`
 - Changed name to `Build Rust9x Toolchain`
- Added input in `workflow_dispatch`
  - Added the `GITHUB_TOKEN` env
- Added some links on title `Links`
- Removed `Set up upstream` and `Install NASM` steps in workflow file
  - Removed Windows i586 support
@zhangxuan2011 zhangxuan2011 force-pushed the rust9x branch 2 times, most recently from 65f2fcb to 2dfe01d Compare February 24, 2026 04:30
@seritools
Copy link
Member

Thank you!

I hope to get around to cleaning this up soon and merge it

@zhangxuan2011
Copy link
Author

Thank you!

I hope to get around to cleaning this up soon and merge it

No problem~ Just let me know when you've finished cleaning it up, I'm ready to merge/test at any time

If you can, you can add the GNU target, so that the CI can do cross-compile

Also, this docs still have some bugs, don't forget to fix it :-) (i have no more time do it because i am preparing for an important exam)

For VS 2026 updates, i hope you can adapt it as well (because it will report "Cannot found FlsAlloc in KERNEL32.dll" in VS 2026)

Anyway, thats what i know during using it, thanks for the reply :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants