philippta / flyscrape

Flyscrape is a command-line web scraping tool designed for those without advanced programming skills.
https://flyscrape.com
Mozilla Public License 2.0
1.02k stars 29 forks source link

cache: failed to create cache table: Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub #2

Closed brianlow closed 10 months ago

brianlow commented 10 months ago

Any ideas on this?

$ wget https://raw.githubusercontent.com/philippta/flyscrape/72f83468299f2510ada7bb2afdc2ca841127fd24/examples/hackernews.js                

$ ./flyscrape run hackernews.js 
cache: failed to create cache table: Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub

Macbook M1 using flyscrape_mac_arm64.tar.gz. Tried 0.4.0 and 0.3.0 versions

billmaya commented 10 months ago

Same here. Download version 0.4.0 and ran from the Mac Mini (M1) terminal.

$ ./flyscrape dev erasmatazz.js cache: failed to create cache table: Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub

Any suggestions appreciated.

philippta commented 10 months ago

Flyscrape uses github.com/mattn/go-sqlite3 for storing the SQLite cache file. This library requires CGO to function correctly which is currently disabled in the release pipeline. That was an oversight.

I tried to enable it but unfortunately it is not trivial. The pipeline must be updated to use something like https://github.com/goreleaser/goreleaser-cross.

Workaround

As a workaround, you can install Flyscrape from source:

go install github.com/philippta/flyscrape/cmd/flyscrape@latest
philippta commented 10 months ago

Fixed in the latest v0.4.1 release.

brianlow commented 9 months ago

Fixed for me, thanks!