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

feat(ports)!: rustup, rust, cargobi #36

Merged
merged 21 commits into from
Feb 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
301 changes: 279 additions & 22 deletions .ghjk/deno.lock

Large diffs are not rendered by default.

439 changes: 433 additions & 6 deletions .ghjk/lock.json

Large diffs are not rendered by default.

19 changes: 11 additions & 8 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_dispatch:

env:
DENO_VERSION: "1.39.0"
DENO_VERSION: "1.40.2"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GHJK_LOG_PANIC_LEVEL: error

Expand All @@ -18,6 +18,8 @@ jobs:
e2eType: "docker"
- os: macos-latest
e2eType: "local"
- os: macos-14
e2eType: "local"
# - os: windows-latest
# e2eType: "local"
env:
Expand All @@ -28,13 +30,14 @@ jobs:
with:
deno-version: ${{ env.DENO_VERSION }}

- if: "${{ matrix.os == 'macos-latest' }}"
run: brew install fish zsh
- if: "${{ matrix.os == 'macos-latest' || matrix.os == 'macos-14' }}"
# we need coreutils on max for the `timeout` command
run: brew install fish zsh coreutils
- name: Cache deno dir
if: "${{ matrix.os == 'macos-latest' }}"
if: "${{ matrix.os == 'macos-latest' || matrix.os == 'macos-14' }}"
uses: actions/cache@v4
with:
path: ${{ env.DENO_DIR }}
path: ${{ env.GHJK_DENO_DIR }}
key: deno-mac-${{ hashFiles('**/deno.lock') }}

- if: "${{ matrix.e2eType == 'docker' }}"
Expand All @@ -50,12 +53,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: metatypedev/setup-ghjk@v1
- uses: metatypedev/setup-ghjk@32fe7ad4eab41d5e62189208afa6fe17112a5563
with:
installer-url: ./install.ts
env:
GHJK_CONFIG: ./examples/protoc/ghjk.ts
GHJKFILE: ./examples/protoc/ghjk.ts
- run: |
cd examples/protoc
. $(dirname $BASH_ENV)/env.bash
. $(ghjk print share-dir-path)/env.sh
protoc --version
10 changes: 6 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- ready_for_review

env:
DENO_VERSION: "1.39.0"
DENO_VERSION: "1.40.2"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GHJK_LOG: debug
GHJK_LOG_PANIC_LEVEL: error
Expand Down Expand Up @@ -40,6 +40,8 @@ jobs:
e2eType: "docker"
- os: macos-latest
e2eType: "local"
- os: macos-14
e2eType: "local"
# - os: windows-latest
# e2eType: "local"
env:
Expand All @@ -50,11 +52,11 @@ jobs:
with:
deno-version: ${{ env.DENO_VERSION }}

