Giter VIP home page Giter VIP logo

Comments (16)

mattip avatar mattip commented on September 28, 2024

I think the proper fix is to add safe.directory like in the NumPy fixes. See pypa/manylinux#1309

from multibuild.

tylerjereddy avatar tylerjereddy commented on September 28, 2024

I haven't had much luck here so far--please do ping me if you see another project do something useful in this regard, etc.

from multibuild.

mattip avatar mattip commented on September 28, 2024

I guess multibuild could add git config --global --add safe.directory $1 to the gh_clone function but is that in common use?

from multibuild.

matthew-brett avatar matthew-brett commented on September 28, 2024

@tylerjereddy - did you try something like Matti's suggestion?

function gh_clone {
    git clone https://github.com/$1
    git config --global --add safe.directory $1
}

from multibuild.

tylerjereddy avatar tylerjereddy commented on September 28, 2024

Ah, I did something similar, but it was elsewhere in the control flow. There's also a suggestion from Henry over there: pypa/manylinux#1309 (comment)

Maybe I will try these ideas later today, thanks!

from multibuild.

mattip avatar mattip commented on September 28, 2024

I see another git step that is actually used by scipy wheels in clean_code, would it be appropriate to add the git config here?

multibuild/common_utils.sh

Lines 282 to 298 in e0b6e4f

function clean_code {
local repo_dir=${1:-$REPO_DIR}
local build_commit=${2:-$BUILD_COMMIT}
[ -z "$repo_dir" ] && echo "repo_dir not defined" && exit 1
[ -z "$build_commit" ] && echo "build_commit not defined" && exit 1
# The package $repo_dir may be a submodule. git submodules do not
# have a .git directory. If $repo_dir is copied around, tools like
# Versioneer which require that it be a git repository are unable
# to determine the version. Give submodule proper git directory
fill_submodule "$repo_dir"
(cd $repo_dir \
&& git fetch origin \
&& git checkout $build_commit \
&& git clean -fxd \
&& git reset --hard \
&& git submodule update --init --recursive)
}

from multibuild.

charris avatar charris commented on September 28, 2024

That looks like a likely spot. git config needs to be added before switching to the build directory, and issuing any other git commands.

from multibuild.

charris avatar charris commented on September 28, 2024

Note that in one case I needed to use --system instead of --global because a root directory wasn't found, that probably isn't a problem here.

from multibuild.

tylerjereddy avatar tylerjereddy commented on September 28, 2024

I see the same thing I saw with my previous attempts so far:

2022-05-02T01:50:22.8996044Z fatal: unsafe repository ('/io/scipy' is owned by someone else)
2022-05-02T01:50:22.8997327Z To add an exception for this directory, call:
2022-05-02T01:50:22.8997722Z 
2022-05-02T01:50:22.8998420Z 	git config --global --add safe.directory /io/scipy
2022-05-02T01:50:22.9017913Z fatal: unsafe repository ('/io/scipy' is owned by someone else)
2022-05-02T01:50:22.9018869Z To add an exception for this directory, call:
2022-05-02T01:50:22.9019256Z 
2022-05-02T01:50:22.9019942Z 	git config --global --add safe.directory /io/scipy

from multibuild.

tylerjereddy avatar tylerjereddy commented on September 28, 2024

(and then the version number looks weird again)

from multibuild.

matthew-brett avatar matthew-brett commented on September 28, 2024

I guess you have to apply this command also in the scipy submodule.

from multibuild.

tylerjereddy avatar tylerjereddy commented on September 28, 2024

More diagnostic info/local reproducer: MacPython/scipy-wheels#167 (comment)

from multibuild.

tylerjereddy avatar tylerjereddy commented on September 28, 2024

Henry's scoping of the git rev-parse command seems to be the key, the git config .. command was useless for me both in CI and locally.

from multibuild.

charris avatar charris commented on September 28, 2024

Hmm. This doesn't directly apply for NumPy, looks like I need to start working on that.

from multibuild.

charris avatar charris commented on September 28, 2024

Found a fix using the config.sh file, see MacPython/numpy-wheels#160. NumPy uses versioneer.

from multibuild.

has2k1 avatar has2k1 commented on September 28, 2024

What worked for me on github actions was adding

if [ $(uname) == "Linux" ]; then
    IS_LINUX=1
    ! git config --global --add safe.directory "*"
fi

to the top of config.sh. I could not figure out the exact directory to make safe.

from multibuild.

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.