Git Product home page Git Product logo

Comments (21)

eddelbuettel avatar eddelbuettel commented on June 12, 2024 71

I find that tone not that helpful or motivating and will close this accordingly.

from rcpparmadillo.

peti avatar peti commented on June 12, 2024 26

Just use the /usr/bin/env trampoline. People have used this solution for 2+ decades, and it works fine. Check the portability section of https://en.m.wikipedia.org/wiki/Shebang_(Unix) if you don't believe me.

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024 25

Sigh. Can't you just install bash, please? Even my Debian builds did not complain about that, and there too only /bin/sh can be assumed. Which does not exclude also having /bin/bash. And too bad that you just missed a release window.

You can also tell how little that script does so feel to adapt it locally in the meantime.

I'll look into into. It would help if you told if it worked once you did the s/bash/sh.

from rcpparmadillo.

peti avatar peti commented on June 12, 2024 4

I have no trouble depending on bash. My system has a bash! But it doesn't have it at /bin/bash. The solution you want is to rely on $PATH to find the binary instead of hard-coding a location, i.e. by using "/usr/bin/env bash".

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024 4

Would you consider having that debate elsewhere? It is now 2019, not 2014 when this ticket was openend, and we have no use of /usr/bin/env here. And have not for years. Cool?

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024 3

Well but that breaks when the next guy comes along who has /bin/env instead. This isn't a standards-compliant tool in a fixed location either, or is it? I'd be happy to learn if it was, but I am rather reluctant to remove what works for thousands with a band aid for you.

Just thinking out loud here: could you add a softlink providing /bin/bash ?

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024 2

You are commenting on a five year old bug report for an issue we no longer have -- these days configure is autoconf generated rather than a shell script with the a shebang line calling bash via env.

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024

I just did a naive test of replacing /bin/bash with /bin/sh which immediately whined:

./configure: 3: [: /usr/lib/R: unexpected operator
* checking LAPACK_LIBS: ./configure: 16: [: unexpected operator
./configure: 20: [: yes: unexpected operator

If you want a non-bash sh, could you please help with a port and test? I am more likely to just make bash an installation requirement (as I am a little short on time for testing this). Could you?

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024

Else I need to bite the bullet and rewrite the if [ ... ] tests which an older sh-compatible approach.

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024

I rewrote it for /bin/dash which is my laptop's /bin/sh. Consider sending a patch next time.

from rcpparmadillo.

peti avatar peti commented on June 12, 2024

Well, I did not intend to come across as impolite. Please accept my apologies if I did.

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024

The env trick has been known for about as long as Python exists. I was trying to ask a legitimate question as to whether /usr/bin/env was in fact a POSIX (or FHS or ..) sanctioned location. Just because we both have seen it there won't make this resilient.

Using a dumber /bin/sh is more resilient. I am now at work but I'll ping you when I committed the change and I would appreciate it if you could test it.

from rcpparmadillo.

peti avatar peti commented on June 12, 2024

As far as I know, env is mandated by POSIX, but the standard doesn't specify a specific location for the tool, so a system could offer /bin/env and still be POSIX-compliant.

I'd say that the env trampoline is not perfect , but it works far more reliably than /bin/bash will.

Have a simple bourne script that /bin/sh can interpret is the best possible solution, though, and I'm glad you decided to go that route. Let me know when the fix is in Git, and I'll gladly test it.

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024

It's been committed as d85be88 -- let me know if that works for you.

from rcpparmadillo.

peti avatar peti commented on June 12, 2024

Unfortunately, the script still refers to /bin/bash, and that path doesn't exist on NixOS, so the script cannot be run. IMHO, everything would be fine if that first line would refer to #! /bin/sh instead.

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024

That was an oversight. I tested on a distinct copy from which I carried over changes, and I promptly forgot the shebang line. Fixed now -- could you test again?

from rcpparmadillo.

peti avatar peti commented on June 12, 2024

With that latest patch applied, the package builds just fine on NixOS. Thank you very much for the fix!

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024

Thanks for testing and confirming.

from rcpparmadillo.

eddelbuettel avatar eddelbuettel commented on June 12, 2024

I reverted this change because of side-effects with other CRAN installations.

You are now assumed to have /bin/bash installed.

If you do not, open the source tarball, run the test in the short script configure by hand and adjust RcppArmadilloLapack.h.in accordingly (which will in most cases just be a straight copy to ``RcppArmadilloLapack.hand runR CMD INSTALL` etc by hand.

from rcpparmadillo.

ORESoftware avatar ORESoftware commented on June 12, 2024

on nixos anyone know how to add bash so that /usr/bin/env can find it? I have this error:

env: can't execute 'bash': No such file or directory

which results from using a hashbang like:

#!/usr/bin/env bash

from rcpparmadillo.

ORESoftware avatar ORESoftware commented on June 12, 2024

@eddelbuettel I am taking about the more general context - a shell script with that hashbang does not seem to work on nixos at all

from rcpparmadillo.

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.