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

Experiments with building binaries for macOS arm #66

Open
wants to merge 34 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3a6bee0
Try for macOS ARM binary
bruceadams Dec 1, 2020
54eb22e
Try Cirrus CI
bruceadams Mar 29, 2021
eeb94f3
Bump version to 1.1.33
bruceadams Mar 29, 2021
ac528f4
.cargo and .rustup ??
bruceadams Mar 29, 2021
79a387f
debugging
bruceadams Mar 29, 2021
9f4a5fa
break the cache
bruceadams Mar 29, 2021
8603684
Maybe getting close?
bruceadams Mar 29, 2021
70c4df8
Still need to avoid broken cache
bruceadams Mar 29, 2021
facf130
Non code change. Should hit all caches.
bruceadams Mar 29, 2021
ae14de8
Break the caches again
bruceadams Mar 29, 2021
4d80aeb
Try again for full cache hit
bruceadams Mar 29, 2021
37c0f6a
More fun with build caching
bruceadams Mar 29, 2021
8d658f3
Try again for full cache hit
bruceadams Mar 29, 2021
c65c106
Simplify caching setup
bruceadams Mar 30, 2021
6fd8d97
Quick rebuild, maybe?
bruceadams Mar 30, 2021
119a162
More caching twiddles
bruceadams Mar 30, 2021
4b0ef08
How about now? Even simpler
bruceadams Mar 30, 2021
c984f04
Getting fancy
bruceadams Mar 30, 2021
319c3b9
More better caching?
bruceadams Mar 30, 2021
2d63bab
Trivial change for cache behavor check
bruceadams Mar 30, 2021
0ae68e1
Consistently invalidate cache on new Rust version
bruceadams Mar 30, 2021
ebce5f9
Invalidate Rust cache annually
bruceadams Mar 30, 2021
8bf922d
Minor tweak to caching
bruceadams Mar 30, 2021
c0552f5
Try for Linux
bruceadams Mar 31, 2021
52e98fb
Try for MUSL on Linux
bruceadams Mar 31, 2021
ed0b372
Install more MUSL stuff
bruceadams Mar 31, 2021
4ac8ac0
Take a shot at Windows :-O
bruceadams Apr 1, 2021
5b5f0cc
Stumbling toward Windows
bruceadams Apr 1, 2021
9f8ae68
lerching toward Windows
bruceadams Apr 1, 2021
11db878
Install VSCode
bruceadams Apr 1, 2021
6696e1d
Getting close on Windows!
bruceadams Apr 1, 2021
59e38f1
Windows ARM?
bruceadams Apr 2, 2021
bd232d7
Again: arm on Windows?
bruceadams Apr 2, 2021
71c71e1
Paths on Windows
bruceadams Apr 2, 2021
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
105 changes: 105 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
macos_universal_task:
macos_instance:
image: big-sur-xcode
env:
RUST_HOME: $HOME/macos
CARGO_HOME: $RUST_HOME/cargo
RUSTUP_HOME: $RUST_HOME/rustup
PATH: $CARGO_HOME/bin:$PATH
rust_cache:
folder: $RUST_HOME
reupload_on_changes: true
fingerprint_script:
- echo $CIRRUS_OS
- date +%Y
populate_script: >
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs |
sh -s -- -y --verbose --no-modify-path --target aarch64-apple-darwin
update_script: rustup --verbose update
target_cache:
folder: target
reupload_on_changes: true
fingerprint_script:
- echo $CIRRUS_OS
- rustc --version
build_script:
- cargo build --verbose --release --target aarch64-apple-darwin
- mv target/aarch64-apple-darwin/release/yj yj.macos.aarch64
- cargo build --verbose --release --target x86_64-apple-darwin
- mv target/x86_64-apple-darwin/release/yj yj.macos.x86_64
- lipo -create -output yj.macos.universal yj.macos.aarch64 yj.macos.x86_64
- file yj.macos.universal
binary_artifacts:
path: yj.macos.*
before_cache_script: rm -f target/.rustc_info.json

linux_x68_64_task:
container:
image: rust:latest
registry_cache:
folder: $CARGO_HOME/registry
reupload_on_changes: true
fingerprint_script: date +%Y
target_cache:
folder: target
reupload_on_changes: true
fingerprint_script:
- echo $CIRRUS_OS
- rustc --version
setup_script:
- echo NOPE apt-get update
- echo NOPE apt-get --yes install musl-tools
- rustup target add x86_64-unknown-linux-musl
build_script:
- cargo build --verbose --release --target x86_64-unknown-linux-musl
- mv target/x86_64-unknown-linux-musl/release/yj yj.$CIRRUS_OS.x86_64
- file yj.$CIRRUS_OS.x86_64
- ldd yj.$CIRRUS_OS.x86_64
binary_artifacts:
path: yj.$CIRRUS_OS.*
before_cache_script: rm -f target/.rustc_info.json

