Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add $N_ARCH as a default architecture #832

Merged
merged 1 commit into from
Feb 11, 2025

Conversation

elibarzilay
Copy link
Contributor

Pull Request

More convenient to use than --arch in case of a mirror with exotic architecture, like the ones in unofficial-builds.

Do this by making it the default for $ARCH.

Also, skip the uname -m if it's not needed because of this, or because of --arch, or the version-specific default. (This is not needed for the functionality.)

Problem

See #830.

Solution

The actual fix is just:

-ARCH=
+ARCH="$N_ARCH"

The rest are:

  • README changes
  • Ensuring that $N_ARCH exists if unset
  • Skipping the uname -m if $ARCH is set (this could be done in a separate PR)
  • Reporting $N_ARCH in show_diagnostics

ChangeLog

New $N_ARCH to set a default architecture.

README.md Outdated
@@ -266,10 +266,15 @@ Another example is the Node.js [unofficial-builds project](https://github.com/no

export N_NODE_MIRROR=https://unofficial-builds.nodejs.org/download/release

You may need to specify the architecture explicitly if not autodetected by `n`, such as using `musl` `libc` on Alpine:
You may need to specify the architecture explicitly if not autodetected by `n`, such as using `musl` `libc` on Alpine. You can do that with using `N_ARCH`:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think fine to just have N_ARCH covered in example here:

Suggested change
You may need to specify the architecture explicitly if not autodetected by `n`, such as using `musl` `libc` on Alpine. You can do that with using `N_ARCH`:
You may need to specify the architecture explicitly if not autodetected by `n`, such as using `musl` `libc` on Alpine. You can do that with `N_ARCH` or `--arch`:

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Combined both, see the new patch which I'll push shortly.

README.md Outdated
Comment on lines 276 to 278
or using `--arch`:

n --arch x64-musl install lts
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can leave out the --arch usage here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

(Left a comment at the end of the line, to avoid the illusion that both are needed...)

@shadowspawn
Copy link
Collaborator

Thanks. Lots of cosmetic comments. I'll do some testing before approving.

More convenient to use than --arch in case of a mirror with exotic
architecture, like the ones in `unofficial-builds`.

Do this by making it the default for `$ARCH`.

Also, skip the `uname -m` if it's not needed because of this, or because
of `--arch`, or the version-specific default. (This is not needed for
the functionality.)
@elibarzilay
Copy link
Contributor Author

Made all changes. (You might have more comments though, so not to be taken blindly...)

@shadowspawn shadowspawn changed the base branch from master to develop February 9, 2025 23:18
@shadowspawn shadowspawn merged commit c817c14 into tj:develop Feb 11, 2025
@shadowspawn shadowspawn added the pending release Merged into a branch for a future release, but not released yet label Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending release Merged into a branch for a future release, but not released yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants