Azure / Azure/static-web-apps-cli

swa deploy fails in Bazel

Open
#877 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
668
Forks
155
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
I am trying to move the swa deploy command to Bazel. But I consistently get an unknown error.

Everything works without Bazel.

I suppose it could be related to the strict path to binary folders. But I am not fully sure about it.

It looks like the issue happens during creating a child process.

To Reproduce

  1. Setup calling swa cli as binary in Bazel config. Like this:
swa_bin.swa_binary(
    name = "release",
    args = ["deploy"],
    data = ["/.out"],
    env = {
        "SWA_CLI_OUTPUT_LOCATION": "./out",
        "SWA_CLI_DEPLOY_ENV": "production",
    },
    chdir = native.package_name(),
)
  1. Call bazel run release

Screenshots
With Bazel:
image

Without:
image

Desktop (please complete the following information):

  • OS: MacOS
  • Version 14.5

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the provided Bazel target with bazel run release, then compare its output with a direct swa deploy run on macOS. Trace the child-process failure and the strict binary-path or working-directory behavior; done means the same deployment succeeds through Bazel without the unknown error.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, typescript
Domain
build-system, cli, cloud
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.