Skip to content

BB_HASHSERVE Warning fix#364

Open
Shreejit-03 wants to merge 1 commit into
ni:nilrt/master/nextfrom
Shreejit-03:warning_fix
Open

BB_HASHSERVE Warning fix#364
Shreejit-03 wants to merge 1 commit into
ni:nilrt/master/nextfrom
Shreejit-03:warning_fix

Conversation

@Shreejit-03

@Shreejit-03 Shreejit-03 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Changes

ni-oe-init-build-env exported SSTATE_MIRRORS unconditionally. When no
-s/--sstate-mirror argument was passed, the sstate_mirrors array was empty
and the expansion collapsed to a whitespace-only string (" ").

OE-core recently enabled hash equivalence by default via commit, which adds
BB_HASHSERVE ??= "auto". With "auto", bitbake auto-starts a local
hash-equivalence server and resolves BB_HASHSERVE to
unix:///…/hashserve.sock. That flips the local-hashserver condition in
sanity.bbclass to true, and combined with the whitespace SSTATE_MIRRORS,
the following warning appears on every build:

WARNING: You are using a local hash equivalence server but have configured an
sstate mirror. This will likely mean no sstate will match from the mirror. ...

The sanity check treats any non-empty SSTATE_MIRRORS — even whitespace — as a
configured mirror, so the empty value tripped it. This previously went
unnoticed on scarthgap because BB_HASHSERVE had no default there and stayed
empty, so the unix:// condition was never met.

This PR guards the export so SSTATE_MIRRORS is only set when a real mirror is
provided (via -s) or was already present in the environment. The warning is
intentionally still emitted when an actual mirror is configured, since it is
legitimate in that case.

Justification

AB#3738536.

Testing

  • Sourced ni-oe-init-build-env with no -s argument and confirmed:

    • bitbake -e | grep ^SSTATE_MIRRORS= shows SSTATE_MIRRORS is empty/unset
      (previously " ").
    • The hash-equivalence warning no longer appears at parse time.
  • Sourced with a real mirror (-s "file://.*" "http://<server>/sstate/PATH")
    and confirmed SSTATE_MIRRORS is populated correctly and that the legitimate
    warning still appears (expected).

  • Ran a build

    • bitbake packagefeed-ni-core
    • bitbake package-index
    • bitbake nilrt-safemode-rootfs
    • bitbake nilrt-base-system-image

    to confirm no regression in environment setup.

Suggested Reviewers:

  • @ni/rtos

The SSTATE_MIRRORS export was unconditional, so when no -s/--sstate-mirror
argument was supplied the sstate_mirrors array was empty and the expansion
collapsed to a whitespace-only string (" ").

OE-core now enables hash equivalence by default (BB_HASHSERVE ??= "auto"),
which bitbake resolves to a local unix:// hash server. This made
sanity.bbclass emit a spurious warning on every build.

The check treats any non-empty SSTATE_MIRRORS - even whitespace - as a
configured mirror, so the empty value tripped it. Guard the export so
SSTATE_MIRRORS is only set when a real mirror is provided (via -s) or was
already present in the environment.

Note this intentionally does not suppress the warning when an actual
mirror is configured, as it is legitimate in that case.

Signed-off-by: Shreejit C <shreejit.c@emerson.com>
@Shreejit-03 Shreejit-03 requested a review from a team as a code owner June 30, 2026 18:57
@chaitu236 chaitu236 requested a review from Copilot June 30, 2026 19:05

Copilot AI left a comment

Copy link
Copy Markdown

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 prevents ni-oe-init-build-env from exporting a whitespace-only SSTATE_MIRRORS value when no --sstate-mirror arguments are provided, avoiding a spurious BitBake hash-equivalence sanity warning that is triggered by non-empty (even whitespace) SSTATE_MIRRORS.

Changes:

  • Add a guard so SSTATE_MIRRORS is exported only when it already has a value or when --sstate-mirror arguments were supplied.
  • Document why exporting an empty/whitespace-only SSTATE_MIRRORS is problematic with BB_HASHSERVE="auto".

💡 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