theRAPTLab / gsgo

GEM-STEP Foundation repo migrated from GitLab June 2023
1 stars 1 forks source link

Updating Build Tools for M1 Macs #793

Closed daveseah closed 6 months ago

daveseah commented 8 months ago

While reinstalling GEMSTEP on M1 and Intel macs that had previously not had any dev environment on them, I have encountered several showstopping install bugs while following the instructions on the Wiki and in the install-helper.sh script.

This issue will capture the errors, and suggest a fix. Probably better to do this sooner than later, as the issue may effect other people attempting to install the software to evaluate it.

daveseah commented 8 months ago

M1/SONOMA: ERRORS NOTED

daveseah commented 8 months ago

INTEL/BIG SUR: ERRORS NOTED

daveseah commented 8 months ago

I'm creating a new branch dev-sri/build-update-2023 to do an update of node under the following conditions with the minimal changes needed to reliably get the repo to run without a lot of fuss.

At some point we need to update the webpack version from v4 to v5, as v4 is quite old. This includes the other plugins it is dependent on, which are many. As v5 has breaking configuration changes this is a tedious and meticulous task.

dsriseah commented 6 months ago

There is an ongoing issue importing libraries when you see this when starting up: Can't access exports in various PIXIJS related modules: image Can't find module: image

These are probably webpack issues, possibly related to pixijs having changed their library structure in older versions of pixijs which breaks compatibility. These are all related to es modules.

I could have sworn I fixed this before, but it's not in my current build or any past build I can find as of this writing. Continuing to look.

dsriseah commented 6 months ago

Searching for "webpack 4 pixijs" shows this: https://github.com/pixijs/pixijs/issues/8554#issuecomment-1237913225

dsriseah commented 6 months ago

Applying this to wp.base.config

        {
          test: /\.mjs$/,
          include: /node_modules/,
          type: 'javascript/auto'
        },

Fixes all the named export issues. However, the module-not-found errors still need resolution.

Speculation: the mjs extension is a node-js only file extension that shouldn't be an import in the pixijs library itself as it's a client-side library. I suspect this is a bug or oversight in the lib that is masked by webpack 5, which has automatic mjs support according to the comments. We are still using webpack 4.

dsriseah commented 6 months ago

To resolve module not found 'clipboard' in prism_extended.js, declaring it as external in wp.pack.webapp.js as follows:

    externals: {
      clipboard: 'ClipboardJS'
    },

resolves it. This is a script in vendor that shouldn't be processed by webpack, though I'm not sure why it is being processed now when it hasn't worked that way during active GEMSTEP development.

daveseah commented 6 months ago

Apparently this branch hasn't been functioning because it wasn't as I though merged with the latest dev, but with another older dev update with a similar auto-generated merge name.

The latest dev as of this check does have the extra checks and fixes I put in, so I am closing this issue and deleting its associated branch build-updates-2023