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

Generated user branches can be too long #139

Closed
n-raymond opened this issue Jul 13, 2022 · 2 comments · Fixed by #141
Closed

Generated user branches can be too long #139

n-raymond opened this issue Jul 13, 2022 · 2 comments · Fixed by #141

Comments

@n-raymond
Copy link

n-raymond commented Jul 13, 2022

As per https://github.com/ocaml-opam/opam-publish/blob/master/src/publishSubmit.ml#L44, a generated user branch is created by concatenating each package concerned by the publication.

Publishing many packages at once can then result in creating a very long branch name / Pull Request title. This can lead to side effects depending on the file system the root directory is located, as certain file systems can't use filenames that exceed a certain size (for instance, ext4 or eCryptfs).

For example, using eCryptfs myself, I got the following error:

> opam publish "https://gitlab.com/nomadic-labs/resto/-/archive/v0.10/resto-v0.10.tar.gz" .

The following will be published:
  - resto version 0.10 with opam file at /home/pixel/Documents/Projects/NomadicLabs/resto/resto.opam
    archive at https://gitlab.com/nomadic-labs/resto/-/archive/v0.10/resto-v0.10.tar.gz
  - resto-json version 0.10 with opam file at /home/pixel/Documents/Projects/NomadicLabs/resto/resto-json.opam
    archive at https://gitlab.com/nomadic-labs/resto/-/archive/v0.10/resto-v0.10.tar.gz
  - resto-directory version 0.10 with opam file at
    /home/pixel/Documents/Projects/NomadicLabs/resto/resto-directory.opam
    archive at https://gitlab.com/nomadic-labs/resto/-/archive/v0.10/resto-v0.10.tar.gz
  - resto-cohttp version 0.10 with opam file at /home/pixel/Documents/Projects/NomadicLabs/resto/resto-cohttp.opam
    archive at https://gitlab.com/nomadic-labs/resto/-/archive/v0.10/resto-v0.10.tar.gz
  - resto-cohttp-server version 0.10 with opam file at
    /home/pixel/Documents/Projects/NomadicLabs/resto/resto-cohttp-server.opam
    archive at https://gitlab.com/nomadic-labs/resto/-/archive/v0.10/resto-v0.10.tar.gz
  - resto-cohttp-self-serving-client version 0.10 with opam file at
    /home/pixel/Documents/Projects/NomadicLabs/resto/resto-cohttp-self-serving-client.opam
    archive at https://gitlab.com/nomadic-labs/resto/-/archive/v0.10/resto-v0.10.tar.gz
  - resto-cohttp-client version 0.10 with opam file at
    /home/pixel/Documents/Projects/NomadicLabs/resto/resto-cohttp-client.opam
    archive at https://gitlab.com/nomadic-labs/resto/-/archive/v0.10/resto-v0.10.tar.gz
  - resto-acl version 0.10 with opam file at /home/pixel/Documents/Projects/NomadicLabs/resto/resto-acl.opam
    archive at https://gitlab.com/nomadic-labs/resto/-/archive/v0.10/resto-v0.10.tar.gz


You will be shown the patch before submitting.
Please confirm the above data. Continue ?  [Y/n] y
Fetching the package repository, this may take a while...
[ERROR] Uncaught exception: "/usr/bin/git fetch --multiple origin user" exited with code 1 "error: could not fetch
        user"
        
> cd ~/.opam/plugins/opam-publish/repos/ocaml%opam-repository/

> git fetch --multiple origin user
Fetching origin
Fetching user
error: cannot lock ref 'refs/remotes/user/opam-publish-resto-resto-acl-resto-cohttp-resto-cohttp-client-resto-cohttp-self-serving-client-resto-cohttp-server-resto-directory-resto-json.0.9': Unable to create '/home/pixel/.opam/plugins/opam-publish/repos/ocaml%opam-repository/.git/refs/remotes/user/opam-publish-resto-resto-acl-resto-cohttp-resto-cohttp-client-resto-cohttp-self-serving-client-resto-cohttp-server-resto-directory-resto-json.0.9.lock': File name too long
From github.com:n-raymond/opam-repository
 ! [new branch]            opam-publish-resto-resto-acl-resto-cohttp-resto-cohttp-client-resto-cohttp-self-serving-client-resto-cohttp-server-resto-directory-resto-json.0.9 -> user/opam-publish-resto-resto-acl-resto-cohttp-resto-cohttp-client-resto-cohttp-self-serving-client-resto-cohttp-server-resto-directory-resto-json.0.9  (unable to update local ref)
error: could not fetch user

It would be good to rethink this behavior to ensure branch names will not exceed a reasonable length.

@rjbou
Copy link
Contributor

rjbou commented Nov 8, 2022

Completely agree, I have the same issue with opam :)

@kit-ty-kate
Copy link
Contributor

#141 should fix this

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

Successfully merging a pull request may close this issue.

3 participants