Giter VIP home page Giter VIP logo

nix-shell's People

Contributors

dependabot[bot] avatar drupol avatar github-actions[bot] avatar loophp-bot avatar raphaelstolt avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

nix-shell's Issues

Grep version from busybox issue with OhMyZsh grep-alias cache

Hi, since d2940b4 I've an issue with grep and ohmyzsh.

grep --version
grep: unrecognized option: exclude-dir=.bzr
BusyBox v1.36.1 () multi-call binary.

I think that this issue is due to the new use of minimal-nix-shell, and the caching mecanism used by ohmyszsh https://github.com/ohmyzsh/ohmyzsh/blob/fd219a94ab585fa699a0e842335a9f33dcbb613b/lib/grep.zsh#L4

Busybox grep version has to be used with --exclude option, and nixos grep with --exclude-dir

If the cache file exists and is not older than a day, the right option to be used with grep will not be selected https://github.com/ohmyzsh/ohmyzsh/blob/fd219a94ab585fa699a0e842335a9f33dcbb613b/lib/grep.zsh#L18-L22

Infer default PHP version from composer.json

I love the idea of inferring default extensions to install from composer.json. I would like to have the same functionality for inferring default PHP version itself as well. At the moment, it's always defaulting to PHP 8.1, no matter what is in composer.json. I suggest to parse require.php from composer.json and detect minimum version from there. My initial attempt is

builtins.replaceStrings ["."] [""] (
  builtins.head (
    builtins.match ".*([[:digit:]]\.[[:digit:]])"
    (
      builtins.fromJSON (
        builtins.readFile "${builtins.getEnv "PWD"}/composer.json"
      )
    )
    .require
    .php
  )
)

but this ought to be improved, because this doesn't handle values like ^7.4 || ^8.0

Error while launching nix shell : The foobar extension does not exist, ignoring.

Steps required to reproduce the problem

  1. A composer.json with some extensions required : rdkafka, sodium, pcov, etc.
  2. A .user.ini to change memory_limit
  3. Launch a nix shell with the following command :
    github:loophp/nix-shell#env-php82 --impure

Expected Result

  • Nix Shell with extension load and memory limit changed.

Actual Result

  • Error message "warning: The foobar extension does not exist, ignoring."

I read the new flake.nix and I saw your new modification : .user.ini is no longer used in configuration and the composer.json read is that local to the repository.
What can I do to get back to the old behaviour ? Thanks for your help ๐Ÿ˜„

Importing extensions from composer.json/lock does not work anymore while building a devShell

Steps required to reproduce the problem

  1. Add some extensions to composer.json:
"require-dev": {
    "ext-xdebug": "*"
}
  1. Run composer install to generate the lock file
  2. Use nix-shell.api.makePhp in flake.nix to generate a devShell as per example in README
  3. Run nix develop --impure

Expected Result

  • php --info | grep xdebug returning xdebug configuration

Actual Result

  • php --info | grep xdebug returns nothing

PHP 5.6 seems broken when used in a flake

I made an example flake: buurro/nix-php-example

Steps required to reproduce the problem

  1. nix build github:buurro/nix-php-example/2845332e938b1df94eb4e823b5b10a8399e2b55b#packages.x86_64-linux.php56

Expected Result

  • successful build

Actual Result

error: builder for '/nix/store/9ydf6ry2pnigbwws01fqpiazs33cg0y5-php-5.6.40.drv' failed with exit code 2;
       last 10 log lines:
       > checking for gawk... gawk
       > checking for bison... bison -y
       > checking for bison version... 3.8 (ok)
       > checking for re2c... re2c
       > checking for re2c version... 3.1 (ok)
       > checking whether to enable computed goto gcc extension with re2c... no
       > checking whether to force non-PIC code in shared modules... no
       > checking whether /dev/urandom exists... yes
       > ./configure: line 6851: syntax error near unexpected token `fi'
       > ./configure: line 6851: `fi'
       For full logs, run 'nix log /nix/store/9ydf6ry2pnigbwws01fqpiazs33cg0y5-php-5.6.40.drv'.
error: 1 dependencies of derivation '/nix/store/nb73ngk59ari4azcw6c4v5q1n43ilckk-php-with-extensions-5.6.40.drv' failed to build

Running nix build github:loophp/nix-shell#php56 works, so I don't understand where is the issue.

Xdebug PHP extension no more infered from composer.json

Steps required to reproduce the problem

With a composer.json where ext-xdebug is required

{
...
   "require": {
        "php": "~8.2"
    },
    "require-dev": {
        "ext-xdebug": "*",
    }
...
}
  1. run nix shell github:loophp/nix-shell#env-php82 --impure
  2. run php --version

Expected Result

PHP 8.2.11 (cli) (built: Sep 26 2023 11:11:58) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.11, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.11, Copyright (c), by Zend Technologies
    with Xdebug v3.2.2, Copyright (c) 2002-2023, by Derick Rethans

(it works with a previous commit nix shell github:loophp/nix-shell/939d9#env-php82 --impure)

Actual Result

PHP 8.2.11 (cli) (built: Sep 26 2023 11:11:58) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.2.11, Copyright (c) Zend Technologies
    with Zend OPcache v8.2.11, Copyright (c), by Zend Technologies

defaultExtensions are way too fat, resulting in long installation times

Running eg. nix develop github:loophp/nix-shell#php74 in folder with composer.json that has no ext- sections takes still quite long time. I can see it compiling things like gd, mysql, iconv and so on which are not needed at all. Is it possible to either improve the speed of installing these (binaries instead of having to compile it? Installing multiple extensions at the same time, or at least each with -J flag?), or skip them? Otherwise amazing feature of this shell, which is auto-installation of extensions from composer.json is quite under-utilized.

NAR hash mismatch in input

Hi,

I have "NAR hash mismatch" errors If I create a new .envrc file in a directory or if I change the php version in an existing .envrc file

direnv: loading /home/dev/DGD/.envrc                                                                                                                                        
direnv: using flake github:loophp/nix-shell#env-php74 --impure
error: NAR hash mismatch in input 'https://www.php.net/releases/active?narHash=sha256-20qIiLPpROWf6onLj1r7dMjt%2fVhUO8%2f%2ffzYYt4KlPYQ=' (/nix/store/3vkk556lnayd123wr6rzjvdw6ambsbcs-source), expected 'sha256-20qIiLPpROWf6onLj1r7dMjt/VhUO8//fzYYt4KlPYQ=', got 'sha256-Omnc2u11Y6CnV3oO1NwrzhB+scKXeOx0tkoAZz7PS3g='
direnv: nix-direnv: renewed cache
direnv: export +CONFIG_SHELL +HOST_PATH +IN_NIX_SHELL +NIX_BUILD_CORES +NIX_CFLAGS_COMPILE +NIX_ENFORCE_NO_NATIVE +NIX_LDFLAGS +NIX_STORE +SOURCE_DATE_EPOCH +__structuredAttrs +buildInputs +buildPhase +builder +cmakeFlags +configureFlags +depsBuildBuild +depsBuildBuildPropagated +depsBuildTarget +depsBuildTargetPropagated +depsHostHost +depsHostHostPropagated +depsTargetTarget +depsTargetTargetPropagated +doCheck +doInstallCheck +dontAddDisableDepTrack +mesonFlags +name +nativeBuildInputs +out +outputs +patches +phases +preferLocalBuild +propagatedBuildInputs +propagatedNativeBuildInputs +shell +shellHook +stdenv +strictDeps +system ~PATH ~XDG_DATA_DIRS

Any ideas how to solve this ?

Thx

Nix experimental features

Steps required to reproduce the problem

  1. run nix shell github:loophp/nix-shell#php74 at MacOS without experimental features enabled

Expected Result

  • building php-7.4...

Actual Result

  • error: experimental Nix feature 'nix-command' is disabled; use '--extra-experimental-features nix-command' to override

On macOS running commands from README would throw an error, it can be fixed by enabling experimental features.

# ~/.config/nix/nix.conf
experimental-features = nix-command flakes

Maybe it would be good to mention this behavior somewhere in the readme?

Can't use nix-shell.api.makePhp to build a devShell with php5.6

Steps required to reproduce the problem

  1. Create a flake.nix as per README example under "You may also use the API to build your own custom version of PHP in your own flake:"
  2. Running nix develop fails, so I tried replacing makePhp system with makePhp pkgs; this worked fine with php81
  3. Replace "php81" with "php56"
  4. Run nix develop

Expected Result

  • A working devShell

Actual Result

  • Error raised by running the example flake:
error: value is a string while a set was expected

       at /nix/store/s8427y5ln38zyyya2vgh3hfk0cq414mi-source/src/phps.nix:113:12:

          112|       if builtins.isString php
          113|       then pkgs."${php}"
             |            ^
          114|       else php;
  • Error raised by running the edited flake:
error: attribute 'php56' missing

       at /nix/store/s8427y5ln38zyyya2vgh3hfk0cq414mi-source/src/phps.nix:113:12:

          112|       if builtins.isString php
          113|       then pkgs."${php}"
             |            ^
          114|       else php;
       Did you mean one of php, php73, php74, php80 or php81?

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/build.yaml
  • actions/checkout v4
  • actions/checkout v4
  • cachix/cachix-action v14
.github/workflows/flakehub-publish-rolling.yaml
  • actions/checkout v4
.github/workflows/merge.yaml
  • actions/github-script v7
  • actions/github-script v7
  • actions/github-script v7
  • actions/github-script v7
.github/workflows/nix-fmt-checks.yaml
  • actions/checkout v4
.github/workflows/publish.yaml
.github/workflows/upgrade-flakes.yaml

  • Check this box to trigger a request for Renovate to run again on this repository

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.