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

Refactor postinstall.ts so go utilities are built at install time #5133

Closed
wants to merge 21 commits into from

Conversation

ericpromislow
Copy link
Contributor

@ericpromislow ericpromislow commented Jul 8, 2023

Fixes #5128

This is required to replace the old node paths.ts code with code that relies on rdctl without keeping a redundant fallback for when rdctl isn't found.

@ericpromislow ericpromislow marked this pull request as draft July 8, 2023 01:01
@ericpromislow ericpromislow marked this pull request as ready for review July 10, 2023 16:34
@jandubois jandubois requested review from adamkpickering and removed request for mook-as July 10, 2023 17:02
}
// If rdctl hasn't been compiled yet, we can't use it to get paths.
// Hardwire the paths for scripts (like postinstall, whcih builds rdctl).

Check failure

Code scanning / check-spelling

Unrecognized Spelling

[whcih](#security-tab) is not a recognized word. \(unrecognized-spelling\)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In draft mode because bats tests were failing on an unknown version...

@ericpromislow ericpromislow force-pushed the 5128-refactor-postinstall branch 2 times, most recently from 71ec012 to c7c1119 Compare July 10, 2023 19:21
@ericpromislow ericpromislow marked this pull request as draft July 10, 2023 19:31
@ericpromislow ericpromislow marked this pull request as ready for review July 10, 2023 20:07
@ericpromislow ericpromislow marked this pull request as draft July 10, 2023 20:42
@ericpromislow ericpromislow marked this pull request as ready for review July 10, 2023 21:23
This is so the renderer process can import definitions and
not worry about executing any code. In particular, importing
`utils/paths.ts` runs the code that sets up the paths and
this code can't be run in the renderer process.

Signed-off-by: Eric Promislow <epromislow@suse.com>
Signed-off-by: Eric Promislow <epromislow@suse.com>
Signed-off-by: Eric Promislow <epromislow@suse.com>
…n error.

Signed-off-by: Eric Promislow <epromislow@suse.com>
Signed-off-by: Eric Promislow <epromislow@suse.com>
Signed-off-by: Eric Promislow <epromislow@suse.com>
Signed-off-by: Eric Promislow <epromislow@suse.com>
Signed-off-by: Eric Promislow <epromislow@suse.com>
…h no other dependencies.

The problem is that some of the postinstall code was loading the logger,
which was loading `utils/paths.ts`, which depended on finding a working `rdctl`.

The first part of the solution is to build `rdctl` earlier and install it in a location where
the `paths.ts` code expects to find it.

The second part is to break up `postinstall.ts` into two parts, and use the simple-spawner
to execute each part, so we don't hit the logger or the paths.ts module until we're ready to.

Signed-off-by: Eric Promislow <epromislow@suse.com>
Signed-off-by: Eric Promislow <epromislow@suse.com>
Signed-off-by: Eric Promislow <epromislow@suse.com>
Signed-off-by: Eric Promislow <epromislow@suse.com>
This is because `spawnFile` depends on `paths.ts` to get logs,
and in `scripts/` files we can't count on having `rdctl` for
the `getPaths` routine.

Signed-off-by: Eric Promislow <epromislow@suse.com>
Signed-off-by: Eric Promislow <epromislow@suse.com>
Signed-off-by: Eric Promislow <epromislow@suse.com>
Signed-off-by: Eric Promislow <epromislow@suse.com>
Signed-off-by: Eric Promislow <epromislow@suse.com>
Signed-off-by: Eric Promislow <epromislow@suse.com>
Signed-off-by: Eric Promislow <epromislow@suse.com>
Signed-off-by: Eric Promislow <epromislow@suse.com>
And drop the legacy-integration stuff.
Also we can now happily import CURRENT_SETTINGS_VERSION from a defn/constant-only settings.ts.

Signed-off-by: Eric Promislow <epromislow@suse.com>
@ericpromislow ericpromislow changed the title 5128 refactor postinstall Refactor postinstall.ts so go utilities are built at install time Jul 14, 2023
@ericpromislow ericpromislow marked this pull request as draft July 14, 2023 18:12
@ericpromislow
Copy link
Contributor Author

This branch got mangled during rebase.

@ericpromislow ericpromislow deleted the 5128-refactor-postinstall branch August 8, 2023 23:51
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.

Refactor postinstall to remove dependency on RD packages
1 participant