Windows Update エラー

イメージ
インストールエラー 0x80070306 はい、また出ました。 最近のMicrosoftの品質管理はどうなってしまったのでしょうか? 今回は、KB5079473を入れようとして、エラー。 再試行してエラー。 日をおいて試してもエラー。 ということで、Updateのたびにエラー表示されるのもイラッとするので、修正する。 まずは、 管理者でコマンドプロンプトを開く dism /online /cleanup-image /restorehealth sfc /scannow を実行する。 イメージのバージョンが異なっているので、更新したかいが有るとよいが…。 sfcは若干時間がかかるが、まぁチェックだけはしておこう。 続いて、 設定 → システム → 回復 → Windows Updateで問題を解決する → 今すぐインストール これを実行すると、Windows Updateの画面が開き、以下のような作業が始まる。 修復バージョンをダウンロードして、それで書き込むっぽい 結構時間がかかりますが、まぁ順調に進みます。 完了すると「再起動」しろと言ってくるので、再起動を実施。  ↓ サインイン画面でサインイン  ↓ ここが、いつもの10倍くらい時間がかかった。  ↓ 無事にデスクトップが表示される 「更新プログラムのチェック」を押しても何も候補は出てこなくなる。

csvqのbuild

使おうと思ったら、無かった…

以前あまりに便利だったので、buildして使っていた「csvq」だけど、マシンを入れ替えた際に入れ忘れていたらしい…。

前にbuildした時は、さっくりと動作したので、最新バージョンを持ってきてbuildすればいいやぁと思って作業してみると、エラーを吐きまくる。
バイナリ持ってきてきても良いけど、時間がある今なので、頑張ってみることにした。


Installation

Install executable binary
Download an archive file from release page.
Extract the downloaded archive and add a binary file in it to your path.
Build from source
Requirements

Go 1.11 or later (ref. Getting Started - The Go Programming Language)
Build with one of the following ways
Use go get
$ go get github.com/mithrandie/csvq
Build with strict dependencies
$ go get -d github.com/mithrandie/csvq
Change directory to $GOPATH/src/github.com/mithrandie/csvq
$ env GO111MODULE=on go install




githubに書かれているとおりに、

$ go get github.com/mithrandie/csvq



すると、以下のようなエラーが大量に…。

$ go get github.com/mithrandie/csvq

# github.com/mithrandie/csvq

../../go/src/github.com/mithrandie/csvq/main.go:35:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
../../go/src/github.com/mithrandie/csvq/main.go:39:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
../../go/src/github.com/mithrandie/csvq/main.go:44:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
../../go/src/github.com/mithrandie/csvq/main.go:48:15: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in slice literal:
cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
../../go/src/github.com/mithrandie/csvq/main.go:52:18: cannot use cli.Float64Flag literal (type cli.Float64Flag) as type cli.Flag in slice literal:
cli.Float64Flag does not implement cli.Flag (Apply method has pointer receiver)
../../go/src/github.com/mithrandie/csvq/main.go:57:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
../../go/src/github.com/mithrandie/csvq/main.go:61:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
../../go/src/github.com/mithrandie/csvq/main.go:66:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
../../go/src/github.com/mithrandie/csvq/main.go:71:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
../../go/src/github.com/mithrandie/csvq/main.go:75:17: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
../../go/src/github.com/mithrandie/csvq/main.go:75:17: too many errors


しかも、最後の行を見るとtoo many errorsとか言ってくるし…。


さて、このErrorの理由をググってみると、

こんな情報をゲット。


良くわからないが、該当する行を全て書き換えてみる。

main.goのAppFlag内のcli.〜に該当する部分を全て&を先頭に付加。

保存して、buildしてみる。


$ make

GOPATH=/home/yoshimura/go/src/github.com/mithrandie/csvq/build go build -ldflags="-X github.com/mithrandie/csvq/lib/query.Version=v1.13.3-3-g119a62d" -o /home/yoshimura/go/src/github.com/mithrandie/csvq/build/bin/csvq
go: downloading github.com/urfave/cli v1.20.0
go: downloading github.com/mithrandie/ternary v1.1.0
go: downloading github.com/mithrandie/go-text v1.3.1
go: downloading github.com/mitchellh/go-homedir v1.0.0
go: downloading github.com/mithrandie/go-file/v2 v2.0.2
go: downloading golang.org/x/crypto v0.0.0-20181112202954-3d3f9f413869
go: downloading github.com/mithrandie/readline-csvq v1.1.1
go: downloading golang.org/x/text v0.3.1
go: downloading golang.org/x/sys v0.0.0-20191029155521-f43be2a4598c


おっ!無事に通った。

build/bin/ を確認すると、csvqが出来上がっている。


念の為、バージョンを確認。

$ ./csvq -v

csvq version v1.13.3-3-g119a62d

ちゃんと、出来上がっているようだ。


helpもInteractiveモードも動作する。


試しに、test.csvを作成し、SQLを叩いてみる。
https://qiita.com/mithrandie/items/146564e748ee235709c0


$ ./csvq
> select * from `test.csv`
+----+------------------+-----------+
| id |       name       | parent_id |
+----+------------------+-----------+
| 1  | ラダトーム       |   NULL    |
| 2  | りゅうおうのしろ |   NULL    |
| 3  | ガライ           | 1         |
| 4  | マイラ           | 1         |
| 5  | リムルダール     | 1         |
| 6  | ドムドーラ       | 1         |
| 7  | メルキド         | 1         |
| 8  | あめのほこら     | 4         |
| 9  | せいなるほこら   | 5         |
+----+------------------+-----------+


問題はなさそう…。

ということで、こいつは~/binに格納しておく。


ただ、ダウンロードしたバイナリと比較してみると微妙にサイズが異なるので、少々心配だけど、動けばOKなので、良しとする。

ちなみに、
csvq-v1.13.1-linux-amd64.tar.gz 内のcsvqは、15,672,673 バイト
自分でbuildしたものは14,517,598バイトなのは、何故かなぁ〜?

ダウンロードしたバイナリのバージョンは、1.13.1とsrcの方が若干新しいのかもしれないと言うことにしておこう。



コメント

このブログの人気の投稿

Ubuntu24.04 でGUIが死んだ

VirtualBoxが異常

MEGAにも弱点があった?