Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fish: 3.7.1 -> 4.0 #367229

Draft
wants to merge 11 commits into
base: master
Choose a base branch
from
Draft

fish: 3.7.1 -> 4.0 #367229

wants to merge 11 commits into from

Conversation

r-vdp
Copy link
Contributor

@r-vdp r-vdp commented Dec 21, 2024

Things done

https://github.com/fish-shell/fish-shell/releases/tag/4.0b1

This PR will need to get updated when the final version gets released, but I wanted to already try it out.

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added the 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label Dec 21, 2024
@r-vdp
Copy link
Contributor Author

r-vdp commented Dec 22, 2024

@ofborg build fish fish.passthru.tests

@r-vdp r-vdp force-pushed the fish branch 3 times, most recently from 50860a6 to b1740c3 Compare December 22, 2024 23:03
pname = "fish";
version = "3.7.1";
version = "4.0b1";

src = fetchurl {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can't you use a fetchFromGitHub?

Copy link
Contributor

Choose a reason for hiding this comment

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

Did you read the comment just below, telling you why FFGH isn't used but instead the release tarball is fetched manually?

Though as this is a major release, we should verify if this difference still exists between source code from the repo and released source code.

Copy link
Contributor

@adamcstephens adamcstephens Dec 24, 2024

Choose a reason for hiding this comment

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

I think this is a good opportunity to switch to ffgh for better security. The fish version can be set as an env var https://codeberg.org/adamcstephens/nix-sandbox/src/commit/ad75d616bebe5b52a2178bc24151b500846b41e4/packages/fish/package.nix#L39

Copy link
Contributor

Choose a reason for hiding this comment

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

If the documentation note still exists we should definitely investigate that, but I’d feel much more comfortable using the git source.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I'll have a look at that

Copy link

Choose a reason for hiding this comment

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

If you fetch from github, you'll have to generate the docs yourself, which needs sphinx.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, I'll have to check how that's done then.

Copy link

Choose a reason for hiding this comment

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

In terms of upstream: Install sphinx before you run cmake.

No idea if nix needs anything special.

Copy link
Contributor

@SigmaSquadron SigmaSquadron Dec 25, 2024

Choose a reason for hiding this comment

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

Install sphinx before you run cmake.

Also known as just putting sphinx in nativeBuildInputs and hoping cmake picks it up.

(ideally put the fetchFromGithub and sphinx improvements in separate commits)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There was a bit more to it. I ran into an issue with fish_indent_lexer, and I'm not sure why upstream didn't run into this. I'll send the patch upstream in any case to see what they say.

@Eveeifyeve
Copy link
Contributor

Again on line 439 where the test is an another IFD which is against nixpkgs.

@r-vdp
Copy link
Contributor Author

r-vdp commented Dec 24, 2024

@Eveeifyeve I'm sorry but your review comments make no sense. You either need to get more familiar with nix and nixpkgs before you start reviewing PRs, or you are simply a troll.

I am kindly asking you to refrain from further review comments on this PR. If you do continue despite this, I will report you to the moderation team.

Copy link
Contributor

@SigmaSquadron SigmaSquadron left a comment

Choose a reason for hiding this comment

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

Thank you for this! I've used it for a few days, and haven't had any issues so far. The diff looks good as well, and the fixed tests pass.

@SigmaSquadron SigmaSquadron added 12.approvals: 1 This PR was reviewed and approved by one reputable person 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in the package labels Dec 24, 2024
@Eveeifyeve
Copy link
Contributor

@Eveeifyeve I'm sorry but your review comments make no sense. You either need to get more familiar with nix and nixpkgs before you start reviewing PRs, or you are simply a troll.

I am not a troll, but I just didn't know if it was IFD or not.

I am kindly asking you to refrain from further review comments on this PR. If you do continue despite this, I will report you to the moderation team.

Ok sounds good, I will report this to them just to let them know that I didn't know if this IFD or not.

@r-vdp
Copy link
Contributor Author

r-vdp commented Dec 24, 2024

Ok sounds good, I will report this to them just to let them know that I didn't know if this IFD or not.

No need, I didn't do anything.

@r-vdp
Copy link
Contributor Author

r-vdp commented Dec 28, 2024

There seem to be some flaky tests that fail from time to time on my machine, so we might need to exclude those still.

@charlottia
Copy link

Thanks so much for this! I started making an attempt at this myself last week and promptly gave up when it started getting hairy; working great for me :)

Lillecarl added a commit to Lillecarl/nixos that referenced this pull request Dec 29, 2024
@Lillecarl
Copy link
Contributor

Thanks for putting in the work. I was looking into this myself and got stuck on how CMake and cargo interact. It was surprisingly elegant.

Considering the scope of 3.7.1 -> 4, would it make sense to keep 3.7.1 around until a (couple?) 4.x.x fixing possible regressions? I think we could get 4 merged sooner if it doesn't replace 3.7.1?

[lillecarl@hetzner1] in [☸ default (valkey)]~/C/nixos [🎋 master][!][🐍 v3.12.8][🗀 loaded/allowed][🐚fish]
[20:01:25]❯ echo $FISH_VERSION
4.0b1

😄

@adamcstephens
Copy link
Contributor

Considering the scope of 3.7.1 -> 4, would it make sense to keep 3.7.1 around until a (couple?) 4.x.x fixing possible regressions?

I'm personally opposed to maintaining two versions. It requires extra effort that I'm not convinced is worth it in this case. I've been using fish from git for many months, including now this PR. Besides a few intended behavior changes by upstream it's a drop in replacement.

If you're concerned about issues, I'd encourage trying this version and providing feedback upstream.

When 4.0 final is released I'd like to move it into unstable. We clearly won't backport this to stable.

@will
Copy link
Contributor

will commented Jan 2, 2025

FWIW, this branch built for me with no issues at all on my aarch64-darwin. I didnt do a full nixpkgs-review run, just nix build "github:nixos/nixpkgs?ref=fish#fish"

❯ nix build "github:nixos/nixpkgs?ref=fish#fish"
❯ result/bin/fish --version
fish, version 4.0b1
❯ result/bin/fish
❯ echo "whoo"
whoo

@r-vdp r-vdp force-pushed the fish branch 2 times, most recently from 52e8fc8 to d458fc2 Compare January 13, 2025 23:27
@oxalica
Copy link
Contributor

oxalica commented Jan 14, 2025

The latest commit (d458fc2) sometimes fails to build for me. It passes on the second run. The history test is also known to be flaky in fish-shell/fish-shell#8789. Maybe we could disable it?

(nix build --rebuild can be used to test rebuild even with path existing.)

fish> pexpects/history.py..FAILED (5207 ms)
fish> 184/187 Test #168: history.py ...............................***Failed    5.27 sec
fish> pexpects/history.py..FAILED (5207 ms)
fish> Failed to match pattern: prompt 16
fish> history.py:101: timeout from expect_prompt("history delete -e -C 'echo hello'" + TO_END_SUFFIX)
fish> Escaped buffer:
fish> When written to the tty, this looks like:
fish> <-------
fish> (no trailing newline)------->
fish> Last 10 messages:
fish> OUTPUT      29.83 ms (Line 87): echo hello\r\n
fish> OUTPUT      +0.45 ms (Line 87): prompt 13>
fish>  INPUT      +0.28 ms (Line 91): history search --exact 'echo hell' | cat\n
fish> OUTPUT      +0.62 ms (Line 92): history search --exact 'echo hell'
fish> OUTPUT      +2.08 ms (Line 92): prompt 14>
fish>  INPUT      +0.25 ms (Line 95): history search --prefix 'echo start*echo end' | cat\n
fish> OUTPUT      +2.29 ms (Line 96): echo start1; builtin history; echo end1\r\n
fish> OUTPUT      +0.48 ms (Line 96): prompt 15>
fish>  INPUT      +0.20 ms (Line 100): history delete -e -C 'echo hello'\n
fish> OUTPUT      +1.40 ms (Line 101): history delete -e -C 'echo hello'\rprompt 15>history delete -e -C 'echo hello'\x1b]133;C\x07\x1b[?2004l\x1b[>4;0m\x1b>\x1b]133;D;0\x07\x1b[?25h⏎                                                                              \r⏎ \r\rprompt 16>\x1b[?2004h\x1b[>4;1m\x1b=
fish> Tmpdir is /build/fishtest-69ukorqn
fish> Failed tests:
fish>     pexpects/history.py
fish> 185/187 Test #178: signals.py ...............................   Passed    4.72 sec
fish> 186/187 Test #154: bind_mode_events.py ......................   Passed   40.29 sec
fish> 187/187 Test #187: cargo-test ...............................   Passed   50.95 sec
fish> 99% tests passed, 1 tests failed out of 187
fish> Total Test time (real) =  55.27 sec
fish> The following tests did not run:
fish>    63 - git.fish (Skipped)
fish>    92 - print-help.fish (Skipped)
fish>   125 - tmux-abbr.fish (Skipped)
fish>   126 - tmux-autosuggestion.fish (Skipped)
fish>   127 - tmux-bind.fish (Skipped)
fish>   128 - tmux-bind2.fish (Skipped)
fish>   129 - tmux-commandline.fish (Skipped)
fish>   130 - tmux-complete.fish (Skipped)
fish>   131 - tmux-complete2.fish (Skipped)
fish>   132 - tmux-history-search.fish (Skipped)
fish>   133 - tmux-job.fish (Skipped)
fish>   134 - tmux-multiline-prompt.fish (Skipped)
fish>   135 - tmux-prompt.fish (Skipped)
fish>   136 - tmux-scrollback.fish (Skipped)
fish>   137 - tmux-signal.fish (Skipped)
fish>   138 - tmux-transient.fish (Skipped)
fish> The following tests FAILED:
fish>   168 - history.py (Failed)
fish> Errors while running CTest
fish> FAILED: CMakeFiles/fish_run_tests /build/source/build/CMakeFiles/fish_run_tests
fish> cd /build/source/build && env CTEST_PARALLEL_LEVEL=14 FISH_FORCE_COLOR=1 FISH_SOURCE_DIR=/build/source /nix/store/38cffsqqx823crf1i4bcf6zz1qz1hgpd-cmake-3.30.5/bin/ctest --force-new-ctest-process --output-on-failure --progress
fish> ninja: build stopped: subcommand failed.

Another thing I noticed is that, the default output out also contains man, pkgconfig, which can be split into man and dev outputs. But the benefit is quite small, because they are only <5% of the total size. They are previously packaged as is, so I don't have strong opinion about it.

@Eveeifyeve
Copy link
Contributor

I've also have a lot of applications fail when running nixpkgs-review is this normal?

@r-vdp
Copy link
Contributor Author

r-vdp commented Jan 14, 2025

I've also have a lot of applications fail when running nixpkgs-review is this normal?

I only see a test failure in kitty, and another test failure in a fish plugin (pure), so I definitely wouldn't qualify that as "a lot".
For both we'd need to either make an issue upstream so that they fix their tests to be compatible (or they can make an issue against fish if these are actual regressions), or we can simply disable those tests in nixpkgs.

@r-vdp
Copy link
Contributor Author

r-vdp commented Jan 14, 2025

The latest commit (d458fc2) sometimes fails to build for me. It passes on the second run. The history test is also known to be flaky in fish-shell/fish-shell#8789. Maybe we could disable it?

(nix build --rebuild can be used to test rebuild even with path existing.)
fish> pexpects/history.py..FAILED (5207 ms)

Another thing I noticed is that, the default output out also contains man, pkgconfig, which can be split into man and dev outputs. But the benefit is quite small, because they are only <5% of the total size. They are previously packaged as is, so I don't have strong opinion about it.

I've been rebuilding in a loop, but didn't get any failure so far. It may depend on hardware, many of these tests seem to be flaky and can time out on machines with heavy load. I think we can just disable the test.

@faho
Copy link

faho commented Jan 14, 2025

Note: This has been synced to master.

That's not going to be included in 4.0, which is being prepared in the Integration_4.0.0 branch.

@r-vdp
Copy link
Contributor Author

r-vdp commented Jan 14, 2025

I've also have a lot of applications fail when running nixpkgs-review is this normal?

Note: This has been synced to master.

That's not going to be included in 4.0, which is being prepared in the Integration_4.0.0 branch.

@faho: oh, I see. Will the recent fixes from master still be cherry-picked into the integration branch then? Like for instance the zellij bug for which a workaround was committed yesterday.

@faho
Copy link

faho commented Jan 14, 2025

Will the recent fixes from master still be cherry-picked into the integration branch then?

Yes, that's the plan.

Like for instance the zellij bug for which a workaround was committed yesterday.

That bug wasn't in 4.0 to begin with (it's triggered by querying that we don't do in 4.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 10.rebuild-darwin: 11-100 10.rebuild-linux: 11-100 12.approvals: 1 This PR was reviewed and approved by one reputable person 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in the package
Projects
None yet
Development

Successfully merging this pull request may close these issues.