- if: "${{ matrix.os == 'macos-latest' }}"
- if: "${{ matrix.os == 'macos-latest' || matrix.os == 'macos-14' }}"
# we need coreutils on max for the `timeout` command
run: brew install fish zsh coreutils
- name: Cache deno dir
if: "${{ matrix.os == 'macos-latest' }}"
if: "${{ matrix.os == 'macos-latest' || matrix.os == 'macos-14' }}"
uses: actions/cache@v4
with:
path: ${{ env.GHJK_DENO_DIR }}
Expand All @@ -73,7 +75,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: metatypedev/setup-ghjk@a4453d20156edde8e1c9b19784f8188a36b3bf23
- uses: metatypedev/setup-ghjk@32fe7ad4eab41d5e62189208afa6fe17112a5563
with:
installer-url: ./install.ts
env:
Expand Down
6 changes: 4 additions & 2 deletions deno.jsonc
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"tasks": {
"test": "GHJK_LOG=debug deno test --fail-fast --parallel --unstable -A tests/*",
"test": "GHJK_LOG=debug deno test --parallel --unstable-worker-options --unstable-kv -A tests/*",
"cache": "deno cache deps/*",
"check": "deno run -A check.ts"
},
"fmt": {
"exclude": ["**/*.md"]
"exclude": [
"**/*.md"
]
},
"lint": {
"exclude": [
Expand Down
579 changes: 293 additions & 286 deletions deno.lock

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions deps/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
//! and located close to their users

export { z as zod } from "https://deno.land/x/[email protected]/mod.ts";
export * as semver from "https://deno.land/std@0.205.0/semver/mod.ts";
export * as std_log from "https://deno.land/std@0.205.0/log/mod.ts";
export * as std_log_levels from "https://deno.land/std@0.205.0/log/levels.ts";
export * as std_fmt_colors from "https://deno.land/std@0.205.0/fmt/colors.ts";
export * as std_url from "https://deno.land/std@0.205.0/url/mod.ts";
export * as std_path from "https://deno.land/std@0.205.0/path/mod.ts";
export * as std_fs from "https://deno.land/std@0.205.0/fs/mod.ts";
export * as dax from "https://deno.land/x/dax@0.35.0/mod.ts";
export * as semver from "https://deno.land/std@0.213.0/semver/mod.ts";
export * as std_log from "https://deno.land/std@0.213.0/log/mod.ts";
export * as std_log_levels from "https://deno.land/std@0.213.0/log/levels.ts";
export * as std_fmt_colors from "https://deno.land/std@0.213.0/fmt/colors.ts";
export * as std_url from "https://deno.land/std@0.213.0/url/mod.ts";
export * as std_path from "https://deno.land/std@0.213.0/path/mod.ts";
export * as std_fs from "https://deno.land/std@0.213.0/fs/mod.ts";
export * as dax from "https://deno.land/x/dax@0.38.0/mod.ts";
export * as jsonHash from "https://deno.land/x/[email protected]/mod.ts";
export { default as deep_eql } from "https://deno.land/x/[email protected]/index.js";
3 changes: 2 additions & 1 deletion deps/dev.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
//! dependencies used by tests

export * from "./common.ts";
export * as std_assert from "https://deno.land/[email protected]/assert/mod.ts";
export * as std_assert from "https://deno.land/[email protected]/assert/mod.ts";
export * as std_async from "https://deno.land/[email protected]/async/mod.ts";
6 changes: 3 additions & 3 deletions deps/ports.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

export * from "./common.ts";
export { Foras } from "https://deno.land/x/[email protected]/src/deno/mod.ts";
export * as std_tar from "https://deno.land/std@0.129.0/archive/tar.ts";
export * as std_streams from "https://deno.land/std@0.129.0/streams/mod.ts";
export * as std_io from "https://deno.land/std@0.129.0/io/mod.ts";
export * as std_untar from "https://deno.land/std@0.213.0/archive/untar.ts";
export * as std_streams from "https://deno.land/std@0.213.0/streams/mod.ts";
export * as std_io from "https://deno.land/std@0.213.0/io/mod.ts";
export * as jszip from "https://deno.land/x/[email protected]/mod.ts";
10 changes: 5 additions & 5 deletions ghjk.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export { ghjk } from "./mod.ts";
import * as ghjk from "./mod.ts";
import { act, cpy_bs, pipi, protoc, temporal_cli } from "./ports/mod.ts";
import * as ports from "./ports/mod.ts";

ghjk
.task("greet", {
Expand All @@ -12,7 +12,7 @@ ghjk
const ha = ghjk
.task("ha", {
installs: [
protoc(),
ports.protoc(),
],
env: { STUFF: "stuffier" },
async fn({ $ }) {
Expand Down Expand Up @@ -59,9 +59,9 @@ ghjk.install();

// these are used for developing ghjk
ghjk.install(
act(),
pipi({ packageName: "pre-commit" })[0],
cpy_bs({ releaseTag: "20231002" }),
ports.act(),
ports.pipi({ packageName: "pre-commit" })[0],
ports.cpy_bs({ releaseTag: "20231002" }),
);

export const secureConfig = ghjk.secureConfig({
Expand Down
2 changes: 1 addition & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -e -u
GHJK_VERSION="${GHJK_VERSION:-v0.1.0-alpha}"
GHJK_INSTALLER_URL="${GHJK_INSTALLER_URL:-https://raw.github.com/metatypedev/ghjk/$GHJK_VERSION/install.ts}"
GHJK_SHARE_DIR="${GHJK_SHARE_DIR:-$HOME/.local/share/ghjk}"
DENO_VERSION="${DENO_VERSION:-v1.38.5}"
DENO_VERSION="${DENO_VERSION:-v1.40.2}"

# make sure the version is prepended with v
if [ "${DENO_VERSION#"v"}" = "$DENO_VERSION" ]; then
Expand Down
10 changes: 3 additions & 7 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type {
PortsModuleSecureConfig,
} from "./modules/ports/types.ts";
import logger from "./utils/logger.ts";
import { $, defaultCommandBuilder, getPortRef } from "./utils/mod.ts";
import { $, defaultCommandBuilder, thinInstallConfig } from "./utils/mod.ts";
import * as std_ports from "./modules/ports/std.ts";
import * as cpy from "./ports/cpy_bs.ts";
import * as node from "./ports/node.ts";
Expand Down Expand Up @@ -132,13 +132,9 @@ export function stdDeps(args = { enableRuntimes: false }) {
node.default(),
cpy.default(),
].map((fatInst) => {
const { port, ...liteInst } = fatInst;
return portsValidators.allowedPortDep.parse({
manifest: port,
defaultInst: {
portRef: getPortRef(port),
...liteInst,
},
manifest: fatInst.port,
defaultInst: thinInstallConfig(fatInst),
});
}),
);
Expand Down
66 changes: 0 additions & 66 deletions modules/ports/cargo-binstall.ts

This file was deleted.

12 changes: 12 additions & 0 deletions modules/ports/std.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import { manifest as man_node_org } from "../../ports/node.ts";
import { manifest as man_pnpm_ghrel } from "../../ports/pnpm.ts";
import { manifest as man_asdf_plugin_git } from "../../ports/asdf_plugin_git.ts";
import { manifest as man_cpy_bs_ghrel } from "../../ports/cpy_bs.ts";
import { manifest as man_rustup_rustlang } from "../../ports/rustup.ts";
import { manifest as man_rust_rustup } from "../../ports/rust.ts";
import { getPortRef } from "../../utils/mod.ts";

const aaPorts: PortManifest[] = [
Expand All @@ -26,6 +28,8 @@ const aaPorts: PortManifest[] = [
];

const denoPorts: PortManifest[] = [
man_rustup_rustlang,
man_rust_rustup,
man_cbin_ghrel,
man_pnpm_ghrel,
man_asdf_plugin_git,
Expand Down Expand Up @@ -71,6 +75,14 @@ export const curl_aa = Object.freeze({
name: man_curl_aa.name,
} as PortDep);

export const rustup_rustlang = Object.freeze({
name: man_rustup_rustlang.name,
} as PortDep);

export const rust_rustup = Object.freeze({
name: man_rust_rustup.name,
} as PortDep);

export const cbin_ghrel = Object.freeze({
name: man_cbin_ghrel.name,
} as PortDep);
Expand Down
2 changes: 1 addition & 1 deletion modules/ports/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ async function resolveAndInstall(
const stageArgs = {
installId,
installPath: std_path.resolve(scx.installsPath, installId),
downloadPath: std_path.resolve(scx.installsPath, installId),
downloadPath: std_path.resolve(scx.downloadsPath, installId),
tmpPath: scx.tmpPath,
config: config,
manifest,
Expand Down
29 changes: 0 additions & 29 deletions ports/cargo-insta.ts

This file was deleted.

Loading
Loading