Skip to content

Fix build on arch and fix bun x to execute local binaries from root package.json - #6913

Closed
tr1ckydev wants to merge 3 commits into
oven-sh:mainfrom
tr1ckydev:main
Closed

tr1ckydev wants to merge 3 commits into
oven-sh:mainfrom
tr1ckydev:main

Conversation

@tr1ckydev

Copy link
Copy Markdown

What does this PR do?

This allows bun x command to search first for local binaries mentioned in the root package.json and execute them if found similar to npx, which wasn't possible earlier.

For example we have a package.json in our root dir

{
  "name": "cli",
  "module": "index.ts",
  "type": "module",
  "bin": "./index.ts",
  "devDependencies": {
    "bun-types": "latest"
  },
  "peerDependencies": {
    "typescript": "^5.0.0"
  }
}

Previously bun x cli would not execute this binary but npx cli worked. This PR allows bun x cli to work as expected and to execute local binaries from root package.json.

Also fixes build not working on arch distros having different names.

  • Documentation or TypeScript types (it's okay to leave the rest blank in this case)
  • Code changes

How did you verify your code works?

Manual tests.

Comment thread CMakeLists.txt
set(DEFAULT_USE_STATIC_LIBATOMIC ON)
if(UNIX AND NOT APPLE)
execute_process(COMMAND cat /etc/os-release COMMAND head -n1 OUTPUT_VARIABLE LINUX_DISTRO)
execute_process(COMMAND cat /usr/lib/os-release COMMAND head -n1 OUTPUT_VARIABLE LINUX_DISTRO)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also fixes build not working on arch distros having different names.

Which distribution has this issue?

afak, /etc/os-release has a higher priority.

The file /etc/os-release takes precedence over /usr/lib/os-release. Applications should check for the former, and exclusively use its data if it exists, and only fall back to /usr/lib/os-release if it is missing.

Link: https://man.archlinux.org/man/os-release.5.en

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have CachyOS Linux currently which doesn't return Arch Linux for the previous one. Hence the former change.

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.

3 participants