Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Building oauth2_proxy #592

Closed
jgn opened this issue May 14, 2018 · 5 comments
Closed

Building oauth2_proxy #592

jgn opened this issue May 14, 2018 · 5 comments

Comments

@jgn
Copy link

jgn commented May 14, 2018

@ploxiln suggests for building:

  1. install the "dep" tool from https://github.com/golang/dep (download a stand-alone binary from Releases, put it somewhere in your PATH e.g. /usr/local/bin/, name it dep, make it executable)
  2. checkout the oauth2_proxy repo into your GOPATH, e.g. git clone https://github.com/bitly/oauth2_proxy $HOME/go/src/github.com/bitly/oauth2_proxy
  3. cd into that repo
  4. run dep ensure
  5. run go build
  6. the result is a single stand-alone binary named oauth2_proxy

But there seem to be issues with the dependencies on a pretty vanilla go environment:

$ # cloned to $HOME/src/oauth2_proxy
$ export GOPATH=$HOME
$ cd $GOPATH/src/oauth2_proxy
$ dep ensure
Warning: the following project(s) have [[constraint]] stanzas in Gopkg.toml:

  ✗  github.com/18F/hmacauth

However, these projects are not direct dependencies of the current project:
they are not imported in any .go files, nor are they in the 'required' list in
Gopkg.toml. Dep only applies [[constraint]] rules to direct dependencies, so
these rules will have no effect.

Either import/require packages from these projects so that they become direct
dependencies, or convert each [[constraint]] to an [[override]] to enforce rules
on these projects, if they happen to be transitive dependencies,

Solving failure: No versions of gopkg.in/fsnotify.v1 met constraints:
	v1.2.11: unable to update checked out version: fatal: reference is not a tree: 836bfd95fecc0f1511dd66bdbf2b5b61ab8b00b6
: command failed: [git checkout 836bfd95fecc0f1511dd66bdbf2b5b61ab8b00b6]: exit status 128
@jgn
Copy link
Author

jgn commented May 14, 2018

A colleague @wm notes: https://github.com/go-fsnotify/fsnotify and "Change your dependencies from github.com/go-fsnotify/fsnotify to github.com/fsnotify/fsnotify"

@jgn
Copy link
Author

jgn commented May 16, 2018

Alright . . . that seems to have compiled and accepts the newer options (--provider oidc, --oidc-issuer-url)

@jgn
Copy link
Author

jgn commented May 16, 2018

$ git diff origin/master
diff --git a/Gopkg.lock b/Gopkg.lock
index 5a3758a..1294a90 100644
--- a/Gopkg.lock
+++ b/Gopkg.lock
@@ -131,7 +131,7 @@
   version = "v1.0.0"

 [[projects]]
-  name = "gopkg.in/fsnotify.v1"
+  name = "gopkg.in/fsnotify/fsnotify.v1"
   packages = ["."]
   revision = "836bfd95fecc0f1511dd66bdbf2b5b61ab8b00b6"
   version = "v1.2.11"
@@ -149,6 +149,6 @@
 [solve-meta]
   analyzer-name = "dep"
   analyzer-version = 1
-  inputs-digest = "b502c41a61115d14d6379be26b0300f65d173bdad852f0170d387ebf2d7ec173"
+  inputs-digest = "cfdd05348394cd0597edb858bdba5681665358a963356ed248d98f39373c33b5"
   solver-name = "gps-cdcl"
   solver-version = 1
diff --git a/Gopkg.toml b/Gopkg.toml
index c4005e1..422bd43 100644
--- a/Gopkg.toml
+++ b/Gopkg.toml
@@ -4,7 +4,7 @@
 #

 [[constraint]]
-  name = "github.com/18F/hmacauth"
+  name = "github.com/mbland/hmacauth"
   version = "~1.0.1"

 [[constraint]]
@@ -36,7 +36,7 @@
   name = "google.golang.org/api"

 [[constraint]]
-  name = "gopkg.in/fsnotify.v1"
+  name = "gopkg.in/fsnotify/fsnotify.v1"
   version = "~1.2.0"

 [[constraint]]
diff --git a/watcher.go b/watcher.go
index bedb9f8..9888fe5 100644
--- a/watcher.go
+++ b/watcher.go
@@ -8,7 +8,7 @@ import (
        "path/filepath"
        "time"

-       "gopkg.in/fsnotify.v1"
+       "gopkg.in/fsnotify/fsnotify.v1"
 )

 func WaitForReplacement(filename string, op fsnotify.Op,

@jgn jgn closed this as completed May 16, 2018
@sporkmonger
Copy link

Should this have been closed?

kautsig added a commit to kautsig/oauth2_proxy that referenced this issue Jun 1, 2018
@kautsig
Copy link

kautsig commented Jun 1, 2018

Nope, don't think so. Just bumped into the same issue. The diff provided by @jgn works though. See PR above.

hensur pushed a commit to hensur/oauth2_proxy that referenced this issue Jun 6, 2018
EricEllett pushed a commit to segmentio/oauth2_proxy that referenced this issue Jun 18, 2018
day0ops added a commit to day0ops/oauth2_proxy that referenced this issue Jul 24, 2018
Adjust build to moved/changed upstream dependencies, fixes bitly#592
simeonlamhk01 added a commit to hk01-digital/oauth2_proxy that referenced this issue Aug 8, 2018
Adjust build to moved/changed upstream dependencies, fixes bitly#592
simeonlamhk01 added a commit to hk01-digital/oauth2_proxy that referenced this issue Aug 8, 2018
Adjust build to moved/changed upstream dependencies, fixes bitly#592
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants