Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Alpine fix; plus 1 #8821

Merged
merged 3 commits into from
Mar 16, 2018
Merged

Conversation

johnbeisner
Copy link

@johnbeisner johnbeisner commented Mar 16, 2018

  • The '-n' option to 'cp' does not exist for Alpine [try "-u"]
  • Don't use "$ID.$VERSION_ID" for the error message

Addresses: https://github.com/dotnet/cli/issues/8738
CP options for Alpine:
From: http://www.spblinux.de/2.0/doc/cp.html
-a Same as -dpR
-d Preserve links
-p Preserve file attributes if possible
-R Copy directories recursively

@johnbeisner
Copy link
Author

@janvorli
Do you have an Alpine that we can try this on?

@janvorli
Copy link
Member

@johnbeisner yes, I do, will test it soon.

@omajid
Copy link
Member

omajid commented Mar 16, 2018

@natemcmaster
Copy link

When I use Alpine 3.6, I see some additional options on cp.

BusyBox v1.26.2 (2017-11-23 08:40:54 GMT) multi-call binary.

Usage: cp [OPTIONS] SOURCE... DEST

Copy SOURCE(s) to DEST

	-a	Same as -dpR
	-R,-r	Recurse
	-d,-P	Preserve symlinks (default if -R)
	-L	Follow all symlinks
	-H	Follow symlinks on command line
	-p	Preserve file attributes if possible
	-f	Overwrite
	-i	Prompt before overwrite
	-l,-s	Create (sym)links
	-u	Copy only newer files

Would -u be an adequate replacement for -n?

@janvorli
Copy link
Member

@johnbeisner the script seems to work on Alpine, there is just one warning:

DOTNET_INSTALL_SKIP_PREREQS=1 ./dotnet-install.sh --version 2.1.300-preview2-008251
dotnet-install: Downloading link: https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.300-preview2-008251/dotnet-sdk-2.1.300-preview2-008251-alpine.3.6-x64.tar.gz
dotnet-install: Extracting zip from https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.300-preview2-008251/dotnet-sdk-2.1.300-preview2-008251-alpine.3.6-x64.tar.gz
./dotnet-install.sh: line 573: linux_platform_name: unbound variable
dotnet-install: Adding to current process PATH: `/home/janvorli/.dotnet`. Note: This change will be visible only when sourcing script.
dotnet-install: Installation finished successfully.

@johnbeisner
Copy link
Author

@natemcmaster
"Would -u be an adequate replacement for -n?" - do all Alpine boxes have BusyBox v1.26.2?

@natemcmaster
Copy link

I'm not sure. The only way I've used Alpine is via Docker. docker run --rm -it alpine:3.6 cp --help

@janvorli
Copy link
Member

@johnbeisner it still works ok.

@johnbeisner
Copy link
Author

@janvorli
May I see the verbose output?

Copy link

@natemcmaster natemcmaster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ghost
Copy link

ghost commented Mar 16, 2018

