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

`-s dir` says 'File name too long' #174

Closed
mblair opened this Issue Mar 19, 2012 · 14 comments

Comments

Projects
None yet
5 participants
@mblair
Contributor

mblair commented Mar 19, 2012

Sample command line:

_GIT_VER=1.7.9.4
wget http://git-core.googlecode.com/files/git-manpages-${_GIT_VER}.tar.gz
gunzip git-manpages-${_GIT_VER}.tar.gz --decompress --stdout | tar -mvxpf - --strip-components=1 -C /opt/other_src/src/git-manpages/${_GIT_VER}
cd /opt/other_src/src/git-manpages/${_GIT_VER}
fpm -s dir -t deb -a all -n git-doc -v ${_GIT_VER} --epoch 0 --iteration 1 --prefix '/usr/share/man' --url "http://www.git-scm.com" --description "The stupid content tracker." --maintainer "Matt Blair <me@matthewblair.net>" .

That gives me:

/usr/lib/ruby/1.9.1/fileutils.rb:247:in `mkdir': File name too long - /opt/other_src/src/git-manpages/package-dir-staging20120319-16844-lb37s/usr/share/man/./package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/package-dir-staging20120319-16844-lb37s/usr/share/man/1.7.9.4/man1 (Errno::ENAMETOOLONG)

But if I run fpm from one level up and use -C 1.7.9.4/ ., it works fine.

This is on a Ubuntu 12.04 Beta 1 64-bit server, fwiw.

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Mar 19, 2012

hah, hilarious. I'll take a peek

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Mar 19, 2012

Slightly modified (changed the directory, really)

_GIT_VER=1.7.9.4
wget http://git-core.googlecode.com/files/git-manpages-${_GIT_VER}.tar.gz
mkdir /tmp/git/
gunzip git-manpages-${_GIT_VER}.tar.gz --decompress --stdout | tar -mvxpf - --strip-components=1 -C /tmp/git/ 
fpm --verbose -s dir -t deb -a all -n git-doc -v ${_GIT_VER} --epoch 0 --iteration 1 -C /tmp/git --prefix '/usr/share/man' --url "http://www.git-scm.com" --description "The stupid content tracker." --maintainer "Matt Blair <me@matthewblair.net>" .

Works for me in fpm 0.4.1

One other slight change I made was that instead of this:

cd /some/path
fpm -s dir. ...

I do this:

fpm -C /some/path -s dir ...
@jordansissel

This comment has been minimized.

Owner

jordansissel commented Mar 19, 2012

Can you test 0.4.1 (available on rubygems) and let me know if this problem persists?

@mblair

This comment has been minimized.

Contributor

mblair commented Mar 19, 2012

Yep, still busted.

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Mar 20, 2012

Confirmed I can reproduce this when -C flag is not used.

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Mar 20, 2012

This probably has to do with $PWD being used internally in fpm for temp dir locations.

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Mar 20, 2012

@mblair

This comment has been minimized.

Contributor

mblair commented Mar 21, 2012

It does!

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Mar 21, 2012

woot.

I changed from using $PWD to using the default temp directory (/tmp, probably). I'll see about making a flag to set the temp directory and push out a new release.

Thanks much for testing! :)

@mblair

This comment has been minimized.

Contributor

mblair commented Mar 21, 2012

Thanks for the great software!

@jordansissel

This comment has been minimized.

Owner

jordansissel commented Mar 21, 2012

fpm 0.4.2 released with this fix.

@jonhatalla

This comment has been minimized.

jonhatalla commented Sep 6, 2013

having a similar issue with the latest version.... command is

fpm -s dir -t deb -a amd64 -C $(pwd) -v $(cat version) -n $PROJECT --prefix /srv/$PROJECT/current .

with the error (shortened....)
/usr/local/lib/ruby/gems/2.0.0/gems/fpm-0.4.2/lib/fpm/package/dir.rb:101:inlink': File name too long - (./package-dir-staging20130906-2........ging20130906-28824-mrlnfl/srv/api.companyname.com/current/package-dir-staging20130906-28824-mrlnfl/srv/api.companyname.com/current/package-dir-staging20130906-28824-mrlnfl/srv/api.companyname.com/current/package-dir-staging20130906-28824-mrlnfl/srv/api.companyname.com/current/.git/objects/pack/pack-f3dd5f49fe277d1ad0f0b2267cb265c...) (Errno::ENAMETOOLONG)`

@zahna

This comment has been minimized.

zahna commented Mar 10, 2017

To add to this thread, I just got the Errno::ENAMETOOLONG on version 1.8.1. I had "--workdir ./tmp" specified. Changing it to "--workdir $PWD/tmp" worked around the issue.

@themasterchef

This comment has been minimized.

themasterchef commented Aug 15, 2017

I am also experiencing this bug when I to use fpm in a Jenkins 2 Docker build container (for the uninitiated, Jenkins 2 containerises each job's build environment nowadays) to make an RPM.

I have tried specifying an absolute path for the workdir, tried doing a workdir of $PWD/tmp, and leaving workdir unspecified, but none of this works. I think the build container messes with the PATH or PWD in some way (though not an obvious way - PWD just gives me /var/lib/Jenkins/jobs/my-job/workspace), and this breaks FPM.

Anyone else experiencing problems with FPM + Jenkins2 + -s dir?

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