Problems when running 'make update_po' in BASH shell on MacOS #74218

Closed
opened 2020-02-26 02:37:55 +01:00 by Hoang Duy Tran · 20 comments
Member

System Information
Operating system: Darwin-19.3.0-x86_64-i386-64bit 64 Bits

Blender Version
Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-12-04 11:32, hash: blender/blender@f1aa4d18d4

Short description of error

Ran the "make update_po" in 'blender_docs' directory on local machine and encountered several problems:

Screenshot 2020-02-26 at 01.06.19.png

these errors resides in the file

blender_docs/tools_maintenance/update_po.sh

  1. The error in -printf '%h\n. This option in 'find' command is NOT available on Darwin. There are two occurrences in this file.
  2. export LANG="en_US.UTF8 should be export LANG="en_US.UTF-8", ie. with a hyphen between F-8. The locale -a will list out list of all available language codes.
  3. The block of code:
for SVNDIR in "$SVN_DIRS_ALL"; do
   svn cleanup "$SVNDIR"
   svn up "$SVNDIR"
 done
 unset SVNDIR

is causing the error message:

svn: Skipping argument: E200025: 'locale//vi/.svn' ends in a reserved name

Note there are two '//' in the path. This is caused by the extra forward slash in the 'find locale/..' Remove the slash so the command is only 'find locale ...' resulted to this line:

svn: Skipping argument: E200025: 'locale/vi/.svn' ends in a reserved name

Commented the above block out (svn cleanup and svn up) and the error message is GONE. If you go to the locale/<lang> and do the svn up . manually, there are no errors encountered.

Last, and the most severed is the creation of locale/locale/<lang_code> directory and files. This is wrong. (locale) is repeated twice.

Screenshot 2020-02-26 at 01.03.41.png

Recreating problem

Run:

svn checkout https://svn.blender.org/svnroot/bf-manual/trunk/blender_docs

to get the documentation code down the local machine:

run:

cd blender_docs
sudo pip3 install -r requirements.txt

then install one language, say vi:

svn checkout https://svn.blender.org/svnroot/bf-manual-translations/trunk/blender_docs/locale/vi locale/vi

Now run the command:

make update_po

Note: The code appeared running OK on Linux Mint, about 1-2 months ago. Presently I do not have access to a Linux machine in order to compare results.

The funny thing is if you just run this from the command line, assuming the environment variable BLENDER_MAN_EN is pointing to your blender_docs directory:

cd $BLENDER_MAN_EN; rm -fr build/locale; make gettext; sphinx-intl --config=manual/conf.py update --pot-dir=build/locale --language="vi"; python3 tools_rst/rst_check_locale.py

and there are no errors

**System Information** Operating system: Darwin-19.3.0-x86_64-i386-64bit 64 Bits **Blender Version** Broken: version: 2.81 (sub 16), branch: master, commit date: 2019-12-04 11:32, hash: `blender/blender@f1aa4d18d4` **Short description of error** Ran the "make update_po" in 'blender_docs' directory on local machine and encountered several problems: ![Screenshot 2020-02-26 at 01.06.19.png](https://archive.blender.org/developer/F8370449/Screenshot_2020-02-26_at_01.06.19.png) these errors resides in the file `blender_docs/tools_maintenance/update_po.sh` 1. The error in ` -printf '%h\n`. This option in 'find' command is NOT available on Darwin. There are two occurrences in this file. 2. `export LANG="en_US.UTF8` should be `export LANG="en_US.UTF-8"`, ie. with a hyphen between `F-8`. The `locale -a` will list out list of all available language codes. 3. The block of code: ``` for SVNDIR in "$SVN_DIRS_ALL"; do svn cleanup "$SVNDIR" svn up "$SVNDIR" done unset SVNDIR ``` is causing the error message: `svn: Skipping argument: E200025: 'locale//vi/.svn' ends in a reserved name` Note there are two '//' in the path. This is caused by the extra forward slash in the 'find locale/..' Remove the slash so the command is only 'find locale ...' resulted to this line: `svn: Skipping argument: E200025: 'locale/vi/.svn' ends in a reserved name` Commented the above block out (svn cleanup and svn up) and the error message is GONE. If you go to the `locale/<lang>` and do the `svn up .` manually, there are no errors encountered. Last, and the most severed is the creation of `locale/locale/<lang_code>` directory and files. This is wrong. (locale) is repeated twice. ![Screenshot 2020-02-26 at 01.03.41.png](https://archive.blender.org/developer/F8370470/Screenshot_2020-02-26_at_01.03.41.png) **Recreating problem** Run: `svn checkout https://svn.blender.org/svnroot/bf-manual/trunk/blender_docs` to get the documentation code down the local machine: run: ``` cd blender_docs sudo pip3 install -r requirements.txt ``` then install one language, say vi: `svn checkout https://svn.blender.org/svnroot/bf-manual-translations/trunk/blender_docs/locale/vi locale/vi` Now run the command: `make update_po` Note: The code appeared running OK on Linux Mint, about 1-2 months ago. Presently I do not have access to a Linux machine in order to compare results. The funny thing is if you just run this from the command line, assuming the environment variable `BLENDER_MAN_EN` is pointing to your `blender_docs` directory: `cd $BLENDER_MAN_EN; rm -fr build/locale; make gettext; sphinx-intl --config=manual/conf.py update --pot-dir=build/locale --language="vi"; python3 tools_rst/rst_check_locale.py` and there are no errors
Author
Member

Added subscriber: @hoanguk

Added subscriber: @hoanguk
Member

Added subscriber: @ankitm

Added subscriber: @ankitm
Member

Hi! please use code formatting to separate your comments and commands/output. use three backticks {key `} to start a code block, three to end it.

Hi! please use code formatting to separate your comments and commands/output. use three backticks {key `} to start a code block, three to end it.
Member

Added subscriber: @Blendify

Added subscriber: @Blendify
Member

find is a standard bash command.

I was able to run just fine on linux, I do not have a mac to test but bash should work identically to linux.

`find` is a standard bash command. I was able to run just fine on linux, I do not have a mac to test but bash should work identically to linux.
Member

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'
Member

find is a standard bash command.

I was able to run just fine on Linux, I do not have a mac to test but bash should work identically to Linux.

Please verify your system or $path is not corrupt.

`find` is a standard bash command. I was able to run just fine on Linux, I do not have a mac to test but bash should work identically to Linux. Please verify your system or $path is not corrupt.
Member

Changed status from 'Needs User Info' to: 'Resolved'

Changed status from 'Needs User Info' to: 'Resolved'
Aaron Carlisle self-assigned this 2020-03-06 18:53:21 +01:00
Member

No reply.

No reply.
Author
Member

Sorry for coming back late. I think you'll need to obtain an access to Darwin, somehow, probably from developers who manages the build for MacOS. I ran the test using 'BASH' (did not change to Zsh for fearing the compatibility issues). I've recently updated the SVN source for $BLENDER_MAN_EN (blender_docs) and by mistake reran the

make update_po

again and the mistake is repeated. Please try to obtain a mac machine and try it out first before closing the LOG. I bet there are someone out there using MACOS to manage and build the translation from, not just me alone.

Sorry for coming back late. I think you'll need to obtain an access to Darwin, somehow, probably from developers who manages the build for MacOS. I ran the test using 'BASH' (did not change to Zsh for fearing the compatibility issues). I've recently updated the SVN source for $BLENDER_MAN_EN (blender_docs) and by mistake reran the make update_po again and the mistake is repeated. Please try to obtain a mac machine and try it out first before closing the LOG. I bet there are someone out there using MACOS to manage and build the translation from, not just me alone.
Member

Changed status from 'Resolved' to: 'Needs Triage'

Changed status from 'Resolved' to: 'Needs Triage'
Member

@ankitm I am unable to test, maybe you can triage this and comment on what's going on from the mac side?

@ankitm I am unable to test, maybe you can triage this and comment on what's going on from the mac side?
Member

Will do. Albeit by this time tomorrow

Will do. Albeit by this time tomorrow
Member

I did the steps as listed out here, (except installing requirements using conda (I'm not okay with sudo and pip))

make update_po
./tools_maintenance/update_po.sh
find: -printf: unknown primary or operator
  Error(1) on line 44, in command:
  SVN_DIRS_ALL="$(find locale/ -name '.svn' -printf '%h\n')"
make: [update_po] Error 1 (ignored)
I did the steps as listed out here, (except installing requirements using conda (I'm not okay with sudo *and* pip)) ``` make update_po ./tools_maintenance/update_po.sh find: -printf: unknown primary or operator Error(1) on line 44, in command: SVN_DIRS_ALL="$(find locale/ -name '.svn' -printf '%h\n')" make: [update_po] Error 1 (ignored) ```
Member

Changed status from 'Needs Triage' to: 'Confirmed'

Changed status from 'Needs Triage' to: 'Confirmed'
Member
For 1: https://unix.stackexchange.com/a/272493/359891 https://github.com/DerrickWood/kraken/issues/48#issuecomment-320018811 For 2: yes,` en_US.UTF-8` is the one in `locale -a`
Member

Added subscriber: @ideasman42

Added subscriber: @ideasman42
Member

Instead of the loop at
https://developer.blender.org/diffusion/BM/browse/trunk/blender_docs/tools_maintenance/update_po.sh$47
and at further locations, can we use this ?

  find locale -name '.svn' \( -exec svn cleanup "{}/../" \; -false -o -exec svn up "{}/../" \; -false -o -exec echo "done" \; \) 

SVN_DIRS_ALL is needed afterwards too, but I'm having some trouble having a nice list of directories (with spaces) without the GNU version of find.
see https://www.unix.com/man-page/mojave/1/find/

CC @ideasman42

Instead of the loop at https://developer.blender.org/diffusion/BM/browse/trunk/blender_docs/tools_maintenance/update_po.sh$47 and at further locations, can we use this ? ``` find locale -name '.svn' \( -exec svn cleanup "{}/../" \; -false -o -exec svn up "{}/../" \; -false -o -exec echo "done" \; \) ``` `SVN_DIRS_ALL` is needed afterwards too, but I'm having some trouble having a nice list of directories (with spaces) without the GNU version of `find`. see https://www.unix.com/man-page/mojave/1/find/ CC @ideasman42
Member

@hoanguk please test the differential if it fixes the first 3 points you mentioned above.

@hoanguk please test the differential if it fixes the first 3 points you mentioned above.
Member

Changed status from 'Confirmed' to: 'Resolved'

Changed status from 'Confirmed' to: 'Resolved'
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-manual#74218
No description provided.