It works on Alpine 3.6 with DOTNET_INSTALL_SKIP_PREREQS=1 ./dotnet-install.sh, but it does NOT work on latest Alpine 3.7, released in Nov 2017..
If I manually install 3.6 tarball on latest 3.7, then Console, Lib and MVC apps all work fine. So RID detection should be flexible (https://github.com/dotnet/core-setup/issues/3817).

Secondly, it would be nice to have a portable (non-GNU) way of finding the libs, instead of ldconfig, so we don't have to set DOTNET_INSTALL_SKIP_PREREQS.

@ghost
Copy link

ghost commented Mar 16, 2018

From docker run -it alpine:latest (v3.7):

/ # DOTNET_INSTALL_SKIP_PREREQS=1 ./dotnet-install.sh --verbose -c master
dotnet-install: Calling: machine_has curl
dotnet-install: Calling: calculate_vars
dotnet-install: Calling: get_normalized_architecture_from_architecture <auto>
dotnet-install: Calling: get_machine_architecture
dotnet-install: Calling: get_normalized_architecture_from_architecture x64
dotnet-install: normalized_architecture=x64
dotnet-install: Calling: get_specific_version_from_version https://dotnetcli.azureedge.net/dotnet master x64 Latest
dotnet-install: Calling: get_latest_version_info https://dotnetcli.azureedge.net/dotnet master x64 false
dotnet-install: get_latest_version_info: latest url: https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/latest.version
dotnet-install: Calling: download https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/latest.version
dotnet-install: Calling: machine_has curl
dotnet-install: Calling: downloadcurl https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/latest.version
dotnet-install: get_specific_version_from_version: version_info=005f87257ad6fca9d1801b239f62fa69f89b0241
2.1.300-preview2-008372
dotnet-install: Calling: get_version_from_version_info
dotnet-install: specific_version=2.1.300-preview2-008372
dotnet-install: Calling: construct_download_link https://dotnetcli.azureedge.net/dotnet master x64 2.1.300-preview2-008372
dotnet-install: Calling: get_current_os_name
dotnet-install: Calling: get_linux_platform_name
dotnet-install: download_link=https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.300-preview2-008372/dotnet-sdk-2.1.300-preview2-008372-linux-x64.tar.gz
dotnet-install: Calling: construct_legacy_download_link https://dotnetcli.azureedge.net/dotnet master x64 2.1.300-preview2-008372
dotnet-install: Calling: get_legacy_os_name
dotnet-install: Calling: get_legacy_os_name_from_platform alpine.3.7.0
dotnet-install: Distribution specific OS name and version could not be detected: UName = Linux
dotnet-install: Cound not construct a legacy_download_link; omitting...
dotnet-install: Calling: resolve_installation_path <auto>
dotnet-install: Calling: get_user_install_path
dotnet-install: resolve_installation_path: user_install_path=/root/.dotnet
dotnet-install: install_root=/root/.dotnet
dotnet-install: Calling: check_pre_reqs
dotnet-install: Calling: install_dotnet
dotnet-install: Calling: is_dotnet_package_installed /root/.dotnet sdk 2.1.300-preview2-008372
dotnet-install: Calling: combine_paths /root/.dotnet sdk
dotnet-install: combine_paths: root_path=/root/.dotnet
dotnet-install: combine_paths: child_path=sdk
dotnet-install: Calling: combine_paths /root/.dotnet/sdk 2.1.300-preview2-008372
dotnet-install: combine_paths: root_path=/root/.dotnet/sdk
dotnet-install: combine_paths: child_path=2.1.300-preview2-008372
dotnet-install: is_dotnet_package_installed: dotnet_package_path=/root/.dotnet/sdk/2.1.300-preview2-008372
dotnet-install: Zip path: /tmp/dotnet.XXXOONPJB
dotnet-install: Downloading link: https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.300-preview2-008372/dotnet-sdk-2.1.300-preview2-008372-linux-x64.tar.gz
dotnet-install: Calling: download https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.300-preview2-008372/dotnet-sdk-2.1.300-preview2-008372-linux-x64.tar.gz /tmp/dotnet.XXXOONPJB
dotnet-install: Calling: machine_has curl
dotnet-install: Calling: downloadcurl https://dotnetcli.azureedge.net/dotnet/Sdk/2.1.300-preview2-008372/dotnet-sdk-2.1.300-preview2-008372-linux-x64.tar.gz /tmp/dotnet.XXXOONPJB

Trying to fetch dotnet-sdk-2.1.300-preview2-008372-linux-x64.tar.gz

@johnbeisner
Copy link
Author

@kasper3
"but it does NOT work on latest Alpine 3.7" - the install script does not support Alpine 3.7; we build an Alpine 3.6* specific asset: dotnet-sdk-2.1.300-preview2-008251-alpine.3.6-x64.tar.gz we do not create a Alpine 3.7 asset.

@ghost
Copy link

ghost commented Mar 16, 2018

@johnbeisner, there is no alpine 3.6 specific asset as I mentioned earlier. You should really give manual install a try (max time 3 minutes if you have docker installed)

docker run -it alpine:latest
# or alpine:3.7

# in container
apk update
apk add curl libstdc++ libunwind libintl icu-libs openssl

curl -O https://dotnetcli.blob.core.windows.net/dotnet/Sdk/master/dotnet-sdk-latest-alpine.3.6-x64.tar.gz
mkdir -p /usr/bin/dotnet
tar -xzvf dotnet-sdk-latest-alpine.3.6-x64.tar.gz  -C /usr/bin/dotnet
export PATH=$PATH:/usr/bin/dotnet
rm dotnet-sdk-latest-alpine.3.6-x64.tar.gz

nugetConfDir="/root/.nuget/NuGet"
mkdir -p $nugetConfDir
cat > $nugetConfDir/NuGet.Config <<-"EOF"
<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
    <add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
  </packageSources>
</configuration>
EOF

now you can do dotnet new console etc.

So the bug in this dotnet-install.sh script is the hardcoded 3.6..

@johnbeisner
Copy link
Author

@kasper3
Please advocate for: https://github.com/dotnet/core-setup/issues/3817 I believe that is the best use of your efforts to effect the change you would like to see.

@ghost
Copy link

ghost commented Mar 16, 2018

OK thanks. Regarding this PR, is the proposed solution from dotnet/cli team for Alpine (any version) is to set DOTNET_INSTALL_SKIP_PREREQS=1, since ldconfig usage is not functional on Alpines (and https://github.com/dotnet/cli/issues/8792 was closed)?

@johnbeisner
Copy link
Author

@kasper3
For now - yes, but we reserve the right to improve the user experience over time.

@johnbeisner johnbeisner merged commit 470acd8 into dotnet:release/2.1.3xx Mar 16, 2018
@johnbeisner johnbeisner deleted the InstallScript branch January 17, 2019 17:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants