Skip to content

Add status buildinfo#10896

Merged
faho merged 6 commits into
fish-shell:masterfrom
faho:build-info
Dec 29, 2024
Merged

Add status buildinfo#10896
faho merged 6 commits into
fish-shell:masterfrom
faho:build-info

Conversation

@faho

@faho faho commented Dec 10, 2024

Copy link
Copy Markdown
Member

This can be used to get some information on how fish was built - the version, the build system, the operating system and architecture, the features.

The idea is that we can tell people to run status buildinfo | fish_clipboard_copy and copy it into bug reports.

Example output:

> ./fish -c 'status buildinfo'
Build system: CMake
Version: 3.7.1-2571-gaadcb292b
Target (and host): x86_64-unknown-linux-gnu
Profile: release
Features: gettext

> ../target/x86_64-unknown-linux-musl/debug/fish -c 'status buildinfo'
Build system: Cargo
Version: 3.7.1-2571-g79aee4d60
Target: x86_64-unknown-linux-musl
Host: x86_64-unknown-linux-gnu
Profile: debug
Features: installable

This seems like it might be useful especially since we have multiple build systems and the potential for cross-compilation now.

The exact set of things to print isn't set in stone, of course, this was just what I came up with.

An alternative is to make a status debuginfo command that is a bit broader in scope, and also prints e.g. terminal or locale information, possibly even the operating system.

Importantly, this should not collect information like the time it was compiled to not break build reproducability, nor should it (for obvious reasons) collect personal information.

TODOs:

  • Changes to fish usage are reflected in user documentation/manpages.
  • Tests have been added for regressions fixed
  • User-visible changes noted in CHANGELOG.rst

@mqudsi

mqudsi commented Dec 15, 2024

Copy link
Copy Markdown
Contributor

fyi I previously added separate status modes target and target-arch as part of #10582 but as they were incidental to the fix rather than an intentional feature (though I found them valuable in all cases) @ridiculousfish was of the opinion that they should be removed.

+1 from me :)

@faho

faho commented Dec 15, 2024

Copy link
Copy Markdown
Member Author

@ridiculousfish was of the opinion that they should be removed.

I'm aware, I understood the issue to be that you added an undocumented command to provide this information for use in one insignificant test.

I want to have it as a proper thing. Documented and meant to be used.

The impetus here is that I'm expecting some amount of confusion about whether to build with cargo or cmake. And so I would at least want to have an easy way to figure that out.

@mqudsi

mqudsi commented Dec 16, 2024

Copy link
Copy Markdown
Contributor

Suggestion: I would add at least crt-static to the features list, possibly pcre2-static as well.

@faho

faho commented Dec 17, 2024

Copy link
Copy Markdown
Member Author

Suggestion: I would add at least crt-static to the features list, possibly pcre2-static as well.

crt-static: Sure, why not

pcre2-static: I don't know how to do that. It's not a feature of the fish crate, it's one of the pcre2-sys crate that's decided when that is compiled. I also don't think it's going to help because I don't think it's a source of problems.

@faho faho added this to the fish 4.0 milestone Dec 26, 2024
@faho faho force-pushed the build-info branch 2 times, most recently from 46b8a55 to fca249d Compare December 26, 2024 19:45
faho added 6 commits December 26, 2024 20:46
This can be used to get some information on how fish was built - the
version, the build system, the operating system and architecture, the
features.
Needed to infer the type if none is used
This may not be 100% enough - it's theoretically possible to
cross-compile and get different Target/Host lines
@faho faho marked this pull request as ready for review December 26, 2024 19:47
@faho

faho commented Dec 26, 2024

Copy link
Copy Markdown
Member Author

Okay, I'd like to get this one in for 4.0, because it'll be useful in case someone e.g. manages to accidentally build as self-installable.

@faho faho merged commit 6f9ca42 into fish-shell:master Dec 29, 2024
faho added a commit that referenced this pull request Dec 29, 2024
This can be used to get some information on how fish was built - the
version, the build system, the operating system and architecture, the
features.

(cherry picked from commit 6f9ca42)
@faho

faho commented Dec 29, 2024

Copy link
Copy Markdown
Member Author

Cherry-picked to 4.0 as 5f76fc3

@faho faho deleted the build-info branch March 20, 2025 08:53
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Mar 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants