Change:
The consul-ui packages currently fails to build on 18.03 and master. On 18.03, applying the following patch causes the build to succeed: however, on master, it fails with: I've tried various things including using different versions of ruby and bundler, but none have solved the issue.

Discussion:
gem "uglifier" gem "sass" <del> gem "therubyracer" </del>

GEM remote: https://rubygems.org/ specs: <del> execjs (2.3.0) json (1.8.2) libv8 (3.16.14.11) ref (1.0.5) sass (3.4.11) therubyracer (0.12.1) libv8 (~> 3.16.14.0) ref uglifier (2.7.0) execjs (>= 0.3.0) json (>= 1.8.0) </del> <ins> execjs (2.7.0) ffi (1.9.23) rb-fsevent (0.10.3) rb-inotify (0.9.10) ffi (>= 0.5.0, < 2) sass (3.5.6) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) uglifier (4.1.10) execjs (>= 0.3.0, < 3) </ins> PLATFORMS ruby DEPENDENCIES sass <del> therubyracer </del> uglifier <ins> BUNDLED WITH 1.14.6 </ins>

{ execjs = { <del> version = "2.3.0"; </del> source = { <ins> remotes = ["https://rubygems.org"]; sha256 = "1yz55sf2nd3l666ms6xr18sm2aggcvmb8qr3v53lr4rir32y1yp1"; </ins> type = "gem"; <del> sha256 = "097v02bhmzc70j7n0yyf8j0z5wms88zcmgpmggby4hnvqxf41y1h"; </del> }; <ins> version = "2.7.0"; </ins> }; <del> json = { version = "1.8.2"; </del> <ins> ffi = { </ins> source = { <ins> remotes = ["https://rubygems.org"]; sha256 = "0zw6pbyvmj8wafdc7l5h7w20zkp1vbr2805ql5d941g2b20pk4zr"; </ins> type = "gem"; <del> sha256 = "0zzvv25vjikavd3b1bp6lvbgj23vv9jvmnl4vpim8pv30z8p6vr5"; </del> }; <ins> version = "1.9.23"; </ins> }; <del> libv8 = { version = "3.16.14.11"; </del> <ins> rb-fsevent = { </ins> source = { <ins> remotes = ["https://rubygems.org"]; sha256 = "1lm1k7wpz69jx7jrc92w3ggczkjyjbfziq5mg62vjnxmzs383xx8"; </ins> type = "gem"; <del> sha256 = "000vbiy78wk5r1f6p7qncab8ldg7qw5pjz7bchn3lw700gpaacxp"; </del> }; <ins> version = "0.10.3"; </ins> }; <del> ref = { version = "1.0.5"; </del> <ins> rb-inotify = { dependencies = ["ffi"]; </ins> source = { <ins> remotes = ["https://rubygems.org"]; sha256 = "0yfsgw5n7pkpyky6a9wkf1g9jafxb0ja7gz0qw0y14fd2jnzfh71"; </ins> type = "gem"; <del> sha256 = "19qgpsfszwc2sfh6wixgky5agn831qq8ap854i1jqqhy1zsci3la"; </del> }; <ins> version = "0.9.10"; </ins> }; sass = { <del> version = "3.4.11"; </del> <ins> dependencies = ["sass-listen"]; </ins> source = { <ins> remotes = ["https://rubygems.org"]; sha256 = "19wyzp9qsg8hdkkxlsv713w0qmy66qrdp0shj42587ssx4qhrlag"; </ins> type = "gem"; <del> sha256 = "10dncnv7g5v8d1xpw2aaarxjjlm68f7nm02ns2kl8nf3yxi6wzdf"; </del> }; <ins> version = "3.5.6"; </ins> }; <del> therubyracer = { version = "0.12.1"; </del> <ins> sass-listen = { dependencies = ["rb-fsevent" "rb-inotify"]; </ins> source = { <ins> remotes = ["https://rubygems.org"]; sha256 = "0xw3q46cmahkgyldid5hwyiwacp590zj2vmswlll68ryvmvcp7df"; </ins> type = "gem"; <del> sha256 = "106fqimqyaalh7p6czbl5m2j69z8gv7cm10mjb8bbb2p2vlmqmi6"; </del> }; <del> dependencies = [ "libv8" "ref" ]; </del> <ins> version = "4.0.0"; </ins> }; uglifier = { <del> version = "2.7.0"; </del> <ins> dependencies = ["execjs"]; </ins> source = { <ins> remotes = ["https://rubygems.org"]; sha256 = "0dycp9c5xiricla6sgvg0vf22i3axs5k1v1607dvl7nv1xkkaczi"; </ins> type = "gem"; <del> sha256 = "1x1mnakx086l83a3alj690c6n8kfmb4bk243a6m6yz99s15gbxfq"; </del> }; <del> dependencies = [ "execjs" "json" ]; </del> <ins> version = "4.1.10"; </ins> }; <del> } </del> <ins> } </ins>  No newline at end of file

<ins> diff --git a/ui/scripts/dist.sh b/ui/scripts/dist.sh index 0ad6e28e..db340da0 100755 --- a/ui/scripts/dist.sh +++ b/ui/scripts/dist.sh @@ -15,10 +15,9 @@ DEPLOY="../pkg/web_ui" rm -rf $DEPLOY mkdir -p $DEPLOY -bundle check >/dev/null 2>&1 || bundle install -bundle exec sass styles/base.scss static/base.css +sass styles/base.scss static/base.css -bundle exec ruby scripts/compile.rb +ruby scripts/compile.rb # Copy into deploy shopt -s dotglob </ins>

<del> { stdenv, consul, ruby, bundlerEnv, zip }: </del> <ins> { stdenv, consul, ruby, bundlerEnv, zip, nodejs }: </ins> let # `sass` et al

src = consul.src; <del> buildInputs = [ ruby gems zip ]; </del> <ins> buildInputs = [ ruby gems zip nodejs ]; </ins> <del> patchPhase = "patchShebangs ./ui/scripts/dist.sh"; </del> <ins> patches = [ ./ui-no-bundle-exec.patch ]; postPatch = "patchShebangs ./ui/scripts/dist.sh"; </ins> buildPhase = '' # Build ui static files