Giter Club home page Giter Club logo

Comments (15)

viric avatar viric commented on July 28, 2024

I think that there are requirements in other places that /bin/sh has to be bash, currently. Some builds fail if not so.

from nixpkgs.

edolstra avatar edolstra commented on July 28, 2024

Agree with @peti, it's good to get rid of /bin/sh references.

from nixpkgs.

vcunat avatar vcunat commented on July 28, 2024

There might be much more offenders. Some build-scripts just have hard-coded paths in them (like /usr/bin/perl). Is there any preConfigure script which fixes these automatically? If not, I think we should create one, it's the problem of many packages.

from nixpkgs.

edolstra avatar edolstra commented on July 28, 2024

I have a patch somewhere that runs patchShebangs on the source tree before configurePhase (as suggested by @civodul a while back). I'll add it after the next stdenv merge.

from nixpkgs.

vcunat avatar vcunat commented on July 28, 2024

I didn't only mean sheBangs, also insides of the scripts... but maybe that would be better reported upstream, I don't know.

from nixpkgs.

Phreedom avatar Phreedom commented on July 28, 2024

@edolstra you seem to have forgottten to commit your patch

from nixpkgs.

domenkozar avatar domenkozar commented on July 28, 2024

+1 for the patch

from nixpkgs.

shlevy avatar shlevy commented on July 28, 2024

@edolstra Do you still have the patchShebangs patch around? Would be good to have.

As for this issue... Should we keep this open or just try to fix this incrementally and document that it's the proper best practice?

from nixpkgs.

matthiasbeyer avatar matthiasbeyer commented on July 28, 2024

After doing #8881 it seems that the following are false positives in the list above:

pkgs/shells/dash/default.nix
pkgs/tools/misc/qjoypad/default.nix
pkgs/tools/compression/gzip/default.nix
pkgs/development/tools/misc/libtool/libtool2.nix
development/tools/misc/libtool/default.nix
pkgs/development/tools/misc/automake/automake-1.10.x.nix
pkgs/development/tools/misc/automake/automake-1.11.x.nix
pkgs/development/tools/misc/automake/automake-1.12.x.nix
pkgs/development/tools/misc/automake/automake-1.13.x.nix
pkgs/development/tools/misc/automake/automake-1.14.x.nix
pkgs/development/tools/misc/automake/automake-1.15.x.nix
pkgs/development/tools/misc/autoconf/2.13.nix
pkgs/development/tools/misc/autoconf/default.nix
pkgs/development/libraries/cloog-ppl/default.nix
pkgs/development/libraries/pango/default.nix
pkgs/development/libraries/libgpg-error/default.nix
pkgs/development/libraries/nss/default.nix
pkgs/development/libraries/cloog/0.18.0.nix
pkgs/development/libraries/cloog/default.nix
pkgs/development/libraries/glibc/common.nix
pkgs/development/r-modules/default.nix
pkgs/stdenv/nix/default.nix
pkgs/stdenv/linux/default.nix
pkgs/applications/graphics/shotwell/default.nix
pkgs/applications/networking/cluster/mesos/default.nix
pkgs/applications/editors/music/tuxguitar/default.nix
pkgs/applications/video/shotcut/default.nix
pkgs/build-support/builder-defs/builder-defs.nix

and the following are done:

development/libraries/icu/default.nix

from nixpkgs.

Profpatsch avatar Profpatsch commented on July 28, 2024

(triage) There’s still a lot of /bin/bash. Maybe an easy task for a beginning contributor? (Is there a tag for that?)

from nixpkgs.

fubarbaz avatar fubarbaz commented on July 28, 2024

I want to be able distinguish between using sh and bash. If ${stdenv.shell} can be assumed to be bash compatible (also which Bash?), then I would also like to have a ${stdenv.posix_shell} which is just plain old /bin/sh. /bin/sh is a part of POSIX, so it seems weird if that doesn't work or is considered to be "wrong", but perhaps this is related to allow cross builds to work.

The motivation for getting rid of /bin/sh seems to be lacking. So, while there might be a motivation, this ticket doesn't contain one and I am not in favor of "fixing" this, until there is a motivation in the ticket.

from nixpkgs.

7c6f434c avatar 7c6f434c commented on July 28, 2024

Using /bin/sh breaks purity, and there are a few realistic scenarios where it does create annoying problems. POSIX is not relevant here — we provide /bin/sh on NixOS because of POSIX, but it is still a good idea not to use it inside builds. #1424 is a problem with system() using /bin/sh, but any use can trigger a similar problem.

from nixpkgs.

cleverca22 avatar cleverca22 commented on July 28, 2024

there is also a second major fault in /bin/sh and sandboxes, if you need to build a missing output of the glibc /bin/sh uses, the entire glibc has to be rebuilt, so ${glibc.lib} is omitted from the sandbox, and now /bin/sh is broken

99% of the time, the binary cache will have you covered, but if you aren't getting glibc from the cache for whatever reason, and you nix-collect-garbage one of glibc's outputs, your screwed

only way out is to make sure the build uses a different glibc from /bin/sh (so sh has to be held behind a mass-rebuild)

from nixpkgs.

vcunat avatar vcunat commented on July 28, 2024

Over long term, I'd prefer if /bin/sh in builds were taken from stdenv.shell, to improve purity. That would side-step this problem of trying to rebuild (part of) bash's glibc.

from nixpkgs.

Mic92 avatar Mic92 commented on July 28, 2024

I think we can close this one.

from nixpkgs.

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.