Git Product home page Git Product logo

gpm's Introduction

gpm

GOPATH Mapping so you can build outside of the GOPATH

Requirements

FUSE + bindfs

MacOS has no builtin bind mounting capabilities so a FUSE + bindfs must be used.

Linux can also use the bindfs FUSE filesystem. Most likely these packages are available for your distro already and installation should be straight forward.

mount

On Linux the mount command can be used to perform the bind mounting. This however may require root privileges in order to execute mountso FUSE should be preferred.

Usage

Using the Bash functions and aliases

>>> source functions.bash
>>> gpm . github.com/hashicorp/consul make

# You can use aliases too
>>> alias gpm_consul='_gpm_aliasable github.com/hashicorp/consul'
>>> gpm_consul . make

Direct bindutil.py invocation

bindutil.py gpm . github.com/hashicorp/consul make

Internals

The binduitl.py gpm subcommand will do a few things:

  1. Create a temporary directory to store a per-command GOPATH.
  2. Bind mount the desired directory into the per-command GOPATH at <per-command GOPATH>/src/<package>
  3. Execute the command with the working directory set to the package within the new GOPATH. It also modifies the GOPATH environment variable to add the per-command GOPATH at the front of the list of directories.
  4. Unmount the bind mount.
  5. Remove the temporary directory and all its contents

gpm's People

Contributors

mkeeler avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.