From 00fd486d49170b1304c67381b3096e55d4cdc76f Mon Sep 17 00:00:00 2001 From: Rudi Floren Date: Thu, 24 Oct 2024 23:53:40 +0200 Subject: [PATCH 1/2] resolve TempDir paths before passing them to the flake bin On MacOS /tmp is a symlink to /private/tmp. TempDir creates a dir and returns the path as /tmp. nix is unhappy with symlink dirs when calling nix flake metadata --json To fix this we canonicalize the path first, resolving any symlinks on the way. Fixes #190. --- src/nix/hive/assets.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/nix/hive/assets.rs b/src/nix/hive/assets.rs index 29eba43..9e1f154 100644 --- a/src/nix/hive/assets.rs +++ b/src/nix/hive/assets.rs @@ -51,7 +51,10 @@ impl Assets { // We explicitly specify `path:` instead of letting Nix resolve // automatically, which would involve checking parent directories // for a git repository. - let uri = format!("path:{}", temp_dir.path().to_str().unwrap()); + let uri = format!( + "path:{}", + temp_dir.path().canonicalize().unwrap().to_str().unwrap() + ); let _ = lock_flake_quiet(&uri).await; let assets_flake = Flake::from_uri(uri).await?; assets_flake_uri = Some(assets_flake.locked_uri().to_owned()); From e5c30066c248739e37ae8c07e07c57ddecf30be3 Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Fri, 8 Nov 2024 11:24:33 -0700 Subject: [PATCH 2/2] Revert ".github: Run workflows on push event only" Sadly it breaks CI in fork-originated PRs if the author doesn't enable Actions on the fork itself. This reverts commit ce1aa41ff402c4d2f1e22ebf4ba11c1814edee43. --- .github/workflows/build.yml | 1 + .github/workflows/linters.yml | 1 + .github/workflows/tests.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a1c9d7f..d6902ba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,6 @@ name: Build on: + pull_request: push: jobs: build: diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index e79f471..1a3b740 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -1,6 +1,7 @@ name: Linters on: + pull_request: push: jobs: linters: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7acf129..b3fc80d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,5 +1,6 @@ name: Tests on: + pull_request: push: jobs: tests: