Truncated Android SDK package paths from sdkmanager CLI - macos

./sdkmanager --list > tmp.txt gives me a .txt file like this:
Installed packages:
Path | Version | Description | Location
------- | ------- | ------- | -------
tools | 25.2.3 | Android SDK Tools 25.2.3 | tools/
Available Packages:
Path | Version | Description
------- | ------- | -------
add-ons;addon-g..._apis-google-15 | 3 | Google APIs
add-ons;addon-g..._apis-google-16 | 4 | Google APIs
add-ons;addon-g..._apis-google-17 | 4 | Google APIs
add-ons;addon-g..._apis-google-18 | 4 | Google APIs
add-ons;addon-g..._apis-google-19 | 20 | Google APIs
add-ons;addon-g..._apis-google-21 | 1 | Google APIs
add-ons;addon-g..._apis-google-22 | 1 | Google APIs
add-ons;addon-g..._apis-google-23 | 1 | Google APIs
add-ons;addon-g..._apis-google-24 | 1 | Google APIs
add-ons;addon-g...e_gdk-google-19 | 11 | Glass Development Kit Preview
build-tools;19.1.0 | 19.1.0 | Android SDK Build-Tools 19.1
Kit Preview
build-tools;19.1.0 | 19.1.0 | Android SDK Build-Tools 19.1
I want to install from some of these paths using ./sdkmanager --install <path>, but I can't, because the paths are truncated. Note I am using the standard Terminal app on macOS, if that matters.
How can I get the full paths to these packages?

This is a known issue. On Jan 19, 2017 a Googler responded with:
Thank you for suggesting this enhancement. We value the feedback from our community and hope to review your suggestion in an upcoming sprint.
Updated answer (sdkmanager >= 26.0.1)
As per the comment from #albodelu, this can now be done via:
sdkmanager --list --verbose
Which on my machine gives the following:
Info: Parsing /home/pete/apps/android-sdk/build-tools/23.0.2/package.xml
Info: Parsing /home/pete/apps/android-sdk/build-tools/23.0.3/package.xml
Info: Parsing /home/pete/apps/android-sdk/build-tools/24.0.0/package.xml
...
Installed packages:
--------------------------------------
build-tools;23.0.2
Description: Android SDK Build-Tools 23.0.2
Version: 23.0.2
Installed Location: /home/pete/apps/android-sdk/build-tools/23.0.2
build-tools;23.0.3
Description: Android SDK Build-Tools 23.0.3
Version: 23.0.3
Installed Location: /home/pete/apps/android-sdk/build-tools/23.0.3
...
Available Packages:
--------------------------------------
add-ons;addon-google_apis-google-15
Description: Google APIs
Version: 3
build-tools;19.1.0
Description: Android SDK Build-Tools 19.1
Version: 19.1.0
...
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0
Description: Solver for ConstraintLayout 1.0.0
Version: 1
...
done
If that is too verbose, then you could do something like the following:
sdkmanager --list --verbose | grep -vP "^Info:|^\s|^$|^done$"
Which uses perl-compatible regular expressions (-P) and a grep inverse matches (-v) to remove all lines starting with Info:, starting with whitespace (^\s), empty lines (^$), and lines which only include the word done:
Installed packages:
--------------------------------------
build-tools;23.0.2
build-tools;23.0.3
build-tools;24.0.0
build-tools;25.0.2
emulator
extras;android;m2repository
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-beta4
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.1
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.2
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-beta4
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2
patcher;v4
platform-tools
platforms;android-22
platforms;android-23
platforms;android-24
platforms;android-25
sources;android-24
system-images;android-10;default;x86
system-images;android-25;google_apis;x86_64
tools
Available Packages:
--------------------------------------
add-ons;addon-google_apis-google-15
add-ons;addon-google_apis-google-16
add-ons;addon-google_apis-google-17
add-ons;addon-google_apis-google-18
add-ons;addon-google_apis-google-19
add-ons;addon-google_apis-google-21
add-ons;addon-google_apis-google-22
add-ons;addon-google_apis-google-23
add-ons;addon-google_apis-google-24
add-ons;addon-google_gdk-google-19
build-tools;19.1.0
build-tools;20.0.0
build-tools;21.1.2
build-tools;22.0.1
build-tools;23.0.1
build-tools;23.0.2
build-tools;23.0.3
build-tools;24.0.0
build-tools;24.0.1
build-tools;24.0.2
build-tools;24.0.3
build-tools;25.0.0
build-tools;25.0.1
build-tools;25.0.2
build-tools;25.0.3
cmake;3.6.3155560
docs
emulator
extras;android;gapid;1
extras;android;gapid;3
extras;android;m2repository
extras;google;auto
extras;google;google_play_services
extras;google;instantapps
extras;google;m2repository
extras;google;market_apk_expansion
extras;google;market_licensing
extras;google;play_billing
extras;google;simulators
extras;google;webdriver
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha2
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha3
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha4
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha5
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha6
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha7
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha8
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha9
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-beta1
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-beta2
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-beta3
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-beta4
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-beta5
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.1
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.2
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha2
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha3
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha4
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha5
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha6
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha7
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha8
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha9
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-beta1
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-beta2
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-beta3
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-beta4
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-beta5
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.1
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.2
lldb;2.0
lldb;2.1
lldb;2.2
lldb;2.3
ndk-bundle
patcher;v4
platform-tools
platforms;android-10
platforms;android-11
platforms;android-12
platforms;android-13
platforms;android-14
platforms;android-15
platforms;android-16
platforms;android-17
platforms;android-18
platforms;android-19
platforms;android-20
platforms;android-21
platforms;android-22
platforms;android-23
platforms;android-24
platforms;android-25
platforms;android-7
platforms;android-8
platforms;android-9
sources;android-15
sources;android-16
sources;android-17
sources;android-18
sources;android-19
sources;android-20
sources;android-21
sources;android-22
sources;android-23
sources;android-24
sources;android-25
system-images;android-10;default;armeabi-v7a
system-images;android-10;default;x86
system-images;android-10;google_apis;armeabi-v7a
system-images;android-10;google_apis;x86
system-images;android-14;default;armeabi-v7a
system-images;android-15;default;armeabi-v7a
system-images;android-15;default;mips
system-images;android-15;default;x86
system-images;android-15;google_apis;armeabi-v7a
system-images;android-15;google_apis;x86
system-images;android-16;default;armeabi-v7a
system-images;android-16;default;mips
system-images;android-16;default;x86
system-images;android-16;google_apis;armeabi-v7a
system-images;android-16;google_apis;x86
system-images;android-17;default;armeabi-v7a
system-images;android-17;default;mips
system-images;android-17;default;x86
system-images;android-17;google_apis;armeabi-v7a
system-images;android-17;google_apis;x86
system-images;android-18;default;armeabi-v7a
system-images;android-18;default;x86
system-images;android-18;google_apis;armeabi-v7a
system-images;android-18;google_apis;x86
system-images;android-19;default;armeabi-v7a
system-images;android-19;default;x86
system-images;android-19;google_apis;armeabi-v7a
system-images;android-19;google_apis;x86
system-images;android-21;android-tv;armeabi-v7a
system-images;android-21;android-tv;x86
system-images;android-21;default;armeabi-v7a
system-images;android-21;default;x86
system-images;android-21;default;x86_64
system-images;android-21;google_apis;armeabi-v7a
system-images;android-21;google_apis;x86
system-images;android-21;google_apis;x86_64
system-images;android-22;android-tv;armeabi-v7a
system-images;android-22;android-tv;x86
system-images;android-22;default;armeabi-v7a
system-images;android-22;default;x86
system-images;android-22;default;x86_64
system-images;android-22;google_apis;armeabi-v7a
system-images;android-22;google_apis;x86
system-images;android-22;google_apis;x86_64
system-images;android-23;android-tv;armeabi-v7a
system-images;android-23;android-tv;x86
system-images;android-23;android-wear;armeabi-v7a
system-images;android-23;android-wear;x86
system-images;android-23;default;x86
system-images;android-23;default;x86_64
system-images;android-23;google_apis;armeabi-v7a
system-images;android-23;google_apis;x86
system-images;android-23;google_apis;x86_64
system-images;android-24;android-tv;x86
system-images;android-24;default;arm64-v8a
system-images;android-24;default;armeabi-v7a
system-images;android-24;default;x86
system-images;android-24;default;x86_64
system-images;android-24;google_apis;arm64-v8a
system-images;android-24;google_apis;armeabi-v7a
system-images;android-24;google_apis;x86
system-images;android-24;google_apis;x86_64
system-images;android-24;google_apis_playstore;x86
system-images;android-25;android-tv;x86
system-images;android-25;android-wear;armeabi-v7a
system-images;android-25;android-wear;x86
system-images;android-25;google_apis;arm64-v8a
system-images;android-25;google_apis;armeabi-v7a
system-images;android-25;google_apis;x86
system-images;android-25;google_apis;x86_64
Old answer
In the mean time, another user figured out an ugly hack to get a list of full package names:
I used --list --verbose and it listed that it was searching some xml files in ~/.android/
So... this (ugly) *nix command prints out the (full?) list of the paths... (for anyone else who stumbles upon this thread before they get a sensible fix to this issue...)
grep -Riwo -e "path.*>" ~/.android | awk -F'path="' -F'"' {'print $2'} | sort | uniq
For reference, that gives the following output for me (including a bit of junk, but I don't care because at least I can see package names now:
/>
add-ons;addon-google_apis-google-10
add-ons;addon-google_apis-google-11
add-ons;addon-google_apis-google-12
add-ons;addon-google_apis-google-13
add-ons;addon-google_apis-google-14
add-ons;addon-google_apis-google-15
add-ons;addon-google_apis-google-16
add-ons;addon-google_apis-google-17
add-ons;addon-google_apis-google-18
add-ons;addon-google_apis-google-19
add-ons;addon-google_apis-google-21
add-ons;addon-google_apis-google-22
add-ons;addon-google_apis-google-23
add-ons;addon-google_apis-google-24
add-ons;addon-google_apis-google-3
add-ons;addon-google_apis-google-4
add-ons;addon-google_apis-google-5
add-ons;addon-google_apis-google-6
add-ons;addon-google_apis-google-7
add-ons;addon-google_apis-google-8
add-ons;addon-google_apis-google-9
add-ons;addon-google_gdk-google-19
add-ons;addon-google_tv_addon-google-12
add-ons;addon-google_tv_addon-google-13
#android:color/black
build-tools;17.0.0
build-tools;18.0.1
build-tools;18.1.0
build-tools;18.1.1
build-tools;19.0.0
build-tools;19.0.1
build-tools;19.0.2
build-tools;19.0.3
build-tools;19.1.0
build-tools;20.0.0
build-tools;21.0.0
build-tools;21.0.1
build-tools;21.0.2
build-tools;21.1.0
build-tools;21.1.1
build-tools;21.1.2
build-tools;22.0.0
build-tools;22.0.1
build-tools;23.0.0
build-tools;23.0.1
build-tools;23.0.2
build-tools;23.0.3
build-tools;24.0.0
build-tools;24.0.1
build-tools;24.0.2
build-tools;24.0.3
build-tools;25.0.0
build-tools;25.0.1
build-tools;25.0.2
category=
cmake;3.6.3155560
docs
emulator
extras;android;gapid;1
extras;android;gapid;3
extras;android;m2repository
extras;google;admob_ads_sdk
extras;google;analytics_sdk_v2
extras;google;auto
extras;google;gcm
extras;google;google_play_services
extras;google;google_play_services_froyo
extras;google;m2repository
extras;google;market_apk_expansion
extras;google;market_licensing
extras;google;play_billing
extras;google;simulators
extras;google;usb_driver
extras;google;webdriver
extras;intel;Hardware_Accelerated_Execution_Manager
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha2
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha3
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha4
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha5
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha6
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha7
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha8
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-alpha9
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-beta1
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-beta2
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-beta3
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-beta4
extras;m2repository;com;android;support;constraint;constraint-layout;1.0.0-beta5
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha2
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha3
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha4
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha5
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha6
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha7
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha8
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-alpha9
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-beta1
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-beta2
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-beta3
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-beta4
extras;m2repository;com;android;support;constraint;constraint-layout-solver;1.0.0-beta5
lldb;2.0
lldb;2.1
lldb;2.2
lldb;2.3
M0,0 L24,0 L24,24 L0,24 L0,0 Z
>M12,4.5C7,4.5 2.73,7.61 1,12c1.73,4.39 6,7.5 11,7.5s9.27,-3.11 11,-7.5c-1.73,-4.39 -6,-7.5 -11,-7.5zM12,17c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5zM12,9c-1.66,0 -3,1.34 -3,3s1.34,3 3,3 3,-1.34 3,-3 -1.34,-3 -3,-3z</string>
M12,7c2.76,0 5,2.24 5,5 0,0.65 -0.13,1.26 -0.36,1.83l2.92,2.92c1.51,-1.26 2.7,-2.89 3.43,-4.75 -1.73,-4.39 -6,-7.5 -11,-7.5 -1.4,0 -2.74,0.25 -3.98,0.7l2.16,2.16C10.74,7.13 11.35,7 12,7zM2,4.27l2.28,2.28 0.46,0.46C3.08,8.3 1.78,10.02 1,12c1.73,4.39 6,7.5 11,7.5 1.55,0 3.03,-0.3 4.38,-0.84l0.42,0.42L19.73,22 21,20.73 3.27,3 2,4.27zM7.53,9.8l1.55,1.55c-0.05,0.21 -0.08,0.43 -0.08,0.65 0,1.66 1.34,3 3,3 0.22,0 0.44,-0.03 0.65,-0.08l1.55,1.55c-0.67,0.33 -1.41,0.53 -2.2,0.53 -2.76,0 -5,-2.24 -5,-5 0,-0.79 0.2,-1.53 0.53,-2.2zM11.84,9.02l3.15,3.15 0.02,-0.16c0,-1.66 -1.34,-3 -3,-3l-0.17,0.01z
M20,11L7.8,11l5.6,-5.6L12,4l-8,8l8,8l1.4,-1.4L7.8,13L20,13L20,11z
>M2,4.27 L19.73,22 L22.27,19.46 L4.54,1.73 L4.54,1 L23,1 L23,23 L1,23 L1,4.27 Z</string>
>M2,4.27 L2,4.27 L4.54,1.73 L4.54,1.73 L4.54,1 L23,1 L23,23 L1,23 L1,4.27 Z</string>
>M3.27,4.27 L19.74,20.74</string>
ndk-bundle
patcher;v4
platforms;android-10
platforms;android-11
platforms;android-12
platforms;android-13
platforms;android-14
platforms;android-15
platforms;android-16
platforms;android-17
platforms;android-18
platforms;android-19
platforms;android-2
platforms;android-20
platforms;android-21
platforms;android-22
platforms;android-23
platforms;android-24
platforms;android-25
platforms;android-3
platforms;android-4
platforms;android-5
platforms;android-6
platforms;android-7
platforms;android-8
platforms;android-9
platform-tools
sources;android-14
sources;android-15
sources;android-16
sources;android-17
sources;android-18
sources;android-19
sources;android-20
sources;android-21
sources;android-22
sources;android-23
sources;android-24
sources;android-25
#string/path_password_eye
#string/path_password_eye_mask_strike_through
#string/path_password_eye_mask_visible
system-images;android-10;default;armeabi-v7a
system-images;android-10;default;x86
system-images;android-10;google_apis;armeabi-v7a
system-images;android-10;google_apis;x86
system-images;android-14;default;armeabi-v7a
system-images;android-15;default;armeabi-v7a
system-images;android-15;default;mips
system-images;android-15;default;x86
system-images;android-15;google_apis;armeabi-v7a
system-images;android-15;google_apis;x86
system-images;android-16;default;armeabi-v7a
system-images;android-16;default;mips
system-images;android-16;default;x86
system-images;android-16;google_apis;armeabi-v7a
system-images;android-16;google_apis;x86
system-images;android-17;default;armeabi-v7a
system-images;android-17;default;mips
system-images;android-17;default;x86
system-images;android-17;google_apis;armeabi-v7a
system-images;android-17;google_apis;x86
system-images;android-18;default;armeabi-v7a
system-images;android-18;default;x86
system-images;android-18;google_apis;armeabi-v7a
system-images;android-18;google_apis;x86
system-images;android-19;default;armeabi-v7a
system-images;android-19;default;x86
system-images;android-19;google_apis;armeabi-v7a
system-images;android-19;google_apis;x86
system-images;android-21;android-tv;armeabi-v7a
system-images;android-21;android-tv;x86
system-images;android-21;default;armeabi-v7a
system-images;android-21;default;x86
system-images;android-21;default;x86_64
system-images;android-21;google_apis;armeabi-v7a
system-images;android-21;google_apis;x86
system-images;android-21;google_apis;x86_64
system-images;android-22;android-tv;armeabi-v7a
system-images;android-22;android-tv;x86
system-images;android-22;default;armeabi-v7a
system-images;android-22;default;x86
system-images;android-22;default;x86_64
system-images;android-22;google_apis;armeabi-v7a
system-images;android-22;google_apis;x86
system-images;android-22;google_apis;x86_64
system-images;android-23;android-tv;armeabi-v7a
system-images;android-23;android-tv;x86
system-images;android-23;android-wear;armeabi-v7a
system-images;android-23;android-wear;x86
system-images;android-23;default;armeabi-v7a
system-images;android-23;default;x86
system-images;android-23;default;x86_64
system-images;android-23;google_apis;armeabi-v7a
system-images;android-23;google_apis;x86
system-images;android-23;google_apis;x86_64
system-images;android-24;android-tv;x86
system-images;android-24;default;arm64-v8a
system-images;android-24;default;armeabi-v7a
system-images;android-24;default;x86
system-images;android-24;default;x86_64
system-images;android-24;google_apis;armeabi-v7a
system-images;android-24;google_apis;x86
system-images;android-24;google_apis;x86_64
system-images;android-25;android-tv;x86
system-images;android-25;android-wear;armeabi-v7a
system-images;android-25;android-wear;x86
system-images;android-25;google_apis;arm64-v8a
system-images;android-25;google_apis;armeabi-v7a
system-images;android-25;google_apis;x86
system-images;android-25;google_apis;x86_64
tools
typeId=

Here's a command to extract all installed android SDK packages with no garbage output:
find ~/.android-sdk/ -name package.xml -exec sh -c 'eval $(xmllint --xpath "//*[local-name()='\'localPackage\'']/#path" $0) && echo $path' {} \;

Related

Error while build error[E0282]: type annotations needed

error[E0282]: type annotations needed
--> /home/amiya/.cargo/registry/src/github.com-1ecc6299db9ec823/sp-arithmetic-2.0.0/src/fixed_point.rs:541:9
|
541 | let accuracy = P::ACCURACY.saturated_into();
| ^^^^^^^^ consider giving `accuracy` a type
...
1595 | / implement_fixed!(
1596 | | FixedI64,
1597 | | test_fixed_i64,
1598 | | i64,
... |
1601 | | "_Fixed Point 64 bits signed, range = [-9223372036.854775808, 9223372036.854775807]_",
1602 | | );
| |__- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0282]: type annotations needed
--> /home/amiya/.cargo/registry/src/github.com-1ecc6299db9ec823/sp-arithmetic-2.0.0/src/fixed_point.rs:541:9
|
541 | let accuracy = P::ACCURACY.saturated_into();
| ^^^^^^^^ consider giving `accuracy` a type
...
1604 | / implement_fixed!(
1605 | | FixedI128,
1606 | | test_fixed_i128,
1607 | | i128,
... |
1611 | | [-170141183460469231731.687303715884105728, 170141183460469231731.687303715884105727]_",
1612 | | );
| |__- in this macro invocation
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error[E0282]: type annotations needed
--> /home/amiya/.cargo/registry/src/github.com-1ecc6299db9ec823/sp-arithmetic-2.0.0/src/fixed_point.rs:541:9
|
541 | let accuracy = P::ACCURACY.saturated_into();
| ^^^^^^^^ consider giving `accuracy` a type
I am using Ubuntu 20.04, its giving same error for both
WASM_BUILD_TOOLCHAIN=nightly-2020-08-23 cargo build --release
and
WASM_BUILD_TOOLCHAIN=nightly-2020-10-05 cargo build --release
https://github.com/substrate-developer-hub/substrate-node-template/blob/4d97032c11b8c65936e53a61607d4522d45a29ea/Makefile
https://stackoverflow.com/a/63993797/1566713
Note: This should be fixed soon in substrate v2.0.1
For now you may need to downgrade your toolchain: https://substrate.dev/docs/en/knowledgebase/getting-started/#downgrading-rust-nightly
The known working date for me is 2020-10-5 for all toolchains, and the default uses nightly from that date.
I am on Ubuntu 20.04LTS as well, and use:
$ rustup show
Default host: x86_64-unknown-linux-gnu
rustup home: ....
installed toolchains
--------------------
stable-x86_64-unknown-linux-gnu
nightly-2020-10-05-x86_64-unknown-linux-gnu (default)
nightly-x86_64-unknown-linux-gnu
installed targets for active toolchain
--------------------------------------
wasm32-unknown-unknown
x86_64-unknown-linux-gnu
active toolchain
----------------
nightly-2020-10-05-x86_64-unknown-linux-gnu (default)
rustc 1.49.0-nightly (beb5ae474 2020-10-04)
Here's the issue https://github.com/paritytech/substrate/issues/7287
Solve with just this single line
rustup default nightly-2020-10-06 && rustup target add wasm32-unknown-unknown
This was fixed already in v2.0.1, try deleting the project and cloning again using the following command.
git clone -b v2.0.1 --depth 1 https://github.com/substrate-developer-hub/substrate-node-template

Simple Arduino PlatformIO C++11 project has undefined reference to default constructor during linking stage (but intellisense detects no errors)

I've been scouring the internet trying to find a solution and done a ton of tinkering myself, but at this point, I've lost all my hair and feel no closer to solving this problem.
The intellisense in VSCode with Platformio extension is able to auto complete the constructors from /lib/SelectWheel/SelectWheel.h, but it seems like the build linker can't find the header and/or cpp file. Why would the intellisense and build process disagree? How can I fix this?
Here's the error:
Linking .pio\build\megaatmega2560\firmware.elf
C:\Users\matth\AppData\Local\Temp\cclHZ2N6.ltrans0.ltrans.o: In function `_GLOBAL__sub_I_selectWheel':
<artificial>:(.text.startup+0xf6): undefined reference to `SelectWheel::SelectWheel()'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\megaatmega2560\firmware.elf] Error 1
Here's the terminal output for pio run -t clean and platformio run --verbose: https://pastebin.com/xn862p00
Here's the project structure:
Hydro9000
| -- .pio
| -- .vscode
| -- include
| | -- Adafruit_BusIO
| | -- Adafruit_EPD
| | -- Adafruit_GFX_Library
| | -- Adafruit_SSD1306
| | -- ArduinoSTL
| -- lib
| | -- SelectWheel
| | | -- SelectWheel.h
| | | -- SelectWheel.cpp
| -- src
| | -- main.cpp
| -- platformio.ini
Here's platformio.ini
[env:megaatmega2560]
platform = atmelavr
board = megaatmega2560
framework = arduino
Here's /src/main.cpp
#include <Arduino.h>
#include "SelectWheel/SelectWheel.h"
SelectWheel* selectWheel = new SelectWheel();
void setup() {}
void loop() {}
Here's /lib/SelectWheel/SelectWheel.h
#ifndef SelectWheel_h
#define SelectWheel_h
#include "Arduino.h"
class SelectWheel {
private:
int pinA, pinB;
public:
SelectWheel();
SelectWheel(int, int);
};
#endif
Here's /lib/SelectWheel/SelectWheel.cpp
#include "SelectWheel.h"
SelectWheel::SelectWheel() {}
SelectWheel::SelectWheel(int pinA, int pinB) {
this->pinA = pinA;
this->pinB = pinB;
pinMode(this->pinA, INPUT);
pinMode(this->pinB, INPUT);
}
Let me know if there is any additional information I can supply to help as I've already tried a bunch of ways to fix this.
I am using...
VSCode v1.47.2
PlatformIO IDE Extension (platformio.platformio-ide) v1.10.0
Microsoft C/C++ Extension (ms-vscode.cpptools) v0.29.0
According to your build log, your file SelectWheel.cpp didn't participate in build process at all (it has not been built). So, add it to build process and make sure it's linked

PostgreSQL on Windows 10. Locale is broken

I have installed PostgreSQL version 11 on Windows 10 PC two times. First time it was from official installer for Windows, second time it was a set of packages for cygwin.
The problem is, I can't get any database locale settings to work correctly. In any of the two above cases, the Postgres cluster was initialized with initdb command.
With cygwin install, the command has -E UTF8, --locale=uk_UA.utf8 and same for collation and ctypes. cygwin seemed to recognize the command, the cluster was created. Then I've created database with appropriate settings and some tables in it.
The output of simple query were plain wrong for my locale. It was $ sign instead of грн for monetary, . insteed of , for fraction and so on. The official installer gave the same results, with locale set up and displayed correctly.
Same initdb and create database are giving me correct results with linux OS.
initdb
initdb —pgdata=... \
—locale=uk_UA.utf8
—lc-collate=...
—lc-type=...
—lc-monetary=...
—lc-numeric=...
—lc-time=...
—encoding=UTF-8
Here, basically I’ve repeated the uk_UA.utf8 locale.
Also tried with “uk-x-icu” locale, as windows version compiled with icu library as it seems.
The queries
create database db
template = template0
encoding = 'UTF8'
lc_collate = 'uk_UA.utf8'
... = 'uk_UA.utf8'
lc_ctype = 'uk_UA.utf8'
connection_limit = -1
is_template = false
;
create table c_types (
id serial,
c_date date,
c_text text,
c_time time,
c_timestamp timestamp,
c_money money,
c_float float
);
insert into c_types(c_date,c_text,c_time,c_timestamp,c_money,c_float) values
('2019-09-01', 'text0', '00:00:01', timestamp '2019-09-01 20:00:00', 1000.0001, 1000.0001),
('2019-09-01', 'text1', '00:00:02', timestamp '2019-09-01 21:00:00', 2000.0001, 2000.0001)
;
select * from c_types;
Correct output(Linux)
# id | c_date | c_text | c_time | c_timestamp | c_money | c_float
#----+------------+--------+----------+---------------------+---------------+-----------
# 1 | 2019-09-01 | text0 | 00:00:01 | 2019-09-01 20:00:00 | 1 000,00грн. | 1000.0001
# 2 | 2019-09-01 | text1 | 00:00:02 | 2019-09-01 21:00:00 | 2 000,00грн. | 2000.0001
This post shows that lc_numeric does not do influence separator in numerics as is
https://stackoverflow.com/a/41759744/8339821
Influenced functions are to_number, to_char etc
https://stackoverflow.com/a/8935028/8339821
The question is, how can I set up Postgres for my locale?

How do I get Istanbul to recognize code coverage when using ESM?

I'm using ESM to loading my modules and I use them in this way:
// More info on why this is needed see (https://github.com/mochajs/mocha/issues/3006)
async function wire(){
await import("./Sanity.spec.mjs");
await import("./Other.spec.mjs");
run();
}
wire();
I run these tests using nyc mocha --delay --exit ./test/suite.js, but when I run Istanbul it does not seems to recognize my imports and fails to provide coverage information...
3 passing (14ms)
----------|----------|----------|----------|----------|-------------------|
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s |
----------|----------|----------|----------|----------|-------------------|
All files | 0 | 0 | 0 | 0 | |
----------|----------|----------|----------|----------|-------------------|
How can I get Istanbul to recognize the ESM loaded code?
Native ESM support is available from Mocha v7.1.0 (February 2020).
See:
Relase notes: https://github.com/mochajs/mocha/releases/tag/v7.1.0
Pull request: https://github.com/mochajs/mocha/pull/4038

can't get network-id using quantum_network in ansible ad-hoc command, while it works in neutron command

My environment: Ansible 1.7.1/Ubuntu
I have a private OpenStack network, it works correctly if I use the neutron command:
$ env | grep OS_
OS_PASSWORD=cai
OS_AUTH_URL=http://demo-controller:35357/v2.0
OS_USERNAME=larry
OS_TENANT_NAME=demo
$ neutron net-list
+--------------------------------------+---------+--------------------------+
| id | name | subnets |
+--------------------------------------+---------+--------------------------+
| 5ecc0fbb-091b-4c6a-b905-c73e66e1ffda | ext-net | 3aa6539d-24d3-4c06-.. |
| 76506b52-1980-470c-b438-094e8b4bb3e7 | demo-1 | 52cd943d-7f25-4a11-.. |
+--------------------------------------+---------+--------------------------+
Now I want to get the network-id using the quantum_network module:
$ ansible localhost -m quantum_network -a "state=present login_username=larry login_password=cai login_tenant_name=demo name=demo-1 auth_url=http://demo-controller:35357/v2.0/" -v
But that throws an authentication error:
... File \"/usr/lib/python2.7/dist-packages/keystoneclient/utils.py\", line 318, in
inner\n return func(*args, **kwargs)\n File \"/usr/lib/python2.7/dist- packages/keystoneclient/session.py\", line 251, in request\n raise exceptions.from_response(resp, method, url)\nkeystoneclient.apiclient.exceptions.Forbidden: You are not authorized to perform the requested action, admin_required. (HTTP 403)\n",
"parsed": false
What is the problem?
It is the bug in quantum_network module, see issue #7275, it requires admin permission to get tenant id, which is not needed always.
Not sure which ansible release will include this.
I use the commit as patch in my release

Resources