Skip to content

Commit

Permalink
refactor!: no_std & no static msvcrt & remove download plugin (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
amrbashir authored Apr 29, 2024
1 parent 0c54d93 commit 5423579
Show file tree
Hide file tree
Showing 28 changed files with 501 additions and 516 deletions.
3 changes: 0 additions & 3 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
[build]
target = "i686-pc-windows-msvc"

[target.i686-pc-windows-msvc]
rustflags = ["-C", "target-feature=+crt-static"]
10 changes: 0 additions & 10 deletions .changes/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,6 @@
}
]
},
"nsis_download": {
"path": "./crates/nsis-download",
"manager": "rust",
"assets": [
{
"path": "target/i686-pc-windows-msvc/release/${ pkg.pkg }.dll",
"name": "${ pkg.pkg }.dll"
}
]
},
"nsis_process": {
"path": "./crates/nsis-process",
"manager": "rust",
Expand Down
7 changes: 7 additions & 0 deletions .changes/no_std.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"nsis_tauri_utils": "minor"
"nsis_semvercompare": "minor"
"nsis_process": "minor"
---

Reduce the DLL size by using `no_std` and without static msvcrt.
5 changes: 2 additions & 3 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ jobs:
audit:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: rust audit
uses: actions-rs/audit-check@v1
- uses: actions/checkout@v4
- uses: rustsec/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/change-status-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: covector status
Expand Down
30 changes: 7 additions & 23 deletions .github/workflows/clippy-fmt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,33 +18,17 @@ jobs:
clippy:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: install stable
uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
components: clippy
- run: cargo clippy --release --all-targets --all-features -- -D warnings

- uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features -- -D warnings

fmt:
rustfmt:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: install stable
uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
profile: minimal
toolchain: stable
override: true
components: rustfmt

- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- run: cargo fmt --all -- --check
9 changes: 2 additions & 7 deletions .github/workflows/covector-version-or-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,11 @@ jobs:
successfulPublish: ${{ steps.covector.outputs.successfulPublish }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 16
check-latest: true
registry-url: 'https://registry.npmjs.org'
- uses: actions/setup-node@v4

- name: git config
run: |
Expand Down
15 changes: 3 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,6 @@ jobs:
runs-on: windows-latest

steps:
- uses: actions/checkout@v2

- name: install stable
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true

- uses: actions-rs/cargo@v1
with:
command: test
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo test --features test
12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ edition = "2021"
license = "MIT or Apache-2.0"

[workspace.dependencies]
pluginapi = { path = "./crates/pluginapi" }
nsis-plugin-api = { path = "./crates/nsis-plugin-api" }

[workspace.dependencies.windows-sys]
version = "0.52.0"
Expand All @@ -24,8 +24,8 @@ features = [
]

[profile.release]
codegen-units = 1
lto = true
opt-level = "s"
panic = "abort"
strip = "symbols"
panic = "abort" # Strip expensive panic clean-up logic
codegen-units = 1 # Compile crates one after another so the compiler can optimize better
lto = true # Enables link time optimizations
opt-level = "s" # Optimize for binary size
strip = true # Remove debug symbols
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@

A collection of NSIS plugins written in rust.

| Plugin | Description |
|---|---|
| [nsis-download](./crates/nsis-download/) | Download a file from an URL to a path |
| [nsis-process](./crates/nsis-process/) | Find and Kill processes |
| [nsis-semvercompare](./crates/nsis-semvercompare/) | Compare two semantic versions |
| [nsis-tauri-utils](./crates/nsis-tauri-utils/) | A collection of all the above plugins into a single DLL for smaller size |
| Plugin | Description |
| -------------------------------------------------- | ------------------------------------------------------------------------ |
| [nsis-process](./crates/nsis-process/) | Find and Kill processes |
| [nsis-semvercompare](./crates/nsis-semvercompare/) | Compare two semantic versions |
| [nsis-tauri-utils](./crates/nsis-tauri-utils/) | A collection of all the above plugins into a single DLL for smaller size |

## License

Apache-2.0/MIT
Apache-2.0/MIT
16 changes: 0 additions & 16 deletions crates/nsis-download/CHANGELOG.md

This file was deleted.

15 changes: 0 additions & 15 deletions crates/nsis-download/Cargo.toml

This file was deleted.

Loading

0 comments on commit 5423579

Please sign in to comment.