Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build failure in alire/macOS #1150

Open
simonjwright opened this issue Jun 12, 2023 · 4 comments
Open

Build failure in alire/macOS #1150

simonjwright opened this issue Jun 12, 2023 · 4 comments

Comments

@simonjwright
Copy link
Contributor

simonjwright commented Jun 12, 2023

After alr get ada_language_server, this happens:

Running post_fetch actions for ada_language_server=23.0.0...
sed: 1: "gnat/lsp_server.gpr": extra characters at the end of g command
error: A post-fetch action failed, re-run with -vv -d for details

I’ve found a working fix: it seems that this action needs the -E or -r switch.

[[actions]]
command = [
"sed",
"-i",                                 <<< here
"-e/gpr2/s/^/--  /",
"gnat/lsp_server.gpr",
]
directory = "."
type = "post-fetch"

The man page for -E says

Interpret regular expressions as extended (modern) regular expressions rather than basic regular expressions (BRE's). The re_format(7) manual page fully describes both formats.

The man page for -r says

Same as -E for compatibility with GNU sed.

There’s a note: "The -E option[ is a] non-standard FreeBSD extension[s] and may not be available on other operating systems."

@reznikmm
Copy link
Contributor

Thank you @simonjwright to trying ALS on Mac OS X (apple silicon?). This sed invocation is a quick fix to drop dependency on libgpr2, not used in ALS 23.0.0. I execute

sed -i "-e/gpr2/s/^/--  /" gnat/lsp_server.gpr

The -i switch in GNU sed means in-place:

  -i[SUFFIX], --in-place[=SUFFIX]

          edit files in place (makes backup if SUFFIX supplied)

If sed in Mac OS doesn't support -i then -E nor -r won't help, unfortunately. You can comment out that line in gnat/lsp_server.gpr in any editor then continue. Just find with "gpr2.gpr"; and comment it out.

This trick won't be needed in next version of ALS, but libgpr2 needed as a dependency. So I'm closing this issue, unless you can propose other simple way to comment this line.

@reznikmm
Copy link
Contributor

Found this discussion. Could you try

[[actions]]
command = [
"sed",
"-i.bak",
"-e/gpr2/s/^/--  /",
"gnat/lsp_server.gpr",
]
directory = "."
type = "post-fetch"

Or

[[actions]]
command = [
"sed",
"-i",
"",
"-e/gpr2/s/^/--  /",
"gnat/lsp_server.gpr",
]
directory = "."
type = "post-fetch"

@reznikmm reznikmm reopened this Jun 12, 2023
@simonjwright
Copy link
Contributor Author

simonjwright commented Jun 12, 2023

Both of those suggestions worked. My previous tries worked because I’d accidentally set the backup prefix to -r!

And yes, this is Apple silicon.

One problem I came up against was

   [Ada]          tagada_marshalling_lib.adb
   [Ada]          tgen-types.adb
tagada_marshalling_lib.adb:633:19: warning: types for unchecked conversion have different sizes [-gnatwz]
tagada_marshalling_lib.adb:738:19: warning: types for unchecked conversion have different sizes [-gnatwz]

which is because, on aarch64 (at any rate, gcc 13.1.0’s system.ads), Long_Long_Float is a mere 64 bits long. This is in libadalang, but seems to have been dropped from the current commits.

Also the objcopy issue, here & in libadalang_tools.

@reznikmm
Copy link
Contributor

May be you can suppress -gnatwe with

alr build -- -gnatwn

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

No branches or pull requests

2 participants