Skip to content

Commit

Permalink
fix: update bun to 1.1.27
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenfiszel committed Sep 17, 2024
1 parent 89b5164 commit 39374d7
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 11 deletions.
6 changes: 3 additions & 3 deletions .github/DockerfileBackendTests
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ SHELL ["/bin/bash", "-c"]
RUN apt update -y
RUN apt install -y unzip curl

RUN [ "$TARGETPLATFORM" == "linux/amd64" ] && curl -Lsf https://github.com/denoland/deno/releases/download/v1.41.0/deno-x86_64-unknown-linux-gnu.zip -o deno.zip || true
RUN [ "$TARGETPLATFORM" == "linux/arm64" ] && curl -Lsf https://github.com/denoland/deno/releases/download/v1.41.0/deno-aarch64-unknown-linux-gnu.zip -o deno.zip || true
RUN [ "$TARGETPLATFORM" == "linux/amd64" ] && curl -Lsf https://github.com/denoland/deno/releases/download/v1.46.3/deno-x86_64-unknown-linux-gnu.zip -o deno.zip || true
RUN [ "$TARGETPLATFORM" == "linux/arm64" ] && curl -Lsf https://github.com/denoland/deno/releases/download/v1.46.3/deno-aarch64-unknown-linux-gnu.zip -o deno.zip || true


RUN unzip deno.zip && rm deno.zip
Expand Down Expand Up @@ -53,7 +53,7 @@ RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VER

RUN /usr/local/bin/python3 -m pip install pip-tools

COPY --from=oven/bun:1.1.8 /usr/local/bin/bun /usr/bin/bun
COPY --from=oven/bun:1.1.27 /usr/local/bin/bun /usr/bin/bun


RUN [ "$TARGETPLATFORM" == "linux/amd64" ] && curl -Lsf https://github.com/denoland/deno/releases/download/v1.41.0/deno-x86_64-unknown-linux-gnu.zip -o deno.zip || true
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ COPY --from=builder /windmill/target/release/windmill ${APP}/windmill

COPY --from=denoland/deno:1.46.3 --chmod=755 /usr/bin/deno /usr/bin/deno

COPY --from=oven/bun:1.1.25 /usr/local/bin/bun /usr/bin/bun
COPY --from=oven/bun:1.1.27 /usr/local/bin/bun /usr/bin/bun

COPY --from=php:8.3.7-cli /usr/local/bin/php /usr/bin/php
COPY --from=composer:2.7.6 /usr/bin/composer /usr/bin/composer
Expand Down
12 changes: 12 additions & 0 deletions cli/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,17 @@ const command = new Command()
.command("completions", new CompletionsCommand());

export let showDiffs = false;

let isWin: boolean | undefined = undefined;

export async function getIsWin() {
if (isWin === undefined) {
const os = await import("node:os");
isWin = os.platform() === "win32";
}
return isWin;
}

async function main() {
try {
if (Deno.args.length === 0) {
Expand All @@ -161,6 +172,7 @@ async function main() {
handlers: {
console: new log.ConsoleHandler(LOG_LEVEL, {
formatter: ({ msg }) => `${msg}`,
useColors: isWin ? false : true,
}),
},
loggers: {
Expand Down
17 changes: 14 additions & 3 deletions cli/metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import {
import { generateHash, readInlinePathSync } from "./utils.ts";
import { SyncCodebase } from "./codebase.ts";
import { FlowFile, replaceInlineScripts } from "./flow.ts";
import { getIsWin } from "./main.ts";

export async function generateAllMetadata() {}

Expand Down Expand Up @@ -169,6 +170,12 @@ export async function generateFlowLockInternal(
log.info(colors.green(`Flow ${remote_path} lockfiles updated`));
}

// on windows, when using powershell, blue is not readable
async function blueColor(): Promise<(x: string) => void> {
const isWin = await getIsWin();
return isWin ? colors.black : colors.blue;
}

export async function generateScriptMetadataInternal(
scriptPath: string,
workspace: Workspace,
Expand Down Expand Up @@ -196,7 +203,7 @@ export async function generateScriptMetadataInternal(
);
if (rawReqs) {
log.info(
colors.blue(
(await blueColor())(
`Found raw requirements (package.json/requirements.txt/composer.json) for ${scriptPath}, using it`
)
);
Expand Down Expand Up @@ -786,7 +793,9 @@ export async function parseMetadataFile(
} catch {
// no metadata file at all. Create it
log.info(
colors.blue(`Creating script metadata file for ${metadataFilePath}`)
(await blueColor())(
`Creating script metadata file for ${metadataFilePath}`
)
);
metadataFilePath = scriptPath + ".script.yaml";
let scriptInitialMetadata = defaultScriptMetadata();
Expand All @@ -800,7 +809,9 @@ export async function parseMetadataFile(

if (generateMetadataIfMissing) {
log.info(
colors.blue(`Generating lockfile and schema for ${metadataFilePath}`)
(await blueColor())(
`Generating lockfile and schema for ${metadataFilePath}`
)
);
try {
await generateScriptMetadataInternal(
Expand Down
3 changes: 1 addition & 2 deletions docker/DockerfileSlim
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ ENV TZ=Etc/UTC

RUN /usr/local/bin/python3 -m pip install pip-tools

COPY --from=oven/bun:1.1.26 /usr/local/bin/bun /usr/bin/bun
COPY --from=oven/bun:1.1.27 /usr/local/bin/bun /usr/bin/bun

# add the docker client to call docker from a worker if enabled
COPY --from=docker:dind /usr/local/bin/docker /usr/local/bin/

WORKDIR ${APP}

COPY --from=ghcr.io/windmill-labs/windmill-ee:dev --chmod=755 ${APP}/windmill ${APP}/windmill
COPY --from=denoland/deno:1.46.1 --chmod=755 /usr/bin/deno /usr/bin/deno

RUN ln -s ${APP}/windmill /usr/local/bin/windmill

Expand Down
3 changes: 1 addition & 2 deletions docker/DockerfileSlimEe
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,14 @@ ENV TZ=Etc/UTC

RUN /usr/local/bin/python3 -m pip install pip-tools

COPY --from=oven/bun:1.1.26 /usr/local/bin/bun /usr/bin/bun
COPY --from=oven/bun:1.1.27 /usr/local/bin/bun /usr/bin/bun

# add the docker client to call docker from a worker if enabled
COPY --from=docker:dind /usr/local/bin/docker /usr/local/bin/

WORKDIR ${APP}

COPY --from=ghcr.io/windmill-labs/windmill-ee:dev --chmod=755 ${APP}/windmill ${APP}/windmill
COPY --from=denoland/deno:1.46.1 --chmod=755 /usr/bin/deno /usr/bin/deno

RUN ln -s ${APP}/windmill /usr/local/bin/windmill

Expand Down

0 comments on commit 39374d7

Please sign in to comment.