Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Makefile should ask for confirmation before changing../cpython #319

Open
Labels
bugSomething isn't working
@ezio-melotti

Description

@ezio-melotti

I ranmake all while already having an existing clone ofcpython, and even thoughmake detected that, it proceeded to alter it without asking for confirmation:

$ make all...git clone --depth 1 --no-single-branch https://github.com/python/cpython.git ../cpython/||echo"cpython exists"fatal: destination path'../cpython' already exists and is not an empty directory.cpython existscd ../cpython/&& git checkout 3.10Switched to branch'3.10'Your branch is behind'upstream/3.10' by 339 commits, and can be fast-forwarded.  (use"git pull" to update yourlocal branch)mkdir -p ../cpython//Doc/locales/zh_TW/LC_MESSAGESfordirnamein$(find. -name'*.po'| xargs -n1 dirname| sort -u| grep -v'^\.$');do mkdir -p ../cpython//Doc/locales/zh_TW/LC_MESSAGES/$dirname;doneforfilein*.po*/*.po;do ln -f$file ../cpython//Doc/locales/zh_TW/LC_MESSAGES/$file;done.~/.venvs/python-docs-i18n//bin/activate; make -C ../cpython//Doc/ SPHINXOPTS='-j4 -D locale_dirs=locales -D language=zh_TW -D gettext_compact=0' autobuild-dev-html...

Since thecpython clone already had a3.10 branch, it switched to it and proceeded to copy files even if the branch was outdated.

It eventually failed while trying to build the docs because of abuggy.rst test file I had in thecpython repo:

checking consistency... failedWarning, treated as error:../cpython/Doc/buggy.rst:document isn't included in any toctreemake[2]: *** [Makefile:51: build] Error 2make[2]: Leaving directory'../cpython/Doc'make[1]: *** [Makefile:231: autobuild-dev-html] Error 2make[1]: Leaving directory'../cpython/Doc'make: *** [Makefile:54: all] Error 2

It would be better if theMakefile asked for confirmation before altering an existing clone ofcpython, however it would also be useful to distinguish between an existing clone that was there before the first execution, and an existing clone that was there becausemake all previously created it.

TheMakefile should do the following:

  • If thecpython clone doesn't exist, it could create it without asking for confirmation.
  • If it exists, it could check ifDoc/locales/zh_TW/LC_MESSAGES/ already exists and if the current branch is$(BRANCH) (currently3.10):
    • if they are, it can assume the clone was previously created bymake all and continue without asking for confirmation;
    • if they aren't, it either means that the clone already existed, or that it was altered after the creation, and should ask for confirmation before switching branch and creating files;

In addition theMakefile created thevenv in~/.venvs, altering yet another "external" directory. It would be better if it created a.venv dir in the cwd instead. (I can create a separate issue for this.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp