Skip to content

Update lib/gdk/erb_renderer.rb

Nick Thomas requested to merge fix-erb-renderer-on-linux into master

File.rename uses the rename system call, which only works if source and destination are on the same mount point: https://www.tutorialspoint.com/unix_system_calls/rename.htm

Without this patch, I get:

lupine@gitlab-t470p:~/dev/gitlab.com/gitlab-org/gdk-ee$ rake Procfile
rake aborted!
Errno::EXDEV: Invalid cross-device link @ rb_file_s_rename - (/tmp/Procfile20190704-31964-9pnlac, Procfile)
/home/lupine/dev/gitlab.com/gitlab-org/gdk-ee/lib/gdk/erb_renderer.rb:27:in `rename'
/home/lupine/dev/gitlab.com/gitlab-org/gdk-ee/lib/gdk/erb_renderer.rb:27:in `safe_render!'
/home/lupine/dev/gitlab.com/gitlab-org/gdk-ee/Rakefile:36:in `block in <top (required)>'
Tasks: TOP => Procfile
(See full trace by running task with --trace)

$HOME is a different partition:

lupine@gitlab-t470p:~/dev/gitlab.com/gitlab-org/gdk-ee$ mount -l
/dev/mapper/gitlab--t470p--vg-root on / type ext4 (rw,relatime,errors=remount-ro)
/dev/mapper/gitlab--t470p--vg-home on /home type ext4 (rw,relatime)

It's also quite common for /tmp itself to be a tmpfs.

Merge request reports