diff --git a/.cargo/release-nightly.toml b/.cargo/release-nightly.toml deleted file mode 100644 index 0ee4e3260d1a..000000000000 --- a/.cargo/release-nightly.toml +++ /dev/null @@ -1,15 +0,0 @@ -[profile.release] -panic = "immediate-abort" - -[target.'cfg(all(target_os = "windows", target_env = "msvc"))'] -rustflags = [ - "-Ctarget-feature=+crt-static", - "-Clink-args=/DEFAULTLIB:ucrt.lib", - "-Clink-args=/NODEFAULTLIB:vcruntime.lib", - "-Clink-args=/NODEFAULTLIB:msvcrt.lib", - "-Clink-args=/NODEFAULTLIB:libucrt.lib", -] - -[unstable] -panic-immediate-abort = true -build-std = ["std", "panic_abort"] diff --git a/.cargo/release-windows-ms.toml b/.cargo/release-windows-ms.toml index cd55659519ae..5314ed42c58e 100644 --- a/.cargo/release-windows-ms.toml +++ b/.cargo/release-windows-ms.toml @@ -3,7 +3,7 @@ # Avoid linking with vcruntime140.dll by statically linking everything, # and then explicitly linking with ucrtbase.dll dynamically. # We do this, because vcruntime140.dll is an optional Windows component. -[target.'cfg(target_os = "windows")'] +[target.'cfg(all(target_os = "windows", target_env = "msvc"))'] rustflags = [ "-Ctarget-feature=+crt-static", "-Clink-args=/DEFAULTLIB:ucrt.lib", @@ -14,9 +14,12 @@ rustflags = [ # The backtrace code for panics in Rust is almost as large as the entire editor. # = Huge reduction in binary size by removing all that. +[profile.release] +panic = "immediate-abort" + [unstable] +panic-immediate-abort = true build-std = ["std", "panic_abort"] -build-std-features = ["panic_immediate_abort", "optimize_for_size"] # vvv The following parts are specific to official Windows builds. vvv # (The use of internal registries, security features, etc., are mandatory.) diff --git a/.cargo/release.toml b/.cargo/release.toml index 84af2f7bf646..c441121a7ba0 100644 --- a/.cargo/release.toml +++ b/.cargo/release.toml @@ -18,6 +18,9 @@ rustflags = [ # The backtrace code for panics in Rust is almost as large as the entire editor. # = Huge reduction in binary size by removing all that. +[profile.release] +panic = "immediate-abort" + [unstable] +panic-immediate-abort = true build-std = ["std", "panic_abort"] -build-std-features = ["default", "panic_immediate_abort", "optimize_for_size"] diff --git a/.pipelines/release.yml b/.pipelines/release.yml index 0293d3e3ba01..f69c27031c38 100644 --- a/.pipelines/release.yml +++ b/.pipelines/release.yml @@ -104,8 +104,7 @@ extends: # For details on this cargo_target_dir setting, see: # https://eng.ms/docs/more/rust/topics/onebranch-workaround CARGO_TARGET_DIR: C:\cargo_target_dir - # msrustup only supports stable toolchains, but this project requires nightly. - # We were told RUSTC_BOOTSTRAP=1 is a supported workaround. + # RUSTC_BOOTSTRAP=1 is required to make panic-immediate-abort work. RUSTC_BOOTSTRAP: 1 steps: # NOTE: Step objects have ordered keys and you MUST have "task" as the first key. diff --git a/Cargo.lock b/Cargo.lock index a66cdfe34e1e..4afe7a208b9e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -253,7 +253,7 @@ checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] name = "edit" -version = "1.2.1" +version = "2.0.0" dependencies = [ "criterion", "libc", diff --git a/README.md b/README.md index 623c6dfd59ce..a7ac26f786fd 100644 --- a/README.md +++ b/README.md @@ -22,20 +22,26 @@ winget install Microsoft.Edit ## Build Instructions * [Install Rust](https://www.rust-lang.org/tools/install) -* Install the nightly toolchain: `rustup install nightly` - * Alternatively, set the environment variable `RUSTC_BOOTSTRAP=1` * Clone the repository -* For a release build, run: - * Rust 1.90 or earlier: `cargo build --config .cargo/release.toml --release` - * otherwise: `cargo build --config .cargo/release-nightly.toml --release` +* If you're using nightly Rust: + ```sh + cargo build --release --config .cargo/release.toml + ``` +* If you're using stable Rust: + * Ideally: Set the environment variable `RUSTC_BOOTSTRAP=1` and use the **nightly** build instructions above. + This is recommended, because it drastically reduces the binary size and slightly improves performance. + * Otherwise, simply run: + ```sh + cargo build --release + ``` ### Build Configuration -During compilation you can set various environment variables to configure the build. The following table lists the available configuration options: +Uou can set the following environment variables at build-time to configure the build: Environment variable | Description --- | --- -`EDIT_CFG_ICU*` | See [ICU library name (SONAME)](#icu-library-name-soname) for details. +`EDIT_CFG_ICU*` | See [ICU library name (SONAME)](#icu-library-name-soname) below for details. This option is particularly important on Linux. `EDIT_CFG_LANGUAGES` | A comma-separated list of languages to include in the build. See [i18n/edit.toml](i18n/edit.toml) for available languages. ## Notes to Package Maintainers @@ -49,7 +55,8 @@ Assigning an "edit" alias is recommended, if possible. ### ICU library name (SONAME) -This project _optionally_ depends on the ICU library for its Search and Replace functionality. +This project optionally depends on the ICU library for its Search and Replace functionality. + By default, the project will look for a SONAME without version suffix: * Windows: `icuuc.dll` * macOS: `libicuuc.dylib` @@ -61,7 +68,7 @@ If your installation uses a different SONAME, please set the following environme * `EDIT_CFG_ICUI18N_SONAME`: For instance, `libicui18n.so.76`. -Additionally, this project assumes that the ICU exports are exported without `_` prefix and without version suffix, such as `u_errorName`. +Additionally, this project assumes that the ICU exports symbols without `_` prefix and without version suffix, such as `u_errorName`. If your installation uses versioned exports, please set: * `EDIT_CFG_ICU_CPP_EXPORTS`: If set to `true`, it'll look for C++ symbols such as `_u_errorName`. @@ -75,7 +82,7 @@ Finally, you can set the following environment variables: The way it does this is not officially supported by ICU and as such is not recommended to be relied upon. Enabled by default on UNIX (excluding macOS) if no other options are set. -To test your settings, run `cargo test` again but with the `--ignored` flag. For instance: +To test your build settings, run `cargo test` with the `--ignored` flag. For instance: ```sh cargo test -- --ignored ``` diff --git a/assets/manpage/edit.1 b/assets/manpage/edit.1 index facbffb7a9d5..bef840a78e88 100644 --- a/assets/manpage/edit.1 +++ b/assets/manpage/edit.1 @@ -1,4 +1,4 @@ -.TH EDIT 1 "version 1.2.1" "December 2025" +.TH EDIT 1 "version 2.0.0" .SH NAME edit \- a simple text editor .SH SYNOPSIS diff --git a/assets/snapcraft.yaml b/assets/snapcraft.yaml index d7961a38656a..34c93d861de2 100644 --- a/assets/snapcraft.yaml +++ b/assets/snapcraft.yaml @@ -1,6 +1,6 @@ name: msedit base: core24 -version: '1.2.1' +version: "2.0.0" summary: Edit is an MS-DOS inspired text editor from Microsoft description: | Edit pays homage to the classic MS-DOS Editor, but with a modern interface and input controls similar to VS Code. Learn more at https://github.com/microsoft/edit diff --git a/crates/edit/Cargo.toml b/crates/edit/Cargo.toml index 30818ec76ed9..02becfdb908a 100644 --- a/crates/edit/Cargo.toml +++ b/crates/edit/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "edit" -version = "1.2.1" +version = "2.0.0" edition.workspace = true license.workspace = true