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

Fix a regression which stopped Ruby from building #547

Merged
merged 1 commit into from
Dec 13, 2021

Conversation

ollietreend
Copy link
Contributor

This change fixes a regression in filesystem permissions introduced in #539, which stopped ruby-build from being able to build the Ruby version required by rbenv.

After #539 was merged, we started seeing the following error message when building the Whitehall and Content Publisher apps:

ruby-build: TMPDIR=/tmp cannot hold executables (partition possibly mounted with `noexec`)

The error was triggered by running make whitehall or make content-publisher to re-build the app's docker image. However it also dependended on the docker cache being empty, because otherwise the required Ruby version would already exist in a cached image layer and wouldn't need to be re-installed.

The cause for the error was the new tmpfs volume which was mounted at /tmp. By default, docker-compose mounts tmpfs volumes with the noexec flag, which means that files inside the /tmp directory cannot be executed. But ruby-build needs to execute files in /tmp in order to build Ruby.

This change re-enables execution of files inside /tmp by including the exec flag on the tmpfs volume mount.

This change fixes a regression in filesystem permissions introduced in #539, which stopped `ruby-build` from being able to build the Ruby version required by `rbenv`.

After #539 was merged, we started seeing the following error message when building the Whitehall and Content Publisher apps:

```
ruby-build: TMPDIR=/tmp cannot hold executables (partition possibly mounted with `noexec`)
```

The error was triggered by running `make whitehall` or `make content-publisher` to re-build the app's docker image. However it also dependended on the docker cache being empty, because otherwise the required Ruby version would already exist in a cached image layer and wouldn't need to be re-installed.

The cause for the error was the new `tmpfs` volume which was mounted at `/tmp`. By default, `docker-compose` mounts `tmpfs` volumes with the `noexec` flag, which means that files inside the `/tmp` directory cannot be executed. But `ruby-build` needs to execute files in `/tmp` in order to build Ruby.

This change re-enables execution of files inside `/tmp` by including the `exec` flag on the `tmpfs` volume mount.
Copy link
Contributor

@beccapearce beccapearce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@ollietreend ollietreend merged commit 830c1af into main Dec 13, 2021
@ollietreend ollietreend deleted the fix-tmp-permissions branch December 13, 2021 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants