Git Product home page Git Product logo

Comments (5)

zshipko avatar zshipko commented on May 18, 2024 1

Closing this because the new CLI has been released

from extism.

bhelx avatar bhelx commented on May 18, 2024

Maybe this needs to change to require sudo: https://github.com/extism/cli/blob/987f0fdbcfe103a578fc57c385bf831c8733ecc4/extism_cli/__init__.py#L349

from extism.

bhelx avatar bhelx commented on May 18, 2024

Looks like it is asking for your password though. So that's confusing

from extism.

bhelx avatar bhelx commented on May 18, 2024

I cannot seem to repro. Trying a new bash session too:

[I] ben@m1lap ~ [1]> rm /usr/local/include/extism.h
override rwxr-xr-x root/wheel for /usr/local/include/extism.h? 
[I] ben@m1lap ~> extism install latest
Getting release for latest
Installing to /usr/local/ (version v0.1.0)
Password:
Installed /usr/local/lib/libextism.dylib
Installed /usr/local/include/extism.h

from extism.

lukevp avatar lukevp commented on May 18, 2024

I believe the issue is because I did not have a /usr/local/include folder, and the /usr/local dir is only writable by root on my Mac. If you look at the cp definition itself, it will auto-sudo if the path is in /usr/.

However, the python makedirs command is being used to create the directory. Even though the script does a sudo later for writing the file, and that works correctly if the path already exists, the script fails if you do not yet have /usr/local/include. I think os.mkdir needs to be wrapped in an auto-sudo like the cp function (and run mkdir -p {path} to recursively make the directory from a subprocess.)

Here are the permissions for my /usr/local showing it's only writable by root

➜  local ls -al /usr/local
total 0
drwxr-xr-x   6 root  wheel  192 Dec 29 17:09 .
drwxr-xr-x@ 11 root  wheel  352 Aug 24 01:59 ..
drwxr-xr-x  14 root  wheel  448 Dec 22 21:58 bin
drwxr-xr-x   3 root  wheel   96 Dec 29 17:09 include
drwxr-xr-x   4 root  wheel  128 Dec 29 17:08 lib
drwxr-xr-x   3 root  wheel   96 Dec 19 19:14 share

Here's the listing of my include dir showing extism is the only thing in there. you may have already had this directory created so didn't run into this issue, since the cp command is correctly sudoing. The only issue seems to be in the mkdir part.

➜  local ls -al /usr/local/include
total 8
drwxr-xr-x  3 root  wheel    96 Dec 29 17:09 .
drwxr-xr-x  6 root  wheel   192 Dec 29 17:09 ..
-rw-r--r--  1 root  wheel  3042 Dec 29 17:09 extism.h

from extism.

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.