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

Add Homebrew formula #5

Open
bbkane opened this issue Jan 15, 2024 · 23 comments
Open

Add Homebrew formula #5

bbkane opened this issue Jan 15, 2024 · 23 comments
Labels
enhancement New feature or request

Comments

@bbkane
Copy link
Contributor

bbkane commented Jan 15, 2024

I'd love to be able to manage upgrades and such with Homebrew.

@pipelight
Copy link
Owner

pipelight commented Jan 16, 2024

Let's go! I'll let you know when things are done!
If u intend to use it on Mac, keep in mind that pipelight uses linux kernel api and therefore isn't compatible with MacOs.

@bbkane
Copy link
Contributor Author

bbkane commented Jan 16, 2024

Oh, I didn't realize Pipelight wasn't cross-platform. Would you accept a PR highlighting that in the README?

@bbkane
Copy link
Contributor Author

bbkane commented Jan 16, 2024

Also, are there any plans to make Pipelight cross-platform? Nothing in the description seems like its Linux-specific- I'm curious what Linux features Pipelight uses that aren't in MacOS or Windows

@pipelight
Copy link
Owner

Thank you I will make it explicit in the doc.

TODO: Add warnings in documentation linux only.

I explain in detail how it works there: https://pipelight.dev/introduction/description.html
There is no compatibility yet because as of today I cant test on Mac and Windows.

@pipelight
Copy link
Owner

Yes of course PR are absolutly welcomed

@pipelight
Copy link
Owner

At the time I wrote the biggest part of the code, the modules(crates) responsible for managing processes were not compatible with other OS than Linux. But it seems things have changed recently with sysinfo and rustix.

Some workaround will be needed for Windows,.. but I think MacOS might finally work!!

@bbkane
Copy link
Contributor Author

bbkane commented Jan 17, 2024

I'm not a rust dev, but if I check it out, can I run cargo test to run the tests?

@pipelight
Copy link
Owner

pipelight commented Jan 17, 2024

Yes of course.

Try building the binary and run a command.

cd <repo_path>
cargo run --bin pipelight ls

I am updating the CONTRIBUTING.md
to your needs

@bbkane
Copy link
Contributor Author

bbkane commented Jan 17, 2024

Unfortunately, the procfs crate still doesn't work on MacOS:

$ cargo build
-- snip --

   Compiling async-trait v0.1.74
error: failed to run custom build command for `procfs v0.15.1`

Caused by:
  process didn't exit successfully: `/Users/bbkane/Git-GH/pipelight/target/debug/build/procfs-f6ebcc48134290b8/build-script-build` (exit status: 1)
  --- stderr
  Building procfs on an for a unsupported platform. Currently only linux and android are supported
  (Your current target_os is macos)
warning: build failed, waiting for other jobs to finish...

@pipelight
Copy link
Owner

pipelight commented Jan 17, 2024

What a shame! I usually try to keep dependencies clean!
procfs is a phantom dependencie. I removed it and pushed the changes.
Could you try to compile against dev branch ?

@bbkane
Copy link
Contributor Author

bbkane commented Jan 19, 2024

@pipelight , It seems like procfs is still a dependency for dev:

master 10:14:12.756 PST mac02:~/Git-GH/pipelight
$ git pull
Already up to date.
master 10:14:14.674 PST mac02:~/Git-GH/pipelight
$ git checkout dev
branch 'dev' set up to track 'origin/dev'.
Switched to a new branch 'dev'
dev 10:14:19.604 PST mac02:~/Git-GH/pipelight
$ git pull
Already up to date.
dev 10:14:21.575 PST mac02:~/Git-GH/pipelight
$ cargo build
   Compiling thiserror-impl v1.0.50
   Compiling serde_derive v1.0.193
   Compiling futures-macro v0.3.29
   Compiling tokio-macros v2.2.0
   Compiling miette-derive v5.10.0
   Compiling tracing-attributes v0.1.27
   Compiling libgit2-sys v0.14.2+1.5.1
   Compiling libssh2-sys v0.2.23
   Compiling uuid-macro-internal v1.6.1
   Compiling strum_macros v0.24.3
   Compiling derivative v2.2.0
   Compiling rayon v1.8.0
   Compiling procfs v0.15.1
   Compiling async-trait v0.1.74
   Compiling crossbeam-channel v0.5.8
   Compiling which v4.4.2
   Compiling colored v2.0.4
error: failed to run custom build command for `procfs v0.15.1`

Caused by:
  process didn't exit successfully: `/Users/bbkane/Git-GH/pipelight/target/debug/build/procfs-f6ebcc48134290b8/build-script-build` (exit status: 1)
  --- stderr
  Building procfs on an for a unsupported platform. Currently only linux and android are supported
  (Your current target_os is macos)
warning: build failed, waiting for other jobs to finish...

@pipelight
Copy link
Owner

Sorry! My bad again! I pushed to the wrong repo!
Things must be a litlle bit different now!

@bbkane
Copy link
Contributor Author

bbkane commented Jan 19, 2024

haha you caught me just before I turned off my Mac - now I'm getting several warnings that look much easier to deal with (mostly #warn(unused_imports), and an error[E0659]: exec is ambiguous.

   Compiling watchexec v2.3.0
warning: unused import: `Key`
 --> utils/src/signal/mod.rs:1:15
  |
1 | use console::{Key, Term};
  |               ^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `signal_hook`
dev 12:21:24.532 PST mac02:~/Git-GH/pipelight
$ cargo build
warning: unused import: `Key`
 --> utils/src/signal/mod.rs:1:15
  |
1 | use console::{Key, Term};
  |               ^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `signal_hook`
 --> utils/src/signal/mod.rs:2:5
  |
2 | use signal_hook;
  |     ^^^^^^^^^^^

warning: `utils` (lib) generated 2 warnings (run `cargo fix --lib -p utils` to apply 2 suggestions)
warning: `utils` (lib) generated 2 warnings (2 duplicates)
warning: unused import: `utils::globals::LOGGER`
 --> workflow/src/pipeline/log.rs:9:5
  |
9 | use utils::globals::LOGGER;
  |     ^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `create_dir_all`
  --> workflow/src/pipeline/log.rs:12:15
   |
12 | use std::fs::{create_dir_all, File};
   |               ^^^^^^^^^^^^^^

warning: unused import: `log::error`
  --> workflow/src/pipeline/log.rs:15:5
   |
15 | use log::error;
   |     ^^^^^^^^^^

warning: unused import: `Mode`
 --> workflow/src/traits/default.rs:2:42
  |
2 | use crate::types::{Command, Event, Logs, Mode, Node, Parallel, Pipeline, Step, StepOrParallel};
  |                                          ^^^^

warning: `workflow` (lib) generated 4 warnings (run `cargo fix --lib -p workflow` to apply 4 suggestions)
warning: `workflow` (lib) generated 4 warnings (4 duplicates)
   Compiling cli v0.4.0 (/Users/bbkane/Git-GH/pipelight/cli)
error[E0659]: `exec` is ambiguous
 --> cli/src/services/traits/mod.rs:8:9
  |
8 | pub use exec::Exec;
  |         ^^^^ ambiguous name
  |
  = note: ambiguous because of multiple potential import sources
  = note: `exec` could refer to a crate passed with `--extern`
  = help: use `::exec` to refer to this crate unambiguously
note: `exec` could also refer to the module defined here
 --> cli/src/services/traits/mod.rs:3:1
  |
3 | mod exec;
  | ^^^^^^^^^
  = help: use `self::exec` to refer to this module unambiguously

warning: unused imports: `Action`, `Service`
 --> cli/src/actions/run/loose.rs:2:30
  |
2 | use crate::services::types::{Action, Service};
  |                              ^^^^^^  ^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `crate::services::traits::FgBg`
 --> cli/src/actions/run/loose.rs:9:5
  |
9 | use crate::services::traits::FgBg;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `crate::services::traits::FgBg`
  --> cli/src/actions/run/strict.rs:11:5
   |
11 | use crate::services::traits::FgBg;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `workflow::error::IsError`
  --> cli/src/actions/run/strict.rs:14:5
   |
14 | use workflow::error::IsError;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `log::trace`
 --> cli/src/services/traits/exec.rs:6:5
  |
6 | use log::trace;
  |     ^^^^^^^^^^

warning: unused imports: `run`, `trigger`
 --> cli/src/start/mod.rs:2:46
  |
2 | use crate::actions::{logs, pipeline, prompt, run, stop, trigger, watch};
  |                                              ^^^        ^^^^^^^

For more information about this error, try `rustc --explain E0659`.
warning: `cli` (build script) generated 6 warnings
error: could not compile `cli` (build script) due to previous error; 6 warnings emitted

@pipelight
Copy link
Owner

pipelight commented Jan 19, 2024

Same for me here! I was just about to prepare for sleep!
The warnings are mainly do to the strict rules I like to keep!
But the errors... I am inspecting right now!

Which version of cargo and rustup are you on?

rustup -V
cargo -V

@pipelight
Copy link
Owner

I renamed the module to a name that is not taken by a rust standard library module.
Hope it removes the ambiguity!

Pushed the changes to dev! For real this time!

@bbkane
Copy link
Contributor Author

bbkane commented Jan 20, 2024

$ rustup -V
rustup 1.26.0 (5af9b9484 2023-04-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.70.0 (90c541806 2023-05-31)`
dev 18:02:41.947 PST mac02:~/Git-GH/pipelight
$ cargo -V
cargo 1.70.0 (ec8a8a0ca 2023-04-25)

I was able to build pipelight with cargo build (and ran /target/debug/pipelight -h to verify).!!

After updating:

dev 18:07:08.719 PST mac02:~/Git-GH/pipelight
$ rustup -V
rustup 1.26.0 (5af9b9484 2023-04-05)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.75.0 (82e1608df 2023-12-21)`
dev 18:07:27.633 PST mac02:~/Git-GH/pipelight
$ cargo -V
cargo 1.75.0 (1d8b05cdd 2023-11-20)

Here's the compilation output (still some unused import errors, but I get a binary!)

$ cargo build
warning: unused imports: `SetLoggerError`, `debug`, `error`, `info`, `trace`, `warn`
 --> utils/src/logger/config_abstraction.rs:1:15
  |
1 | pub use log::{debug, error, info, trace, warn, LevelFilter, SetLoggerError};
  |               ^^^^^  ^^^^^  ^^^^  ^^^^^  ^^^^               ^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `Key`
 --> utils/src/signal/mod.rs:1:15
  |
1 | use console::{Key, Term};
  |               ^^^

warning: unused import: `signal_hook`
 --> utils/src/signal/mod.rs:2:5
  |
2 | use signal_hook;
  |     ^^^^^^^^^^^

warning: `utils` (lib) generated 3 warnings (run `cargo fix --lib -p utils` to apply 3 suggestions)
warning: `utils` (lib) generated 3 warnings (3 duplicates)
warning: unused import: `logs::*`
  --> cast/src/lib.rs:12:9
   |
12 | pub use logs::*;
   |         ^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

warning: `cast` (lib) generated 1 warning (run `cargo fix --lib -p cast` to apply 1 suggestion)
warning: `cast` (lib) generated 1 warning (1 duplicate)
warning: unused import: `utils::globals::LOGGER`
 --> workflow/src/pipeline/log.rs:9:5
  |
9 | use utils::globals::LOGGER;
  |     ^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `create_dir_all`
  --> workflow/src/pipeline/log.rs:12:15
   |
12 | use std::fs::{create_dir_all, File};
   |               ^^^^^^^^^^^^^^

warning: unused import: `log::error`
  --> workflow/src/pipeline/log.rs:15:5
   |
15 | use log::error;
   |     ^^^^^^^^^^

warning: unused import: `colored::control::set_override`
 --> workflow/src/trigger/display.rs:4:9
  |
4 | pub use colored::control::set_override;
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `Mode`
 --> workflow/src/traits/default.rs:2:42
  |
2 | use crate::types::{Command, Event, Logs, Mode, Node, Parallel, Pipeline, Step, StepOrParallel};
  |                                          ^^^^

warning: `workflow` (lib) generated 5 warnings (run `cargo fix --lib -p workflow` to apply 5 suggestions)
warning: `workflow` (lib) generated 5 warnings (5 duplicates)
warning: unused imports: `Action`, `Service`
 --> cli/src/actions/run/loose.rs:2:30
  |
2 | use crate::services::types::{Action, Service};
  |                              ^^^^^^  ^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused import: `crate::services::traits::FgBg`
 --> cli/src/actions/run/loose.rs:9:5
  |
9 | use crate::services::traits::FgBg;
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `crate::services::traits::FgBg`
  --> cli/src/actions/run/strict.rs:11:5
   |
11 | use crate::services::traits::FgBg;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `workflow::error::IsError`
  --> cli/src/actions/run/strict.rs:14:5
   |
14 | use workflow::error::IsError;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `log::trace`
 --> cli/src/services/traits/execute.rs:6:5
  |
6 | use log::trace;
  |     ^^^^^^^^^^

warning: unused import: `crate::verbosity::external::Verbosity`
 --> cli/src/types/post.rs:4:9
  |
4 | pub use crate::verbosity::external::Verbosity;
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `crate::verbosity::internal::InternalVerbosity`
 --> cli/src/types/post.rs:5:9
  |
5 | pub use crate::verbosity::internal::InternalVerbosity;
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `crate::verbosity::external::Verbosity`
 --> cli/src/types/pre.rs:4:9
  |
4 | pub use crate::verbosity::external::Verbosity;
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused import: `crate::verbosity::internal::InternalVerbosity`
 --> cli/src/types/pre.rs:5:9
  |
5 | pub use crate::verbosity::internal::InternalVerbosity;
  |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: unused imports: `run`, `trigger`
 --> cli/src/start/mod.rs:2:46
  |
2 | use crate::actions::{logs, pipeline, prompt, run, stop, trigger, watch};
  |                                              ^^^        ^^^^^^^

warning: `cli` (build script) generated 10 warnings
warning: [email protected]: completion file is generated: "/Users/bbkane/Git-GH/pipelight/target/debug/build/cli-70be425bc8dbf9fb/out/pipelight.bash"
warning: [email protected]: completion file is generated: "/Users/bbkane/Git-GH/pipelight/target/debug/build/cli-70be425bc8dbf9fb/out/_pipelight"
warning: [email protected]: completion file is generated: "/Users/bbkane/Git-GH/pipelight/target/debug/build/cli-70be425bc8dbf9fb/out/pipelight.fish"
warning: [email protected]: completion file is generated: "/Users/bbkane/Git-GH/pipelight/target/debug/build/cli-70be425bc8dbf9fb/out/pipelight.elv"
warning: `cli` (lib) generated 10 warnings (10 duplicates)
warning: unused import: `GraphicalTheme`
  --> pipelight/src/main.rs:12:14
   |
12 | use miette::{GraphicalTheme, MietteHandlerOpts, Result, RgbColors, ThemeStyles};
   |              ^^^^^^^^^^^^^^
   |
   = note: `#[warn(unused_imports)]` on by default

warning: unused variable: `styles`
  --> pipelight/src/main.rs:32:13
   |
32 |         let styles = ThemeStyles {
   |             ^^^^^^ help: if this is intentional, prefix it with an underscore: `_styles`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: `pipelight` (bin "pipelight") generated 2 warnings (run `cargo fix --bin "pipelight"` to apply 2 suggestions)
    Finished dev [unoptimized + debuginfo] target(s) in 0.

@bbkane
Copy link
Contributor Author

bbkane commented Jan 20, 2024

Still interested in providing a Homebrew formula for macOS? I'm not sure how to do it for Rust (I use GoReleaser - GoReleaser for my Go ClIs).

@pipelight
Copy link
Owner

Amazing!!
I have spent some times in the Homebrew documentation! It is a matter of days before I come with a Formula that works nicely.

@pipelight
Copy link
Owner

I can not test the formula myself!
I think you will have to figure out how to make it work!
https://github.com/pipelight/homebrew-pipelight

@pipelight pipelight added the enhancement New feature or request label Jan 26, 2024
@Orcomp
Copy link

Orcomp commented Apr 13, 2024

I'm happy to assist to get this working on Windows.

@pipelight
Copy link
Owner

I think that it could run in WSL...
Let's do this anyway! I need to replace the rustix crate with the sysinfo crate that has windows compatibility.
Are you however able to build successfully on windows?

@Orcomp
Copy link

Orcomp commented Apr 18, 2024

Building failed on compiling signal-hook-registry. (on the master branch)

   Compiling url v2.5.0
   Compiling clap_derive v4.4.7
   Compiling typemap-ors v1.0.0
   Compiling thread-id v4.2.1
   Compiling tokio v1.35.1
   Compiling signal-hook-registry v1.4.1
error: failed to run custom build command for `signal-hook v0.3.17`

Caused by:
  process didn't exit successfully: `E:\Source\ThirdParty.pipelight\target\release\build\signal-hook-bff241cf5ff74c3c\build-script-build` (exit code: 1)
  --- stdout
  TARGET = Some("x86_64-pc-windows-msvc")
  OPT_LEVEL = Some("0")
  HOST = Some("x86_64-pc-windows-msvc")
  cargo:rerun-if-env-changed=CC_x86_64-pc-windows-msvc
  CC_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CC_x86_64_pc_windows_msvc
  CC_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=HOST_CC
  HOST_CC = None
  cargo:rerun-if-env-changed=CC
  CC = None
  cargo:rerun-if-env-changed=CRATE_CC_NO_DEFAULTS
  CRATE_CC_NO_DEFAULTS = None
  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  DEBUG = Some("false")
  cargo:rerun-if-env-changed=CFLAGS_x86_64-pc-windows-msvc
  CFLAGS_x86_64-pc-windows-msvc = None
  cargo:rerun-if-env-changed=CFLAGS_x86_64_pc_windows_msvc
  CFLAGS_x86_64_pc_windows_msvc = None
  cargo:rerun-if-env-changed=HOST_CFLAGS
  HOST_CFLAGS = None
  cargo:rerun-if-env-changed=CFLAGS
  CFLAGS = None
  running: "C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.39.33519\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Brepro" "-W4" "-FoE:\\Source\\ThirdParty.pipelight\\target\\release\\build\\signal-hook-50c34f521663bc3e\\out\\src/low_level/extract.o" "-c" "src/low_level/extract.c"
  extract.c
  src/low_level/extract.c(21): error C2065: 'SI_USER': undeclared identifier
  src/low_level/extract.c(25): error C2065: 'SI_QUEUE': undeclared identifier
  src/low_level/extract.c(29): error C2065: 'CLD_EXITED': undeclared identifier
  src/low_level/extract.c(29): error C2065: 'SIGCHLD': undeclared identifier
  src/low_level/extract.c(30): error C2065: 'CLD_KILLED': undeclared identifier
  src/low_level/extract.c(30): error C2065: 'SIGCHLD': undeclared identifier
  src/low_level/extract.c(31): error C2065: 'CLD_DUMPED': undeclared identifier
  src/low_level/extract.c(31): error C2065: 'SIGCHLD': undeclared identifier
  src/low_level/extract.c(32): error C2065: 'CLD_TRAPPED': undeclared identifier
  src/low_level/extract.c(32): error C2065: 'SIGCHLD': undeclared identifier
  src/low_level/extract.c(33): error C2065: 'CLD_STOPPED': undeclared identifier
  src/low_level/extract.c(33): error C2065: 'SIGCHLD': undeclared identifier
  src/low_level/extract.c(34): error C2065: 'CLD_CONTINUED': undeclared identifier
  src/low_level/extract.c(34): error C2065: 'SIGCHLD': undeclared identifier
  src/low_level/extract.c(17): error C2099: initializer is not a constant
  src/low_level/extract.c(37): warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int
  src/low_level/extract.c(37): error C2143: syntax error: missing ')' before '*'
  src/low_level/extract.c(37): error C2143: syntax error: missing '{' before '*'
  src/low_level/extract.c(37): error C2059: syntax error: ')'
  src/low_level/extract.c(37): warning C4431: missing type specifier - int assumed. Note: C no longer supports default-int
  src/low_level/extract.c(37): error C2054: expected '(' to follow 'info'
  src/low_level/extract.c(51): error C2061: syntax error: identifier 'sighook_signal_pid'
  src/low_level/extract.c(51): error C2059: syntax error: ';'
  src/low_level/extract.c(51): error C2059: syntax error: '<cv-qualifier>'
  src/low_level/extract.c(55): error C2061: syntax error: identifier 'sighook_signal_uid'
  src/low_level/extract.c(55): error C2059: syntax error: ';'
  src/low_level/extract.c(55): error C2059: syntax error: '<cv-qualifier>'
  exit code: 2

  --- stderr


  error occurred: Command "C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.39.33519\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Brepro" "-W4" "-FoE:\\Source\\ThirdParty.pipelight\\target\\release\\build\\signal-hook-50c34f521663bc3e\\out\\src/low_level/extract.o" "-c" "src/low_level/extract.c" with args "cl.exe" did not execute successfully (status code exit code: 2).


warning: build failed, waiting for other jobs to finish...

@pipelight
Copy link
Owner

Ok, i will replace this dependencie with one compatible with windows
signal_hook -> ctrl_c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants