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

Error in src/cli.cr:1: while requiring "./hpr/cli" #10

Closed
a455455b opened this issue Jul 23, 2019 · 16 comments
Closed

Error in src/cli.cr:1: while requiring "./hpr/cli" #10

a455455b opened this issue Jul 23, 2019 · 16 comments
Labels
bug Something isn't working

Comments

@a455455b
Copy link

尝试了源码编译,也尝试了Docker安装 但是都会报这个错误。在github搜到crystal在旧版会有这个问题,但是我是通过homebrew安装的0.29最新版呀。
相关log:

+ shards build --production --release --static --no-debug
Dependencies are satisfied
Building: hpr
Error target hpr failed to compile:
Error in src/cli.cr:1: while requiring "./hpr/cli"

require "./hpr/cli"
^

in src/hpr/cli.cr:1: while requiring "../hpr"

require "../hpr"
^

in src/hpr.cr:2: while requiring "gitlab"

require "gitlab"
^

in lib/gitlab/src/gitlab.cr:1: while requiring "./gitlab/**"

require "./gitlab/**"
@icyleaf
Copy link
Owner

icyleaf commented Jul 23, 2019

这个项目是用 Crystal 0.27.0 编写,因为是开发中的语言每个版本都会有 breaking changes,建议安装 0.27.0 进行编译。

@a455455b
Copy link
Author

  • 通过brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/17b864f66552871b74c2085e7b7ae38f8e9cd81f/Formula/crystal.rb 切换到0.27.0之后,出现ld: library not found for -lssl 报错,通过Crystal not working in Mac OS X Mojave crystal-lang/crystal#6875 修复。
  • 成功编译完之后发现执行hpr的命令和文档不一样了,需要使用hpr [command] 才行。
  • 还有一个问题,镜像Cocoapods公共索引的时候总是报错unpacking objects 您遇到过吗

@icyleaf
Copy link
Owner

icyleaf commented Jul 25, 2019

ld: library not found for -lssl 报错,通过crystal-lang/crystal#6875 修复。

-lssl 是因为 openssl 配置错误。

成功编译完之后发现执行hpr的命令和文档不一样了,需要使用hpr [command] 才行。

理论上就是 hpr [command],难道我文档写错了?

镜像Cocoapods公共索引的时候总是报错unpacking objects 您遇到过吗

如果你 clone 的是 cocoapods 的 master repo 的话正常情况是功夫网的原因造成 clone github 巨大的库超时了,建议你找个国内镜像的 cocoapods master repo 仓库 clone 下来后在替换 remote url 再进行拉取这样速度就会缩短很多,或者你不替换也行这取决于镜像库的同步速度。

@a455455b
Copy link
Author

  • 在您的文档中安装这一栏有这个命令 ./bin/hpr --help
  • 在执行 ./bin/hpr create --progress -U https://github.com/facebook/facebook-objc-sdk.git 或者 ./bin/hpr list 时,会出现如下报错,但是创建仓库是成功了的
[warn] kq_init: detected broken kqueue; not using.: Undefined error: 0
.[KeyError] Missing hash key: "hpr"
  Hpr::Git::Repo#remote<String>:Hpr::Git::Repo::Remote
  Hpr::Cli::Create@Hpr::Git::Helper#repository_info<String>:Hash(String, String)
  Hpr::Cli#run!:(Bool | IO+ | Int32 | Nil)
  __crystal_main
  main
  • 不好意思刚刚没说清楚,刚刚问您的是我创建镜像仓库成功之后并没有在gitlab看到相应的代码,我看到本地已经clone下来远程仓库了,想要用git push mirrors --no-thin这条命令来往上推,然后发现推了几次都失败了,报错都是unpacking objects

@icyleaf
Copy link
Owner

icyleaf commented Jul 25, 2019

在您的文档中安装这一栏有这个命令 ./bin/hpr --help

这个是编译后二进制文件会放在 bin 目录只能使用使用,如果你用 docker 的话就是直接 hpr ...

在执行 ./bin/hpr create --progress -U https://github.com/facebook/facebook-objc-sdk.git 或者 ./bin/hpr list 时,会出现如下报错,但是创建仓库是成功了的

我来跟进下,可能是 bug

报错都是unpacking objects

镜像是使用的 git clone --mirror 拉取的完整的历史记录,如果 repo 项目 commit 的很多,加上文件也很大这种错误很容易出现,你可以试试改 http 协议为 ssh 协议: [email protected]/xxx/xxx.git

@a455455b
Copy link
Author

为啥不管怎么update,gitlab仓库都是空的呢

@icyleaf
Copy link
Owner

icyleaf commented Jul 25, 2019

你看看 hpr 项目目录 repositories 目录,找找里面镜像的仓库没有,如果有进去看看有没有 packed-refs 文件,有的话基本上说明 clone 已经完毕了,git log 是可以看到 commit logs

@a455455b
Copy link
Author

packed-refs文件是存在的,commit logs也存在,但是镜像仓库并没有push成功,gitlab的里还是只有空仓库,我试了只包含两个文件的github仓库也是如此

@icyleaf
Copy link
Owner

icyleaf commented Jul 26, 2019

麻烦能复制下 logs/sidekiq.log 日志吗

@a455455b
Copy link
Author

sidekiq.log
感谢大佬的及时回复

@icyleaf
Copy link
Owner

icyleaf commented Jul 26, 2019

CocoaPods-Specs、facebook-facebook-objc-sdk 在 gitlab 上都是空仓库么?

后面几个我看 create 的时候都报错了,看似是 repositories/mirrors/xxx-xxx 目录没有创建成功,可能我还得看下 logs/hpr.log 😢

@a455455b
Copy link
Author

a455455b commented Jul 29, 2019

  • 😢不好意思这么晚才看到,我没有在我的logs文件夹下看到hpr.log这个文件哦
  • 所有在gitlab上的仓库都是空的

@icyleaf
Copy link
Owner

icyleaf commented Aug 2, 2019

Crystal 0.29 在 Docker 编译总会报错 crystal-lang/crystal#7993 我计划用 ruby 重写,需要耗费几天的时间。

@icyleaf
Copy link
Owner

icyleaf commented Aug 2, 2019

有空可以试试 ruby 版本 https://github.com/icyleaf/hpr/tree/ruby-version

刚开始写还未支持 Docker,配置文件由 json 变为了 yaml,配置都是一样的,命令行功能未支持但有 HTTP APIs 兼容之前的文档同时还多加了一些 APIs,具体可以看 lib/hpr/web.rb

@a455455b
Copy link
Author

a455455b commented Aug 5, 2019

好的好的,辛苦大佬了,ruby我能看懂一点点,我试试去。

@a455455b a455455b closed this as completed Aug 5, 2019
@icyleaf
Copy link
Owner

icyleaf commented Aug 9, 2019

这是 ruby 版本的进度:#11 基本可用了

@icyleaf icyleaf added the bug Something isn't working label Sep 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants