microsoft / azure-vhd-utils

Azure VHD utilities.
Other
96 stars 41 forks source link

Installation problem #56

Open DawidCh opened 5 years ago

DawidCh commented 5 years ago

Hello. During installation I have following problem:

go get github.com/Microsoft/azure-vhd-utils
    # github.com/Microsoft/azure-vhd-utils/upload
    go/src/github.com/Microsoft/azure-vhd-utils/upload/upload.go:89:34: cxt.BlobServiceClient.PutPage undefined (type storage.BlobStorageClient has no field or method PutPage)
    go/src/github.com/Microsoft/azure-vhd-utils/upload/upload.go:93:7: undefined: storage.PageWriteTypeUpdate
    # github.com/Microsoft/azure-vhd-utils/upload/metadata
    go/src/github.com/Microsoft/azure-vhd-utils/upload/metadata/metaData.go:95:32: blobClient.GetBlobMetadata undefined (type storage.BlobStorageClient has no field or method GetBlobMetadata)

My versions:

go version go1.11 linux/amd64
Distributor ID: Ubuntu
Description:    Ubuntu 18.04.1 LTS
Release:    18.04
Codename:   bionic

Could you please help? Regards, Dawid.

slcj commented 5 years ago

+1 I'm experiencing the same issue. go version go1.11.2 linux/amd64

cs-niraj-nandane commented 5 years ago

+1 I am getting same issue on CentOS 7

rahulroshan96 commented 5 years ago

+1 I am also getting the same error on Linux 4.4.0-137-generic #163-Ubuntu SMP Mon Sep 24 13:14:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

# github.com/Microsoft/azure-vhd-utils/upload
go/src/github.com/Microsoft/azure-vhd-utils/upload/upload.go:89:34: cxt.BlobServiceClient.PutPage undefined (type storage.BlobStorageClient has no field or method PutPage)
go/src/github.com/Microsoft/azure-vhd-utils/upload/upload.go:93:7: undefined: storage.PageWriteTypeUpdate
# github.com/Microsoft/azure-vhd-utils/upload/metadata
go/src/github.com/Microsoft/azure-vhd-utils/upload/metadata/metaData.go:95:32: blobClient.GetBlobMetadata undefined (type storage.BlobStorageClient has no field or method GetBlobMetadata)
aaha97 commented 5 years ago

moving the azure-vhd-utils directory from $GOPATH/src/github.com/Microsoft/ to $GOPATH/bin and performing a build from within the directory worked for me

cs-niraj-nandane commented 5 years ago

how to do that ?

tonylambiris commented 5 years ago

I was able to fix this by using the following Gopkg.toml

[[constraint]]
  name = "github.com/Azure/azure-sdk-for-go"
  revision = "d05c22dc3f9fdd2ec6e3593839fdd44df17f2de5"

[[constraint]]
  name = "github.com/Azure/azure-pipeline-go"
  revision = "f4da77e3846319876aebb41f2e6dccc6b1d7f1e0"

[[constraint]]
  name = "github.com/Azure/azure-storage-blob-go"
  revision = "fb328272929aed4cd6e5108011abe489d6e445fa"

[[constraint]]
  name = "gopkg.in/urfave/cli.v1"
  version = "1.20.0"

[prune]
  go-tests = true
  unused-packages = true

The quick steps are: 1) Clone this repo and cd into aazure-vhd-utils (make sure you're on master) 2) Run go get -v -u github.com/golang/dep/cmd/dep 3) Run dep init -v 4) Replace the generated Gopkg.toml with the snippet above 5) run dep ensure -v -update

Then you should be able to type make:

➜ make
go test ./...
?       github.com/Microsoft/azure-vhd-utils    [no test files]
?       github.com/Microsoft/azure-vhd-utils/upload [no test files]
?       github.com/Microsoft/azure-vhd-utils/upload/concurrent  [no test files]
?       github.com/Microsoft/azure-vhd-utils/upload/metadata    [no test files]
?       github.com/Microsoft/azure-vhd-utils/upload/progress    [no test files]
?       github.com/Microsoft/azure-vhd-utils/vhdcore    [no test files]
?       github.com/Microsoft/azure-vhd-utils/vhdcore/bat    [no test files]
?       github.com/Microsoft/azure-vhd-utils/vhdcore/block  [no test files]
?       github.com/Microsoft/azure-vhd-utils/vhdcore/block/bitmap   [no test files]
?       github.com/Microsoft/azure-vhd-utils/vhdcore/common [no test files]
?       github.com/Microsoft/azure-vhd-utils/vhdcore/diskstream [no test files]
?       github.com/Microsoft/azure-vhd-utils/vhdcore/footer [no test files]
?       github.com/Microsoft/azure-vhd-utils/vhdcore/header [no test files]
?       github.com/Microsoft/azure-vhd-utils/vhdcore/header/parentlocator   [no test files]
?       github.com/Microsoft/azure-vhd-utils/vhdcore/innererror [no test files]
?       github.com/Microsoft/azure-vhd-utils/vhdcore/reader [no test files]
?       github.com/Microsoft/azure-vhd-utils/vhdcore/validator  [no test files]
?       github.com/Microsoft/azure-vhd-utils/vhdcore/vhdfile    [no test files]
?       github.com/Microsoft/azure-vhd-utils/vhdcore/writer [no test files]
go build
golint ./...
vendor/gopkg.in/urfave/cli.v1/command.go:69:6: exported type CommandsByName should have comment or be unexported
vendor/gopkg.in/urfave/cli.v1/errors.go:37:6: exported type ErrorFormatter should have comment or be unexported
go fmt ./...
➜ ./azure-vhd-utils -h | head -5
NAME:
   vhd - Commands to manage VHDs

USAGE:
   azure-vhd-utils [global options] command [command options] [arguments...]
sachinktewari commented 5 years ago

The solution is simple. I am assuming you already installed go environment on your system and GOPATH and its bin is already appended in PATH. Now do the following things.

  1. Install golint using following command go get -u golang.org/x/lint/golint
  2. Clone the azure-vhd-utils to some directory and cd to azure-vhd-utils directory.
  3. Now make $ make go test ./... ? github.com/Microsoft/azure-vhd-utils [no test files] ? github.com/Microsoft/azure-vhd-utils/upload [no test files] ? github.com/Microsoft/azure-vhd-utils/upload/concurrent [no test files] ? github.com/Microsoft/azure-vhd-utils/upload/metadata [no test files] ? github.com/Microsoft/azure-vhd-utils/upload/progress [no test files] ? github.com/Microsoft/azure-vhd-utils/vhdcore [no test files] ? github.com/Microsoft/azure-vhd-utils/vhdcore/bat [no test files] ? github.com/Microsoft/azure-vhd-utils/vhdcore/block [no test files] ? github.com/Microsoft/azure-vhd-utils/vhdcore/block/bitmap [no test files] ? github.com/Microsoft/azure-vhd-utils/vhdcore/common [no test files] ? github.com/Microsoft/azure-vhd-utils/vhdcore/diskstream [no test files] ? github.com/Microsoft/azure-vhd-utils/vhdcore/footer [no test files] ? github.com/Microsoft/azure-vhd-utils/vhdcore/header [no test files] ? github.com/Microsoft/azure-vhd-utils/vhdcore/header/parentlocator [no test files] ? github.com/Microsoft/azure-vhd-utils/vhdcore/innererror [no test files] ? github.com/Microsoft/azure-vhd-utils/vhdcore/reader [no test files] ? github.com/Microsoft/azure-vhd-utils/vhdcore/validator [no test files] ? github.com/Microsoft/azure-vhd-utils/vhdcore/vhdfile [no test files] ? github.com/Microsoft/azure-vhd-utils/vhdcore/writer [no test files] go build golint ./... go fmt ./...
  4. You can find the executable in the same directory.
  5. Enjoy.
invidian commented 5 years ago

Dockerized version for anyone interested:

FROM microsoft/azure-cli

RUN apk add go --update-cache --repository http://dl-3.alpinelinux.org/alpine/edge/community/ --allow-untrusted

WORKDIR /usr/src

RUN go get -u golang.org/x/lint/golint && \
    wget https://github.com/microsoft/azure-vhd-utils/archive/master.zip && \
    unzip master.zip && \
    rm master.zip

WORKDIR /usr/src/azure-vhd-utils-master

ENV PATH="/root/go/bin:${PATH}"
RUN make && \
    cp /usr/src/azure-vhd-utils-master/azure-vhd-utils /usr/local/bin/azure-vhd-utils
stderr-to-devnull commented 3 years ago

The solution is simple. I am assuming you already installed go environment on your system and GOPATH and its bin is already appended in PATH. Now do the following things.

1. Install golint using following command
   **go get -u golang.org/x/lint/golint**

2. Clone the azure-vhd-utils to some directory and cd to azure-vhd-utils directory.

3. Now make
   $ make
   go test ./...
   ?      github.com/Microsoft/azure-vhd-utils    [no test files]
   ?      github.com/Microsoft/azure-vhd-utils/upload [no test files]
   ?      github.com/Microsoft/azure-vhd-utils/upload/concurrent  [no test files]
   ?      github.com/Microsoft/azure-vhd-utils/upload/metadata    [no test files]
   ?      github.com/Microsoft/azure-vhd-utils/upload/progress    [no test files]
   ?      github.com/Microsoft/azure-vhd-utils/vhdcore    [no test files]
   ?      github.com/Microsoft/azure-vhd-utils/vhdcore/bat    [no test files]
   ?      github.com/Microsoft/azure-vhd-utils/vhdcore/block  [no test files]
   ?      github.com/Microsoft/azure-vhd-utils/vhdcore/block/bitmap   [no test files]
   ?      github.com/Microsoft/azure-vhd-utils/vhdcore/common [no test files]
   ?      github.com/Microsoft/azure-vhd-utils/vhdcore/diskstream [no test files]
   ?      github.com/Microsoft/azure-vhd-utils/vhdcore/footer [no test files]
   ?      github.com/Microsoft/azure-vhd-utils/vhdcore/header [no test files]
   ?      github.com/Microsoft/azure-vhd-utils/vhdcore/header/parentlocator   [no test files]
   ?      github.com/Microsoft/azure-vhd-utils/vhdcore/innererror [no test files]
   ?      github.com/Microsoft/azure-vhd-utils/vhdcore/reader [no test files]
   ?      github.com/Microsoft/azure-vhd-utils/vhdcore/validator  [no test files]
   ?      github.com/Microsoft/azure-vhd-utils/vhdcore/vhdfile    [no test files]
   ?      github.com/Microsoft/azure-vhd-utils/vhdcore/writer [no test files]
   go build
   golint ./...
   go fmt ./...

4. You can find the executable in the same directory.

5. Enjoy.

Why isn't this answer placed in the INSTALLATION INSTRUCTIONS since following the current ones results in these errors:

go get github.com/Microsoft/azure-vhd-utils
# github.com/Microsoft/azure-vhd-utils/upload
src/github.com/Microsoft/azure-vhd-utils/upload/upload.go:89:34: cxt.BlobServiceClient.PutPage undefined (type storage.BlobStorageClient has no field or method PutPage)
src/github.com/Microsoft/azure-vhd-utils/upload/upload.go:93:7: undefined: storage.PageWriteTypeUpdate
# github.com/Microsoft/azure-vhd-utils/upload/metadata
src/github.com/Microsoft/azure-vhd-utils/upload/metadata/metaData.go:95:32: blobClient.GetBlobMetadata undefined (type storage.BlobStorageClient has no field or method GetBlobMetadata)

...or what dependencies need to be met before attempting to go get? ALL dependencies for main distros like Ubuntu (20.04) in my case. The installation instructions are incomplete/faulty.