Specify target platform value in postinstall script
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, node.js
- Domain
- build-system
Research direction
Start at the postinstall script and the getTarget entry point shown in the issue. Check how npm_config_arch is currently handled, then verify that npm_config_platform selects the intended target values for each supported platform and architecture; done means cross-platform builds use the requested platform without changing default behavior.
Written by the indexing model from the issue text.
Description
We can currently specify the arch value using process.env.npm_config_arch, would it be possible to extend that to include the platform attribute. This would be helpful for cross-platform builds.
async function getTarget() {
const arch = process.env.npm_config_arch || os.arch();
const platform = process.env.npm_config_platform || os.platform();
switch (platform) {
case 'darwin':
return arch === 'arm64' ? 'aarch64-apple-darwin' :
'x86_64-apple-darwin';
case 'win32':
return arch === 'x64' ? 'x86_64-pc-windows-msvc' :
arch === 'arm64' ? 'aarch64-pc-windows-msvc' :
'i686-pc-windows-msvc';
case 'linux':
return arch === 'x64' ? 'x86_64-unknown-linux-musl' :
arch === 'arm' ? 'arm-unknown-linux-gnueabihf' :
arch === 'armv7l' ? 'arm-unknown-linux-gnueabihf' :
arch === 'arm64' ? 'aarch64-unknown-linux-musl':
arch === 'ppc64' ? 'powerpc64le-unknown-linux-gnu' :
arch === 's390x' ? 's390x-unknown-linux-gnu' :
'i686-unknown-linux-musl'
default: throw new Error('Unknown platform: ' + platform);
}
}
- Dominant language
- JavaScript
- Stars
- 203
- Forks
- 66
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/vscode-ripgrep
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
microsoft/vscode-ripgrep#88 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
microsoft/vscode-ripgrep#87 · 1 comment · 3 reactions ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
microsoft/vscode-ripgrep#81 · 1 reaction ·
-
Difficulty 1/5 Under an hour Newbie friendliness 55/100
microsoft/vscode-ripgrep#80 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
microsoft/vscode-ripgrep#76 ·
All issues in microsoft/vscode-ripgrep
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100