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

Bug: binary.github prevents further manifest actions from running when it thinks no action is required. #287

Closed
airtonix opened this issue Dec 11, 2022 · 6 comments

Comments

@airtonix
Copy link
Contributor

Description

If I have:

files/enact/enact.service

[Unit]
Description=Enact Auto configures Xrandr

[Service]
ExecStart=$HOME/.local/share/bin/enact --pos top --watch

enact.yml

---
where: os.name == "linux"

actions:
  - action: binary.github
    name: enact
    directory: "{{ user.home_dir }}/.local/share/bin/"
    repository: chmln/enact
    version: v0.1

  - action: file.copy
    from: enact
    to: "{{ user.home_dir }}/.config/systemd/user/"

then:

  • 1st run both actions run
  • 2nd run binary.github attempts, fails and nothing else in the manifest is processed.

If I switch to:

---
where: os.name == "linux"

actions:
  - action: file.copy
    from: enact
    to: "{{ user.home_dir }}/.config/systemd/user/"

  - action: binary.github
    name: enact
    directory: "{{ user.home_dir }}/.local/share/bin/"
    repository: chmln/enact
    version: v0.1

Then it works.

This would obviously force certain workflows that depend on the installed binary to be split into two manifests.

Steps to reproduce

Try the above two manifests.

  1. The first one will succeed on first try, never attempt to copy the files on the 2nd try.
  2. The second one will always run both actions.

Expected behaviour

binary.github should never cause the current manifest to bail/error/exit/prevent-further-actions/prevent-further-manifests

Environment

  • OS: Fedora release 36 (Thirty Six) 5.19.15-201.fc36.x86_64
  • Version: 0.8.0

Additional information
Add more context which didn't fit in the fields above.

@airtonix
Copy link
Contributor Author

airtonix commented Dec 11, 2022

Actually the workaround doens't work.. any other manifest coming after enact will never run.

So looks like I have to delete the downloaded binary:

---
where: os.name == "linux"

actions:

  - action: command.run
    command: rm
    args:
      - "{{ user.home_dir }}/.local/share/bin/enact"

  - action: binary.github
    name: enact
    directory: "{{ user.home_dir }}/.local/share/bin/"
    repository: chmln/enact
    version: v0.1

  - action: directory.copy
    from: enact
    to: "{{ user.home_dir }}/.config/systemd/user/"

@rawkode
Copy link
Member

rawkode commented Dec 11, 2022

This is fixed on the main branch.

54095b3

@rawkode rawkode closed this as completed Dec 11, 2022
@airtonix
Copy link
Contributor Author

@rawkode how do I get a binary for the lates fixes? 👈🏻 rust noob.

@icepuma
Copy link
Member

icepuma commented Dec 14, 2022

https://crates.io/crates/comtrya is broken, because we messed up the tag name and our action didn't run to make a release and nobody reran the whole shebang :D

You could download comtrya here

@airtonix
Copy link
Contributor Author

yeah I've already got that release.

Does publishing a crate result in a executable that i can download and use on windows/linux and mac without installing rust?

@icepuma
Copy link
Member

icepuma commented Dec 16, 2022

Nope, you have to install it via cargo install comtrya and it will compile it based on your local Rust install or you can download the repo and do a cargo install --path ..

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

3 participants