Skip to content

Change build tmp dir to support parallel builds#1338

Merged
e9gille merged 3 commits intomasterfrom
build_tmpdir
Jul 24, 2025
Merged

Change build tmp dir to support parallel builds#1338
e9gille merged 3 commits intomasterfrom
build_tmpdir

Conversation

@e9gille
Copy link
Contributor

@e9gille e9gille commented Jul 24, 2025

Fixes #1322

@e9gille e9gille requested a review from dyaandys July 24, 2025 07:47
Copy link
Contributor

@dyaandys dyaandys left a comment

Choose a reason for hiding this comment

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

My apologies Gil .. it should have been JOB_NAME.

Otherwise it looks fine.

@e9gille e9gille requested a review from dyaandys July 24, 2025 08:41
Copy link
Contributor

@dyaandys dyaandys left a comment

Choose a reason for hiding this comment

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

Hmm .. I think the issue is that the packaging tool does not like having tmp under the top level directory .. we see errors like
Error: Cannot copy '.' to a subdirectory of itself,
in the Jenkins output. So I think we'll have to back off some of the changes while we think more about this.

Can we therefore for now alter mk:

`diff --git a/mk b/mk
index 2e54a6d2..e430ad5f 100755
--- a/mk
+++ b/mk
@@ -51,11 +51,17 @@ const incl = new RegExp('^$'
const pkg = (x, y, f) => {
const version = isDyalogBuild ? process.env.APPVERSION : v;
let tmpdir;

  • if (process.env.JOB_NAME) {
  • tmpdir = ${process.env.WORKSPACE}/tmp;
  • } else {
  • tmpdir = /tmp/ridebuild_${version}_${rq('os').userInfo().username}_${process.pid};
  • }
    +// Creating tmpdir under WORKSPACE under Jenkins would be preferable, but that currently
    +// leads to errors like "Error: Cannot copy '.' to a subdirectory of itself, "
    +// so for now create tmpdir in /tmp. This code doesn't tidy up after itself so
    +// for now we'll create a per-user directory which results in just one or
    +// two tmpdirs, but avoids the permissions issues seen when using just one tmpdir
    +// if (process.env.JOB_NAME) {
    +// tmpdir = ${process.env.WORKSPACE}/tmp;
    +// } else {
    +// tmpdir = /tmp/ridebuild_${version}_${rq('os').userInfo().username}_${process.pid};
    +// }
  • tmpdir = /tmp/ridebuild_${version}_${rq('os').userInfo().username};
    rq('@electron/packager')({
    dir: '.',
    platform: x,
    `

@e9gille e9gille requested a review from dyaandys July 24, 2025 12:41
@e9gille e9gille merged commit 316fbb1 into master Jul 24, 2025
1 check passed
@e9gille e9gille deleted the build_tmpdir branch July 24, 2025 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The mk script defines tmpdir to be /tmp/ridebuild. This causes permissions problems and concurrency issues leading to failing build

2 participants