microsoft / microsoft/vcpkg

Relying on `which` is bad

Open
#8,619 4 comments 0 reactions 2 assignees View on GitHub

Nobody has claimed this yet.

category:tool-update
Dominant language
CMake
Stars
27.5k
Forks
7.7k
Avg merge
2d 19h
Merged PRs (30d)
321

Description

**Describe the bug**
`which` is a bash builtin and does not have to be available on a target system. In return this causes vcpkg to fail because it can't locate external tools.

**Environment**
- OS: Linux
- Compiler: gcc-9

**To Reproduce**
Steps to reproduce the behavior:
1. Set up a github workflow with ubuntu-latest as the base and the build running in archlinux/base (archlinux does not have which by default)
2. Try to install any package via vcpkg

**Expected behavior**
vcpkg should parse the linux path on its own instead of relying on `which`.

**Failure logs**
https://github.com/NovaMods/nova-renderer/commit/ae8de49fa1c03c4c731262d60bd4401cb67ce407/checks?check_suite_id=266692098

**Additional context**
Arch Linux does not deliver `which` by default.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.