Skip to content

pkg_install should work in Windows #387

Closed

Description

@nacl

The current iteration of pkg_install was only tested on Linux and macOS. I currently do not have a Windows development environment available, so things were likely to be missed.

In particular, this failure comes to mind: https://buildkite.com/bazel/rules-pkg/builds/968. This might be caused by RUNFILES_DIR not being in the command's environment.

This is within tests only, though, so bazel running it may "just work".

Confirm and investigate.

Activity

  1. added
    P2An issue that should be worked on when time is available
    on Jul 19, 2021
  2. added this to the 1.1 milestone on May 13, 2022
  3. redsun82 commented on Apr 29, 2024

    @redsun82

    Unfortunately windows package install does not work on Windows as far as I could test, with an error like:

    Traceback (most recent call last):
      File "C:\Users\redsun82\AppData\Local\Temp\Bazel.runfiles_wd_pz4_y\runfiles\_main\go\_extractor-pack-installer_install_script.py", line 203, in <module>
        exit(main(sys.argv))
             ^^^^^^^^^^^^^^
      File "C:\Users\redsun82\AppData\Local\Temp\Bazel.runfiles_wd_pz4_y\runfiles\_main\go\_extractor-pack-installer_install_script.py", line 195, in main
        installer.include_manifest_path(f)
      File "C:\Users\redsun82\AppData\Local\Temp\Bazel.runfiles_wd_pz4_y\runfiles\_main\go\_extractor-pack-installer_install_script.py", line 123, in include_manifest_path
        with open(path, 'r') as fh:
             ^^^^^^^^^^^^^^^
    FileNotFoundError: [Errno 2] No such file or directory: 'go/_extractor-pack-installer_install_script-install-manifest.json'
    

    I might be able to do some debugging and maybe come up with a patch for this in the coming days.

  4. hsjdhudn commented on Oct 12, 2025

    @hsjdhudn

    Perhaps, we can use commands related to Wix3 and NSIS to allow users to create Wix or NSI script files, and Bazel can use these script files for packaging. As for zip, we might use PowerShell's Compress-Archive?

  5. tonyaiuto commented on Oct 14, 2025

    @tonyaiuto
    Collaborator

    I think there is already an issue to make a pkg_msi or equivalent. But there is little chance any of the maintainers are going to work on that.
    That aside, it is a different feature set than what pkg_install does.

  6. rdesgroppes commented on Nov 5, 2025

    @rdesgroppes
    Contributor

    On Windows, "runfiles" aren't enabled by default, which can be changed by executing bazel run --enable_runfiles.

    • When runfiles are enabled (Unix default): the RUNFILES_DIR env var is set,
    • When runfiles are not enabled (Windows default): the RUNFILES_MANIFEST_FILE env var is set instead.

    Unfortunately windows package install does not work on Windows [...]

    This is hopefully addressed by:

  7. added 4 commits that reference this issue on Nov 7, 2025
    a1f8077
    424ea34
    a8e9790
    57f4b7d
  8. added a commit that references this issue on Nov 13, 2025
    38f29af
  9. added a commit that references this issue on Nov 21, 2025
    918049e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2An issue that should be worked on when time is availablepkg_install

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions