Attempt to build Rosetta Code "Rosetta Code/Count examples" Task fails

Hi;

I attempted a build of the “Rosetta Code/Count examples” Task using ALR.

Here’s the bottom portion of my lair.toml file:

[[depends-on]]
aws = “^24.0.0”

[[depends-on]]
gnatcoll = “^24.0.0”

[[depends-on]]
libgpr = “^24.0.0”

[[depends-on]]
openssl = “^3.0.0”

[[depends-on]]
xmlada = “^24.0.0”

Here’s my build log:

Note: Building count_examples=0.1.0-dev/count_examples.gpr…
Compile
[Ada] count_examples.adb
count_examples.adb:1:07: (style) bad casing of “AWS” declared at aws.ads:32 [-gnatyr]
count_examples.adb:1:19: (style) bad casing of “AWS” declared at aws.ads:32 [-gnatyr]
count_examples.adb:1:33: (style) bad casing of “AWS” declared at aws.ads:32 [-gnatyr]
count_examples.adb:1:47: (style) bad casing of “AWS” declared at aws.ads:32 [-gnatyr]
count_examples.adb:1:62: (style) bad casing of “AWS” declared at aws.ads:32 [-gnatyr]
count_examples.adb:1:66: (style) bad casing of “URL” declared at aws-url.ads:37 [-gnatyr]
count_examples.adb:2:07: (style) bad casing of “DOM” declared at dom.ads:37 [-gnatyr]
count_examples.adb:2:20: (style) bad casing of “DOM” declared at dom.ads:37 [-gnatyr]
count_examples.adb:2:30: (style) bad casing of “DOM” declared at dom.ads:37 [-gnatyr]
count_examples.adb:2:50: (style) bad casing of “DOM” declared at dom.ads:37 [-gnatyr]
count_examples.adb:2:66: (style) bad casing of “DOM” declared at dom.ads:37 [-gnatyr]
count_examples.adb:3:47: (style) bad casing of “CES” declared at unicode-ces.ads:35 [-gnatyr]
count_examples.adb:7:06: (style) bad casing of “AWS” declared at aws.ads:32 [-gnatyr]
count_examples.adb:7:18: (style) bad casing of “AWS” declared at aws.ads:32 [-gnatyr]
count_examples.adb:7:32: (style) bad casing of “AWS” declared at aws.ads:32 [-gnatyr]
count_examples.adb:7:46: (style) bad casing of “AWS” declared at aws.ads:32 [-gnatyr]
count_examples.adb:7:61: (style) bad casing of “AWS” declared at aws.ads:32 [-gnatyr]
count_examples.adb:7:65: (style) bad casing of “URL” declared at aws-url.ads:37 [-gnatyr]
count_examples.adb:8:06: (style) bad casing of “DOM” declared at dom.ads:37 [-gnatyr]
count_examples.adb:8:19: (style) bad casing of “DOM” declared at dom.ads:37 [-gnatyr]
count_examples.adb:8:29: (style) bad casing of “DOM” declared at dom.ads:37 [-gnatyr]
count_examples.adb:8:49: (style) bad casing of “DOM” declared at dom.ads:37 [-gnatyr]
count_examples.adb:8:65: (style) bad casing of “DOM” declared at dom.ads:37 [-gnatyr]
count_examples.adb:9:06: (style) bad casing of “AWS” declared at aws.ads:32 [-gnatyr]
count_examples.adb:21:37: (style) “in” should be omitted [-gnatyI]
count_examples.adb:27:18: (style) bad casing of “AWS” declared at aws.ads:32 [-gnatyr]
count_examples.adb:33:10: error: “Response” is not visible (more references follow)
count_examples.adb:33:10: error: multiple use clauses cause hiding
count_examples.adb:33:10: error: hidden declaration at aws-response.ads:52
count_examples.adb:33:10: error: hidden declaration at aws-messages.ads:255
count_examples.adb:41:47: (style) bad casing of “CES” declared at unicode-ces.ads:35 [-gnatyr]
count_examples.adb:57:36: (style) bad casing of “AWS” declared at aws.ads:32 [-gnatyr]
count_examples.adb:58:36: (style) bad casing of “AWS” declared at aws.ads:32 [-gnatyr]
count_examples.adb:65:13: (style) bad casing of “AWS” declared at aws.ads:32 [-gnatyr]
count_examples.adb:65:17: (style) bad casing of “URL” declared at aws-url.ads:37 [-gnatyr]

compilation of count_examples.adb failed

gprbuild: *** compilation phase failed
ERROR: Command [“gprbuild”, “-s”, “-j0”, “-p”, “-P”, “/Users/kwolcott/tmp/ALR/count_examples/count_examples.gpr”] exited with code 4
ERROR: Compilation failed.

Thanks,
Retired_Build_Engineer

The standard alr build compiles with style checks, as it should. As a regrettable workround, try alr build --release, though it’s not that hard to correct all the style errors (all bar one are casing errors, e.g. Aws for AWS).

Then, you’ll get errors at lines 35 and 71,

count_examples.adb:35:10: error: "Response" is not visible
count_examples.adb:35:10: error: multiple use clauses cause hiding
count_examples.adb:35:10: error: hidden declaration at aws-response.ads:52
count_examples.adb:35:10: error: hidden declaration at aws-messages.ads:255

In both cases, it needs to be AWS.Response.

After all that,

$ bin/count_examples 

Execution of bin/count_examples terminated by unhandled exception
raised AWS.CLIENT.CONNECTION_ERROR : count_examples.adb:36

at which point it’s over to you!

1 Like

Can’t resist a challenge.

Changed the URLs from "https://rosettacode.org/mw/ ... to "https://rosettacode.org/w/ ....

Added Follow_Redirection => True to the Client.Get calls.

Worth updating the task?

1 Like

Hi Simon;

Thank you for all the help!

I’m confused about how to implement your last suggestion, but the " Added Follow_Redirection => True to the Client.Get calls."

Yes, I think that the Rosetta Code Task should be updated, but I don’t think that I should be the one to take the credit for the update.

Thanks,
Retired_Build_Engineer

Updated. It’s painfully slow, I didn’t bother to wait for it to finish!

Hi Simon;

Updated on Rosetta Code? The recent updates to Ada don’t show up on the front page “Recently updated”…so I need to check the task itself.

Even if it is very slow, if the code is “correct”, then I will learn from it.

Thanks,
Retired_Build_Engineer

i think Simon was saying that the Rosetta Code site is very slow. (Simon, please correct me if i’m wrong!) Certainly my experiences of it suggest that its underlying infrastructure is … not necessarily in the best state.

Yesterday, it took several seconds to return the raw text of an individual task’s page; today, Safari can’t make a secure connection to rosettacode.org, Firefox says it’s misconfigured, so I can’t even see how big an individual task’s page is!

The Ada code could probably be faster, but any impact of that must be extremely marginal.

Looks like the site’s certificate has just expired.