Skip to content

Conversation

@pastelmind
Copy link
Contributor

This PR monkey-patches Vite so that it produces identical bundles on Windows and Linux.

Vite currently has a bug that causes it to generate different bundles on Windows and Linux. This is caused by a bug in @rollup/plugin-commonjs where paths with non-OS-specific separators ('/') are not handled correctly.

I'm working on a PR to resolve the root cause. While we wait, let's monkey-patch Vite using patch-package so that we can enjoy reproducible builds today.

Closes #75

Vite currently has a bug that causes it to generate different bundles on
Windows and Linux. This is caused by a fault in @rollup/plugin-commonjs
which is bundled into Vite.

We directly fix the fault in our `node_modules/` using patch-package.
Let's hope the Rollup devs accept my PR and the fix is integrated into
Vite.

More links:

- Bug reports:
    - vitejs/vite#2623
    - rollup/plugins#923
- Related pull requests:
    - rollup/plugins#924
@pastelmind pastelmind added the type: bug Something isn't working label Jul 3, 2021
@pastelmind pastelmind requested review from a team July 3, 2021 09:46
@pastelmind pastelmind self-assigned this Jul 3, 2021
@pastelmind pastelmind merged commit 551ebe0 into main Jul 4, 2021
@pastelmind pastelmind deleted the fix-manager-reproducible-builds branch July 4, 2021 00:29
pastelmind added a commit that referenced this pull request Aug 23, 2021
Notes:

- Update Vite to 2.5.0, which fixes a bug that caused absolute paths of
  dependencies to leak into the bundle (and the sourcemap). This was
  discovered in pull request #62, investigated further in issue #75, and
  then remedied via monkeypatching Vite in PR #77.
  Now that Vite has fixed the bug, we can remove the monkeypatch.
  (`patch-package` is still needed to work with `react-virtualized`)
pastelmind added a commit that referenced this pull request Aug 23, 2021
Notes:

- Update Vite to 2.5.0, which fixes a bug that caused absolute paths of
  dependencies to leak into the bundle (and the sourcemap). This was
  discovered in pull request #62, investigated further in issue #75, and
  then remedied via monkeypatching Vite in PR #77.
  Now that Vite has fixed the bug, we can remove the monkeypatch.
  (`patch-package` is still needed to work with `react-virtualized`)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bundles generated on Windows and Linux are different

2 participants