Skip to content

Commit b19cb6d

Browse files
author
Lee Drengenberg
committed
Merge pull request #7141 from LeeDr/fix-build-windows-cygwin
Re-applied PR 6267 to master to fix Windows/cygwin build Credit for this work goes to @repocho. Thanks for getting Windows builds working!
2 parents 1f0a452 + 82b06cd commit b19cb6d

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Please make sure you have signed the [Contributor License Agreement](http://www.
5555
npm run elasticsearch
5656
```
5757

58-
- Start the development server. _On Windows, you'll need you use Git Bash, Cygwin, or a similar shell that exposes the `sh` command._
58+
- Start the development server. _On Windows, you'll need you use Git Bash, Cygwin, or a similar shell that exposes the `sh` command. And to successfully build you'll need Cygwin optional packages zip, tar, and shasum._
5959

6060
```sh
6161
npm start

tasks/build/archives.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = function createPackages(grunt) {
22
let { config } = grunt;
3-
let { resolve } = require('path');
3+
let { resolve, relative } = require('path');
44
let { execFile } = require('child_process');
55
let { all, fromNode } = require('bluebird');
66

@@ -13,13 +13,13 @@ module.exports = function createPackages(grunt) {
1313

1414
let archives = async (platform) => {
1515
// kibana.tar.gz
16-
await exec('tar', ['-zchf', platform.tarPath, platform.buildName]);
16+
await exec('tar', ['-zchf', relative(buildPath, platform.tarPath), platform.buildName]);
1717

1818
// kibana.zip
1919
if (/windows/.test(platform.name)) {
20-
await exec('zip', ['-rq', '-ll', platform.zipPath, platform.buildName]);
20+
await exec('zip', ['-rq', '-ll', relative(buildPath, platform.zipPath), platform.buildName]);
2121
} else {
22-
await exec('zip', ['-rq', platform.zipPath, platform.buildName]);
22+
await exec('zip', ['-rq', relative(buildPath, platform.zipPath), platform.buildName]);
2323
}
2424
};
2525

tasks/build/shasums.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
var { promisify } = require('bluebird');
22
var readdir = promisify(require('fs').readdir);
33
var exec = promisify(require('child_process').exec);
4+
var platform = require('os').platform();
5+
var cmd = /^win/.test(platform) ? 'sha1sum ' : 'shasum ';
46

57
module.exports = function (grunt) {
68
grunt.registerTask('_build:shasums', function () {
@@ -11,7 +13,7 @@ module.exports = function (grunt) {
1113
// only sha the archives
1214
if (!archive.match(/\.zip$|\.tar.gz$/)) return;
1315

14-
return exec('shasum ' + archive + ' > ' + archive + '.sha1.txt', {
16+
return exec(cmd + archive + ' > ' + archive + '.sha1.txt', {
1517
cwd: targetDir
1618
});
1719
})

tasks/config/run.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ module.exports = function (grunt) {
44
let {resolve} = require('path');
55
let root = p => resolve(__dirname, '../../', p);
66
let binScript = /^win/.test(platform) ? '.\\bin\\kibana.bat' : './bin/kibana';
7+
let buildScript = /^win/.test(platform) ? '.\\build\\kibana\\bin\\kibana.bat' : './build/kibana/bin/kibana';
78
let uiConfig = require(root('test/server_config'));
89

910
const stdDevArgs = [
@@ -150,7 +151,7 @@ module.exports = function (grunt) {
150151
ready: /Optimization .+ complete/,
151152
quiet: true
152153
},
153-
cmd: './build/kibana/bin/kibana',
154+
cmd: buildScript,
154155
args: [
155156
'--env.name=production',
156157
'--logging.json=false',

0 commit comments

Comments
 (0)