diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 118f48a702..8ece30c83b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,11 +16,8 @@ jobs: fail-fast: false matrix: # macos-13 is x86; macos-14 is ARM - os: [ubuntu-latest, macos-13, macos-14, windows-latest] + os: [windows-latest] cargo_flags: [""] - include: - - os: ubuntu-latest - cargo_flags: "--all-features" runs-on: ${{ matrix.os }} # TODO FIXME (aseipp): keep the timeout limit to ~15 minutes. this is long @@ -38,32 +35,6 @@ jobs: steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 - # The default version of gpg installed on the runners is a version baked in with git - # which only contains the components needed by git and doesn't work for our test cases. - # - # This installs the latest gpg4win version, which is a variation of GnuPG built for - # Windows. - # - # There is some issue with windows PATH max length which is what all the PATH wrangling - # below is for. Please see the below link for where this fix was derived from: - # https://github.com/orgs/community/discussions/24933 - - name: Setup GnuPG [windows] - if: ${{ matrix.os == 'windows-latest' }} - run: | - $env:PATH = "C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\ProgramData\chocolatey\bin" - [Environment]::SetEnvironmentVariable("Path", $env:PATH, "Machine") - choco install --yes gpg4win - echo "C:\Program Files (x86)\Gpg4win\..\GnuPG\bin" >> $env:GITHUB_PATH - - # The default version of openssh on windows server is quite old (8.1) and doesn't have - # all the necessary signing/verification commands available (such as -Y find-principals) - - name: Setup ssh-agent [windows] - if: ${{ matrix.os == 'windows-latest' }} - run: | - Remove-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0 - Remove-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0 - choco install openssh --pre - - name: Install Rust uses: dtolnay/rust-toolchain@1482605bfc5719782e1267fd0c0cc350fe7646b8 with: @@ -71,7 +42,7 @@ jobs: - name: Build run: cargo build --workspace --all-targets --verbose ${{ matrix.cargo_flags }} - name: Test - run: cargo test --workspace --all-targets --verbose ${{ matrix.cargo_flags }} + run: cargo test working --workspace --all-targets --verbose ${{ matrix.cargo_flags }} --no-fail-fast -- --show-output env: RUST_BACKTRACE: 1 diff --git a/Cargo.lock b/Cargo.lock index 7cba36cdfa..69bd34fef9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1890,6 +1890,7 @@ dependencies = [ "config", "criterion", "digest", + "dunce", "either", "esl01-renderdag", "futures 0.3.31", diff --git a/lib/Cargo.toml b/lib/Cargo.toml index b75e3bf49b..07a6d3c783 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -42,6 +42,7 @@ chrono-english = { workspace = true } clru = { workspace = true } config = { workspace = true } digest = { workspace = true } +dunce = { workspace = true } either = { workspace = true } futures = { workspace = true } git2 = { workspace = true, optional = true } diff --git a/lib/tests/test_local_working_copy.rs b/lib/tests/test_local_working_copy.rs index 8d328ea9e9..ccad43f53d 100644 --- a/lib/tests/test_local_working_copy.rs +++ b/lib/tests/test_local_working_copy.rs @@ -1329,7 +1329,7 @@ fn test_check_out_existing_file_symlink_icase_fs(victim_exists: bool) { if victim_exists { std::fs::write(&victim_file_path, "old").unwrap(); } - assert_eq!(workspace_root.join("parent").exists(), victim_exists); + assert_eq!(workspace_root.join("parent").try_exists().unwrap(), victim_exists); let file_path = RepoPath::from_internal_string("PARENT"); let tree = create_tree(repo, &[(file_path, "bad")]); @@ -1348,7 +1348,7 @@ fn test_check_out_existing_file_symlink_icase_fs(victim_exists: bool) { if victim_exists { assert_eq!(std::fs::read(&victim_file_path).unwrap(), b"old"); } else { - assert!(!victim_file_path.exists()); + assert!(!victim_file_path.try_exists().unwrap()); } } @@ -1632,7 +1632,23 @@ fn test_check_out_reserved_file_path_vfat(vfat_path_str: &str, file_path_strs: & let repo = &test_workspace.repo; let workspace_root = test_workspace.workspace.workspace_root().to_owned(); std::fs::create_dir(workspace_root.join(".git")).unwrap(); + std::fs::create_dir(workspace_root.join("..git")).unwrap(); + std::fs::create_dir(workspace_root.join("...git")).unwrap(); + std::fs::create_dir(workspace_root.join("....git")).unwrap(); + std::fs::create_dir(workspace_root.join(".....git")).unwrap(); + assert!(workspace_root.join(".jj").exists()); let is_vfat = check_vfat(&workspace_root); + for i in 0..=9 { + for name in ["GIT", "JJ"] { + let path = workspace_root.join(format!("{name}~{i}")); + eprintln!("XXX {} {}", path.display(), path.exists()); + } + } + std::process::Command::new("cmd") + .args(["/c", "dir /x"]) + .current_dir(dunce::simplified(&workspace_root)) + .status() + .unwrap(); let vfat_disk_path = workspace_root.join(vfat_path_str); let file_paths = file_path_strs