Skip to content

Commit 8cf52d8

Browse files
Remove build functionality, make install work with prebuilt tarballs only
Co-authored-by: thetayloredman <26350849+thetayloredman@users.noreply.github.com>
1 parent de0b1cf commit 8cf52d8

9 files changed

Lines changed: 216 additions & 201 deletions

File tree

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ SRCS = src/main.c \
1515
src/build.c \
1616
src/toolchains.c \
1717
src/update_check.c \
18-
src/cmds/build_cmds.c \
1918
src/cmds/env_cmds.c \
2019
src/cmds/install_cmds.c \
2120
src/cmds/internal_cmds.c \

README.md

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -126,30 +126,18 @@ source <(zircon env)
126126

127127
## Usage
128128

129-
### Build a Zirco Toolchain
129+
### Install a Zirco Toolchain
130130

131-
Build the latest version from the main branch:
132-
133-
```bash
134-
zircon build main
135-
```
136-
137-
Build a specific version (tag):
138-
139-
```bash
140-
zircon build v0.1.0
141-
```
142-
143-
Build from a specific branch:
131+
Install the latest nightly release:
144132

145133
```bash
146-
zircon build feat-145
134+
zircon install nightly
147135
```
148136

149-
Build from a custom repository:
137+
Install a specific version (tag):
150138

151139
```bash
152-
zircon build --zrc-repo https://github.com/SomeFork/zrc main
140+
zircon install v0.1.0
153141
```
154142

155143
### Switch Between Toolchains

src/cli.c

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
#include "cli.h"
2-
#include "cmds/build_cmds.h"
32
#include "cmds/env_cmds.h"
43
#include "cmds/install_cmds.h"
54
#include "cmds/internal_cmds.h"
65
#include "cmds/self_cmds.h"
76
#include "cmds/toolchain_cmds.h"
87

98
static void print_usage(const char* prog) {
10-
printf("Zircon %s - The Zircon toolchain installer and build tool\n\n", ZIRCON_VERSION);
9+
printf("Zircon %s - The Zircon toolchain installer\n\n", ZIRCON_VERSION);
1110
printf("Usage: %s [OPTIONS] <COMMAND>\n\n", prog);
1211
printf("Commands:\n");
1312
printf(" self <SUBCOMMAND> Commands to manage Zircon itself\n");
14-
printf(" build <reference> Build a specific version of zrc\n");
15-
printf(" install [tag] Install pre-built toolchains\n");
13+
printf(" install [tag] Install pre-built toolchains (default: nightly)\n");
1614
printf(" import <archive> Import a toolchain from an archive\n");
1715
printf(" switch <version> Switch to a different toolchain version\n");
1816
printf(" list List installed toolchains\n");
@@ -76,16 +74,6 @@ cli_context_t* parse_args(int argc, char** argv) {
7674
free(ctx);
7775
return NULL;
7876
}
79-
} else if (strcmp(cmd, "build") == 0) {
80-
ctx->command = CMD_BUILD;
81-
if (argc < 3) {
82-
fprintf(stderr, "Error: 'build' requires a reference argument\n");
83-
free(ctx);
84-
return NULL;
85-
}
86-
ctx->data.build_cmd.reference = string_duplicate(argv[2]);
87-
ctx->data.build_cmd.repo_url = string_duplicate("https://github.com/zirco-lang/zrc.git");
88-
/* TODO: Parse --zrc-repo flag */
8977
} else if (strcmp(cmd, "install") == 0) {
9078
ctx->command = CMD_INSTALL;
9179
ctx->data.install_cmd.tag = argc > 2 ? string_duplicate(argv[2]) : string_duplicate("nightly");
@@ -154,10 +142,6 @@ void free_cli_context(cli_context_t* ctx) {
154142
SAFE_FREE(ctx->data.self_cmd.archive);
155143
SAFE_FREE(ctx->data.self_cmd.tag);
156144
break;
157-
case CMD_BUILD:
158-
SAFE_FREE(ctx->data.build_cmd.reference);
159-
SAFE_FREE(ctx->data.build_cmd.repo_url);
160-
break;
161145
case CMD_INSTALL:
162146
SAFE_FREE(ctx->data.install_cmd.tag);
163147
break;
@@ -186,8 +170,6 @@ int dispatch_command(cli_context_t* ctx) {
186170
switch (ctx->command) {
187171
case CMD_SELF:
188172
return dispatch_self_command(ctx);
189-
case CMD_BUILD:
190-
return dispatch_build_command(ctx);
191173
case CMD_INSTALL:
192174
return dispatch_install_command(ctx);
193175
case CMD_IMPORT:

src/cli.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
/* Command types */
77
typedef enum {
88
CMD_SELF,
9-
CMD_BUILD,
109
CMD_INSTALL,
1110
CMD_IMPORT,
1211
CMD_SWITCH,
@@ -38,10 +37,6 @@ typedef struct {
3837
char* archive;
3938
char* tag;
4039
} self_cmd;
41-
struct {
42-
char* reference;
43-
char* repo_url;
44-
} build_cmd;
4540
struct {
4641
char* tag;
4742
} install_cmd;

src/cmds/build_cmds.c

Lines changed: 0 additions & 144 deletions
This file was deleted.

src/cmds/build_cmds.h

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)