Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
yuja committed Dec 18, 2024
1 parent 4199729 commit d604087
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 32 deletions.
32 changes: 2 additions & 30 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,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
Expand All @@ -42,31 +39,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@a54c7afa936fefeb4456b2dd8068152669aa8203
Expand All @@ -75,7 +47,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 --workspace --all-targets --verbose ${{ matrix.cargo_flags }} -- config
env:
RUST_BACKTRACE: 1

Expand Down
2 changes: 1 addition & 1 deletion cli/src/cli_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3679,7 +3679,7 @@ impl CliRunner {
let maybe_workspace_loader = if let Some(path) = &args.global_args.repository {
// TODO: maybe path should be canonicalized by WorkspaceLoader?
let abs_path = cwd.join(path);
let abs_path = dunce::canonicalize(&abs_path).unwrap_or(abs_path);
let abs_path = abs_path.canonicalize().unwrap_or(abs_path);
// Invalid -R path is an error. No need to proceed.
let loader = self
.workspace_loader_factory
Expand Down
2 changes: 1 addition & 1 deletion cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ pub struct ConfigEnv {
impl ConfigEnv {
/// Initializes configuration loader based on environment variables.
pub fn from_environment() -> Result<Self, ConfigEnvError> {
let home_dir = dirs::home_dir();
let home_dir = dirs::home_dir().map(|path| path.canonicalize().unwrap_or(path));
let env = UnresolvedConfigEnv {
config_dir: dirs::config_dir(),
home_dir: home_dir.clone(),
Expand Down
2 changes: 2 additions & 0 deletions cli/tests/test_config_command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,8 @@ fn test_config_conditional() {
let mut test_env = TestEnvironment::default();
test_env.jj_cmd_ok(test_env.home_dir(), &["git", "init", "repo1"]);
test_env.jj_cmd_ok(test_env.home_dir(), &["git", "init", "repo2"]);
dbg!(test_env.home_dir());
dbg!(dirs::home_dir());
let repo1_path = test_env.home_dir().join("repo1");
let repo2_path = test_env.home_dir().join("repo2");
// Test with fresh new config file
Expand Down

0 comments on commit d604087

Please sign in to comment.