Juniper / juise

juise is the JUNOS User Interface Script Environment, which allows users to develop, test, and execute script outside of JUNOS. For more information about juise, see:
https://github.com/Juniper/juise/wiki
Other
53 stars 15 forks source link

SLAX_EXTDIR should be configurable #34

Open ilovezfs opened 8 years ago

ilovezfs commented 8 years ago

See https://github.com/Homebrew/homebrew-core/pull/865 for the motivation for this issue.

It would help with the Homebrew formula to have a configure option for the target directory into which juise's libslax extensions are installed (i.e., what is referred to as SLAX_EXTDIR in juise's build system).

Perhaps it could be called --with-libslax-extdir or something similar.

We would then be able to set --with-libslax-extdir="#{lib}/slax/extensions" (i.e., /usr/local/Cellar/juise/0.6.1/lib/slax/extensions) rather than hacking around the sandbox violation.

Currently, in order to restrict juise to its configured prefix, I am having to use the following workaround:

    inreplace "configure",
      "SLAX_EXTDIR=\"`$SLAX_CONFIG --extdir | head -1`\"",
      "SLAX_EXTDIR=\"#{lib}/slax/extensions\""

The reason this is necessary is that make install causes a sandbox violation when it attempts to install juise's slax extensions into slax-config --extdir (https://github.com/Juniper/juise/blob/master/libjuise/Makefile.am#L105-L119), which is outside of juise's prefix.

Here's how the sandbox violation looks:

==> Sandbox log
May  5 05:02:06 sandboxd[137]: rm(39316) deny file-write-unlink /usr/local/Cellar/libslax/0.20.1/lib/slax/extensions/jcs.prefix
May  5 05:02:06 sandboxd[137]: rm(39316) deny file-write-unlink /usr/local/Cellar/libslax/0.20.1/lib/slax/extensions/jcs.prefix
May  5 05:02:06 sandboxd[137]: rm(39316) deny file-write-unlink /usr/local/Cellar/libslax/0.20.1/lib/slax/extensions/http%3A%2F%2Fxml.juniper.net%2Fjunos%2Fcommit-scripts%2F1.0.ext
May  5 05:02:06 sandboxd[137]: rm(39316) deny file-write-unlink /usr/local/Cellar/libslax/0.20.1/lib/slax/extensions/http%3A%2F%2Fxml.juniper.net%2Fjunos%2Fcommit-scripts%2F1.0.ext
/Library/Developer/CommandLineTools/usr/bin/make  install-exec-hook
Install link libjuise.0.dylib -> jcs.prefix:http%3A%2F%2Fxml.juniper.net%2Fjunos%2Fcommit-scripts%2F1.0.ext ...
rm: jcs.prefix: Operation not permitted
rm: http%3A%2F%2Fxml.juniper.net%2Fjunos%2Fcommit-scripts%2F1.0.ext: Operation not permitted
make[3]: *** [install-exec-hook] Error 1
make[2]: *** [install-exec-am] Error 2
make[1]: *** [install-am] Error 2
make: *** [install-recursive] Error 1
philshafer commented 8 years ago

Will do. Thanks…..

On May 5, 2016, at 8:18 AM, ilovezfs notifications@github.com wrote:

See Homebrew/homebrew-core#865 https://github.com/Homebrew/homebrew-core/pull/865 for the motivation for this issue.

It would help with the Homebrew formula to have a configure option for the target directory into which juise's libslax extensions are installed (i.e., what is referred to as SLAX_EXTDIR in juise's build system).

Perhaps it could be called --with-libslax-extdir or something similar.

We would then be able to set --with-libslax-extdir="#{lib}/slax/extensions" (i.e., /usr/local/Cellar/juise/0.6.1/lib/slax/extensions) rather than hacking around the sandbox violation.

Currently, in order to restrict juise to its configured prefix, I am having to use the following workaround:

inreplace "configure",
  "SLAX_EXTDIR=\"`$SLAX_CONFIG --extdir | head -1`\"",
  "SLAX_EXTDIR=\"#{lib}/slax/extensions\""

The reason this is necessary is that make install causes a sandbox violation when it attempts to install juise's slax extensions into slax-config --extdir (https://github.com/Juniper/juise/blob/master/libjuise/Makefile.am#L105-L119 https://github.com/Juniper/juise/blob/master/libjuise/Makefile.am#L105-L119), which is outside of juise's prefix.

Here's how the sandbox violation looks:

==> Sandbox log May 5 05:02:06 sandboxd[137]: rm(39316) deny file-write-unlink /usr/local/Cellar/libslax/0.20.1/lib/slax/extensions/jcs.prefix May 5 05:02:06 sandboxd[137]: rm(39316) deny file-write-unlink /usr/local/Cellar/libslax/0.20.1/lib/slax/extensions/jcs.prefix May 5 05:02:06 sandboxd[137]: rm(39316) deny file-write-unlink /usr/local/Cellar/libslax/0.20.1/lib/slax/extensions/http%3A%2F%2Fxml.juniper.net%2Fjunos%2Fcommit-scripts%2F1.0.ext May 5 05:02:06 sandboxd[137]: rm(39316) deny file-write-unlink /usr/local/Cellar/libslax/0.20.1/lib/slax/extensions/http%3A%2F%2Fxml.juniper.net%2Fjunos%2Fcommit-scripts%2F1.0.ext /Library/Developer/CommandLineTools/usr/bin/make install-exec-hook Install link libjuise.0.dylib -> jcs.prefix:http%3A%2F%2Fxml.juniper.net%2Fjunos%2Fcommit-scripts%2F1.0.ext ... rm: jcs.prefix: Operation not permitted rm: http%3A%2F%2Fxml.juniper.net%2Fjunos%2Fcommit-scripts%2F1.0.ext: Operation not permitted make[3]: * [install-exec-hook] Error 1 make[2]: * [install-exec-am] Error 2 make[1]: * [install-am] Error 2 make: * [install-recursive] Error 1 — You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/Juniper/juise/issues/34