denji / homebrew-nginx

:fire_engine: Community NGINX tap for custom modules

Home Page:https://denji.github.io/homebrew-nginx/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot install nginx-full --with-mruby-module

chriscarpenter12 opened this issue · comments

Indicate troubleshooting steps taken

  • Ran brew update and retried your prior step?
  • Ran brew doctor, fixed as many issues as possible and retried your prior step?
  • Checked that a similar issue hasn't already been filed?
  • Looked up the software bug tracker if reporting a build error?
  • If you're seeing permission errors tried running sudo chown -R $(whoami) $(brew --prefix)?

Bug reports / build errors:

brew install nginx-full --with-mruby-module
==> Installing nginx-full from homebrew/nginx
==> Installing dependencies for homebrew/nginx/nginx-full: mruby-nginx-module
==> Installing homebrew/nginx/nginx-full dependency: mruby-nginx-module
==> Downloading https://github.com/matsumoto-r/ngx_mruby/archive/v1.20.0.tar.gz
Already downloaded: /Users/chris/Library/Caches/Homebrew/mruby-nginx-module-1.20.0.tar.gz
Warning: This keg was marked linked already, continuing anyway
🍺  /usr/local/Cellar/mruby-nginx-module/1.20.0: 512 files, 4MB, built in 1 second
==> Installing homebrew/nginx/nginx-full --with-mruby-module
==> Downloading https://nginx.org/download/nginx-1.12.1.tar.gz
Already downloaded: /Users/chris/Library/Caches/Homebrew/nginx-full-1.12.1.tar.gz
==> git init
Last 15 lines from /Users/chris/Library/Logs/Homebrew/nginx-full/01.git:
2017-08-08 10:16:25 -0400

git
init

/usr/local/Cellar/mruby-nginx-module/1.20.0/share/mruby-nginx-module/.git: Operation not permitted

READ THIS: https://docs.brew.sh/Troubleshooting.html

These open issues may also help:
Compiler error when installing nginx-full ---with-upload-module https://github.com/Homebrew/homebrew-nginx/issues/304
building nginx-full with healthcheck module giving error https://github.com/Homebrew/homebrew-nginx/issues/263

Brief summary of issue:

Seems to have an issue initializing git in the directory?...

The complete command that you issued:

nginx-full --with-mruby-module

Gist with output of brew doctor:

Link output by brew gist-logs <formula>:

Output of brew config:

https://gist.github.com/chriscarpenter12/442504f6d1ea2f1fae281436185394d5

If I try going directly to /usr/local/Cellar/mruby-nginx-module/1.20.0/share/mruby-nginx-module I can run a git init manually.

Try to install again and get a different error:

brew install nginx-full --with-mruby-module
==> Installing nginx-full from homebrew/nginx
==> Downloading https://nginx.org/download/nginx-1.12.1.tar.gz
Already downloaded: /Users/chris/Library/Caches/Homebrew/nginx-full-1.12.1.tar.gz
==> git init
Last 15 lines from /Users/chris/Library/Logs/Homebrew/nginx-full/01.git:
2017-08-08 10:21:41 -0400

git
init

error: could not lock config file /usr/local/Cellar/mruby-nginx-module/1.20.0/share/mruby-nginx-module/.git/config: Operation not permitted
fatal: could not set 'core.repositoryformatversion' to '0'

READ THIS: https://docs.brew.sh/Troubleshooting.html

These open issues may also help:
Compiler error when installing nginx-full ---with-upload-module https://github.com/Homebrew/homebrew-nginx/issues/304
building nginx-full with healthcheck module giving error https://github.com/Homebrew/homebrew-nginx/issues/263

Seems to have an issue setting a line in the git config file. Ok, lets check:

cat /usr/local/Cellar/mruby-nginx-module/1.20.0/share/mruby-nginx-module/.git/config
[core]
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
	ignorecase = true
	precomposeunicode = true

repositoryformatversion = 0 is already set to 0.

Not sure what else to try here. Any help is appreciated.

I have encountered the same problem. This may be because now homebrew build is executed within a sandbox, using sandbox-exec.
The error occurs because the git command here tries to write or modify files in mruby-nginx-module directory, which is not allowed to write within the sandbox, even though you can write files under the only explicitly allowed directories within a sandbox.
You can see the detail with --verbose and --debug option.

The possible workaround to handle this is to use --no-sandbox option...

The no-sandbox option doesn't work for me.

error: could not lock config file /usr/local/Cellar/mruby-nginx-module/1.20.0/share/mruby-nginx-module/.git/config: Operation not permitted
fatal: could not set 'core.repositoryformatversion' to '0'

lsattr -d /usr/local/Cellar/mruby-nginx-module/*/share/mruby-nginx-module/.git{,/*}

/cc @matsumotory

The no-sandbox option doesn't work for me.

It'll fixed by #324.
The sandbox-exec issue continues. Recent ngx_mruby contains mruby src so git files modifications is not required but nginx-full Formula writes mruby-nginx-modules Formula's dir, out of its dir. See also https://github.com/Homebrew/brew/blob/master/Library/Homebrew/formula_installer.rb#L696-L700.

I think these Formula's need any mechanism allows write operations from other Formula...

commented

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.