Skip to content

Comments

Use a fallback mirror for code.dlang.org#273

Merged
wilzbach merged 1 commit intodlang:masterfrom
wilzbach:dub-mirror
Apr 5, 2018
Merged

Use a fallback mirror for code.dlang.org#273
wilzbach merged 1 commit intodlang:masterfrom
wilzbach:dub-mirror

Conversation

@wilzbach
Copy link
Contributor

@wilzbach wilzbach commented Dec 4, 2017

As #218 doesn't seem to be moving forward, I have uploaded all DUB releases to GitHub, which should be much more reliable (see dlang/dub#1290 for details).
At the moment, there isn't a mirror for code.dlang.org/download/LATEST (we should probably create a gh-pages repo like LDC or use an S3 bucket), so for now I simply used the GitHub API. I know that it's rate-limited, but imho having a chance to succeed is a lot better than having none.

If code.dlang.org is down, we still manage to get the latest DUB:

dmd-2.077.1 already installed
curl: (7) Failed to connect to code.dlang.org port 80: Connection refused
curl: (7) Failed to connect to code.dlang.org port 80: Connection refused
curl: (7) Failed to connect to code.dlang.org port 80: Connection refused
curl: (7) Failed to connect to code.dlang.org port 80: Connection refused
curl: (7) Failed to connect to code.dlang.org port 80: Connection refused
Failed to download 'http://code.dlang.org/download/LATEST'
Downloading and unpacking http://code.dlang.org/files/dub-1.6.0-linux-x86_64.tar.gz

curl: (7) Failed to connect to code.dlang.org port 80: Connection refused
Downloading and unpacking https://github.com/dlang/dub/releases/download/v1.6.0/dub-1.6.0-linux-x86_64.tar.gz
######################################################################## 100.0%

Run `source ~/dlang/dmd-2.077.1/activate` in your shell to use dmd-2.077.1.
This will setup PATH, LIBRARY_PATH, LD_LIBRARY_PATH, DMD, DC, and PS1.
Run `deactivate` later on to restore your environment.

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @wilzbach!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

logV "Determining latest dub version ($url)."
version=$(fetch $url)
if [ -z "${version}" ] ; then
version=$(curl -s https://api.github.com/repos/dlang/dub/releases/latest | grep tag_name | sed -e 's/.*"tag_name": "v\([^"]*\)".*/\1/')
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This will be replaced soon once an actual mirror for LATEST exists

@wilzbach
Copy link
Contributor Author

Are you okay with adding this fallback mirror @MartinNowak?

@wilzbach
Copy link
Contributor Author

What's wrong with this? Code.dlang.org is often down and we mirrored all dub releases to GitHub.
Also only DMD and LDC ship with dub

wilzbach added a commit to wilzbach/dmd that referenced this pull request Jan 12, 2018
@wilzbach
Copy link
Contributor Author

wilzbach commented Jan 29, 2018

A few things have changed here:

  1. People are still using GDC and old DMD compilers and experience failures due to code.dlang.org being down
  2. There's https://dlang.github.io/dub/LATEST now (see Can we switch to hosting the DUB binaries on GitHub? dub#1290 (comment)), so now workarounds will be needed
  3. There's Use fallback mirrors in the install script #291 which adds mirroring capability to fetch and download

-> I'm reopening this, s.t. it doesn't get forgotten and I will revive and rebase it once #291 has been merged.

@wilzbach wilzbach reopened this Jan 29, 2018
@dlang dlang deleted a comment from codecov-io Feb 19, 2018
@wilzbach
Copy link
Contributor Author

I will revive and rebase it once #291 has been merged.

Done. Also note that the DUB binaries will soon be auto-deployed to GitHub, s.t. code.dlang.org/download might be retired.

@wilzbach
Copy link
Contributor Author

wilzbach commented Apr 5, 2018

Going to merge this now as the errors are still a thing, I'm tired of waiting for such a simple fix and the backup "mirror" now got the primary "upstream" for the binaries.

@wilzbach wilzbach merged commit 6763102 into dlang:master Apr 5, 2018
@wilzbach wilzbach deleted the dub-mirror branch April 5, 2018 01:02
dub="dub-$(fetch $url)"
local latestMirrors=(
"http://code.dlang.org/download/LATEST"
"http://dlang.github.io/dub/LATEST"
Copy link
Member

Choose a reason for hiding this comment

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

Why not https?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think simply because it wasn't using https before

@MartinNowak
Copy link
Member

Sorry, must have forgotten to submit a comment or accidentally hit the close button. Definitely helpful in the short-term.

It's still a bit unfortunate that dub releases are lingering between dlang.org and code.dlang.org (and now GH).
I'm not particularly convinced that we want to go further into GH releases as they are quite cumbersome and rely on quite a lot of services.

How about just archiving old dub releases that preceed the dmd integration.
I'm also open to extract separate binary dub tars/zips from the official releases and publish them on the existing release pipeline.

My main point here is to avoid the maintenance overhead of a second release pipeline when we already have established infrastructure and processes in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants