Skip to content

Iotools: fix werror + add psb_status package - #401975

Merged
Sigmanificient merged 2 commits into
NixOS:masterfrom
phodina:iotools
Aug 22, 2025
Merged

Sigmanificient merged 2 commits into
NixOS:masterfrom
phodina:iotools

Conversation

@phodina

@phodina phodina commented Apr 26, 2025

Copy link
Copy Markdown
Contributor

Hi,
wanted to add psb_status but found out the iotools is broken.

The point of psb_status is to check that your AMD Zen CPU does not have fused keys.

# psb_status 
0x00000000
PSB is not enabled on your platform. You may be able to run custom firmware

Things done

  • 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.

@phodina
phodina requested a review from Sigmanificient April 26, 2025 09:04
@github-actions github-actions Bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Apr 26, 2025
@nix-owners
nix-owners Bot requested a review from felixsinger April 26, 2025 09:12
@felixsinger

Copy link
Copy Markdown
Member

@phodina Please add the compile error to the commit message. Otherwise looks good.

Comment thread pkgs/by-name/ps/psb_status/package.nix Resolved
Comment thread pkgs/by-name/ps/psb_status/package.nix Resolved
Comment thread pkgs/by-name/ps/psb_status/package.nix Resolved
Comment thread pkgs/by-name/ps/psb_status/package.nix Resolved
Comment thread pkgs/by-name/ps/psb_status/package.nix Resolved
@phodina

phodina commented May 3, 2025

Copy link
Copy Markdown
Contributor Author

@Sigmanificient fixed the issue + assigned myself :-)

@felixsinger Here's the error (due to warnings treated as errors):

gcc -Wall -Werror -D_GNU_SOURCE -DVER_MAJOR=1 -DVER_MINOR=6    -O2 -DNDEBUG   -c -o commands.o commands.c
commands.c: In function 'make_command_links':
commands.c:153:49: error: '__builtin___snprintf_chk' output may be truncated before the last format character []
  153 |         snprintf(link_name, FILENAME_MAX, "%s/%s", path_to_bin, cmd->name);
      |                                                 ^
In file included from /nix/store/pz6jgrfqyl2il2785a75vmwdp9vypv0j-glibc-2.40-66-dev/include/stdio.h:970,
                 from commands.c:19:
In function 'snprintf',
    inlined from 'build_symlink_name' at commands.c:153:2,
    inlined from 'make_command_links' at commands.c:173:16:
/nix/store/pz6jgrfqyl2il2785a75vmwdp9vypv0j-glibc-2.40-66-dev/include/bits/stdio2.h:68:10: note: '__builtin___snprintf_chk' output 2 or more bytes (assuming 4097) into a destination of size 4096
   68 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   69 |                                    __glibc_objsize (__s), __fmt,
      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   70 |                                    __va_arg_pack ());
      |                                    ~~~~~~~~~~~~~~~~~
commands.c: In function 'clean_command_links':
commands.c:153:49: error: '__builtin___snprintf_chk' output may be truncated before the last format character []
  153 |         snprintf(link_name, FILENAME_MAX, "%s/%s", path_to_bin, cmd->name);
      |                                                 ^
In function 'snprintf',
    inlined from 'build_symlink_name' at commands.c:153:2,
    inlined from 'clean_command_links' at commands.c:204:16:
/nix/store/pz6jgrfqyl2il2785a75vmwdp9vypv0j-glibc-2.40-66-dev/include/bits/stdio2.h:68:10: note: '__builtin___snprintf_chk' output 2 or more bytes (assuming 4097) into a destination of size 4096
   68 |   return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   69 |                                    __glibc_objsize (__s), __fmt,
      |                                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   70 |                                    __va_arg_pack ());
      |                                    ~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [<builtin>: commands.o] Error 1

@phodina

phodina commented May 3, 2025

Copy link
Copy Markdown
Contributor Author

Also restricted the package to just x86_64

@Sigmanificient

Copy link
Copy Markdown
Member

Reopen for CI

@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Aug 21, 2025
@Sigmanificient
Sigmanificient merged commit f3789dd into NixOS:master Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants