Skip to content

Fix broken user_settings.h flip in windows-check workflow#1030

Draft
yosuke-wolfssl wants to merge 1 commit into
wolfSSL:masterfrom
yosuke-wolfssl:fix/winLog
Draft

Fix broken user_settings.h flip in windows-check workflow#1030
yosuke-wolfssl wants to merge 1 commit into
wolfSSL:masterfrom
yosuke-wolfssl:fix/winLog

Conversation

@yosuke-wolfssl

Copy link
Copy Markdown
Contributor

Description

Fixes the wolfsshd "no log output" problem on the Windows (Visual Studio) CI build.

When wolfsshd is built from the ide/winvs solution in the windows-check
workflow, it emits no log output at all — neither to a -E log file nor to
stderr, even with -d. The -E log file is always 0 bytes.

Root cause

wolfSSH_Log in the wolfSSH library (src/log.c) only has a real
implementation under #if defined(DEBUG_WOLFSSH) || defined(WOLFSSH_SSHD);
otherwise it compiles to a no-op stub. In Release builds the library project
defines neither directly, so WOLFSSH_SSHD must arrive via
WOLFSSL_USER_SETTINGSwolfssh/settings.hide/winvs/user_settings.h,
where the SSHD block sits under #if 0 and is meant to be flipped to #if 1
by CI.

The flip in .github/workflows/windows-check.yml was broken:

- name: replace wolfSSL user_settings.h with wolfSSH user_settings.h
  run: get-content ${{env.USER_SETTINGS_H_NEW}} | %{$_ -replace "if 0","if 1"}

This PowerShell pipeline reads the file and prints the modified text to stdout —
it never writes the file back. So #if 0 was never flipped, WOLFSSH_SSHD
was never defined, and the library compiled the no-op wolfSSH_Log stub →
0-byte logs. The preceding cp also ran before the (broken) flip, so even the
wolfSSL copy was un-flipped.

Fix

Replace the two broken steps with a single bash step that mirrors the already
working windows-sftp.yml: flip in place with sed -i, then copy to the
wolfSSL location.

- name: Update user_settings.h for sshd and x509
  working-directory: ${{env.GITHUB_WORKSPACE}}
  shell: bash
  run: |
    sed -i 's/#if 0/#if 1/g' ${{env.USER_SETTINGS_H_NEW}}
    cp ${{env.USER_SETTINGS_H_NEW}} ${{env.USER_SETTINGS_H}}

With the flip persisted, both the wolfSSH library and the wolfsshd app are
compiled with WOLFSSH_SSHD, restoring the real wolfSSH_Log implementation.
No C source changes are required.

Testing

  • No remaining broken flips: grep -rn "get-content" .github/workflows/ returns nothing.
  • The new step matches the proven windows-sftp.yml pattern (write-in-place, then copy).
  • CI: the windows-check workflow builds Release/x64 with the SSHD/X509 blocks now actually enabled.
  • End-to-end: wolfsshd.exe -D -d -E log.txt -f <conf> -p <port> now writes startup/auth [PID ...]: [SSHD] ... lines to log.txt instead of producing a 0-byte file.

Scope / notes

  • CI-workflow change only; no C sources, project files, or user_settings.h defaults touched.
  • Local Visual Studio builds still require manually enabling the #if 0 SSHD block in ide/winvs/user_settings.h (the existing intended workflow).

@yosuke-wolfssl yosuke-wolfssl self-assigned this Jun 15, 2026
Copilot AI review requested due to automatic review settings June 15, 2026 07:48
@yosuke-wolfssl yosuke-wolfssl marked this pull request as draft June 15, 2026 07:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes the Windows CI (windows-check) build configuration so that ide/winvs/user_settings.h is actually modified in-place (enabling the #if 0 blocks for X509 + SSHD) before being copied into the wolfSSL build tree, restoring expected wolfsshd logging behavior in Release builds.

Changes:

  • Replace the ineffective PowerShell “replace” pipeline (stdout-only) with an in-place sed -i edit.
  • Reorder the operation so the flipped user_settings.h is then copied into wolfssl/IDE/WIN/user_settings.h.
  • Standardize the step to the same bash/sed approach already used successfully in windows-sftp.yml.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants