Skip to content

Installing twice to the same location can cause Permission denied errors #523

@eregon

Description

@eregon

For example:
(I'm running this after my fixes for #522)

$ bin/ruby-install truffleruby-graalvm-33.0.0 --prefix /tmp/truffleruby
works fine
$ bin/ruby-install truffleruby-graalvm-33.0.0 --prefix /tmp/truffleruby
...
>>> Installing TruffleRuby GraalVM 33.0.0 ...
cp: cannot create regular file '/tmp/truffleruby/jvm/legal/jdk.sctp/LICENSE': Permission denied
cp: cannot create regular file '/tmp/truffleruby/jvm/legal/jdk.sctp/COPYRIGHT': Permission denied
cp: cannot create regular file '/tmp/truffleruby/jvm/legal/jdk.crypto.ec/LICENSE': Permission denied
cp: cannot create regular file '/tmp/truffleruby/jvm/legal/jdk.crypto.ec/COPYRIGHT': Permission denied
cp: cannot create regular file '/tmp/truffleruby/jvm/legal/jdk.incubator.vector/LICENSE': Permission denied
...

The reason is those files have -r--r--r--. permissions.

Naturally, rm -rf /tmp/truffleruby between both commands fixes it.

@postmodern What do you think would be a good solution here?

I'm thinking rm -rf $install_dir might be best, and avoid e.g. potentially mixing old and new files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions