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

Invalid Homebrew formula #1

Closed
messense opened this issue Jul 12, 2021 · 5 comments
Closed

Invalid Homebrew formula #1

messense opened this issue Jul 12, 2021 · 5 comments

Comments

@messense
Copy link

messense commented Jul 12, 2021

❯ brew tap "rhysd/actionlint" "https://github.com/rhysd/actionlint"
==> Tapping rhysd/actionlint
Cloning into '/opt/homebrew/Library/Taps/rhysd/homebrew-actionlint'...
remote: Enumerating objects: 2103, done.
remote: Counting objects: 100% (768/768), done.
remote: Compressing objects: 100% (317/317), done.
remote: Total 2103 (delta 429), reused 705 (delta 411), pack-reused 1335
Receiving objects: 100% (2103/2103), 6.70 MiB | 736.00 KiB/s, done.
Resolving deltas: 100% (1206/1206), done.
Error: Invalid formula: /opt/homebrew/Library/Taps/rhysd/homebrew-actionlint/HomebrewFormula/actionlint.rb
formulae require at least a URL
Error: Cannot tap rhysd/actionlint: invalid syntax in tap!
❯ brew --version
Homebrew 3.2.1-70-g5659d74
Homebrew/homebrew-core (git revision 4e3ff58f97; last commit 2021-07-12)
Homebrew/homebrew-cask (git revision 59f1985d26; last commit 2021-07-12)
@messense
Copy link
Author

Ah, I'm on M1 Mac, looks like there are no binary releases for Apple Silicon yet.

@rhysd
Copy link
Owner

rhysd commented Jul 12, 2021

Thanks for reporting.

Unfortunately, M1 Mac pre-built binary is not supported yet because I don't have environment to confirm the behavior. If you already have Go installed, would you install it from source?

go install github.com/rhysd/actionlint/cmd/actionlint@latest
$(go env GOPATH)/bin/actionlint -h

I need to mention that on documentation. And I will consider to add pre-built binary for M1 Mac on release.

@messense
Copy link
Author

It works.

❯ go install github.com/rhysd/actionlint/cmd/actionlint@latest
go: downloading github.com/rhysd/actionlint v1.4.0
go: downloading github.com/fatih/color v1.12.0
go: downloading github.com/mattn/go-colorable v0.1.8
go: downloading github.com/mattn/go-runewidth v0.0.13
go: downloading github.com/robfig/cron v1.2.0
go: downloading golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
go: downloading gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b
go: downloading github.com/mattn/go-isatty v0.0.12
go: downloading golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae
go: downloading github.com/rivo/uniseg v0.2.0

❯ $(go env GOPATH)/bin/actionlint -h
Usage: actionlint [FLAGS] [FILES...] [-]

  actionlint is a linter for GitHub Actions workflow files.

  To check all YAML files in current repository, just run actionlint without
  arguments. It automatically finds the nearest '.github/workflows' directory:

    $ actionlint

  To check specific files, pass the file paths as arguments:

    $ actionlint file1.yaml file2.yaml

  To check content which is not saved in file yet (e.g. output from some
  command), pass - argument. It reads stdin and checks it as workflow file:

    $ actionlint -

Configuration:

  Configuration file can be put at:

    .github/actionlint.yaml
    .github/actionlint.yml

  Please generate default configuration file and check comments in the file for
  more details.

    $ actionlint -init-config

Flags:
  -color
    	Always enable colorful output. This is useful to force colorful outputs
  -config-file string
    	File path to config file
  -debug
    	Enable debug output (for development)
  -ignore value
    	Regular expression matching to error messages you want to ignore. This flag is repeatable
  -init-config
    	Generate default config file at .github/actionlint.yaml in current project
  -no-color
    	Disable colorful output
  -oneline
    	Use one line per one error. Useful for reading error messages from programs
  -pyflakes string
    	Command name or file path of "pyflakes" external command (default "pyflakes")
  -shellcheck string
    	Command name or file path of "shellcheck" external command (default "shellcheck")
  -verbose
    	Enable verbose output
  -version
    	Show version and how this binary was installed

@rhysd
Copy link
Owner

rhysd commented Jul 12, 2021

Thank you for confirming that. I'll consider to add pre-built binary for darwin/arm64 from next release.

@rhysd
Copy link
Owner

rhysd commented Jul 12, 2021

Now pre-built binary for darwin/arm64 is included in v1.4.1 release. Homebrew should work on M1 Mac. Closing.

https://github.com/rhysd/actionlint/releases/tag/v1.4.1

@rhysd rhysd closed this as completed Jul 12, 2021
rhysd added a commit that referenced this issue Jul 15, 2021
I confirmed that this change does not affect performance:

```
Benchmark #1: ./actionlint.before testdata/examples/*.yaml
  Time (mean ± σ):     273.0 ms ±  13.4 ms    [User: 494.8 ms, System: 3874.5 ms]
  Range (min … max):   250.4 ms … 291.4 ms    10 runs

  Warning: Ignoring non-zero exit code.

Benchmark #2: ./actionlint.after testdata/examples/*.yaml
  Time (mean ± σ):     270.3 ms ±   3.5 ms    [User: 506.7 ms, System: 3737.0 ms]
  Range (min … max):   264.0 ms … 277.4 ms    10 runs

  Warning: Ignoring non-zero exit code.

Summary
  './actionlint.after testdata/examples/*.yaml' ran
    1.01 ± 0.05 times faster than './actionlint.before testdata/examples/*.yaml'
```
rhysd added a commit that referenced this issue Jul 15, 2021
I confirmed this does not affect performance:

```
Benchmark #1: ./actionlint.before testdata/examples/*.yaml
  Time (mean ± σ):     272.8 ms ±  12.2 ms    [User: 500.7 ms, System: 3702.6 ms]
  Range (min … max):   261.6 ms … 304.9 ms    10 runs

  Warning: Ignoring non-zero exit code.
  Warning: The first benchmarking run for this command was significantly slower than the rest (304.9 ms). This could be caused by (filesystem) caches that were not filled until after the first run. You should consider using the '--warmup' option to fill those caches before the actual benchmark. Alternatively, use the '--prepare' option to clear the caches before each timing run.

Benchmark #2: ./actionlint.after testdata/examples/*.yaml
  Time (mean ± σ):     273.0 ms ±  17.5 ms    [User: 489.2 ms, System: 3670.7 ms]
  Range (min … max):   260.1 ms … 310.1 ms    10 runs

  Warning: Ignoring non-zero exit code.
  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet PC without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.

Summary
  './actionlint.before testdata/examples/*.yaml' ran
    1.00 ± 0.08 times faster than './actionlint.after testdata/examples/*.yaml'
```
rhysd pushed a commit that referenced this issue Jul 16, 2021
Add musl support for alpine
rhysd added a commit that referenced this issue Jul 17, 2021
by making goroutine per process. This makes many goroutines, but number
of them at the same time is bounded to number of CPUs. This approach may
introduce additional overhead of creating/deleting goroutines. But as
far as checking the benchmarks, it is as efficient as or slightly more
efficient than previous implementation. This might happen due to channel
overhead.

- Previous implementation (with mocking running process)

```
goos: darwin
goarch: amd64
pkg: github.com/rhysd/actionlint
cpu: Intel(R) Core(TM) i9-10910 CPU @ 3.60GHz
BenchmarkLintWorkflows/small-1-20                  14172             83750 ns/op           32274 B/op        482 allocs/op
BenchmarkLintWorkflows/small-3-20                   8744            133699 ns/op           95600 B/op       1433 allocs/op
BenchmarkLintWorkflows/small-10-20                  4669            251667 ns/op          316652 B/op       4750 allocs/op
BenchmarkLintWorkflows/small-shellcheck-1-20                8743            126736 ns/op           35104 B/op        532 allocs/op
BenchmarkLintWorkflows/small-shellcheck-3-20                6404            181138 ns/op          104130 B/op       1585 allocs/op
BenchmarkLintWorkflows/small-shellcheck-10-20               2337            497045 ns/op          347283 B/op       5273 allocs/op
BenchmarkLintWorkflows/large-shellcheck-1-20                1831            656964 ns/op          224186 B/op       4529 allocs/op
BenchmarkLintWorkflows/large-shellcheck-3-20                 949           1262167 ns/op          672339 B/op      13584 allocs/op
BenchmarkLintWorkflows/large-shellcheck-10-20                283           4220101 ns/op         2240366 B/op      45258 allocs/op
PASS
ok      github.com/rhysd/actionlint     12.409s
```

- This commit (with mocking running process)

```
goos: darwin
goarch: amd64
pkg: github.com/rhysd/actionlint
cpu: Intel(R) Core(TM) i9-10910 CPU @ 3.60GHz
BenchmarkLintWorkflows/small-1-20                  14246             83775 ns/op           32162 B/op        481 allocs/op
BenchmarkLintWorkflows/small-3-20                   8832            133214 ns/op           95495 B/op       1432 allocs/op
BenchmarkLintWorkflows/small-10-20                  4738            250377 ns/op          316532 B/op       4749 allocs/op
BenchmarkLintWorkflows/small-shellcheck-1-20                8955            121658 ns/op           35030 B/op        531 allocs/op
BenchmarkLintWorkflows/small-shellcheck-3-20                6835            173217 ns/op          104112 B/op       1583 allocs/op
BenchmarkLintWorkflows/small-shellcheck-10-20               2593            459949 ns/op          347263 B/op       5269 allocs/op
BenchmarkLintWorkflows/large-shellcheck-1-20                2109            562768 ns/op          225346 B/op       4526 allocs/op
BenchmarkLintWorkflows/large-shellcheck-3-20                1353            880209 ns/op          677864 B/op      13603 allocs/op
BenchmarkLintWorkflows/large-shellcheck-10-20                482           2528021 ns/op         2282275 B/op      45760 allocs/op
PASS
ok      github.com/rhysd/actionlint     12.238s
```

- Ref: `hyperfine` results

```
Benchmark #1: ./actionlint.before testdata/bench/many_scripts.yaml
  Time (mean ± σ):       3.7 ms ±   0.4 ms    [User: 2.8 ms, System: 1.5 ms]
  Range (min … max):     3.2 ms …   5.3 ms    406 runs

  Warning: Command took less than 5 ms to complete. Results might be inaccurate.
  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet PC without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.

Benchmark #2: ./actionlint.after testdata/bench/many_scripts.yaml
  Time (mean ± σ):       3.6 ms ±   0.4 ms    [User: 2.5 ms, System: 1.4 ms]
  Range (min … max):     3.2 ms …   5.5 ms    489 runs

  Warning: Command took less than 5 ms to complete. Results might be inaccurate.
  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet PC without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.

Summary
  './actionlint.after testdata/bench/many_scripts.yaml' ran
    1.04 ± 0.17 times faster than './actionlint.before testdata/bench/many_scripts.yaml'
```
rhysd added a commit that referenced this issue Jul 17, 2021
by making goroutine per process. This makes many goroutines, but number
of them at the same time is bounded to number of CPUs. This approach may
introduce additional overhead of creating/deleting goroutines. But as
far as checking the benchmarks, it is as efficient as or slightly more
efficient than previous implementation. This might happen due to channel
overhead.

- Previous implementation (with mocking running process)

```
goos: darwin
goarch: amd64
pkg: github.com/rhysd/actionlint
cpu: Intel(R) Core(TM) i9-10910 CPU @ 3.60GHz
BenchmarkLintWorkflows/small-1-20                  14172             83750 ns/op           32274 B/op        482 allocs/op
BenchmarkLintWorkflows/small-3-20                   8744            133699 ns/op           95600 B/op       1433 allocs/op
BenchmarkLintWorkflows/small-10-20                  4669            251667 ns/op          316652 B/op       4750 allocs/op
BenchmarkLintWorkflows/small-shellcheck-1-20                8743            126736 ns/op           35104 B/op        532 allocs/op
BenchmarkLintWorkflows/small-shellcheck-3-20                6404            181138 ns/op          104130 B/op       1585 allocs/op
BenchmarkLintWorkflows/small-shellcheck-10-20               2337            497045 ns/op          347283 B/op       5273 allocs/op
BenchmarkLintWorkflows/large-shellcheck-1-20                1831            656964 ns/op          224186 B/op       4529 allocs/op
BenchmarkLintWorkflows/large-shellcheck-3-20                 949           1262167 ns/op          672339 B/op      13584 allocs/op
BenchmarkLintWorkflows/large-shellcheck-10-20                283           4220101 ns/op         2240366 B/op      45258 allocs/op
PASS
ok      github.com/rhysd/actionlint     12.409s
```

- This commit (with mocking running process)

```
goos: darwin
goarch: amd64
pkg: github.com/rhysd/actionlint
cpu: Intel(R) Core(TM) i9-10910 CPU @ 3.60GHz
BenchmarkLintWorkflows/small-1-20                  14246             83775 ns/op           32162 B/op        481 allocs/op
BenchmarkLintWorkflows/small-3-20                   8832            133214 ns/op           95495 B/op       1432 allocs/op
BenchmarkLintWorkflows/small-10-20                  4738            250377 ns/op          316532 B/op       4749 allocs/op
BenchmarkLintWorkflows/small-shellcheck-1-20                8955            121658 ns/op           35030 B/op        531 allocs/op
BenchmarkLintWorkflows/small-shellcheck-3-20                6835            173217 ns/op          104112 B/op       1583 allocs/op
BenchmarkLintWorkflows/small-shellcheck-10-20               2593            459949 ns/op          347263 B/op       5269 allocs/op
BenchmarkLintWorkflows/large-shellcheck-1-20                2109            562768 ns/op          225346 B/op       4526 allocs/op
BenchmarkLintWorkflows/large-shellcheck-3-20                1353            880209 ns/op          677864 B/op      13603 allocs/op
BenchmarkLintWorkflows/large-shellcheck-10-20                482           2528021 ns/op         2282275 B/op      45760 allocs/op
PASS
ok      github.com/rhysd/actionlint     12.238s
```

- Ref: `hyperfine` results

```
Benchmark #1: ./actionlint.before testdata/bench/many_scripts.yaml
  Time (mean ± σ):       3.7 ms ±   0.4 ms    [User: 2.8 ms, System: 1.5 ms]
  Range (min … max):     3.2 ms …   5.3 ms    406 runs

  Warning: Command took less than 5 ms to complete. Results might be inaccurate.
  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet PC without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.

Benchmark #2: ./actionlint.after testdata/bench/many_scripts.yaml
  Time (mean ± σ):       3.6 ms ±   0.4 ms    [User: 2.5 ms, System: 1.4 ms]
  Range (min … max):     3.2 ms …   5.5 ms    489 runs

  Warning: Command took less than 5 ms to complete. Results might be inaccurate.
  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet PC without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.

Summary
  './actionlint.after testdata/bench/many_scripts.yaml' ran
    1.04 ± 0.17 times faster than './actionlint.before testdata/bench/many_scripts.yaml'
```
rhysd added a commit that referenced this issue Jul 17, 2021
by making goroutine per process. This makes many goroutines, but number
of them at the same time is bounded to number of CPUs. This approach may
introduce additional overhead of creating/deleting goroutines. But as
far as checking the benchmarks, it is as efficient as or slightly more
efficient than previous implementation. This might happen due to channel
overhead.

- Previous implementation (with mocking running process)

```
goos: darwin
goarch: amd64
pkg: github.com/rhysd/actionlint
cpu: Intel(R) Core(TM) i9-10910 CPU @ 3.60GHz
BenchmarkLintWorkflows/small-1-20                  14172             83750 ns/op           32274 B/op        482 allocs/op
BenchmarkLintWorkflows/small-3-20                   8744            133699 ns/op           95600 B/op       1433 allocs/op
BenchmarkLintWorkflows/small-10-20                  4669            251667 ns/op          316652 B/op       4750 allocs/op
BenchmarkLintWorkflows/small-shellcheck-1-20                8743            126736 ns/op           35104 B/op        532 allocs/op
BenchmarkLintWorkflows/small-shellcheck-3-20                6404            181138 ns/op          104130 B/op       1585 allocs/op
BenchmarkLintWorkflows/small-shellcheck-10-20               2337            497045 ns/op          347283 B/op       5273 allocs/op
BenchmarkLintWorkflows/large-shellcheck-1-20                1831            656964 ns/op          224186 B/op       4529 allocs/op
BenchmarkLintWorkflows/large-shellcheck-3-20                 949           1262167 ns/op          672339 B/op      13584 allocs/op
BenchmarkLintWorkflows/large-shellcheck-10-20                283           4220101 ns/op         2240366 B/op      45258 allocs/op
PASS
ok      github.com/rhysd/actionlint     12.409s
```

- This commit (with mocking running process)

```
goos: darwin
goarch: amd64
pkg: github.com/rhysd/actionlint
cpu: Intel(R) Core(TM) i9-10910 CPU @ 3.60GHz
BenchmarkLintWorkflows/small-1-20                  14246             83775 ns/op           32162 B/op        481 allocs/op
BenchmarkLintWorkflows/small-3-20                   8832            133214 ns/op           95495 B/op       1432 allocs/op
BenchmarkLintWorkflows/small-10-20                  4738            250377 ns/op          316532 B/op       4749 allocs/op
BenchmarkLintWorkflows/small-shellcheck-1-20                8955            121658 ns/op           35030 B/op        531 allocs/op
BenchmarkLintWorkflows/small-shellcheck-3-20                6835            173217 ns/op          104112 B/op       1583 allocs/op
BenchmarkLintWorkflows/small-shellcheck-10-20               2593            459949 ns/op          347263 B/op       5269 allocs/op
BenchmarkLintWorkflows/large-shellcheck-1-20                2109            562768 ns/op          225346 B/op       4526 allocs/op
BenchmarkLintWorkflows/large-shellcheck-3-20                1353            880209 ns/op          677864 B/op      13603 allocs/op
BenchmarkLintWorkflows/large-shellcheck-10-20                482           2528021 ns/op         2282275 B/op      45760 allocs/op
PASS
ok      github.com/rhysd/actionlint     12.238s
```

- Ref: `hyperfine` results

```
Benchmark #1: ./actionlint.before testdata/bench/many_scripts.yaml
  Time (mean ± σ):       3.7 ms ±   0.4 ms    [User: 2.8 ms, System: 1.5 ms]
  Range (min … max):     3.2 ms …   5.3 ms    406 runs

  Warning: Command took less than 5 ms to complete. Results might be inaccurate.
  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet PC without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.

Benchmark #2: ./actionlint.after testdata/bench/many_scripts.yaml
  Time (mean ± σ):       3.6 ms ±   0.4 ms    [User: 2.5 ms, System: 1.4 ms]
  Range (min … max):     3.2 ms …   5.5 ms    489 runs

  Warning: Command took less than 5 ms to complete. Results might be inaccurate.
  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet PC without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.

Summary
  './actionlint.after testdata/bench/many_scripts.yaml' ran
    1.04 ± 0.17 times faster than './actionlint.before testdata/bench/many_scripts.yaml'
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants