Project

General

Profile

Actions

Bug #19867

closed

Block definition right after a variable definition break the compiler

Added by Félix DALLIDET over 2 years ago. Updated almost 2 years ago.

Status:
Rejected
Priority:
N/A
Assignee:
-
Category:
rudderc
Target version:
Severity:
Minor - inconvenience | misleading | easy workaround
UX impact:
User visibility:
Operational - other Techniques | Rudder settings | Plugins
Effort required:
Priority:
14
Name check:
To do
Fix check:
To do
Regression:

Description

In a rudderlang technique, the following is correct:

CIS_rhel7_setup_filesystem state configured() {
  let bench = "CIS_RHEL7" 

  if any =>
    @index = "1.1.1.1" 
    @component = "Ensure mounting of cramfs filesystems is disabled" 
    {
      condition("${bench}_1_1_1_1").from_variable_existence("node.properties[${bench}][1.1.1.1]")
      if CIS_RHEL7_1_1_1_1_false =>
      {
        command("lsmod | grep -q cramfs").execution_result("1", "")
        command("modprobe -n -v cramfs | grep -qE 'install (/bin/true|/bin/false)'").execution_result("1", "")
      }
    }

But the same without newline after the variable definition does throw a syntax error:

CIS_rhel7_setup_filesystem state configured() {
  let bench = "CIS_RHEL7" 
  if any =>
    @index = "1.1.1.1" 
    @component = "Ensure mounting of cramfs filesystems is disabled" 
    {
      condition("${bench}_1_1_1_1").from_variable_existence("node.properties[${bench}][1.1.1.1]")
      if CIS_RHEL7_1_1_1_1_false =>
      {
        command("lsmod | grep -q cramfs").execution_result("1", "")
        command("modprobe -n -v cramfs | grep -qE 'install (/bin/true|/bin/false)'").execution_result("1", "")
      }
    }

And the error, which does fail on other part of the technique for no reasons:

An error occurred, could not create content from 'technique.rd':
'CIS_kernel_module': 'name' metadata is mandatory ; 'CIS_kernel_module': 'description' metadata is mandatory ; 'CIS_kernel_module': 'version' metadata is mandatory ; 'CIS_kernel_module': 'category' metadata is mandatory ; 'CIS_kernel_module': 'parameters' metadata is mandatory

An error occurred, could not create content: Command was "/opt/rudder/bin/rudderc" "technique" "read" "-i" "technique.rd" 

The behaviour does not seem to be fully reproductible. If I recompile right after the error, it works... Could be a cache issue?

Actions #1

Updated by François ARMAND over 2 years ago

  • Target version changed from 7.0.0~beta1 to 899
Actions #2

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 899 to 7.0.0~beta3
Actions #3

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 7.0.0~beta3 to 7.0.0~rc1
Actions #4

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 7.0.0~rc1 to 7.0.0~rc2
  • Priority changed from 32 to 31
Actions #5

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 7.0.0~rc2 to 7.0.0~rc3
Actions #6

Updated by Vincent MEMBRÉ about 2 years ago

  • Target version changed from 7.0.0~rc3 to 7.0.0
  • Priority changed from 31 to 30
Actions #7

Updated by Vincent MEMBRÉ about 2 years ago

  • Target version changed from 7.0.0 to 7.0.1
Actions #8

Updated by Vincent MEMBRÉ about 2 years ago

  • Target version changed from 7.0.1 to 7.0.2
Actions #9

Updated by Vincent MEMBRÉ about 2 years ago

  • Target version changed from 7.0.2 to 7.0.3
  • Priority changed from 30 to 29
Actions #10

Updated by Alexis Mousset almost 2 years ago

  • Target version changed from 7.0.3 to 7.2.0~beta1
  • Priority changed from 29 to 14
Actions #11

Updated by Alexis Mousset almost 2 years ago

  • Status changed from New to Rejected

Closing for now as the language is on hold.

Actions

Also available in: Atom PDF