FINet icon indicating copy to clipboard operation
FINet copied to clipboard

hai报错keyerror

Open 1727686235 opened this issue 2 years ago • 1 comments

您好,我在fork您的项目FINet时,在安装库hai后查看版本会出现报错“keyerror:HOME”,同样在下载好您的权重后评估的时候也是出现这样的问题。下的hepai版本是1.0.6,能向您请教一下为什么会出现这种情况吗?是库的问题还是我的操作问题(因为我看这个报错文件位置还有跟app相关的代码)? pro

1727686235 avatar Apr 04 '23 03:04 1727686235

Oh strange, fails on arm64v8 too in the same way :thinking:

tianon avatar Dec 18 '23 19:12 tianon

Minimally reproducible with:

docker run --rm -it node:18-alpine sh
apk add --no-cache --virtual .gyp python3 make g++ > /dev/null
npm install -g re2 > /dev/null
pm ERR! make: Leaving directory '/usr/local/lib/node_modules/re2/build'
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | arm64
npm ERR! gyp info find Python using Python version 3.11.6 found at "/usr/bin/python3"
npm ERR! gyp http GET https://nodejs.org/download/release/v18.19.0/node-v18.19.0-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v18.19.0/node-v18.19.0-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v18.19.0/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v18.19.0/SHASUMS256.txt
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/usr/local/lib/node_modules/re2/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/local/lib/node_modules/re2/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/local/lib/node_modules/re2/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/root/.cache/node-gyp/18.19.0/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/root/.cache/node-gyp/18.19.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/local/lib/node_modules/re2/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/root/.cache/node-gyp/18.19.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/usr/local/lib/node_modules/re2',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn make
npm ERR! gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
npm ERR! In file included from ../vendor/abseil-cpp/absl/base/internal/low_level_alloc.cc:26:
npm ERR! ../vendor/abseil-cpp/absl/base/internal/direct_mmap.h:36:10: fatal error: linux/unistd.h: No such file or directory
npm ERR!    36 | #include <linux/unistd.h>
npm ERR!       |          ^~~~~~~~~~~~~~~~
npm ERR! compilation terminated.
npm ERR! make: *** [re2.target.mk:235: Release/obj.target/re2/vendor/abseil-cpp/absl/base/internal/low_level_alloc.o] Error 1
npm ERR! gyp ERR! build error 
npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.<anonymous> (/usr/local/lib/node_modules/re2/node_modules/node-gyp/lib/build.js:209:23)
npm ERR! gyp ERR! System Linux 6.4.16-linuxkit
npm ERR! gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/re2/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /usr/local/lib/node_modules/re2
npm ERR! gyp ERR! node -v v18.19.0
npm ERR! gyp ERR! node-gyp -v v10.0.1
npm ERR! gyp ERR! not ok 
npm ERR! node:internal/process/promises:288
npm ERR!             triggerUncaughtException(err, true /* fromPromise */);
npm ERR!             ^
npm ERR! 
npm ERR! [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "1".] {
npm ERR!   code: 'ERR_UNHANDLED_REJECTION'
npm ERR! }

LaurentGoderre avatar Dec 20 '23 15:12 LaurentGoderre

This fix upstream could help: https://github.com/gperftools/gperftools/issues/693#issuecomment-173898629

LaurentGoderre avatar Dec 20 '23 18:12 LaurentGoderre

@tianon I isolated it even further

docker run --rm -it node:18-alpine sh
apk add --no-cache --virtual .gyp git python3 linux-headers make g++ > /dev/null
git clone https://github.com/uhop/node-re2.git && cd node-re2/
git checkout 1.20.3
git submodule init && git submodule update
npm install

LaurentGoderre avatar Dec 20 '23 20:12 LaurentGoderre

In file included from ../vendor/abseil-cpp/absl/base/internal/low_level_alloc.cc:26:
../vendor/abseil-cpp/absl/base/internal/direct_mmap.h:75:25: error: 'off64_t' has not been declared
   75 |                         off64_t offset) noexcept {
      |                         ^~~~~~~

I think https://github.com/abseil/abseil-cpp/issues/1473 (https://github.com/abseil/abseil-cpp/commit/4500c2fada4e952037c59bd65e8be1ba0b29f21e) is the fix for this off64_t compilation error and node-re2 has already updated their vendor copy of abseil-cpp (https://github.com/uhop/node-re2/commit/bea0c0041b0c7c9614d3ff4b91bf17f344fefb80) which would mean that it needs to be using 1.20.5+ of node-re2.

yosifkit avatar Dec 20 '23 20:12 yosifkit

https://github.com/microlinkhq/metascraper/pull/681

LaurentGoderre avatar Dec 20 '23 20:12 LaurentGoderre

This was closed as completed: https://github.com/abseil/abseil-cpp/issues/1473 This was merged: https://github.com/microlinkhq/metascraper/pull/681

Please update on what's missing for this issue.

brunoais avatar Feb 05 '24 17:02 brunoais

https://github.com/TryGhost/Ghost/pull/19401 :+1:

tianon avatar Feb 05 '24 21:02 tianon

Thank you. I'll track that one.

brunoais avatar Feb 05 '24 21:02 brunoais

@tianon These failures started just after the update from Alpine 3.17 to 3.19, here: https://github.com/docker-library/ghost/commit/123735dbbb5a717a71ff941d85cc0ee0ca0717f4. Could that update be reverted until Ghost's fix is merged so that the most recent version of Ghost can be available on Alpine again?

markstos avatar Mar 27 '24 11:03 markstos

As per the upstream PR, a fix for this should be release on Friday so hopefully we can have this fixed early next week!

LaurentGoderre avatar Apr 16 '24 10:04 LaurentGoderre

Should be fixed in https://github.com/docker-library/official-images/pull/16782

LaurentGoderre avatar May 17 '24 17:05 LaurentGoderre

https://oci.dag.dev/?image=oisupport/staging-arm32v6:6039183ab8b1d76ab7d580b06b2bd0d91b3481646648a83dc295c55694cb2701 :metal:

(coming soon to a library/ghost near you)

tianon avatar May 17 '24 18:05 tianon