Skip to content

antlr: Turn off CSharp#8157

Merged
scheibelp merged 6 commits intospack:developfrom
citibeth:efischer/180516-FixANTLR
May 18, 2018
Merged

antlr: Turn off CSharp#8157
scheibelp merged 6 commits intospack:developfrom
citibeth:efischer/180516-FixANTLR

Conversation

@citibeth
Copy link
Copy Markdown
Member

On my SUSE11 system, ANLTR build of the CSharp bindings was failing due to a lack of system-installed CSharp on the system. Unless we add csharp support to Spack, we should disable the ANTLR CSharp bindings.

Note the available options for ANTLR's ./configure script. This stuff isn't really documented anywhere else:

Optional Features:
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --enable-java           enable or disable ANTLR for Java (enabled)

  --enable-cxx            enable or disable ANTLR for C++ (enabled)

  --enable-python         enable or disable ANTLR for Python (enabled).

  --enable-csharp         enable or disable ANTLR for C# (enabled)

  --enable-verbose        turn on verbosity when building package.

  --enable-debug          set debug level - any value greater zero enables a
                          debug version

  --enable-examples       include examples into this configuration (enabled)

  --enable-allow-partially-trusted-callers
                          allow partially trusted callers (C#)

Elizabeth Fischer added 2 commits May 16, 2018 12:58
@healther
Copy link
Copy Markdown
Contributor

Why not make it into a variant? The default could be up for debate (with a slight preference to "as configure without arguments would build it" from me, but idc)

@citibeth
Copy link
Copy Markdown
Member Author

citibeth commented May 17, 2018 via email

@adamjstewart
Copy link
Copy Markdown
Member

I think I agree with @citibeth here, I don't like the idea of Spack packages linking to system libraries. If someone needs C# support, they'll need to add a C# package to Spack first.

'--{0}-python'.format('enable' if '+python' in spec else 'disable')
'--{0}-cxx'.format(E if '+cxx' in spec else D),
'--{0}-java'.format(E if '+java' in spec else D),
'--{0}-python'.format(E if '+python' in spec else D),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Aside from the --disable-csharp change, I would leave the rest of this package the same. PEP 8 says not to use capital letters in variable names. Also, single character variables names aren't very descriptive.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I would leave the rest of this package the same.

Unfortunately I can't. Adding a comma to the '+python' line caused it to fail flake8 by going 1 character over the 79-char limit. The changes above are a solution to that problem.

PEP 8 says not to use capital letters in variable names.
PEP8 also says:
Constants are... written in all capital letters with underscores separating words. Examples include MAX_OVERFLOW and TOTAL.

Also, single character variables names aren't very descriptive.

The names are defined, then used immediately over the next 4 lines. Should not be a problem. And if they were longer, it would defeat the purpose.

If there's another solution to the original problem that you like better, please suggest it.

Copy link
Copy Markdown
Member

@scheibelp scheibelp May 18, 2018

Choose a reason for hiding this comment

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

A few Two things:

  • Autotools packages have access to the enable_or_disable function which should do this automatically for you
  • More generally, for flake, you can split after the format:
         return [
             '--{0}-cxx'.format(E if '+cxx' in spec else D),
             '--{0}-java'.format(E if '+java' in spec else D),
             '--{0}-python'.format(
                 E if '+python' in spec else D),
             '--disable-csharp'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Move --disable-csharp to the beginning so python is still last?

@citibeth
Copy link
Copy Markdown
Member Author

citibeth commented May 18, 2018 via email

@scheibelp
Copy link
Copy Markdown
Member

The question is, what is the preferred approach? I would have been happy to just leave the whole thing alone.

As for that I don't think you can leave it alone (at least the enable-python line since it adds a comma). Edits that would reduce the churn the most would be:

         return [
             '--{0}-cxx'.format('enable' if '+cxx' in spec else 'disable'),
             '--{0}-java'.format('enable' if '+java' in spec else 'disable'),
             '--{0}-python'.format(
                 'enable' if '+python' in spec else 'disable'),
             '--disable-csharp'

The first two lines would be excluded from the diff. That's my preference. I'd also be fine with the use of the enable_or_disable function.

Elizabeth Fischer and others added 3 commits May 17, 2018 23:01
This reverts commit 58ec10c.
This reverts commit f19bd90.
@scheibelp scheibelp merged commit 780cc9d into spack:develop May 18, 2018
@adamjstewart adamjstewart deleted the efischer/180516-FixANTLR branch May 18, 2018 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants