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

Zap v11 was deleted #342

Open
coldestheart opened this issue Apr 7, 2020 · 14 comments
Open

Zap v11 was deleted #342

coldestheart opened this issue Apr 7, 2020 · 14 comments

Comments

@coldestheart
Copy link

coldestheart commented Apr 7, 2020

go get -u github.com/ponzu-cms/ponzu/...

Return error after blevesearch/zap/v11 was deleted from git.
Dependencies need to be updated

@nilslice
Copy link
Contributor

nilslice commented Apr 8, 2020

Yea, there's a lot of work that needs to be done to bring Ponzu up to speed with the latest in the Go modules world.

Alternatively, you may be able to git clone https://github.com/ponzu-cms/ponzu.git && cd ponzu && GO111MODULE=off go install ./...

The dependencies are vendored into the project source - though module support is not added.

@IvoPereira
Copy link

Hi @nilslice,

I have just tried installing Ponzu with the main installation method and I've faced these same issues.

When trying to install using your alternate method, I am having the following issue:

$ git clone https://github.com/ponzu-cms/ponzu.git && cd ponzu && GO111MODULE=off go install ./...
Cloning into 'ponzu'...
remote: Enumerating objects: 41, done.
remote: Counting objects: 100% (41/41), done.
remote: Compressing objects: 100% (35/35), done.
remote: Total 7664 (delta 4), reused 15 (delta 2), pack-reused 7623
Receiving objects: 100% (7664/7664), 3.59 MiB | 3.92 MiB/s, done.
Resolving deltas: 100% (3959/3959), done.
../../../../../go/src/github.com/blevesearch/bleve/index/scorch/segment_plugin.go:22:2: cannot find package "github.com/blevesearch/zap/v11" in any of:
        /snap/go/5646/src/github.com/blevesearch/zap/v11 (from $GOROOT)
        /home/{$username}/go/src/github.com/blevesearch/zap/v11 (from $GOPATH)

Any ideas?

@coldestheart
Copy link
Author

coldestheart commented May 4, 2020

@IvoPereira
Yes, you could use latest zap v11 from repo archive and unpack it to your $gopath folder:

github.com/blevesearch/zap/v11

After this do:
go get -u github.com/ponzu-cms/ponzu/...
Go get will return git checking error but all will work, tested in go 1.14.2

@sysfu
Copy link

sysfu commented Jun 8, 2020

@IvoPereira
Yes, you could use latest zap v11 from repo archive and unpack it to your $gopath folder:

github.com/blevesearch/zap/v11

After this do:
go get -u github.com/ponzu-cms/ponzu/...
Go get will return git checking error but all will work, tested in go 1.14.2

Tried the workaround on a windows system with go1.14.3 windows/amd64 but unable to build ponzu, log attached.
ponzu-build-errors.txt

@thanateros
Copy link

Ubuntu 20.04 LTS, golang version 1.14.6

go get github.com/ponzu-cms/ponzu/... gives:

package github.com/blevesearch/zap/v11: cannot find package "github.com/blevesearch/zap/v11" in any of:
        /snap/go/6123/src/github.com/blevesearch/zap/v11 (from $GOROOT)
        /home/xxxxxx/go/src/github.com/blevesearch/zap/v11 (from $GOPATH)
package github.com/blevesearch/zap/v12: cannot find package "github.com/blevesearch/zap/v12" in any of:
        /snap/go/6123/src/github.com/blevesearch/zap/v12 (from $GOROOT)
        /home/xxxxxx/go/src/github.com/blevesearch/zap/v12 (from $GOPATH)
package github.com/blevesearch/zap/v13: cannot find package "github.com/blevesearch/zap/v13" in any of:
        /snap/go/6123/src/github.com/blevesearch/zap/v13 (from $GOROOT)
        /home/xxxxxx/go/src/github.com/blevesearch/zap/v13 (from $GOPATH)

I REALLY want to use this in the revamp of my company's website and was so excited to try it out ... only to run into this brick wall, and I am loathe to jump through a bunch of kludgy hoops to get it to work (that seems to violate the point of all of this, don't you think?).

I'm curious as to how anyone with a modern version of GO is expected to adopt this as their headless CMS backend.

It feels like this project is heading to the bit graveyard sigh.

@sysfu
Copy link

sysfu commented Aug 6, 2020

Unfortunately (for us) the original maintainer stepped down and the company that acquired the project doesn't even seem to acknowledge its existence.

I have tried contacting their support and been met with canned responses (for another product!), basically a brick wall.

Hopefully someone in the community with the skills can fork it, fix it, and bring it back to life.

@amznms
Copy link

amznms commented Aug 15, 2020

most packages are now using go modules
alternative:
you can create folders /ponzu_projects/test
at the terminal:
/ponzu_projects> go mod init test
cd test
/ponzu_projects/test> go get -u github.com/ponzu-cms/ponzu/...
is expected to work correctly
and
ponzu new ponzu_projects/new_project

@gokaybiz
Copy link

gokaybiz commented Sep 19, 2020

ponzu new ponzu_projects/new_project

Error: open cmd/ponzu/vendor/github.com/ponzu-cms/ponzu/content: no such file or directory

EDIT:
It builds without any error, but it didn't worked; when i'm generating content struct with "ponzu gen content ...", Content sidebar still empty.

@bobbygryzynger
Copy link

bobbygryzynger commented Sep 26, 2020

This at least gets the custom content types showing up: kudzu-cms@f8e2569

@alevinetx
Copy link

alevinetx commented Dec 11, 2020

@amznms

most packages are now using go modules
alternative:
you can create folders /ponzu_projects/test
at the terminal:
/ponzu_projects> go mod init test
cd test
/ponzu_projects/test> go get -u github.com/ponzu-cms/ponzu/...
is expected to work correctly
and
ponzu new ponzu_projects/new_project

I've seen you respond with this comment in a few places, but it doesn't actually work in getting 0.11.0 to build. it still fails with the lack of zap/vXX errors. Also, go mod init newmod doesn't create a folder for ./newmod, so the instruction to cd newmod is also incorrect.

@lphuctai
Copy link

lphuctai commented May 27, 2021

@IvoPereira
Yes, you could use latest zap v11 from repo archive and unpack it to your $gopath folder:

github.com/blevesearch/zap/v11

After this do:
go get -u github.com/ponzu-cms/ponzu/...
Go get will return git checking error but all will work, tested in go 1.14.2

Tried the workaround on a windows system with go1.14.3 windows/amd64 but unable to build ponzu, log attached.
ponzu-build-errors.txt

Thanks you so much. I working on it and well done :D

I re-write Dockerfile in source for support everybody else can install them quickly follow this solution ^^

git clone source

Dockerfile

#syntax=docker/dockerfile:1.2
# Base our image on an official, minimal image of our preferred golang
FROM --platform=${BUILDPLATFORM} golang:1.14.3-alpine AS build

ARG TARGETOS
ARG TARGETARCH

ENV GOOS=${TARGETOS}
ENV GOARCH=${TARGETARCH}
ENV CGO_ENABLED=0

ENV GO_SRC $GOPATH/src
ENV GO_BIN $GOPATH/bin
ENV ZAPX_GITHUB github.com/blevesearch/zapx
ENV ZAPX_ROOT $GO_SRC/$ZAPX_GITHUB

RUN --mount=type=cache,target=/root/.cache/go-build apk add git
RUN --mount=type=cache,target=/root/.cache/go-build go get $ZAPX_GITHUB
WORKDIR $ZAPX_ROOT
RUN --mount=type=cache,target=/root/.cache/go-build git clone --branch v14.x https://$ZAPX_GITHUB v14
RUN --mount=type=cache,target=/root/.cache/go-build git clone --branch v13.x https://$ZAPX_GITHUB v13
RUN --mount=type=cache,target=/root/.cache/go-build git clone --branch v12.x https://$ZAPX_GITHUB v12
RUN --mount=type=cache,target=/root/.cache/go-build git clone --branch v11.x https://$ZAPX_GITHUB v11

# Note: The default golang docker image, already has the GOPATH env variable set.
# GOPATH is located at /go
ENV PONZU_GITHUB github.com/ponzu-cms/ponzu
ENV PONZU_ROOT $GO_SRC/$PONZU_GITHUB

# Consider updating package in the future. For instance ca-certificates etc.
# RUN apt-get update -qq && apt-get install -y build-essential

# Make the ponzu root directory
RUN mkdir -p $PONZU_ROOT

# All commands will be run inside of ponzu root
WORKDIR $PONZU_ROOT

# Copy the ponzu source into ponzu root.
COPY . .

# the following runs the code inside of the $GO_SRC/$PONZU_GITHUB directory
RUN --mount=type=cache,target=/root/.cache/go-build go get -u $PONZU_GITHUB...

FROM scratch AS bin
COPY --from=build /go/bin/ /bin

Script: docker build --progress=plain --output . --platform local .

Output is folder ./bin with binary ponzu inside

@victomteng1997
Copy link

Thanks you so much. I working on it and well done :D

I re-write Dockerfile in source for support everybody else can install them quickly follow this solution ^^

git clone source

Dockerfile

#syntax=docker/dockerfile:1.2
# Base our image on an official, minimal image of our preferred golang
FROM --platform=${BUILDPLATFORM} golang:1.14.3-alpine AS build

ARG TARGETOS
ARG TARGETARCH

ENV GOOS=${TARGETOS}
ENV GOARCH=${TARGETARCH}
ENV CGO_ENABLED=0

ENV GO_SRC $GOPATH/src
ENV GO_BIN $GOPATH/bin
ENV ZAPX_GITHUB github.com/blevesearch/zapx
ENV ZAPX_ROOT $GO_SRC/$ZAPX_GITHUB

RUN --mount=type=cache,target=/root/.cache/go-build apk add git
RUN --mount=type=cache,target=/root/.cache/go-build go get $ZAPX_GITHUB
WORKDIR $ZAPX_ROOT
RUN --mount=type=cache,target=/root/.cache/go-build git clone --branch v14.x https://$ZAPX_GITHUB v14
RUN --mount=type=cache,target=/root/.cache/go-build git clone --branch v13.x https://$ZAPX_GITHUB v13
RUN --mount=type=cache,target=/root/.cache/go-build git clone --branch v12.x https://$ZAPX_GITHUB v12
RUN --mount=type=cache,target=/root/.cache/go-build git clone --branch v11.x https://$ZAPX_GITHUB v11

# Note: The default golang docker image, already has the GOPATH env variable set.
# GOPATH is located at /go
ENV PONZU_GITHUB github.com/ponzu-cms/ponzu
ENV PONZU_ROOT $GO_SRC/$PONZU_GITHUB

# Consider updating package in the future. For instance ca-certificates etc.
# RUN apt-get update -qq && apt-get install -y build-essential

# Make the ponzu root directory
RUN mkdir -p $PONZU_ROOT

# All commands will be run inside of ponzu root
WORKDIR $PONZU_ROOT

# Copy the ponzu source into ponzu root.
COPY . .

# the following runs the code inside of the $GO_SRC/$PONZU_GITHUB directory
RUN --mount=type=cache,target=/root/.cache/go-build go get -u $PONZU_GITHUB...

FROM scratch AS bin
COPY --from=build /go/bin/ /bin

Script: docker build --progress=plain --output . --platform local .

Output is folder ./bin with binary ponzu inside

I was trying to use the Dockerfile you posted here but encountered the error:

sudo docker build --progress=plain --output . --platform local . Sending build context to Docker daemon 14.23MB Error response from daemon: "local": unknown operating system or architecture: invalid argument

Is it because that I didn't set platform flag correctly? Was trying to change local to sth like linux/amd64 but it didn't work out.

@lphuctai
Copy link

Thanks you so much. I working on it and well done :D
I re-write Dockerfile in source for support everybody else can install them quickly follow this solution ^^
git clone source
Dockerfile

#syntax=docker/dockerfile:1.2
# Base our image on an official, minimal image of our preferred golang
FROM --platform=${BUILDPLATFORM} golang:1.14.3-alpine AS build

ARG TARGETOS
ARG TARGETARCH

ENV GOOS=${TARGETOS}
ENV GOARCH=${TARGETARCH}
ENV CGO_ENABLED=0

ENV GO_SRC $GOPATH/src
ENV GO_BIN $GOPATH/bin
ENV ZAPX_GITHUB github.com/blevesearch/zapx
ENV ZAPX_ROOT $GO_SRC/$ZAPX_GITHUB

RUN --mount=type=cache,target=/root/.cache/go-build apk add git
RUN --mount=type=cache,target=/root/.cache/go-build go get $ZAPX_GITHUB
WORKDIR $ZAPX_ROOT
RUN --mount=type=cache,target=/root/.cache/go-build git clone --branch v14.x https://$ZAPX_GITHUB v14
RUN --mount=type=cache,target=/root/.cache/go-build git clone --branch v13.x https://$ZAPX_GITHUB v13
RUN --mount=type=cache,target=/root/.cache/go-build git clone --branch v12.x https://$ZAPX_GITHUB v12
RUN --mount=type=cache,target=/root/.cache/go-build git clone --branch v11.x https://$ZAPX_GITHUB v11

# Note: The default golang docker image, already has the GOPATH env variable set.
# GOPATH is located at /go
ENV PONZU_GITHUB github.com/ponzu-cms/ponzu
ENV PONZU_ROOT $GO_SRC/$PONZU_GITHUB

# Consider updating package in the future. For instance ca-certificates etc.
# RUN apt-get update -qq && apt-get install -y build-essential

# Make the ponzu root directory
RUN mkdir -p $PONZU_ROOT

# All commands will be run inside of ponzu root
WORKDIR $PONZU_ROOT

# Copy the ponzu source into ponzu root.
COPY . .

# the following runs the code inside of the $GO_SRC/$PONZU_GITHUB directory
RUN --mount=type=cache,target=/root/.cache/go-build go get -u $PONZU_GITHUB...

FROM scratch AS bin
COPY --from=build /go/bin/ /bin

Script: docker build --progress=plain --output . --platform local .
Output is folder ./bin with binary ponzu inside

I was trying to use the Dockerfile you posted here but encountered the error:

sudo docker build --progress=plain --output . --platform local . Sending build context to Docker daemon 14.23MB Error response from daemon: "local": unknown operating system or architecture: invalid argument

Is it because that I didn't set platform flag correctly? Was trying to change local to sth like linux/amd64 but it didn't work out.

Sorry, I forgot mention the version and config for Docker
When I write Dockerfile, I reference to this guidline https://www.docker.com/blog/tag/go-env-series/
With enable DOCKER_BUILDKIT and Docker version Docker version 20.10.6, build 370c289

You can try this reference guidline and hope them can help you ^^

@torniker
Copy link
Contributor

after cloning the repo try following

go mod init github.com/ponzu-cms/ponzu
go mod tidy
go install ./...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests