Acknowledged

Bug: Include barrel by path with a .barrel file present causes weird behaviour

Have jungle file that includes a barrel:

project.manifest = manifest.xml
FOO = "../barrels/FOO"
# similar results
FOO = ["../barrels/FOO/monkey.jungle"]
base.FOO.annotations = whatever
base.barrelpath = $(base.barrelpath):$(FOO)

This works nice and fine.

Now, if for whatever reason you have build a barrel in the barrel can be found IN the path, eg ../barrels/FOO/bin/FOO.barrel and you later add a function to the barrel without making the barrel file) and want to use that function the project that has the above mentioned barrel include it breaks. You'll get messages like Undefined symbol "foo" detected. It appears the barrel is than looked up via the barrel file and not via the path, which is not what you expect given the monkey.jungle file you have. Especially if you specify a monkey.jungle file.

Parents
  • My barrel annotion is actually OPN so there isn't a name clash. I can tar two projects that exhibit this problem, sure.

    https://drive.google.com/drive/folders/1dLiFKe12C6pMjuV0zPvzW5zfmy5Wyu_N?usp=sharing

    ```
    ERROR: fenix6xpro: /home/ciq/src/source/t/typechecking.mc:27: Undefined symbol ':notexists' detected.
    make: *** [/etc/garmin-connectiq/Makefile.ciq:32: bin/fenix6xpro-TheBuggyApp-3.2.6.test.prg] Error 105`

    ```

    If you remove the bin dir from OPN-MonkeyC you don't get the error

    ```

    _ciq@d9231fe54002:~/src$ make test
    mkdir -p bin
    monkeyc -w -l 1 \
    -o bin/fenix6xpro-TheBuggyApp-3.2.6.test.prg \
    -d fenix6xpro \
    -c 3.2.6 \
    -y /home/ciq/.Garmin/ConnectIQ/developer.der \
    -f /home/ciq/src/monkey.jungle \
    -t

    ERROR: fenix6xpro: /home/ciq/src/source/t/typechecking.mc:27: Undefined symbol ':notexists' detected.
    make: *** [/etc/garmin-connectiq/Makefile.ciq:32: bin/fenix6xpro-TheBuggyApp-3.2.6.test.prg] Error 105
    _ciq@d9231fe54002:~/src$ rm -rf ../barrels/OPN/bin/*
    _ciq@d9231fe54002:~/src$ make test
    mkdir -p bin
    monkeyc -w -l 1 \
    -o bin/fenix6xpro-TheBuggyApp-3.2.6.test.prg \
    -d fenix6xpro \
    -c 3.2.6 \
    -y /home/ciq/.Garmin/ConnectIQ/developer.der \
    -f /home/ciq/src/monkey.jungle \
    -t
    WARNING: The launcher icon (30x30) isn't compatible with the specified launcher icon size of the device 'fenix6xpro' (40x40). Image will be scaled to the target size.
    export DISPLAY_OLD=:0
    DISPLAY=:1 Xvfb ":1" -screen 0 1280x1024x24 &
    pkill simulator || true
    DISPLAY=:1 simulator 1>/dev/null & sleep 1
    18:32:32: Debug: Adding duplicate image handler for 'JPEG file'
    18:32:32: Debug: SetLayout
    monkeydo ./bin/fenix6xpro-TheBuggyApp-3.2.6.test.prg fenix6xpro -t
    ------------------------------------------------------------------------------
    Executing test TestTypechecking.testTypechecker...
    I do not exist in the barrel
    # Works for me
    PASS
    ------------------------------------------------------------------------------
    Executing test OPN.testTime...
    PASS
    ------------------------------------------------------------------------------
    Executing test OPN.testDuration...
    PASS
    ------------------------------------------------------------------------------
    Executing test OPN.testWeight...
    PASS
    ------------------------------------------------------------------------------
    Executing test OPN.testTestMore...
    PASS
    ------------------------------------------------------------------------------
    Executing test OPN.testUUID...
    # 17c2b4c3a8c24cc38375576cc2b8c2acc285c3861f473579
    # 25677f47-c38b-42a6-9d40-c3a252c3aac2
    # ????????
    C???????? ????"????????????
    PASS
    ------------------------------------------------------------------------------
    Executing test OPN.testGetCoordinates...
    PASS
    ------------------------------------------------------------------------------
    Executing test OPN.testGetCoordinatesOfBox...
    PASS
    ------------------------------------------------------------------------------
    Executing test OPN.testTemp...
    PASS
    ------------------------------------------------------------------------------
    Executing test OPN.testDistance...
    PASS

    ==============================================================================
    RESULTS
    Test: Status:
    TestTypechecking.testTypechecker PASS
    OPN.testTime PASS
    OPN.testDuration PASS
    OPN.testWeight PASS
    OPN.testTestMore PASS
    OPN.testUUID PASS
    OPN.testGetCoordinates PASS
    OPN.testGetCoordinatesOfBox PASS
    OPN.testTemp PASS
    OPN.testDistance PASS
    Ran 10 tests

    PASSED (passed=10, failed=0, errors=0)
    pkill simulator
    pkill Xvfb

    ```

Comment
  • My barrel annotion is actually OPN so there isn't a name clash. I can tar two projects that exhibit this problem, sure.

    https://drive.google.com/drive/folders/1dLiFKe12C6pMjuV0zPvzW5zfmy5Wyu_N?usp=sharing

    ```
    ERROR: fenix6xpro: /home/ciq/src/source/t/typechecking.mc:27: Undefined symbol ':notexists' detected.
    make: *** [/etc/garmin-connectiq/Makefile.ciq:32: bin/fenix6xpro-TheBuggyApp-3.2.6.test.prg] Error 105`

    ```

    If you remove the bin dir from OPN-MonkeyC you don't get the error

    ```

    _ciq@d9231fe54002:~/src$ make test
    mkdir -p bin
    monkeyc -w -l 1 \
    -o bin/fenix6xpro-TheBuggyApp-3.2.6.test.prg \
    -d fenix6xpro \
    -c 3.2.6 \
    -y /home/ciq/.Garmin/ConnectIQ/developer.der \
    -f /home/ciq/src/monkey.jungle \
    -t

    ERROR: fenix6xpro: /home/ciq/src/source/t/typechecking.mc:27: Undefined symbol ':notexists' detected.
    make: *** [/etc/garmin-connectiq/Makefile.ciq:32: bin/fenix6xpro-TheBuggyApp-3.2.6.test.prg] Error 105
    _ciq@d9231fe54002:~/src$ rm -rf ../barrels/OPN/bin/*
    _ciq@d9231fe54002:~/src$ make test
    mkdir -p bin
    monkeyc -w -l 1 \
    -o bin/fenix6xpro-TheBuggyApp-3.2.6.test.prg \
    -d fenix6xpro \
    -c 3.2.6 \
    -y /home/ciq/.Garmin/ConnectIQ/developer.der \
    -f /home/ciq/src/monkey.jungle \
    -t
    WARNING: The launcher icon (30x30) isn't compatible with the specified launcher icon size of the device 'fenix6xpro' (40x40). Image will be scaled to the target size.
    export DISPLAY_OLD=:0
    DISPLAY=:1 Xvfb ":1" -screen 0 1280x1024x24 &
    pkill simulator || true
    DISPLAY=:1 simulator 1>/dev/null & sleep 1
    18:32:32: Debug: Adding duplicate image handler for 'JPEG file'
    18:32:32: Debug: SetLayout
    monkeydo ./bin/fenix6xpro-TheBuggyApp-3.2.6.test.prg fenix6xpro -t
    ------------------------------------------------------------------------------
    Executing test TestTypechecking.testTypechecker...
    I do not exist in the barrel
    # Works for me
    PASS
    ------------------------------------------------------------------------------
    Executing test OPN.testTime...
    PASS
    ------------------------------------------------------------------------------
    Executing test OPN.testDuration...
    PASS
    ------------------------------------------------------------------------------
    Executing test OPN.testWeight...
    PASS
    ------------------------------------------------------------------------------
    Executing test OPN.testTestMore...
    PASS
    ------------------------------------------------------------------------------
    Executing test OPN.testUUID...
    # 17c2b4c3a8c24cc38375576cc2b8c2acc285c3861f473579
    # 25677f47-c38b-42a6-9d40-c3a252c3aac2
    # ????????
    C???????? ????"????????????
    PASS
    ------------------------------------------------------------------------------
    Executing test OPN.testGetCoordinates...
    PASS
    ------------------------------------------------------------------------------
    Executing test OPN.testGetCoordinatesOfBox...
    PASS
    ------------------------------------------------------------------------------
    Executing test OPN.testTemp...
    PASS
    ------------------------------------------------------------------------------
    Executing test OPN.testDistance...
    PASS

    ==============================================================================
    RESULTS
    Test: Status:
    TestTypechecking.testTypechecker PASS
    OPN.testTime PASS
    OPN.testDuration PASS
    OPN.testWeight PASS
    OPN.testTestMore PASS
    OPN.testUUID PASS
    OPN.testGetCoordinates PASS
    OPN.testGetCoordinatesOfBox PASS
    OPN.testTemp PASS
    OPN.testDistance PASS
    Ran 10 tests

    PASSED (passed=10, failed=0, errors=0)
    pkill simulator
    pkill Xvfb

    ```

Children