-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
ci[minor]: Start building on windows #6188
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
import { Command } from "commander"; | ||
import { rollup } from "rollup"; | ||
import { rollup } from "@rollup/wasm-node"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rollup
does not work the same on windows, see here
@@ -27,6 +28,50 @@ async function asyncSpawn(command: string, args: string[]) { | |||
}); | |||
} | |||
|
|||
const deleteFolderRecursive = async function (inputPath: string) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleting directories on windows does not act the same as mac. Need this recursive func to manage deleting directories w/ contents.
@@ -16,6 +16,7 @@ async function asyncSpawn(command: string, args: string[]) { | |||
...process.env, | |||
NODE_OPTIONS: "--max-old-space-size=4096", | |||
}, | |||
shell: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Required for windows
if (process.platform === "win32") { | ||
// windows, must resolve path with file:// | ||
langchainConfigPath = `file:///${langchainConfigPath}`; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can not import modules (langchain.config.js
) on windows with the protocol d:
Full error:
Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'd:'
rimraf("dist"), | ||
rimraf(".turbo"), | ||
deleteFolderRecursive("dist").catch((e) => { | ||
console.error("Error removing dist (pre && shouldGenMaps)"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added logs to make debugging a little easier
// Required for cross-platform compatibility. | ||
// Windows does not manage globs the same as Max/Linux when deleting directories. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like the comment says...
@@ -43,3 +43,20 @@ jobs: | |||
uses: | |||
./.github/workflows/test-exports.yml | |||
secrets: inherit | |||
|
|||
platform-compatibility: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will now try and build @langchain/core
on windows, macos and ubuntu.
Fixes build when running on windows
Renames build script (npm deals with
:
in a funny way for scripts)Added CI test for building
@langchain/core
in macos, windows and ubuntu