mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2025-01-09 03:18:16 +03:00
Avoid using nightly by default.
Instead, use it only where needed, which at this time is Windows for some nightly-only access to file-descriptors.
This commit is contained in:
parent
b29229f3b6
commit
ad3e15dae4
10
.github/actions/init-env-rust/action.yaml
vendored
10
.github/actions/init-env-rust/action.yaml
vendored
@ -3,6 +3,16 @@ description: prepare runner for rust related tasks
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Setup Nightly
|
||||
if: runner.os == 'Windows'
|
||||
shell: bash
|
||||
run: |
|
||||
mv rust-toolchain.toml.nightly rust-toolchain.toml
|
||||
- name: Setup Stable
|
||||
if: runner.os != 'Windows'
|
||||
shell: bash
|
||||
run: |
|
||||
mv rust-toolchain.toml.stable rust-toolchain.toml
|
||||
- name: Check versions
|
||||
shell: bash
|
||||
run: |
|
||||
|
2
.github/workflows/push.yaml
vendored
2
.github/workflows/push.yaml
vendored
@ -32,7 +32,6 @@ jobs:
|
||||
- *workflows
|
||||
- 'Cargo.lock'
|
||||
- 'Cargo.toml'
|
||||
- 'rust-toolchain.toml'
|
||||
rust: &any-rust
|
||||
- *rust
|
||||
- 'crates/**'
|
||||
@ -111,7 +110,6 @@ jobs:
|
||||
- [devtools]
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: ./.github/actions/init-env-rust
|
||||
- uses: ./.github/actions/check-crate
|
||||
with:
|
||||
features: ${{ toJson(matrix.features) }}
|
||||
|
@ -18,9 +18,9 @@ you right. Let's get started.
|
||||
- [Tokio](#tokio)
|
||||
- [Building](#building)
|
||||
- [Building on Windows](#building-on-windows)
|
||||
- [File permissions](#file-permissions)
|
||||
- [Perl](#perl)
|
||||
- [Crosscompilation](#crosscompilation)
|
||||
- [File permissions](#file-permissions)
|
||||
- [Perl](#perl)
|
||||
- [Crosscompilation](#crosscompilation)
|
||||
- [Design](#design)
|
||||
- [Contributing](#contributing)
|
||||
- [Some Other Random Notes](#some-other-random-notes)
|
||||
@ -162,7 +162,22 @@ This will make an asset similar to our nightly build.
|
||||
|
||||
Building on Windows is a bit of a tricky process. Here are some helpful tips.
|
||||
|
||||
### File permissions
|
||||
#### Nightly Compiler
|
||||
|
||||
As a few crates require nightly features on Windows, it's easiest to set an override
|
||||
to automatically use a nightly compiler.
|
||||
|
||||
```shell
|
||||
rustup override add nightly-2024-07-01
|
||||
```
|
||||
|
||||
If a stable nightly isn't desired or necessary, the latest nightly compiler can also be used:
|
||||
|
||||
```shell
|
||||
rustup override add nightly
|
||||
```
|
||||
|
||||
#### File permissions
|
||||
|
||||
We use `pnpm`, which requires a relatively recent version of Node.js.
|
||||
Make sure that the latest stable version of Node.js is installed and
|
||||
@ -184,7 +199,7 @@ npm config set prefix $env:APPDATA\npm
|
||||
|
||||
Afterwards, add this folder to your PATH.
|
||||
|
||||
### Perl
|
||||
#### Perl
|
||||
|
||||
A Perl interpreter is required to be installed in order to configure the `openssl-sys`
|
||||
crate. We've used [Strawberry Perl](https://strawberryperl.com/) without issue.
|
||||
@ -196,7 +211,7 @@ Note that it might appear that the build has hung or frozen on the `openssl-sys`
|
||||
It's not, it's just that Cargo can't report the status of a C/C++ build happening
|
||||
under the hood, and openssl is _large_. It'll take a while to compile.
|
||||
|
||||
### Crosscompilation
|
||||
#### Crosscompilation
|
||||
|
||||
This paragraph is about crosscompilation to x86_64-MSVC from ARM Windows,
|
||||
a configuration typical for people with Apple Silicon and Parallels VMs,
|
||||
|
@ -6,9 +6,8 @@
|
||||
//! a longer-term solution for managing Git operations.
|
||||
#![deny(missing_docs, unsafe_code)]
|
||||
#![allow(async_fn_in_trait)]
|
||||
#![cfg_attr(test, feature(async_closure))]
|
||||
#![allow(unknown_lints)]
|
||||
#![cfg_attr(windows, feature(windows_by_handle))]
|
||||
#![feature(impl_trait_in_assoc_type)]
|
||||
|
||||
#[cfg(all(not(debug_assertions), feature = "test-askpass-path"))]
|
||||
compile_error!("BUG: in production code this flag should not be set, nor do we run test with `cargo test --release`");
|
||||
|
@ -1,5 +1,3 @@
|
||||
#![feature(error_generic_member_access)]
|
||||
#![cfg_attr(windows, feature(windows_by_handle))]
|
||||
#![cfg_attr(
|
||||
all(windows, not(test), not(debug_assertions)),
|
||||
windows_subsystem = "windows"
|
||||
@ -36,6 +34,3 @@ pub mod users;
|
||||
pub mod virtual_branches;
|
||||
|
||||
pub mod zip;
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
pub mod windows;
|
||||
|
@ -1,5 +1,3 @@
|
||||
#![feature(error_generic_member_access)]
|
||||
#![cfg_attr(windows, feature(windows_by_handle))]
|
||||
#![cfg_attr(
|
||||
all(windows, not(test), not(debug_assertions)),
|
||||
windows_subsystem = "windows"
|
||||
|
@ -1,24 +0,0 @@
|
||||
use std::os::windows::fs::MetadataExt;
|
||||
|
||||
pub trait MetadataShim {
|
||||
fn ino(&self) -> u64;
|
||||
fn dev(&self) -> u64;
|
||||
fn uid(&self) -> u32;
|
||||
fn gid(&self) -> u32;
|
||||
}
|
||||
|
||||
impl MetadataShim for std::fs::Metadata {
|
||||
fn ino(&self) -> u64 {
|
||||
self.file_index().expect("file metadata constructed based on directory listing instead of a file (see https://doc.rust-lang.org/std/os/windows/fs/trait.MetadataExt.html#tymethod.file_index)")
|
||||
}
|
||||
#[allow(clippy::cast_lossless)]
|
||||
fn dev(&self) -> u64 {
|
||||
self.volume_serial_number().expect("file metadata constructed based on directory listing instead of a file (see https://doc.rust-lang.org/std/os/windows/fs/trait.MetadataExt.html#tymethod.volume_serial_number)") as u64
|
||||
}
|
||||
fn uid(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
fn gid(&self) -> u32 {
|
||||
0
|
||||
}
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
//! Implement the file-monitoring agent that informs about changes in interesting locations.
|
||||
#![deny(unsafe_code, rust_2018_idioms)]
|
||||
#![allow(clippy::doc_markdown, clippy::missing_errors_doc)]
|
||||
#![feature(slice_as_chunks)]
|
||||
|
||||
mod events;
|
||||
use events::InternalEvent;
|
||||
|
@ -22,7 +22,7 @@
|
||||
inherit system overlays;
|
||||
};
|
||||
|
||||
rustToolchain = unstablePkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
|
||||
rustToolchain = "stable";
|
||||
|
||||
common = with unstablePkgs; [
|
||||
gtk3
|
||||
|
4
rust-toolchain.toml.stable
Normal file
4
rust-toolchain.toml.stable
Normal file
@ -0,0 +1,4 @@
|
||||
[toolchain]
|
||||
channel = "stable"
|
||||
components = [ "rustfmt", "clippy" ]
|
||||
profile = "minimal"
|
Loading…
Reference in New Issue
Block a user