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

file name too long repeats #364

Closed
universam1 opened this issue Dec 18, 2023 · 6 comments
Closed

file name too long repeats #364

universam1 opened this issue Dec 18, 2023 · 6 comments
Assignees
Labels
bug Something isn't working Needs: attention 👋 Standard GitHub label Issue caused by core project dependency modules or library

Comments

@universam1
Copy link

universam1 commented Dec 18, 2023

Issue #260 is not resolved yet, the error appears when run inside a container:

go: unzip /go/pkg/mod/cache/download/github.com/microsoftgraph/msgraph-beta-sdk-go/@v/v0.88.0.zip: 
open /go/pkg/mod/github.com/microsoftgraph/[email protected]/identitygovernance/entitlement_management_access_package_catalogs_item_access_package_resource_roles_item_access_package_resource_access_package_resource_scopes_item_access_package_resource_access_package_resource_roles_access_package_resource_role_item_request_builder.go: 
file name too long
@baywet
Copy link
Member

baywet commented Dec 18, 2023

Hi @universam1
Can you share a bit more about your container setup and a set of steps to reproduce the issue please?
Thanks!

@baywet baywet added question Further information is requested Needs: author feedback labels Dec 18, 2023
@universam1
Copy link
Author

universam1 commented Dec 19, 2023

Hi @baywet , thanks for checking back!

I put a simple scenario together that replicates the problem on my machine, Ubuntu 23.10 using Podman. Not sure if that holds true for Docker though.

podman run -it --rm -w /tmp golang:1.21-alpine ash -c '
mkdir /src
cd /src
cat <<EOF > go.mod
module test
go 1.21
require ()
EOF
cat <<EOF > main.go
package main

import (
	msgraphsdk "github.com/microsoftgraph/msgraph-beta-sdk-go"
	"github.com/microsoftgraph/msgraph-beta-sdk-go/models"
	"github.com/microsoftgraph/msgraph-beta-sdk-go/sites"
)

func main() {
fmt.Println("Hello, World!")
}
EOF
go mod tidy
'

That results in

go: downloading github.com/microsoftgraph/msgraph-beta-sdk-go v0.88.0
-> unzip /go/pkg/mod/cache/download/github.com/microsoftgraph/msgraph-beta-sdk-go/@v/v0.88.0.zip: open /go/pkg/mod/github.com/microsoftgraph/[email protected]/identitygovernance/entitlement_management_access_package_catalogs_item_access_package_resource_roles_item_access_package_resource_access_package_resource_scopes_item_access_package_resource_access_package_resource_roles_access_package_resource_role_item_request_builder.go: file name too long
go: test imports
        github.com/microsoftgraph/msgraph-beta-sdk-go: unzip /go/pkg/mod/cache/download/github.com/microsoftgraph/msgraph-beta-sdk-go/@v/v0.88.0.zip: open /go/pkg/mod/github.com/microsoftgraph/[email protected]/identitygovernance/entitlement_management_access_package_catalogs_item_access_package_resource_roles_item_access_package_resource_access_package_resource_scopes_item_access_package_resource_access_package_resource_roles_access_package_resource_role_item_request_builder.go: file name too long
go: test imports
        github.com/microsoftgraph/msgraph-beta-sdk-go/models: unzip /go/pkg/mod/cache/download/github.com/microsoftgraph/msgraph-beta-sdk-go/@v/v0.88.0.zip: open /go/pkg/mod/github.com/microsoftgraph/[email protected]/identitygovernance/entitlement_management_access_package_catalogs_item_access_package_resource_roles_item_access_package_resource_access_package_resource_scopes_item_access_package_resource_access_package_resource_roles_access_package_resource_role_item_request_builder.go: file name too long
go: test imports
        github.com/microsoftgraph/msgraph-beta-sdk-go/sites: unzip /go/pkg/mod/cache/download/github.com/microsoftgraph/msgraph-beta-sdk-go/@v/v0.88.0.zip: open /go/pkg/mod/github.com/microsoftgraph/[email protected]/identitygovernance/entitlement_management_access_package_catalogs_item_access_package_resource_roles_item_access_package_resource_access_package_resource_scopes_item_access_package_resource_access_package_resource_roles_access_package_resource_role_item_request_builder.go: file name too long

Hope that helps!

@baywet
Copy link
Member

baywet commented Dec 19, 2023

Thanks for the repro here.
the current limit for the file name is 251 characters

Note: that limit applies on the file name, not the whole path.

But that doesn't account for the fact that in most cases, people will already have some kind of prefix (project structure, location of package cache), for example:
/go/pkg/mod/github.com/microsoftgraph/[email protected]/identitygovernance/entitlement_management_access_package_catalogs_item_access_package_resource_roles_item_access_package_resource_access_package_resource_scopes_item_access_package_resource_access_package_resource_roles_access_package_resource_role_item_request_builder.go is 338 characters long

already 65 characters are used by the package cache conventions, also 20 characters are used by the main directory name (identitygovernance). ~85 total. With a safety margin, I'd recommend to reduce the number by 100, to 155.

With that in mind, would you be willing to submit a pull request on the generator to address this?

@baywet baywet added bug Something isn't working Standard GitHub label Issue caused by core project dependency modules or library Needs: author feedback and removed question Further information is requested Needs: attention 👋 labels Dec 19, 2023
@universam1
Copy link
Author

Thanks @baywet for your analyze, this sounds like the problem. Since I have no c# experience I would not dare to make this change, would you be able to?

@baywet
Copy link
Member

baywet commented Jan 8, 2024

@rkodev can you take this over please?

@rkodev
Copy link
Contributor

rkodev commented Jul 15, 2024

Hi @universam1, as of release 0.106.0 this issue should be resolved

@rkodev rkodev closed this as completed Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Needs: attention 👋 Standard GitHub label Issue caused by core project dependency modules or library
Projects
None yet
Development

No branches or pull requests

3 participants