Commit Graph

76 Commits

Author SHA1 Message Date
Augusto Moura
385ff1349e
feat: limit dynamic resolve strategies 2023-05-18 14:00:34 -03:00
Augusto Moura
c406dac170
feat: refactor version/aliases resolution 2023-04-19 23:07:49 -03:00
burnettk
a20484c57f promote nodebuild_wrapped from install to utils so we can use it in list-all 2022-03-12 17:58:31 -05:00
burnettk
eb110f87bd if a version is not available in node-build, make sure it is not in list-all 2022-03-11 09:26:31 -05:00
Augusto Moura
364c078340
Merge pull request #291 from augustobmoura/feat/comments-on-default-packages
feat: add comments to default npm packages
2022-02-21 10:17:09 -03:00
Jeremy Fleischman
dbc07b70a9
Don't set NODE_BUILD_BUILD_PATH
If not set, [node-build defaults to a timestamped subdirectory of
`TMPDIR`](https://github.com/nodenv/node-build#custom-build-configuration),
which is exactly what we need.

This fixes https://github.com/asdf-vm/asdf-nodejs/issues/289

With this change, I see repeated builds fail in the exact same way (see
https://github.com/asdf-vm/asdf-nodejs/issues/289 for a detailed
explanation of what used to happen):

    $ PATH="$PWD:$PATH" ASDF_NODEJS_FORCE_COMPILE=1 asdf install nodejs 14.18.1
    Trying to update node-build... ok

    WARNING: node-v14.18.1 is in LTS Maintenance mode and nearing its end of life.
    It only receives *critical* security updates, *critical* bug fixes and documentation updates.

    Installing node-v14.18.1...

    BUILD FAILED (Arch rolling using node-build 4.9.69)

    Inspect or clean up the working tree at /tmp/node-build.20220216023317.178521.tZF5cV
    Results logged to /tmp/node-build.20220216023317.178521.log

    Last 10 log lines:
    /tmp/node-build.20220216023317.178521.tZF5cV ~/tmp/demoing
    /tmp/node-build.20220216023317.178521.tZF5cV/node-v14.18.1 /tmp/node-build.20220216023317.178521.tZF5cV ~/tmp/demoing
    Node.js configure: Found Python 3.9.6...
    WARNING: C compiler (CC=gcc, 0.0.0) too old, need gcc 4.2 or clang 3.2
    WARNING: Could not recognize `gas`:
    ERROR: Did not find a new enough assembler, install one or build with
           --openssl-no-asm.
           Please refer to BUILDING.md

    $ PATH="$PWD:$PATH" ASDF_NODEJS_FORCE_COMPILE=1 asdf install nodejs 14.18.1
    Trying to update node-build... ok

    WARNING: node-v14.18.1 is in LTS Maintenance mode and nearing its end of life.
    It only receives *critical* security updates, *critical* bug fixes and documentation updates.

    Installing node-v14.18.1...

    BUILD FAILED (Arch rolling using node-build 4.9.69)

    Inspect or clean up the working tree at /tmp/node-build.20220216023335.178790.u0kcPV
    Results logged to /tmp/node-build.20220216023335.178790.log

    Last 10 log lines:
    /tmp/node-build.20220216023335.178790.u0kcPV ~/tmp/demoing
    /tmp/node-build.20220216023335.178790.u0kcPV/node-v14.18.1 /tmp/node-build.20220216023335.178790.u0kcPV ~/tmp/demoing
    Node.js configure: Found Python 3.9.6...
    WARNING: C compiler (CC=gcc, 0.0.0) too old, need gcc 4.2 or clang 3.2
    WARNING: Could not recognize `gas`:
    ERROR: Did not find a new enough assembler, install one or build with
           --openssl-no-asm.
           Please refer to BUILDING.md
2022-02-16 02:36:31 -08:00
Augusto Moura
7f5a86ce00
feat: add comments to default npm packages 2022-02-09 22:29:34 -03:00
Augusto Moura
2f7ed7520c
feat: add force rebuild variable 2022-02-09 20:12:37 -03:00
Augusto Moura
b58ae2359f
fix: add fallback for unbound variables in bash3 2021-12-16 21:10:58 -03:00
Augusto Moura
363c0d1d9f
fix: add fallback for empty arrays in bash3 2021-12-15 14:07:51 -03:00
Augusto Moura
dcc73aea0e
fix: fix typos & revert import of utils.sh 2021-12-13 22:50:58 -03:00
Augusto Moura
58859abcd5
chore: better messages 2021-12-07 00:03:28 -03:00
Augusto Moura
e2e0db2aad
chore: add better error messages 2021-11-29 15:00:39 -03:00
Augusto Moura
67c382b8a2
docs: update README com new information about installation 2021-11-24 00:20:25 -03:00
Augusto Moura
ee8daa2b75
feat: remove previous integrity check logic 2021-11-23 23:35:25 -03:00
Augusto Moura
c4e335f872
feat: modify install to use node-build behind the scenes 2021-11-23 23:08:14 -03:00
Pascal Martel
1bc55cb601
Fallback on source code build when no binary available (#207) 2021-10-29 21:40:13 -04:00
Michael Poutre
18f2a58981
Revert "Fix resolve_version_query to not kill tee in filter_version_candidates (#264)"
This reverts commit a32e6c9751.
2021-10-08 14:56:17 -07:00
Michael Poutre
a32e6c9751
Fix resolve_version_query to not kill tee in filter_version_candidates (#264)
Prior to this change the awk 'prog' contained an exit command. When tee attempted to write to the stdout at this point, it received a SIGPIPE signal and exited with an error code of 141. I can't seem to find a way to have tee ignore this signal, but I don't believe the overhead of awk doing a small comparison will have a large/any performance impact especially relative to the processing in filter_version_candidates

Fixes #263
2021-10-07 08:15:13 -04:00
Augusto Moura
4d9196d0ad
feat(shims): implement new wrapper strategy
Now we are using a shim template, we find the true binary in the path
and then call asdf reshim only when necessary
2021-07-19 15:26:56 -03:00
Augusto Moura
6ddcdfdb81
refactor(auto-reshim): add npm wrapper and remove npm hooks
Instead of relying in npm global installation hook for auto reshimming,
a pretty obscure functionality of npm, I just wrote a wrapper script
that intercept calls for npm and invokes asdf reshim whenever necessary.

The wrapper needs to be configured manually by the user, following the
practices of other plugins with similar settings.

I also wrote an utility for printing the current wrapper path easing the
configuration of new environments.

README now has an example of how to configure auto-reshimming.

There's also a notice on plugin installation about setting up the
auto-reshimming configuration.

A notice was also added to the install command, so that we reach more
people about the changes.
2021-05-16 21:06:10 -03:00
Augusto Borges de Moura
d2adc081be
Merge pull request #229 from Roman2K/master
Add support for ASDF_CONCURRENCY
2021-05-01 19:08:51 -03:00
villu164
cb61e3ddf9
Update install for better error message (#230)
* Clarify improved GPG error message.

Co-authored-by: Trevor Brown <Stratus3D@users.noreply.github.com>
2021-04-20 08:17:09 -04:00
Roman Le Négrate
45024fd545
add support for ASDF_CONCURRENCY 2021-04-17 21:50:40 +02:00
Yaroslav Rogov
e0f49386c9 feat: Implement index tab cache (#219)
* feat: Implement index tab cache
* feat: Switch to etag-based caching
* Update lib/utils.sh

Co-authored-by: Augusto Borges de Moura <augusto.borgesm@gmail.com>
Co-authored-by: Trevor Brown <Stratus3D@users.noreply.github.com>
2021-04-09 13:41:07 -03:00
Dave Ashby
9a093d4be5 tweak automatic key import 2021-04-09 13:41:07 -03:00
Dave Ashby
e0f170fc52 tweak gpg check and add automatic key installation 2021-04-09 13:41:07 -03:00
Augusto Moura
e6ace0fca5 separate install functions between alias and canon 2021-04-09 13:41:07 -03:00
Augusto Moura
6b287904e4 install alias as symlinks to real versions 2021-04-09 13:41:07 -03:00
Augusto Moura
753b4a7b26 add better formatting and commentaries 2021-04-09 13:41:06 -03:00
Augusto Moura
d5d2ea6ce9 refactor list all to use the official index.tab
also add support for lts aliases, giving it's trivial to implement after
processing the tab

also get better error messages for missing versions
2021-04-09 13:41:06 -03:00
Adam Hawkins
6cd8bc40b2 fix(bin): add --yes to confirm GPG overwrite 2021-04-09 13:41:06 -03:00
Adam Hawkins
2abce68edc fix(bin): close #165
This file may already exist. It's unclear why this happens though.
2021-04-09 13:41:06 -03:00
Brian van Burken
3bff0719af Support non-default default-npm-packages location. 2021-04-09 13:41:06 -03:00
Trevor Brown
adb47b8bc9 Add comment on individual uname -m clause 2021-04-09 13:41:06 -03:00
Nicolas Caille
cc7c7d20ae add 'amd64' in install script function get_nodejs_machine_hardware_name for FreeBSD 2021-04-09 13:41:06 -03:00
Ben Limmer
f0cc64c799
Update bin/install
Co-authored-by: Augusto Borges de Moura <augusto.borgesm@gmail.com>
2021-04-09 10:18:04 -06:00
Ben Limmer
44cff5c4b0
Suggest updating plugin upon failure 2020-11-14 14:17:18 -07:00
Thomas B Homburg
66f5292b45 Extract gpg key name to env var 2020-05-14 22:32:14 +02:00
Thomas B Homburg
b7430cbecc Fix install 2020-05-13 17:43:43 +02:00
Thomas B Homburg
c3aec726a2 Import and use gpg keys in separate keyring
Using separate gpg keyring file in
~/.gnupg/asdf-nodejs.gpg to avoid
mixing with default keyring
2020-05-13 17:43:43 +02:00
Trevor Brown
cd3a1a7ddb
Merge pull request #162 from homburg/fix/default-packages-install-location
Fix `.default-npm-packages` install location
2020-05-12 15:52:11 -04:00
天驱 · 练剑 / TianQu · LianJian
4c4d4ef6c7
--check to -c for busybox
when use asdf-node in docker image alpine
```
sha256sum: unrecognized option: check
BusyBox v1.31.1 () multi-call binary.

Usage: sha256sum [-c[sw]] [FILE]...

Print or check SHA256 checksums

        -c      Check sums against list in FILEs
        -s      Don't output anything, status code shows success
        -w      Warn about improperly formatted checksum lines
```
2020-05-10 04:07:59 +08:00
Thomas B Homburg
4b6591e3bb Fix .default-npm-packages install location 2020-05-08 15:01:03 +02:00
Ryan Roden-Corrent
dd80ca0fbf
Align install PGP warning with README
If you haven't imported the necessary PGP keys, the installer will print an error about "bootstrapping trust" and direct you to the README. However, the words "bootstrap" and "trust" never appear in the README.

This adjusts the warning to include some words that you can actually search the README for.
2020-02-25 16:01:05 -05:00
Trevor Brown
c975636239 Remove hardcoded plugin name and replace with variable
Fixes issue #20
2020-01-14 09:54:39 -05:00
Trevor Brown
7b4f11365a Hide gpg signature trust warning 2019-12-20 10:32:47 -05:00
Ryan Bigg
ad152f3b72 Use 'command' over 'which' to check for shasum
'command' is a shell builtin on all current shells

'which' is not builtin to bash, and if the node 'which' package is installed, that package may interfere

See https://github.com/asdf-vm/asdf-nodejs/issues/137 for an example of that interference
2019-10-03 14:44:10 +10:00
Thomas B Homburg
7677cbfa78 Get command exit code without exiting 2019-05-03 13:16:52 +02:00
Thomas B Homburg
1656548338 Fix bash ansi color output 2019-05-03 13:14:59 +02:00