Skip to content

Conversation

@Frost-Phoenix
Copy link
Contributor

@Frost-Phoenix Frost-Phoenix commented May 23, 2025

This PR fixes two different problem related to the nix flake

Outdated pkgs

The flake pkgs (flake.lock file) are really outdated, they haven't been updated in over a year. This causes a build failure.

$ nix build

error: builder for '/nix/store/g033a0mll0yng54qf23wl9h3vgircbgr-superfile-1.3.0.drv' failed with exit code 1;
       last 10 log lines:
       > Running phase: unpackPhase
       > unpacking source archive /nix/store/jln4fw2z90x5qgy84x8amr0gnjawj9ls-zq6czi9bkjdwq9qa8ilvlmc6s7a6qf34-source
       > source root is zq6czi9bkjdwq9qa8ilvlmc6s7a6qf34-source
       > Running phase: patchPhase
       > Running phase: updateAutotoolsGnuConfigScriptsPhase
       > Running phase: configurePhase
       > Running phase: buildPhase
       > Building subPackage .
       > go: downloading go1.24.1 (linux/amd64)
       > go: download go1.24.1 for linux/amd64: toolchain not available
       For full logs, run:
         nix log /nix/store/g033a0mll0yng54qf23wl9h3vgircbgr-superfile-1.3.0.drv

After updating the lock file the build process can start.

Check phase fail

Now the package start to build, finishes the build phase (compiling), but fail on the check phase (when it runs the go tests)

$ nix build

error: builder for '/nix/store/0gpqxxa83n4lzznm93j95kp1f9q1vnc3-superfile-1.3.0.drv' failed with exit code 1;
       last 25 log lines:
       > time=2025-05-23T13:43:24.982Z level=ERROR msg="Error while read superfile data" error="open /homeless-shelter/.local/share/superfile/pinned.json: no such file or directory"
       > time=2025-05-23T13:43:24.983Z level=DEBUG msg="model.Update() called"
       > time=2025-05-23T13:43:24.983Z level=ERROR msg="Error while read superfile data" error="open /homeless-shelter/.local/share/superfile/pinned.json: no such file or directory"
       > time=2025-05-23T13:43:24.984Z level=DEBUG msg="model.Update() called"
       > time=2025-05-23T13:43:24.984Z level=DEBUG msg=model.handleKeyInput msg=e typestr=runes runes=[101] type=-1 paste=false alt=false
       > time=2025-05-23T13:43:24.984Z level=DEBUG msg="model.handleKeyInput. model info. " filePanelFocusIndex=0 filePanel.focusType=focus filePanel.panelMode=browserMode typingModal.open=false warnModal.open=false promptModal.open=false fileModel.renaming=false searchBar.focussed=false helpMenu.open=false firstTextInput=false focusPanel=nonePanelFocus
       > time=2025-05-23T13:43:24.985Z level=ERROR msg="Error while read superfile data" error="open /homeless-shelter/.local/share/superfile/pinned.json: no such file or directory"
       > === RUN   TestChooserFile/Open_with_file_editor_with_Invalid_chooser_file
       > time=2025-05-23T13:43:24.986Z level=ERROR msg="Error while read superfile data" error="open /homeless-shelter/.local/share/superfile/pinned.json: no such file or directory"
       > time=2025-05-23T13:43:24.988Z level=DEBUG msg="model.Update() called"
       > time=2025-05-23T13:43:24.988Z level=ERROR msg="Error while read superfile data" error="open /homeless-shelter/.local/share/superfile/pinned.json: no such file or directory"
       > time=2025-05-23T13:43:24.989Z level=DEBUG msg="model.Update() called"
       > time=2025-05-23T13:43:24.989Z level=DEBUG msg=model.handleKeyInput msg=e typestr=runes runes=[101] type=-1 paste=false alt=false
       > time=2025-05-23T13:43:24.989Z level=DEBUG msg="model.handleKeyInput. model info. " filePanelFocusIndex=0 filePanel.focusType=focus filePanel.panelMode=browserMode typingModal.open=false warnModal.open=false promptModal.open=false fileModel.renaming=false searchBar.focussed=false helpMenu.open=false firstTextInput=false focusPanel=nonePanelFocus
       > time=2025-05-23T13:43:24.989Z level=ERROR msg="Error while writing to chooser file, continuing with open via file editor" error="open /build/spf_testdir/TestChooserFile/non_existent_dir/file.txt: no such file or directory"
       > time=2025-05-23T13:43:24.989Z level=ERROR msg="Error while read superfile data" error="open /homeless-shelter/.local/share/superfile/pinned.json: no such file or directory"
       > --- PASS: TestChooserFile (0.03s)
       >     --- PASS: TestChooserFile/Open_with_default_app_with_valid_chooser_file (0.00s)
       >     --- PASS: TestChooserFile/Open_with_file_editor_with_valid_chooser_file (0.01s)
       >     --- PASS: TestChooserFile/Open_with_directory_editor_valid_chooser_file (0.01s)
       >     --- PASS: TestChooserFile/Open_with_file_editor_with_Blank_chooser_file (0.00s)
       >     --- PASS: TestChooserFile/Open_with_file_editor_with_Invalid_chooser_file (0.00s)
       > FAIL
       > FAIL github.com/yorukot/superfile/src/internal       0.338s
       > FAIL

This problem seem to be caused by the absence of certain files that are expected to be present during the test phase. This is a nix only problem as the go test runs without any issues.

A simple fix is to simply disable the check phase, as the build in itself is successful.

Result

After these two changes the build is successful and the flake can be used by nix users to get the latest version of superfile.

$ nix build
$ ./result/bin/superfile

Works as expected.

Test

To test you can run the current broken flake with nix run github:yorukot/superfile, and the flake changed by this pr with nix run "github:frost-phoenix/superfile?ref=flake-fix"

Summary by CodeRabbit

  • Chores
    • Enabled tests during the build process for the superfile application.
    • Added specific native inputs to support the testing phase.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 23, 2025

Walkthrough

The update modifies the Nix build configuration for the superfile Go application by adding nativeCheckInputs = [ pkgs.writableTmpDirAsHomeHook ]; to the pkgs.buildGoApplication invocation in flake.nix, specifying a writable temporary directory hook for the check phase during the build.

Changes

File(s) Change Summary
flake.nix Adds nativeCheckInputs = [ pkgs.writableTmpDirAsHomeHook ]; to pkgs.buildGoApplication for superfile.

Poem

🐇 In fields of code where changes bloom,
A writable home clears the room.
With hooks in place, tests now run,
Superfile’s build shines like the sun.
Hopping swift through lines so bright,
The rabbit cheers, "Build done just right!" 🌿


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 309d105 and e5f99c4.

📒 Files selected for processing (1)
  • flake.nix (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • flake.nix

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

flake.nix Outdated
version = "1.3.0";
src = ./.;
modules = ./gomod2nix.toml;
doCheck = false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@coderabbitai What it this check ? What are the implications of disabling it ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lazysegtree The doCheck parameter controls whether the check phase runs during the Nix build process. Here's what it does:

What is the check phase?

  • For Go applications built with buildGoApplication, the check phase typically runs go test to execute the project's test suite
  • It's part of the standard Nix build pipeline: unpack → patch → configure → build → check → install → fixup

What doCheck = false does:

  • Disables the test execution entirely during the build
  • The build process skips from the build phase directly to the install phase
  • Tests are not run as part of the package creation process

Implications of disabling it:

Pros:

  • Faster builds - no time spent running tests
  • Avoids environment-specific test failures (which is the case here)
  • Still produces a working binary if the build phase succeeds

Cons:

  • No test validation during packaging - potential for shipping untested code
  • Less confidence in the package integrity
  • May miss regressions that tests would catch

Context for this specific change:

According to the PR description, the tests were failing in the Nix build environment with errors like missing /homeless-shelter/.local/share/superfile/pinned.json, but these same tests pass when run outside of Nix. This indicates environment-specific issues rather than actual code problems.

Since the build itself succeeds and the resulting binary works correctly, disabling the check phase is a pragmatic solution to make the Nix package buildable while the underlying test environment issues could be addressed separately.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Frost-Phoenix I dont know much about nix. I will attempt to fix the tests. If that doesn't works, we will go with your changes to skip tests.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont know much about nix. I will attempt to fix the tests. If that doesn't works, we will go with your changes to skip tests.

I think I found a way to make the tests work, as they managed to make it work in the upstream nixpkgs repo NixOS/nixpkgs#410196

I don't have time today, but I will look into it tomorrow.

@Frost-Phoenix
Copy link
Contributor Author

This fixes the checkPhase, so it is no longer needed to disable it.
Could someone try it to be sure that it works ?

@lazysegtree lazysegtree merged commit aa39e4e into yorukot:main May 27, 2025
3 checks passed
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Jul 28, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [yorukot/superfile](https://github.com/yorukot/superfile) | patch | `v1.3.1` -> `v1.3.3` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>yorukot/superfile (yorukot/superfile)</summary>

### [`v1.3.3`](https://github.com/yorukot/superfile/releases/tag/v1.3.3)

[Compare Source](yorukot/superfile@v1.3.2...v1.3.3)

Hey folks. Releasing v1.3.3 with bug fix related to config file, and improvements in metadata panel feature.

#### Install:

[**Click me to know how to install**](https://github.com/yorukot/superfile?tab=readme-ov-file#installation)

#### Highlights

- Fixed a bug in config file correction that would make config file invalid. Thanks [@&#8203;estebandpena](https://github.com/estebandpena) for reporting the issue, and [@&#8203;wassup05](https://github.com/wassup05) for the fix.

#### Detailed Change Summary

<details><summary>Details</summary>
<p>

##### Update
- feat: Metadata loading via bubbletea's tea.Cmd method, removed usage channels and custom goroutines [#&#8203;947](yorukot/superfile#947) by @&#8203;lazysegtree
- feat: Metadata panel into separate package, UI bug fixes, Code improvements [#&#8203;950](yorukot/superfile#950) by @&#8203;lazysegtree
- feat: add support for Python virtual environment in testsuite setup [#&#8203;956](yorukot/superfile#956) by @&#8203;Khitoshi

##### Bug fix
- fix: windows test ci [#&#8203;941](yorukot/superfile#941) by @&#8203;claykom
- fix: fixing `config.toml` [#&#8203;952](yorukot/superfile#952) by @&#8203;wassup05

</p>
</details> 

**Full Changelog**: yorukot/superfile@v1.3.2...v1.3.3

### [`v1.3.2`](https://github.com/yorukot/superfile/releases/tag/v1.3.2)

[Compare Source](yorukot/superfile@v1.3.1...v1.3.2)

Hey folks. Releasing v1.3.2 with multiple new features including implementation image preview using kitty protocol, and various bug fixes and internal improvements.

##### **You can now preview images in high quality — no more pixelation!**

<img width="1267" height="670" alt="image" src="https://github.com/user-attachments/assets/0f7ec48e-9386-4716-92a5-4a02783f6612" />

#### Install:
[**Click me to know how to install**](https://github.com/yorukot/superfile?tab=readme-ov-file#installation)

#### Highlights
- Added image preview via kitty protocol. Thanks @&#8203;JassonCordones and @&#8203;yorukot for the implementation.
- Added Zoxide support for path resolution in initial configuration. Thanks @&#8203;yorukot for this.
- New 0x96f Theme by @&#8203;filipjanevski 
- Various usability and layout bug fixes. See "Detailed Change Summary" below.  Thanks to @&#8203;larsn03  @&#8203;Frost-Phoenix  @&#8203;TheLazron @&#8203;vkhatsiur @&#8203;Khitoshi @&#8203;claykom 

##### Developer Improvements
- Added CI Action to run unit tests and build for windows.
- Updated contribution guidelines and MR template
- Added a dev.sh script for building, linting and running tests for faster development workflows.

####  Detailed Change Summary

<details><summary>Details</summary>
<p>

##### Update
- Normalize user-facing naming to superfile [#&#8203;880](yorukot/superfile#880) by @&#8203;yorukot
- Add kitty protocol for image preview [#&#8203;841](yorukot/superfile#841) by @&#8203;JassonCordones
- feat: add Zoxide support for path resolution in initial configuration [#&#8203;892](yorukot/superfile#892) by @&#8203;yorukot
- feat: update superfile's help output [#&#8203;908](yorukot/superfile#908) by @&#8203;yorukot
- feat: Add Action to Publish to Winget [#&#8203;925](yorukot/superfile#925) by @&#8203;claykom
- feat: update superfile build test for the windows and macOS [#&#8203;922](yorukot/superfile#922) by @&#8203;yorukot
- Theme: add 0x96f theme [#&#8203;860](yorukot/superfile#860) by @&#8203;filipjanevski

##### Bug fix
- fix: outdated and broken nix flake [#&#8203;846](yorukot/superfile#846) by @&#8203;Frost-Phoenix
- fix: handle UTF-8 BOM in file reader [#&#8203;865](yorukot/superfile#865) by @&#8203;vkhatsiur
- fix icon displayed on spf prompt when nerdfont disabled [#&#8203;878](yorukot/superfile#878) by @&#8203;claykom
- fix: create item check for dot-entries [#&#8203;817](yorukot/superfile#817) by @&#8203;TheLazron
- fix: prevent pasting a directory into itself, avoiding infinite loop [#&#8203;887](yorukot/superfile#887) by @&#8203;yorukot
- fix: clear search bar value on parent directory reset [#&#8203;906](yorukot/superfile#906) by @&#8203;yorukot
- fix: enhance terminal pixel detection and response handling [#&#8203;904](yorukot/superfile#904) by @&#8203;yorukot
- fix: Cannot Build superfile on Windows [#&#8203;921](yorukot/superfile#921) by @&#8203;claykom
- fix: Improve command tokenization to handle quotes and escapes [#&#8203;931](yorukot/superfile#931) by @&#8203;Khitoshi
- fix: Dont read special files, and prevent freeze [#&#8203;932](yorukot/superfile#932) by @&#8203;lazysegtree
- Compress all files selected [#&#8203;821](yorukot/superfile#821) by @&#8203;larsn03

##### Optimization
- Metadata and filepanel rendering refactor [#&#8203;867](yorukot/superfile#867) by @&#8203;JassonCordones
- refactor: simplify panel mode handling in file movement logic [#&#8203;907](yorukot/superfile#907) by @&#8203;yorukot
- refactor: standardize TODO comments and ReadMe to README [#&#8203;913](yorukot/superfile#913) by @&#8203;yorukot

##### Documentation
- enhance: add detailed documentation for InitIcon function and update … [#&#8203;879](yorukot/superfile#879) by @&#8203;yorukot
- docs: add documentation for image preview [#&#8203;882](yorukot/superfile#882) by @&#8203;yorukot
- docs: update contributing guide and MR template [#&#8203;885](yorukot/superfile#885) by @&#8203;yorukot
- docs: update README and plugin documentation for clarity and structure [#&#8203;902](yorukot/superfile#902) by @&#8203;yorukot
- feat(docs): Update arch install package docs [#&#8203;929](yorukot/superfile#929) by @&#8203;booth-w

##### CI/CD
- ci: add MR title linting with semantic-pull-request action [#&#8203;884](yorukot/superfile#884) by @&#8203;yorukot
- ci: improve MR workflows with contributor greeting and title linter fix [#&#8203;886](yorukot/superfile#886) by @&#8203;yorukot

##### Dependencies
- build(deps): bump prismjs from 1.29.0 to 1.30.0 in /website [#&#8203;786](yorukot/superfile#786) by @&#8203;dependabot[bot]
- fix(deps): update dependency astro to v5.8.0 [#&#8203;787](yorukot/superfile#787) by @&#8203;renovate[bot]
- chore(deps): bump vite from 6.3.3 to 6.3.5 in /website [#&#8203;822](yorukot/superfile#822) by @&#8203;dependabot[bot]
- fix(deps): update dependency sharp to v0.34.2 [#&#8203;909](yorukot/superfile#909) by @&#8203;renovate[bot]
- fix(deps): update astro monorepo [#&#8203;894](yorukot/superfile#894) by @&#8203;renovate[bot]
- fix(deps): update fontsource monorepo to v5.2.6 [#&#8203;910](yorukot/superfile#910) by @&#8203;renovate[bot]

##### Misc
- chore(license): update copyright year [#&#8203;895](yorukot/superfile#895) by @&#8203;yorukot
- feat: add ignore missing field flag [#&#8203;881](yorukot/superfile#881) by @&#8203;claykom
- feat: add sitemap integration and update giscus input position [#&#8203;912](yorukot/superfile#912) by @&#8203;yorukot

</p>
</details> 

#### New Contributors
* @&#8203;filipjanevski made their first contribution in yorukot/superfile#860
* @&#8203;larsn03 made their first contribution in yorukot/superfile#821
* @&#8203;vkhatsiur made their first contribution in yorukot/superfile#865
* @&#8203;claykom made their first contribution in yorukot/superfile#878
* @&#8203;TheLazron made their first contribution in yorukot/superfile#817
* @&#8203;Khitoshi made their first contribution in yorukot/superfile#931

**Full Changelog**: yorukot/superfile@v1.3.1...v1.3.2

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC42Mi4xIiwidXBkYXRlZEluVmVyIjoiNDAuNjIuMSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants