Code Monkey home page Code Monkey logo

Comments (15)

zimbatm avatar zimbatm commented on June 11, 2024 1

ok, this is not a free support channel.

from flake-utils.

zimbatm avatar zimbatm commented on June 11, 2024

I don't think this is coming from flake-utils.

If yarn2nix uses Import-From-Derivation (IFD), it will try building the derivation it's supposed to import on the same arch where the code is evaluated. And since Flakes evaluates all the architectures, it's exposing that problem.

from flake-utils.

dzmitry-lahoda avatar dzmitry-lahoda commented on June 11, 2024

flake evaluates only systems+arch which is provided by flake-utils. if flake-utils can be configured via override only to one it will wokr

from flake-utils.

dzmitry-lahoda avatar dzmitry-lahoda commented on June 11, 2024

i have tested that. so it is mundane to support out of this repo.

read it to be akin to Rust Features or Rust targets. It has filter by specific target and featue, and has -all-targes and -all-features check

from flake-utils.

dzmitry-lahoda avatar dzmitry-lahoda commented on June 11, 2024

huh, you are weird. i do not need support. i said you tool can have 2 feautes and you closed both by asking me to pay. we do not need support. I have fork of this already.

crazy.

from flake-utils.

dzmitry-lahoda avatar dzmitry-lahoda commented on June 11, 2024

yarn2nix is not relevant. relevant is single system nix check which is possible with flake override for single system. I did it and it worked. you cannot nix check flake with ustils without as it cross checks too much.

from flake-utils.

dzmitry-lahoda avatar dzmitry-lahoda commented on June 11, 2024

i reported this repor is not well plays with nix check and devops and you closed issuess with some weird response.

from flake-utils.

dzmitry-lahoda avatar dzmitry-lahoda commented on June 11, 2024

here is the code for thoose who will have same issue https://github.com/ComposableFi/composable/blob/nix/v1/.nix/override-input/flake-utils/flake.nix

from flake-utils.

zimbatm avatar zimbatm commented on June 11, 2024

who knows. it's either a communication or expectation issue between us. or maybe I'm just being grumpy. I don't have a lot of energy to give away when half of it is already spent trying to understand the messages.

from flake-utils.

dzmitry-lahoda avatar dzmitry-lahoda commented on June 11, 2024

What we want - check that nix """compiles""" in CI.

How? Run https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-flake-check.html

But, it tries to evaluate arm/darwin. Our CI is not that.

How to fix?

--override-input with flake-utils from template which does only on ${system} in list.

What it gets?

You can compile whole nix and ensure it is typed. But you cannot cross compile because of some dependencies. So we wan to check nix lang is correct, but cannot because of the only way to check is have arm/darwin.

Can I you

--arg name expr
Pass the value expr as the argument name to Nix functions.

--argstr name string
Pass the string string as the argument name to Nix functions.

Seems flakes ignore this or do not allow (at least what I read, and may be there is my ack of knowledge - but as per items on nix gh - it is dissallowed to have arbitrary input because it violates isolation of nix flake is flake.nix + flake.lock).

So there only way to """compile""" nix in CI to check it before build is to override with flake for 1 and only one system.

Can we just build? No, we do not have mac or ARM. But if nix lang is wrong it is wrong for all systems (we talk here about """compilation""", not about side effecting derivaiton which is different on different systems).

from flake-utils.

dzmitry-lahoda avatar dzmitry-lahoda commented on June 11, 2024

@zimbatm you likely should undrestand that flake.nix can be '""compiled""", that is hard to get as I see for people. eqactly same as complex rust/typescript monorepo is compiled.

I tell flake.nix and its deps, not arbitrary defaul.nix.

And the only way to do compilation now is to override flake-utils with current system of CI.

from flake-utils.

dzmitry-lahoda avatar dzmitry-lahoda commented on June 11, 2024

But yeah, that can be a bug in NIX. who knows.

from flake-utils.

dzmitry-lahoda avatar dzmitry-lahoda commented on June 11, 2024

nix flake check =>

error: error: a 'aarch64-darwin' with features {} is required to build '/nix/store/22zx8fsi94pa9p9m3w1m21ylb7fb55xa-yarn.nix.drv', but I am a 'x86_64-linux' with features {benchmark, big-parallel, kvm, nixos-test}

nix flake check --override flake-utils flake-utils-x86_64-linux -> no error.

sure. it can be different if there is if else on system. but that is usually not what users do or see. they use cross platform stuff.

these packages - kvm - for sure cannot do mac darwin, but how can I test all the flake nix which is not mac?

 but I am a 'x86_64-linux' with features {benchmark, big-parallel, kvm, nixos-test}

so that is feature.

from flake-utils.

zimbatm avatar zimbatm commented on June 11, 2024

flake.nix:

{
  outputs = { self, nixpkgs }: {
    checks.aarch64-darwin.hello = nixpkgs.legacyPackages.aarch64-darwin.hello;
    checks.aarch64-linux.hello = nixpkgs.legacyPackages.aarch64-linux.hello;
    checks.x86_64-darwin.hello = nixpkgs.legacyPackages.x86_64-darwin.hello;
    checks.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello;
  };
}
$ nix flake check -v
evaluating flake...
running flake checks...

You can try this on your system and see that the issue is not the multi-arch support. Flakes evaluate all the systems, but only builds the current one. Adding more hacks to fix the hacks is not the right solution. Stop using IFD, and your problem will go away.

from flake-utils.

dzmitry-lahoda avatar dzmitry-lahoda commented on June 11, 2024

check in nix does run check command. in many cases check actually builds to run tests. so solution was pass not build param during check (so no test are running).

nix flake metadata && \
nix flake show --allow-import-from-derivation  --show-trace --fallback --debug --print-build-logs --keep-failed --option sandbox relaxed && \
nix flake check --no-build --keep-going --allow-import-from-derivation  --show-trace --no-update-lock-file --fallback --debug --print-build-logs --keep-failed --impure --option sandbox relaxed

in case of strict sandbox it gives compiled nix kind of.

from flake-utils.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.