why does `nix flake show` builds ghc? - haskell

If I look at the outputs provided by the haskell.nix flake from a M1 computer, it starts building ghc-8.8.4 etc..
❯ nix flake show github:input-output-hk/haskell.nix
github:input-output-hk/haskell.nix/1b54ea01568299a0eda578ae9395e20d5c699ee1
├───checks
│ ├───aarch64-darwin
trace: haskell-nix.haskellLib.cleanGit: /nix/store/jmx2m0ldgrjq7p3gb4yyca47nvbvspfl-source does not seem to be a git repository,
assuming it is a clean checkout.
trace: No index state specified for haskell-project, using the latest index state that we know about (2022-02-07T00:00:00Z)!
trace: No index state specified for haskell-project, using the latest index state that we know about (2022-02-07T00:00:00Z)!
trace: No index state specified for haskell-project, using the latest index state that we know about (2022-02-07T00:00:00Z)!
trace: WARNING: No materialized dummy-ghc-data for ghc-8.8.4-aarch64-darwin.
trace: To make this a fixed-output derivation but not materialized, set `sha256` to the output of the 'calculateMaterializedSha' script in 'passthru'.
trace: To materialize this entirely, pass a writable path as the `materialized` argument and run the 'updateMaterialized' script in 'passthru'.
[1/0/579 built, 0.1 MiB DL] building ghc-8.8.4 (buildPhase):.....
From an Intel Mac, I get
❯ nix flake show github:input-output-hk/haskell.nix
github:input-output-hk/haskell.nix/1b54ea01568299a0eda578ae9395e20d5c699ee1
├───checks
│ ├───aarch64-darwin
trace: haskell-nix.haskellLib.cleanGit: /nix/store/jmx2m0ldgrjq7p3gb4yyca47nvbvspfl-source does not seem to be a git repository,
assuming it is a clean checkout.
trace: No index state specified for haskell-project, using the latest index state that we know about (2022-02-07T00:00:00Z)!
trace: No index state specified for haskell-project, using the latest index state that we know about (2022-02-07T00:00:00Z)!
trace: No index state specified for haskell-project, using the latest index state that we know about (2022-02-07T00:00:00Z)!
error: --- Error ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- nix
a 'aarch64-darwin' with features {} is required to build '/nix/store/sc11rh4l348yw3z4q4fy4byw324nm5yz-nix-tools-plan-to-nix-pkgs.drv', but I am a 'x86_64-darwin' with features {benchmark, big-parallel, nixos-test, recursive-nix}
(use '--show-trace' to show detailed location information)
Why do those flakes need to build anything for showing their outputs ?
If I run this command on some other flake I have, after a few fetches :
❯ nix flake show github:edolstra/dwarffs
github:edolstra/dwarffs/69d73417d83ebeb7711912e33515d87049b39de0
├───checks
│ ├───aarch64-linux
│ │ ├───build: derivation 'dwarffs-0.1.20220128.69d7341'
│ │ └───test: derivation 'vm-test-run-unnamed'
│ ├───i686-linux
│ │ ├───build: derivation 'dwarffs-0.1.20220128.69d7341'
│ │ └───test: derivation 'vm-test-run-unnamed'
│ └───x86_64-linux
│ ├───build: derivation 'dwarffs-0.1.20220128.69d7341'
│ └───test: derivation 'vm-test-run-unnamed'
├───defaultPackage
│ ├───aarch64-linux: package 'dwarffs-0.1.20220128.69d7341'
│ ├───i686-linux: package 'dwarffs-0.1.20220128.69d7341'
│ └───x86_64-linux: package 'dwarffs-0.1.20220128.69d7341'
├───nixosModules
│ └───dwarffs: NixOS module
└───overlay: Nixpkgs overlay

haskell.nix depends heavily on what is commonly called "import from derivation" or IFD. These are expressions such as
foo = import "${mkDerivation bar}/expr.nix";
or
qux = builtins.readFile (somePackage + "/data.json");
These can not be evaluated without building bar and somePackage.
haskell.nix does have a feature that lets you avoid such expressions altogether. They've called it materialization.

Related

the vue-awesome-swiper dependency was not found

I tried to use swiper plugin on my nuxtjs project. But I've got error on my command line when I running "yarn run dev":
`
yarn run dev
yarn run v1.22.19
$ nuxt
WARN sass-loader#13.1.0 is installed but ^10.1.1 is expected
╭───────────────────────────────────────╮
│ │
│ Nuxt # v2.15.8 │
│ │
│ ▸ Environment: development │
│ ▸ Rendering: server-side │
│ ▸ Target: server │
│ │
│ Listening: http://localhost:3000/ │
│ │
╰───────────────────────────────────────╯
i Preparing project for development
i Initial build may take a while
√ Builder initialized
√ Nuxt files generated
* Client █████████████████████████ building (39%) 245/251 modul
es 6 active
node_modules\setimmediate\setImmediate.js
× Server
Compiled with some errors in 9.04s
× Client
Compiled with some errors in 10.53s
× Server
Compiled with some errors in 9.04s
ERROR Failed to compile with 1 errors
This dependency was not found:
* vue-awesome-swiper/dist/ssr in ./plugins/swiper.js
To install it, you can run: npm install --save vue-awesome-swiper/dist/ssr
i Waiting for file changes
i Memory usage: 143 MB (RSS: 232 MB)
i Listening on: http://localhost:3000/
WARN Error from chokidar (C:\): Error: EBUSY: resource busy or locked, lstat 'C:\DumpStack.log.tmp'
`
vue-awesome-swiper does not detected while I've installed by "yarn add vue-awesome-swiper".
And I've followed this instruction on cmd:
npm install --save vue-awesome-swiper/dist/ssr
i Waiting for file changes
i Memory usage: 143 MB (RSS: 232 MB)
i Listening on: http://localhost:3000/
But still have issued on my code. Does anyone have same problems and had solution?

Terraform init failed with Error: Failed to install provider read: connection reset by peer

Recently, I've got the problem when running terraoform init. The error showed as below:
>terraform init
Initializing modules...
Initializing the backend...
Initializing provider plugins...
- Reusing previous version of hashicorp/template from the dependency lock file
- Reusing previous version of cloudflare/cloudflare from the dependency lock file
- Reusing previous version of hashicorp/aws from the dependency lock file
- Reusing previous version of hashicorp/null from the dependency lock file
- Installing hashicorp/template v2.2.0...
- Using previously-installed cloudflare/cloudflare v3.18.0
- Installing hashicorp/aws v3.30.0...
- Installing hashicorp/null v3.1.1...
╷
│ Error: Failed to install provider
│
│ Error while installing hashicorp/template v2.2.0: Get "https://releases.hashicorp.com/terraform-provider-template/2.2.0/terraform-provider-template_2.2.0_linux_amd64.zip": read tcp 10.250.192.121:45540->108.157.30.78:443: read:
│ connection reset by peer
╵
╷
│ Error: Failed to install provider
│
│ Error while installing hashicorp/aws v3.30.0: Get "https://releases.hashicorp.com/terraform-provider-aws/3.30.0/terraform-provider-aws_3.30.0_linux_amd64.zip": read tcp 10.250.192.121:37686->108.157.30.40:443: read: connection reset
│ by peer
╵
╷
│ Error: Failed to install provider
│
│ Error while installing hashicorp/null v3.1.1: Get "https://releases.hashicorp.com/terraform-provider-null/3.1.1/terraform-provider-null_3.1.1_linux_amd64.zip": read tcp 10.250.192.121:45552->108.157.30.78:443: read: connection reset
│ by peer
I suppose I need to add some additional configuration relating to network in my server? (IT team just added the new cert in the compary network system)

Unable to get local issuer certificate error while building kibana - yarn build

I am facing the unable to get local issuer certificate error when I try to build kibana using the command - yarn build --skip-os-packages
I have tried these solutions before which didn't work :
disabling TLS connection using set NODE_TLS_REJECT_UNAUTHORIZED=0 but then the build throws a warning and terminates the process.
yarn config set strict-ssl false
Below is the complete error :
yarn build --skip-os-packages
yarn run v1.22.17
$ node scripts/build --all-platforms --skip-os-packages
info [ global ] Verifying environment meets requirements
│ succ Node.js version verified
│ succ ✓ 0 sec
info [ global ] Cleaning artifacts from previous builds
│ debg Deleted 0 files/directories
│ succ ✓ 0 sec
info [ global ] Downloading node.js builds for all platforms
│ debg Downloading shasum values for node version 14.17.2 from https://us-central1-elastic-kibana-184716.cloudfunctions.net/kibana-ci-proxy-cache/dist/v14.17.2/SHASUMS256.txt
│ERROR failure 1 sec
│ERROR Error: unable to get local issuer certificate
│ at TLSSocket.onConnectSecure (_tls_wrap.js:1514:34)
│ at TLSSocket.emit (events.js:375:28)
│ at TLSSocket._finishInit (_tls_wrap.js:936:8)
│ at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:708:12)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Why can't I add packages to flutter

I tried to add dependencies:
english_words: ^3.1.5 To my pupsec.yaml file, when I do and try the Flutter Pub Get command I get this error: Mathiass-MacBook-Pro:startuplabs_0 mathiassoderlund$ flutter pub get
Error on line 34, column 5 of pubspec.yaml: A dependency may only have one source.
╷
34 │ ┌ sdk: flutter
35 │ │
36 │ │ dependencies:
37 │ │ flutter:
38 │ │ sdk: flutter
39 │ │
40 │ │
41 │ │ english_words: ^3.1.5
42 │ │
43 │ │ # For information on the generic Dart part of this file, see the
44 │ │ # following page: https://dart.dev/tools/pub/pubspec
45 │ │
46 │ └ # The following section is specific to Flutter.
╵
Running "flutter pub get" in startuplabs_0...
pub get failed (65; ╵)
Mathiass-MacBook-Pro:startuplabs_0 mathiassoderlund$
Here is my pupspec.yaml file: Pupspec.yaml
You write it on the wrong place, Write it below cupertino_icons
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.2
english_words: ^3.1.5
Use proper indentation(spaces) in front of english_words.
The code should looks like this-
dependencies:
flutter:
sdk: flutter
english_words: ^3.1.5
Hope this will help you.

how event loop phases handles the requests?

Event loop has phases as:
┌───────────────────────┐
┌─>│ timers │
│ └──────────┬────────────┘
│ ┌──────────┴────────────┐
│ │ I/O callbacks │
│ └──────────┬────────────┘
│ ┌──────────┴────────────┐
│ │ idle, prepare │
│ └──────────┬────────────┘ ┌───────────────┐
│ ┌──────────┴────────────┐ │ incoming: │
│ │ poll │<─────┤ connections, │
│ └──────────┬────────────┘ │ data, etc. │
│ ┌──────────┴────────────┐ └───────────────┘
│ │ check │
│ └──────────┬────────────┘
│ ┌──────────┴────────────┐
└──┤ close callbacks │
└───────────────────────┘
how does it work? does it jump from one phase to another? if yes then when it jumps? or it just maintains the que and executes the one callback after the another? and what is next tick , does it mean that when entire que is completed and que is empty then the loop starts over again? is there any actual loop in event loop? and how does this poll phase works? what happens when a new request arrives?
node maintains the worker pool (which are actually c++ threads), and whenever a some I/O task or any other blocking task comes, it hands over that task to that worker thread which actually carries out system task as interacting with database and getting data and when worker thread completes its task than worker thread puts the callback handler in event que back, and node takes this callback and executes it . Is this correct?
what is nodejs binding(c++)?
how event loop works? does it run on main thread?

Resources