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

1.0 & nixpkgs release #204

Open
6 tasks done
srid opened this issue Aug 6, 2024 · 21 comments
Open
6 tasks done

1.0 & nixpkgs release #204

srid opened this issue Aug 6, 2024 · 21 comments

Comments

@srid
Copy link
Member

srid commented Aug 6, 2024

Before release

See sub-issues below for pending work.

Upstream

  • @srid Release to crates.io Release 1.0 #423
  • Upstream pkgs.omnix to nixpkgs omnix: init at 1.0.3 NixOS/nixpkgs#385761
    • Check: it installs the om binary (not omnix-cli).
    • Check: auto completion works on zsh (macOS) and bash (Linux)
    • Check: it builds on Intel mac
      • Even if upstream doesn't test x86_64-darwin in CI, we should manually make sure that our PR builds.
    • Check: om ci run --on ssh://... works.
@srid

This comment was marked as outdated.

@srid srid unpinned this issue Aug 12, 2024
@srid

This comment was marked as outdated.

@srid
Copy link
Member Author

srid commented Dec 4, 2024

Regarding release version of omnixrc:

The caller can now override the omnix invocation as of d25eab3

Once we release 1.0 to nixpkgs, we can host the stable omnixrc at https://ominx.page/omnixrc/1.0 (or some such versioned URL), which file would use nix run nixpkgs/<commithash>#omnix to fetch the pinned omnix.

When we release 1.1, we repeat the same process, allowing existings projects on 1.0 to remain unimpacted until they explicitly upgrade to 1.0 (by changing the URL and hash in their .envrc).

@srid srid modified the milestones: v2, `omnix-cli` MVP Jan 7, 2025
@srid srid changed the title Upstream to nixpkgs 1.0 & upstream to nixpkgs Jan 19, 2025
@srid srid changed the title 1.0 & upstream to nixpkgs 1.0 & nixpkgs release Jan 19, 2025
@shivaraj-bh
Copy link
Member

NixOS/nixpkgs#385761

requires #427

@srid
Copy link
Member Author

srid commented Feb 28, 2025

Is there something we can do in the omnix source tree to avoid having to duplicate this in nixpkgs?

Perhaps a .json file that refers to these inputs, which the Nix expression can use directly.

Image

@srid
Copy link
Member Author

srid commented Feb 28, 2025

This is interesting. I wonder if we can revert the doCheck = false; with this ...

Image

@srid
Copy link
Member Author

srid commented Mar 4, 2025

Should I tag after merging #430 - or do we need anything else for nixpkgs upstreaming? Let me know.

srid pushed a commit that referenced this issue Mar 4, 2025
Avoids the need to explicitly define—and later maintain—these ENVs in
nixpkgs while packaging for #204.

requires juspay/rust-flake#33
@shivaraj-bh
Copy link
Member

shivaraj-bh commented Mar 5, 2025

Should I tag after merging #430 - or do we need anything else for nixpkgs upstreaming? Let me know.

Have to enable checks. I will raise a PR for that.

Edit: #432

@srid
Copy link
Member Author

srid commented Mar 10, 2025

1.0.1 released https://github.com/juspay/omnix/releases/tag/1.0.1

Feel free to use the source directly, github:juspay/omnix/1.0.1 in the nixpkgs PR.

@srid
Copy link
Member Author

srid commented Mar 10, 2025

Can we make doCheck = false; instead in the nixpkgs PR?

Image

@srid
Copy link
Member Author

srid commented Mar 11, 2025

@shivaraj-bh
Copy link
Member

Check: it installs the om binary (not omnix-cli).
Check: auto completion works on zsh (macOS) and bash (Linux)

Linux (x86_64):
Image

macOS (aarch64):
Image

Check: it builds on Intel mac

❯ file /nix/store/v2jdclqsmzdxwkamf7xv0v7qxi3nwzrx-omnix-1.0.2/bin/om
/nix/store/v2jdclqsmzdxwkamf7xv0v7qxi3nwzrx-omnix-1.0.2/bin/om: Mach-O 64-bit executable x86_64

Check: om ci run --on ssh://... works.

/nix/store/l3qsdxi0h8l5ancf52v9cwmr3b5n4phx-omnix-1.0.2/bin/om ci run github:srid/haskell-template --on ssh://<user>@<IP>
...
🥳 Success!
❄️  nix -j auto build '/nix/store/qy2iml5bf9jaacr917x0y3j0gvrxn5az-nix-rs-flake-addstringcontext#default' -L --print-out-paths --impure --out-link /tmp/om.json.6iohk6/om.json --override-input jsonfile path:om-ci-results-Glemx0.json️
warning: not writing modified lock file of flake 'path:/nix/store/qy2iml5bf9jaacr917x0y3j0gvrxn5az-nix-rs-flake-addstringcontext':
• Added input 'jsonfile':
    'path:om-ci-results-Glemx0.json?lastModified=1742244626&narHash=sha256-eiE9ERVRiO3mvp/Z%2BXjvEUefFeXKb8zOD0Hqv20lK44%3D' (2025-03-17)
/nix/store/h7q58bjjfk3icz6qpn7wmnxm77yncr3q-addstringcontext.json
Result available at "/nix/store/h7q58bjjfk3icz6qpn7wmnxm77yncr3q-addstringcontext.json" and symlinked at "/tmp/om.json.6iohk6/om.json"

@shivaraj-bh
Copy link
Member

The package builds fine, but nixpkgs-review fails:

nix run github:Mic92/nixpkgs-review -- pr --print-result 385761
….
       … while calling the ‘import' builtin
         at /home/shivaraj/.cache/nixpkgs-review/pr-385761-3/nixpkgs/pkgs/by-name/om/omnix/package.nix:33:9:
           32|
           33|   env = import "${src}/nix/envs" {
             |         ^
           34|     inherit

       … while realising the context of path '/nix/store/3p76lh7b5aikmmlliyaj2b33lajicv9b-source/nix/envs'

       error: path '/nix/store/f0nfgkfxf5azxhc8rkjfn7dczqswv48p-source.drv' is not valid

@srid
Copy link
Member Author

srid commented Mar 17, 2025

The package builds fine, but nixpkgs-review fails:

Anything to do on this repo (before I tag 1.0.3)?

@shivaraj-bh
Copy link
Member

The package builds fine, but nixpkgs-review fails:

Anything to do on this repo (before I tag 1.0.3)?

Not sure.

I even tried maintaining a copy of nix/envs/default.nix in NixOS/nixpkgs@a8a5cc5, that does pass previously failing checks but their dependent checks fail:

Image

@shivaraj-bh
Copy link
Member

The ENVs depending on src must be removed to upstream to nixpkgs

DEFAULT_FLAKE_SCHEMAS = lib.cleanSourceWith {
name = "flake-schemas";
src = src + /nix/flake-schemas;
};
FLAKE_METADATA = lib.cleanSourceWith {
name = "nix-rs-flake-metadata";
src = src + /crates/nix_rs/src/flake/functions/metadata;
};
FLAKE_ADDSTRINGCONTEXT = lib.cleanSourceWith {
name = "nix-rs-flake-addstringcontext";
src = src + /crates/nix_rs/src/flake/functions/addstringcontext;
};

@srid
Copy link
Member Author

srid commented Mar 26, 2025

Image

@srid
Copy link
Member Author

srid commented Mar 26, 2025

The use of cleanSourceIFD breaks omnix build on nixpkgs due to IFD.

On the other hand, removing cleanSourceIFD breaks local build of omnix:

❯ cargo run -p omnix-cli --  ci run --on ssh://pureintent --no-link
   Compiling nix_rs v1.2.1 (/Users/srid/code/omnix/crates/nix_rs)
   Compiling omnix-common v1.0.3 (/Users/srid/code/omnix/crates/omnix-common)
   Compiling omnix-health v1.0.1 (/Users/srid/code/omnix/crates/omnix-health)
   Compiling omnix-init v1.0.1 (/Users/srid/code/omnix/crates/omnix-init)
   Compiling omnix-develop v1.0.1 (/Users/srid/code/omnix/crates/omnix-develop)
   Compiling omnix-ci v1.0.3 (/Users/srid/code/omnix/crates/omnix-ci)
   Compiling omnix-cli v1.0.3 (/Users/srid/code/omnix/crates/omnix-cli)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 13.12s
     Running `target/debug/om ci run --on 'ssh://pureintent' --no-link`

👟 Reading om.ci config from flake

🛜 Running CI remotely on pureintent (Opts { copy_inputs: false })
❄️  nix build '/nix/store/w19485qhbwsqga514xb8b17ipvpy5300-source/crates/nix_rs/src/flake/functions/metadata#default' -L --print-out-paths --no-link --override-input flake . --override-input include-inputs /nix/store/wb47j3cp8fjjgidlqlr2mhwi5zwmvsqh-source
Error: JSON error: Is a directory (os error 21)

Caused by:
    Is a directory (os error 21)

@srid
Copy link
Member Author

srid commented Apr 6, 2025

Done: juspay/nixos-unified-template#157

The only thing left to do is to update our .envrc in docs.

@srid
Copy link
Member Author

srid commented Apr 6, 2025

@shivaraj-bh
Copy link
Member

https://www.reddit.com/r/NixOS/comments/1jv0tqz/omnix_10_is_now_in_nixpkgs/

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