-
Notifications
You must be signed in to change notification settings - Fork 1
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
Mac M2芯片 docker 中运行出现Segmentation fault #2
Comments
我尝试复现了下, 未能复现,对比了下环境, 我用的配置如下. 目前的建议是,
REPOSITORY TAG IMAGE ID CREATED SIZE
ubuntu 24.04 b62afbf00f1f 13 days ago 93.6MB
复现日志# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu Noble Numbat (development branch)"
# /home/ubuntu/test/16/node-v16.20.2-linux-arm64/bin/node
Welcome to Node.js v16.20.2.
Type ".help" for more information.
> x = require('./es-module-parser.linux-arm64-gnu.node')
{
parseCode: [Function: parseCode],
parseFiles: [Function: parseFiles],
parseFilesSync: [Function: parseFilesSync]
}
> x.parseCode("import a from 'b'")
[
{
end: 18,
importKind: 'value',
source: 'b',
specifiers: [ [Object] ],
start: 1,
type: 'ImportDeclaration'
}
]
> |
涉及到 docker 虚拟环境确实可能存在很多不确定性,建议升级一下 rust 的依赖,然后改一下 cargo build 参数重新构建发包一次试试? @stormslowly 目前通用的 napi cargo build 配置如下: 展开查看# .cargo/config.toml
# macos
[target.x86_64-apple-darwin]
rustflags = ["-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup"]
[target.aarch64-apple-darwin]
rustflags = ["-C", "link-arg=-undefined", "-C", "link-arg=dynamic_lookup"]
# windows
[target.x86_64-pc-windows-msvc]
linker = "rust-lld"
rustflags = ["-C", "target-feature=+crt-static"]
[target.aarch64-pc-windows-msvc]
linker = "rust-lld"
rustflags = ["-C", "target-feature=+crt-static"]
# linux
[target.x86_64-unknown-linux-gnu]
rustflags = ["-C", "target-feature=+sse2"]
[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"
rustflags = []
[target.x86_64-unknown-linux-musl]
rustflags = ["-C", "target-feature=-crt-static"]
[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-gcc"
rustflags = ["-C", "target-feature=-crt-static", "-C", "link-arg=-lgcc"]
[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"
rustflags = [] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
关联的issue
具体的case 见umijs/umi#12013
Mac M2芯片,
macOS 13.6.3
docker镜像采用ubuntu:24.04
运行自己的项目和按照文档创建项目是同样的结果 https://umijs.org/docs/guides/getting-started
项目里面只有这个.node文件会在 npx umi setup阶段被使用,应该是这个文件的问题,希望能更新一下
@umijs/es-module-parser-linux-arm64-gnu/es-module-parser.linux-arm64-gnu.node
The text was updated successfully, but these errors were encountered: