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 build windows cygwin #6267

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tasks/build/archives.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = function createPackages(grunt) {
let { config } = grunt;
let { resolve } = require('path');
let { resolve, relative } = require('path');
let { execFile } = require('child_process');
let { all, fromNode } = require('bluebird');

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

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

// kibana.zip
if (/windows/.test(platform.name)) {
await exec('zip', ['-rq', '-ll', platform.zipPath, platform.buildName]);
await exec('zip', ['-rq', '-ll', relative(buildPath, platform.zipPath), platform.buildName]);
Copy link
Contributor

Choose a reason for hiding this comment

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

What zip executable are you using? AFAIK there is no zip executable bundled with windows. So when I try to run the build process in your PR, I get an ENOENT error.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You should build kibana using Cygwin. You must install all the packages used for the build (the default ones plus zip, tar and shasum).

} else {
await exec('zip', ['-rq', platform.zipPath, platform.buildName]);
await exec('zip', ['-rq', relative(buildPath, platform.zipPath), platform.buildName]);
}
};

Expand Down
5 changes: 4 additions & 1 deletion tasks/build/shasums.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
var { promisify } = require('bluebird');
var readdir = promisify(require('fs').readdir);
var exec = promisify(require('child_process').exec);
var platform = require('os').platform();
var cmd = /^win/.test(platform) ? 'sha1sum ' : 'shasum ';


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

return exec('shasum ' + archive + ' > ' + archive + '.sha1.txt', {
return exec(cmd + archive + ' > ' + archive + '.sha1.txt', {
cwd: targetDir
});
})
Expand Down
3 changes: 2 additions & 1 deletion tasks/config/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module.exports = function (grunt) {
let {resolve} = require('path');
let root = p => resolve(__dirname, '../../', p);
let binScript = /^win/.test(platform) ? '.\\bin\\kibana.bat' : './bin/kibana';
let buildedBinScript = /^win/.test(platform) ? '.\\build\\kibana\\bin\\kibana.bat' : './build/kibana/bin/kibana';
Copy link
Contributor

Choose a reason for hiding this comment

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

Please rename buildedBinScript to buildScript

let uiConfig = require(root('test/serverConfig'));

const stdDevArgs = [
Expand Down Expand Up @@ -150,7 +151,7 @@ module.exports = function (grunt) {
ready: /Optimization .+ complete/,
quiet: true
},
cmd: './build/kibana/bin/kibana',
cmd: buildedBinScript,
args: [
'--env.name=production',
'--logging.json=false',
Expand Down