Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Jake-Shadle/xwin
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.2.15
Choose a base ref
...
head repository: Jake-Shadle/xwin
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 3,704 additions and 1,229 deletions.
  1. +83 −0 .cargo/config.toml
  2. +3 −0 .earthlyignore
  3. +12 −15 .github/workflows/rust-ci.yml
  4. +0 −15 .vscode/launch.json
  5. +78 −1 CHANGELOG.md
  6. +725 −505 Cargo.lock
  7. +39 −17 Cargo.toml
  8. +10 −0 Earthfile
  9. +71 −3 README.md
  10. +11 −21 deny.toml
  11. +264 −0 docs/example-map.toml
  12. +269 −70 src/ctx.rs
  13. +10 −11 src/download.rs
  14. +220 −117 src/lib.rs
  15. +200 −68 src/main.rs
  16. +3 −3 src/manifest.rs
  17. +550 −0 src/minimize.rs
  18. +487 −301 src/splat.rs
  19. +5 −8 src/unpack.rs
  20. +11 −1 src/util.rs
  21. +201 −41 tests/compiles.rs
  22. +10 −3 tests/deterministic.rs
  23. +285 −0 tests/snapshots/compiles__verify_compiles_minimized.snap
  24. +83 −0 tests/snapshots/xwin-minimize.snap
  25. +24 −11 tests/snapshots/xwin-splat.snap
  26. +34 −8 tests/snapshots/xwin.snap
  27. +6 −0 tests/xwin-test/src/main.rs
  28. +10 −10 xwin.dockerfile
83 changes: 83 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
[target.'cfg(all())']
rustflags = [
# BEGIN - Embark standard lints v5 for Rust 1.55+
# do not change or add/remove here, but one can add exceptions after this section
# for more info see: <https://github.com/EmbarkStudios/rust-ecosystem/issues/59>
"-Wclippy::all",
"-Wclippy::await_holding_lock",
"-Wclippy::char_lit_as_u8",
"-Wclippy::checked_conversions",
"-Wclippy::clear_with_drain",
"-Wclippy::dbg_macro",
"-Wclippy::debug_assert_with_mut_call",
"-Wclippy::disallowed_methods",
"-Wclippy::disallowed_types",
"-Wclippy::doc_markdown",
"-Wclippy::empty_enum",
"-Wclippy::enum_glob_use",
"-Wclippy::exit",
"-Wclippy::expl_impl_clone_on_copy",
"-Wclippy::explicit_deref_methods",
"-Wclippy::explicit_into_iter_loop",
"-Wclippy::fallible_impl_from",
"-Wclippy::filter_map_next",
"-Wclippy::flat_map_option",
"-Wclippy::float_cmp_const",
"-Wclippy::fn_params_excessive_bools",
"-Wclippy::from_iter_instead_of_collect",
"-Wclippy::if_let_mutex",
"-Wclippy::implicit_clone",
"-Wclippy::imprecise_flops",
"-Wclippy::inefficient_to_string",
"-Wclippy::invalid_upcast_comparisons",
"-Wclippy::large_digit_groups",
"-Wclippy::large_stack_arrays",
"-Wclippy::large_types_passed_by_value",
"-Wclippy::let_unit_value",
"-Wclippy::linkedlist",
"-Wclippy::lossy_float_literal",
"-Wclippy::macro_use_imports",
"-Wclippy::manual_ok_or",
"-Wclippy::map_err_ignore",
"-Wclippy::map_flatten",
"-Wclippy::map_unwrap_or",
"-Wclippy::match_on_vec_items",
"-Wclippy::match_same_arms",
"-Wclippy::match_wild_err_arm",
"-Wclippy::match_wildcard_for_single_variants",
"-Wclippy::mem_forget",
"-Wclippy::mismatched_target_os",
"-Wclippy::missing_enforced_import_renames",
"-Wclippy::mut_mut",
"-Wclippy::mutex_integer",
"-Wclippy::needless_borrow",
"-Wclippy::needless_continue",
"-Wclippy::needless_for_each",
"-Wclippy::option_option",
"-Wclippy::path_buf_push_overwrite",
"-Wclippy::ptr_as_ptr",
"-Wclippy::ptr_cast_constness",
"-Wclippy::rc_mutex",
"-Wclippy::ref_option_ref",
"-Wclippy::rest_pat_in_fully_bound_structs",
"-Wclippy::same_functions_in_if_condition",
"-Wclippy::semicolon_if_nothing_returned",
"-Wclippy::single_match_else",
"-Wclippy::string_add_assign",
"-Wclippy::string_add",
"-Wclippy::string_lit_as_bytes",
"-Wclippy::string_to_string",
"-Wclippy::todo",
"-Wclippy::trait_duplication_in_bounds",
"-Wclippy::unimplemented",
"-Wclippy::unnecessary_box_returns",
"-Wclippy::unnested_or_patterns",
"-Wclippy::unused_self",
"-Wclippy::useless_transmute",
"-Wclippy::verbose_file_reads",
"-Wclippy::zero_sized_map_values",
"-Wfuture_incompatible",
"-Wnonstandard_style",
"-Wrust_2018_idioms",
# END - Embark standard lints v5 for Rust 1.55+
]
3 changes: 3 additions & 0 deletions .earthlyignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/*
!xwin.dockerfile
!Earthfile
27 changes: 12 additions & 15 deletions .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ jobs:
- os: ubuntu-22.04
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable

# make sure all code has been formatted with rustfmt
@@ -40,17 +40,17 @@ jobs:
name: Verify compiles
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
# Add the actual target we compile for in the test
- run: rustup target add x86_64-pc-windows-msvc
- name: symlinks
run: |
set -eux
sudo ln -s clang-12 /usr/bin/clang-cl
sudo ln -s llvm-ar-12 /usr/bin/llvm-lib
sudo ln -s lld-link-12 /usr/bin/lld-link
sudo ln -s lld-12 /usr/bin/ld.lld
sudo ln -s clang-14 /usr/bin/clang-cl
sudo ln -s llvm-ar-14 /usr/bin/llvm-lib
sudo ln -s lld-link-14 /usr/bin/lld-link
sudo ln -s lld-14 /usr/bin/ld.lld
clang++ -v
ld.lld -v
llvm-lib -v
@@ -66,7 +66,7 @@ jobs:
name: Verify deterministic
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo fetch
- name: cargo test build
@@ -78,7 +78,7 @@ jobs:
name: Verify CLI
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo fetch
- name: cargo test build
@@ -90,11 +90,8 @@ jobs:
name: cargo-deny
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check
arguments: --all-features
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2

publish-check:
name: Publish Check
@@ -109,7 +106,7 @@ jobs:
AR_aarch64_unknown_linux_musl: llvm-ar
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS: "-Clink-self-contained=yes -Clinker=rust-lld"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
target: ${{ matrix.target }}
@@ -155,7 +152,7 @@ jobs:
if: endsWith(matrix.target, '-linux-musl')
run: sudo apt-get install -y musl-tools llvm
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- run: cargo fetch --target ${{ matrix.target }}
- name: Release build
shell: bash
15 changes: 0 additions & 15 deletions .vscode/launch.json

This file was deleted.

79 changes: 78 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -8,6 +8,70 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

<!-- next-header -->
## [Unreleased] - ReleaseDate
### Fixed
- [PR#143](https://github.com/Jake-Shadle/xwin/pull/142) is a second attempt to resolve [#141](https://github.com/Jake-Shadle/xwin/issues/141) by switching to a new `3.0.0-rc1` version of ureq that might not have the same issue, as well as adding support for retries for EOF I/O errors seen by users which can be configured via `--http-retry` or `XWIN_HTTP_RETRY`.

### Fixed (failed)
- [PR#142](https://github.com/Jake-Shadle/xwin/pull/142) is an attempt to resolve [#141](https://github.com/Jake-Shadle/xwin/issues/141) by switching from `ureq` to `reqwest`.

## [0.6.5] - 2024-08-21
### Fixed
- [PR#137](https://github.com/Jake-Shadle/xwin/pull/137) fixes the fix introduced in [PR#136](https://github.com/Jake-Shadle/xwin/pull/136).

## [0.6.4] - 2024-08-21
### Fixed
- [PR#136](https://github.com/Jake-Shadle/xwin/pull/136) fixed an issue introduced in [PR#131](https://github.com/Jake-Shadle/xwin/pull/131) where symlink disabling when a case-insensitive file system was detected was...not being respected. At all.

## [0.6.3] - 2024-08-09
### Fixed
- [PR#134](https://github.com/Jake-Shadle/xwin/pull/134) added back onecoreuap headers that were moved from the main SDK header package in recent versions of the SDK. Thanks [@tomager](https://github.com/tomager)!

## [0.6.2] - 2024-07-02
### Fixed
- [PR#131](https://github.com/Jake-Shadle/xwin/pull/131) resolved [#130](https://github.com/Jake-Shadle/xwin/issues/130) by adding detection of case-insensitive file systems, which then disables symlink creation since it is not needed, and breaks.

## [0.6.1] - 2024-06-30
### Fixed
- [PR#129](https://github.com/Jake-Shadle/xwin/pull/129) fixed [#128](https://github.com/Jake-Shadle/xwin/issues/128) by adding the additional `onecoreuap` MSI package that contains headers that were previously (before SDK 10.0.26100) part of other MSI packages. Thanks [@bigfoodK](https://github.com/bigfoodK)!

## [0.6.0] - 2024-06-03
### Added
- [PR#123](https://github.com/Jake-Shadle/xwin/pull/123) (a rework of [#119](https://github.com/Jake-Shadle/xwin/pull/119)) adds the ability to splat in the format understood by clang-cl `/winsysroot` option.

## [0.5.2] - 2024-05-06
### Changed
- [PR#117](https://github.com/Jake-Shadle/xwin/pull/117) updated a few crates, notably `zip`.

## [0.5.1] - 2024-04-02
### Changed
- [PR#116](https://github.com/Jake-Shadle/xwin/pull/116) (a rework of [#115](https://github.com/Jake-Shadle/xwin/pull/115)) improves the speed of the `x86_64-unknown-linux-musl` binary by using `mimalloc`.

## [0.5.0] - 2023-11-13
### Changed
- [PR#110](https://github.com/Jake-Shadle/xwin/pull/110) changed how `Ctx` is built. It was getting too complicated to support niche use cases, some of which didn't belong in a library (like reading environment variables), so this functionality has been completely removed. Instead, one must pass in a `ureq::Agent` that is fully configured how the user wants it.
- [PR#110](https://github.com/Jake-Shadle/xwin/pull/110) changed the environment variable read to the `xwin` binary instead of the library, as well as its name `https_proxy` -> `HTTPS_PROXY`, and added it to an an option on the command line.

## [0.4.1] - 2023-11-09
### Fixed
- [PR#108](https://github.com/Jake-Shadle/xwin/pull/108) resolved [#107](https://github.com/Jake-Shadle/xwin/issues/107) by fixing the Window symlink code added in [PR#105](https://github.com/Jake-Shadle/xwin/pull/105) and only using it in the two cases it was needed.

## [0.4.0] - 2023-11-07
### Added
- [PR#101](https://github.com/Jake-Shadle/xwin/pull/101) resolved [#28](https://github.com/Jake-Shadle/xwin/issues/28), [#84](https://github.com/Jake-Shadle/xwin/issues/84), and [#85](https://github.com/Jake-Shadle/xwin/issues/85) by adding a `minimize` command that straces a cargo build to write a `map` file that can be used by a `splat` command to only splat the headers and libraries actually needed to build, drastically reducing the splat output (eg. 1.3GiB -> 101MiB). This `map` file also allows the creation of symlinks on a per-file basis, allowing users to create their own symlinks if needed.
- [PR#104](https://github.com/Jake-Shadle/xwin/pull/104) resolved [#103](https://github.com/Jake-Shadle/xwin/issues/103) by allowing custom certificates to be specified via the `SSL_CERT_FILE`, `CURL_CA_BUNDLE`, or `REQUESTS_CA_BUNDLE` environment variables. `xwin` must be compiled with the `native-tls` feature for this to function. Thanks [@Owen-CH-Leung](https://github.com/Owen-CH-Leung)!
- [PR#105](https://github.com/Jake-Shadle/xwin/pull/105) supplanted [#100](https://github.com/Jake-Shadle/xwin/pull/100), allowing creation of symlinks on a Windows host. Thanks [@sykhro](https://github.com/sykhro)!

## [0.3.1] - 2023-09-12
### Changed
- [PR#99](https://github.com/Jake-Shadle/xwin/pull/99) changed the default VS manifest version from 16 -> 17. You can preserve the old behavior by passing `--manifest-version 16` on the cmd line.

### Fixed
- [PR#99](https://github.com/Jake-Shadle/xwin/pull/99) resolved [#92](https://github.com/Jake-Shadle/xwin/issues/92) by only failing if matching relative paths didn't have the same contents. This currently only applies to one file, `appnotify.h`, which is present in the SDK headers and Store headers.

## [0.3.0] - 2023-09-12
### Changed
- [PR#93](https://github.com/Jake-Shadle/xwin/pull/93) added the ability to specify a download timeout for each individual download, and changed the default from infinite to 60 seconds, so that xwin will error if the remote HTTP server is slow/unresponsive. Thanks [@dragonmux](https://github.com/dragonmux)!

## [0.2.15] - 2023-09-11
### Changed
- [PR#93](https://github.com/Jake-Shadle/xwin/pull/93) added the ability to specify a download timeout for each individual download, and changed the default from infinite to 60 seconds, so that xwin will error if the remote HTTP server is slow/unresponsive. Thanks [@dragonmux](https://github.com/dragonmux)!
@@ -133,7 +197,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Initial implementation if downloading, unpacking, and splatting of the CRT and Windows SDK. This first pass focused on targeting x86_64 Desktop, so targeting the Windows Store or other architectures is not guaranteed to work.

<!-- next-url -->
[Unreleased]: https://github.com/Jake-Shadle/xwin/compare/0.2.15...HEAD
[Unreleased]: https://github.com/Jake-Shadle/xwin/compare/0.6.5...HEAD
[0.6.5]: https://github.com/Jake-Shadle/xwin/compare/0.6.4...0.6.5
[0.6.4]: https://github.com/Jake-Shadle/xwin/compare/0.6.3...0.6.4
[0.6.3]: https://github.com/Jake-Shadle/xwin/compare/0.6.2...0.6.3
[0.6.2]: https://github.com/Jake-Shadle/xwin/compare/0.6.1...0.6.2
[0.6.1]: https://github.com/Jake-Shadle/xwin/compare/0.6.0...0.6.1
[0.6.0]: https://github.com/Jake-Shadle/xwin/compare/0.5.2...0.6.0
[0.5.2]: https://github.com/Jake-Shadle/xwin/compare/0.5.1...0.5.2
[0.5.1]: https://github.com/Jake-Shadle/xwin/compare/0.5.0...0.5.1
[0.5.0]: https://github.com/Jake-Shadle/xwin/compare/0.4.1...0.5.0
[0.4.1]: https://github.com/Jake-Shadle/xwin/compare/0.4.0...0.4.1
[0.4.0]: https://github.com/Jake-Shadle/xwin/compare/0.3.1...0.4.0
[0.3.1]: https://github.com/Jake-Shadle/xwin/compare/0.3.0...0.3.1
[0.3.0]: https://github.com/Jake-Shadle/xwin/compare/0.2.15...0.3.0
[0.2.15]: https://github.com/Jake-Shadle/xwin/compare/0.2.14...0.2.15
[0.2.14]: https://github.com/Jake-Shadle/xwin/compare/0.2.13...0.2.14
[0.2.13]: https://github.com/Jake-Shadle/xwin/compare/0.2.12...0.2.13
Loading