Skip to content
This repository has been archived by the owner on Oct 17, 2024. It is now read-only.

Windows: "go get" Fails due to Path Length #37

Closed
bgshacklett opened this issue Aug 29, 2017 · 3 comments · Fixed by #51
Closed

Windows: "go get" Fails due to Path Length #37

bgshacklett opened this issue Aug 29, 2017 · 3 comments · Fixed by #51

Comments

@bgshacklett
Copy link

bgshacklett commented Aug 29, 2017

Summary:

It's currently not possible to build this project on Windows because of the length of some of the file names.

Steps to Reproduce

  1. Configure a very short $env:GOPATH:
    PS>mkdir "C:\godir"
    PS>$env:GOPATH = "C:\godir"
  2. Attempt to "go get" the project:
    PS> go get github.com/awslabs/goformation

Expected Behavior

The package should be installed successfully

Actual Behavior

An error is returned:

go build github.com/awslabs/goformation/cloudformation: C:\Go\pkg\tool\windows_amd64\compile.exe: fork/exec C:\Go\pkg\tool\windows_amd64\compile.exe: The filename or extension is too long.

Environment

Windows

PS>[Environment]::OSVersion | fl

Platform      : Win32NT
ServicePack   :
Version       : 10.0.14393.0
VersionString : Microsoft Windows NT 10.0.14393.0

Go

PS>go version
go version go1.7.4 windows/amd64

Other Notes

I understand that this is technically an issue with the Go compiler as noted in golang/go#18468, but some of the file names in /cloudformation do seem to be excessively long. E.g.:

PS> gci .\cloudformation | Where-Object { $_.Name.Length -ge 80 } | select Name

Name
----
aws-applicationautoscaling-scalingpolicy_targettrackingscalingpolicyconfigur...  
awsserverlessfunction_s3eventorsnseventorkinesiseventordynamodbeventorapieve...  
awsserverlessfunction_stringoriampolicydocumentorlistofstringorlistofiampoli...  

I'm not familiar with go generate yet, but are there, perhaps, any flags which might allow for combining these types into a smaller set of files with shorter names?

@PaulMaddox
Copy link
Contributor

I agree, the auto-generated names need rethinking. I'll take a look at this soon.

@zined
Copy link

zined commented Sep 4, 2017

this also leads to errors on a default ubuntu 17.04 installation:

zined@baz:~/foo$ git clone https://github.com/awslabs/goformation
Cloning into 'goformation'...
remote: Counting objects: 9276, done.
remote: Compressing objects: 100% (1136/1136), done.
remote: Total 9276 (delta 1135), reused 255 (delta 193), pack-reused 7947
Receiving objects: 100% (9276/9276), 3.73 MiB | 746.00 KiB/s, done.
Resolving deltas: 100% (8329/8329), done.
error: unable to create file cloudformation/awsserverlessfunction_s3eventorsnseventorkinesiseventordynamodbeventorapieventorscheduleeventorcloudwatcheventeventoriotruleeventoralexaskillevent.go: File name too long
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

zined@baz:~/foo$ 
zined@baz:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 17.04
Release:        17.04
Codename:       zesty
zined@baz:~$ getconf NAME_MAX /
255
zined@baz:~$ getconf PATH_MAX /
4096
zined@baz:~$ 

@zined
Copy link

zined commented Sep 4, 2017

this also leads to errors on a default ubuntu 17.04 installation:

ext4

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

Successfully merging a pull request may close this issue.

3 participants