windows_x86_task:
windows_container:
image: cirrusci/windowsservercore:2019
env:
RUST_HOME: C:\Users\ContainerAdministrator\rust
CARGO_HOME: $RUST_HOME\cargo
RUSTUP_HOME: $RUST_HOME\rustup
PATH: $CARGO_HOME\bin;$PATH
vs_cpp_script:
- curl -fSLo vs_buildtools.exe https://aka.ms/vs/16/release/vs_buildtools.exe
- >
vs_buildtools.exe --quiet --wait --norestart --nocache
--installPath C:\BuildTools
--add Microsoft.Component.MSBuild
--add Microsoft.VisualStudio.Component.Windows10SDK.18362
--add Microsoft.VisualStudio.Component.VC.Tools.ARM64
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64
rust_cache:
folder: $RUST_HOME
reupload_on_changes: true
fingerprint_script:
- echo %CIRRUS_OS%
- echo plusarm
- date /t
populate_script:
- curl -fSLo rustup-init.exe https://win.rustup.rs/x86_64
- rustup-init.exe -y --verbose --target aarch64-pc-windows-msvc
- del rustup-init.exe
update_script:
- rustup --verbose update
target_cache:
folder: target
reupload_on_changes: true
fingerprint_script:
- echo %CIRRUS_OS%
- rustc --version
build_script:
- cargo build --verbose --release --target aarch64-pc-windows-msvc
- move target\aarch64-pc-windows-msvc\release\yj.exe yj.%CIRRUS_OS%.aarch64.exe
- cargo build --verbose --release --target x86_64-pc-windows-msvc
- move target\x86_64-pc-windows-msvc\release\yj.exe yj.%CIRRUS_OS%.x86_64.exe
binary_artifacts:
path: yj.%CIRRUS_OS%.*
before_cache_script: del target\.rustc_info.json
73 changes: 0 additions & 73 deletions .github/workflows/release.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/rust.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "yj"
version = "1.1.30"
version = "1.1.39"
authors = ["Bruce Adams <bruce.adams@acm.org>"]
categories = ["command-line-utilities"]
description = "Command line tool that converts YAML to JSON"
Expand Down
41 changes: 20 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# YJ - YAML to JSON
![Rust](https://github.com/bruceadams/yj/workflows/Rust/badge.svg)
![Rust](https://api.cirrus-ci.com/github/bruceadams/yj.svg)

Simple command line tool to convert a YAML input file into a JSON output file.

Expand All @@ -9,34 +9,30 @@ Simple command line tool to convert a YAML input file into a JSON output file.

```bash
$ yj --help
yj 1.1.25
yj 1.1.34
Bruce Adams <bruce.adams@acm.org>
Read YAML, write JSON

USAGE:
yj.exe [FLAGS] [OPTIONS] [input]
yj [FLAGS] [OPTIONS] [input]

ARGS:
<input> Input YAML file name. Defaults to stdin

FLAGS:
-c, --compact Use compact formatting for the JSON output.
-c, --compact Use compact formatting for the JSON output
-h, --help Prints help information
-j, --json Parse the input as JSON. For most use
cases, this option makes no difference.
Valid JSON is valid YAML, so JSON input
will (should?) parse correctly even when
being handled with the YAML parser. Use
this option when you want failure (instead
of weird results) when the input is invalid
JSON.
-j, --json Parse the input as JSON. For most use cases, this option
makes no difference. Valid JSON is valid YAML, so JSON
input will (should?) parse correctly even when being
handled with the YAML parser. Use this option when you
want failure (instead of weird results) when the input is
invalid JSON
-V, --version Prints version information
-y, --yaml Format the output as YAML instead of JSON.
-y, --yaml Format the output as YAML instead of JSON

OPTIONS:
-o, --output <output>
Output file name for the JSON. Defaults to stdout.


ARGS:
<input> Input YAML file name. Defaults to stdin.
-o, --output <output> Output file name for the JSON. Defaults to stdout
```

### Installing
Expand All @@ -47,7 +43,9 @@ Local build and install with `cargo`:
$ cargo install yj
```

Prebuilt binaries are available on [Github releases](https://github.com/bruceadams/yj/releases) for 64bit x86 for Windows, Linux and macOS.
Prebuilt binaries are available on
[Github releases](https://github.com/bruceadams/yj/releases)
for 64bit x86 for Windows, Linux and macOS.

On macOS, the prebuilt binary can be installed using [Homebrew](https://brew.sh).

Expand All @@ -56,7 +54,8 @@ $ brew tap bruceadams/utilities
$ brew install yj
```

Minimal Docker images are available on [Docker Hub](https://cloud.docker.com/repository/docker/bruceadams/yj):
Minimal Docker images are available on
[Docker Hub](https://cloud.docker.com/repository/docker/bruceadams/yj):

```bash
$ docker pull bruceadams/yj
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ fn main() -> Result<(), ExitFailure> {
Ok(())
}

// Copyright 2018 Bruce Adams
// Copyright 2018—2021 Bruce Adams
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down