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

Add Linux Support #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Add Linux Support #1

wants to merge 1 commit into from

Conversation

kadircancetin
Copy link

This is Linux binary. I test it with


(algojig) ➜  algojig git:(linux-support) cat /etc/*release
Manjaro Linux
DISTRIB_ID=ManjaroLinux
DISTRIB_RELEASE=21.3.1
DISTRIB_CODENAME=Ruah
DISTRIB_DESCRIPTION="Manjaro Linux"
Manjaro Linux
NAME="Manjaro Linux"
ID=manjaro
ID_LIKE=arch
BUILD_ID=rolling
PRETTY_NAME="Manjaro Linux"
ANSI_COLOR="32;1;24;144;200"
HOME_URL="https://manjaro.org/"
DOCUMENTATION_URL="https://wiki.manjaro.org/"
SUPPORT_URL="https://manjaro.org/"
BUG_REPORT_URL="https://bugs.manjaro.org/"
LOGO=manjarolinux

(algojig) ➜  algojig git:(linux-support) uname -a
Linux kadir-20y7004etx 5.17.15-1-MANJARO #1 SMP PREEMPT Wed Jun 15 07:09:31 UTC 2022 x86_64 GNU/Linux

Because I don't know how can I support more than one binary, I replace mac binary.

@fergalwalsh please lead me about supporting multiple platforms.

@fergalwalsh
Copy link
Collaborator

gojig.py contains the following lines to get the binary name:
https://github.com/Hipo/algojig/blob/main/algojig/gojig.py#L11

machine = platform.machine()
binary = f'algojig_{machine}'

We should change this to include the system name too. And we should make sure these are all lowercase:

machine = platform.machine().lower()
system = platform.system().lower()
binary = f'algojig_{system}_{machine}'

Can you please rename the existing binaries for mac to include darwin as the system.
You can check platform.machine() and platform.system() on your own computer. Your system should be 'Linux'.


# Checkout v3.8.1
WORKDIR "/Users/fergal/go-algorand/"
RUN git checkout v3.8.1-stable
Copy link
Author

@kadircancetin kadircancetin Sep 25, 2022

Choose a reason for hiding this comment

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

I can not build with v3.9 :/ . Also can not build with in my host machine as well.

Copy link
Author

@kadircancetin kadircancetin Sep 25, 2022

Choose a reason for hiding this comment

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

# github.com/mattn/go-sqlite3
sqlite3-binding.c: In function 'sqlite3SelectNew':
sqlite3-binding.c:123303:10: warning: function may return address of local variable [-Wreturn-local-addr]
123303 |   return pNew;
       |          ^~~~
sqlite3-binding.c:123263:10: note: declared here
123263 |   Select standin;
       |          ^~~~~~~
# github.com/Hipo/algojig
./main.go:163:43: not enough arguments in call to verify.TxnGroup
        have ([]transactions.SignedTxn, bookkeeping.BlockHeader, verify.VerifiedTransactionCache)
        want ([]transactions.SignedTxn, bookkeeping.BlockHeader, verify.VerifiedTransactionCache, logic.LedgerForSignature)

This is the exception I got when I try v3.9.x. Same exception without docker.

@kadircancetin
Copy link
Author

kadircancetin commented Sep 25, 2022

@fergalwalsh

also, not all tests are passed. I think it is not directly related to the executable.
EX: tests.test_ledger.TestDebug.test_pass_logisig passing.

export PYTHONPATH="${PYTHONPATH}:/home/kadir/algojig/";
python -m unittest
E.EE...EE.....E..E
======================================================================
ERROR: test_fail_app_reject (tests.test_ledger.TestDebug)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kadir/algojig/tests/test_ledger.py", line 239, in test_fail_app_reject
    self.ledger.create_app(11, approval_program=TealProgram(teal='#pragma version 6\nint 0'))
  File "/home/kadir/algojig/algojig/teal.py", line 18, in __init__
    self.compile()
  File "/home/kadir/algojig/algojig/teal.py", line 29, in compile
    self.compile_teal()
  File "/home/kadir/algojig/algojig/teal.py", line 26, in compile_teal
    self.source_map = source_map.SourceMap(map)
  File "/home/kadir/.virtualenvs/algojig/lib/python3.10/site-packages/algosdk/source_map.py", line 24, in __init__
    self.mappings: str = source_map["mappings"]
KeyError: 'mappings'

======================================================================
ERROR: test_fail_logisig (tests.test_ledger.TestDebug)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kadir/algojig/tests/test_ledger.py", line 176, in test_fail_logisig
    p = TealProgram(teal='#pragma version 6\nint 0')
  File "/home/kadir/algojig/algojig/teal.py", line 18, in __init__
    self.compile()
  File "/home/kadir/algojig/algojig/teal.py", line 29, in compile
    self.compile_teal()
  File "/home/kadir/algojig/algojig/teal.py", line 26, in compile_teal
    self.source_map = source_map.SourceMap(map)
  File "/home/kadir/.virtualenvs/algojig/lib/python3.10/site-packages/algosdk/source_map.py", line 24, in __init__
    self.mappings: str = source_map["mappings"]
KeyError: 'mappings'

======================================================================
ERROR: test_fail_logisig_pc (tests.test_ledger.TestDebug)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kadir/algojig/tests/test_ledger.py", line 196, in test_fail_logisig_pc
    p = TealProgram(teal="""
  File "/home/kadir/algojig/algojig/teal.py", line 18, in __init__
    self.compile()
  File "/home/kadir/algojig/algojig/teal.py", line 29, in compile
    self.compile_teal()
  File "/home/kadir/algojig/algojig/teal.py", line 26, in compile_teal
    self.source_map = source_map.SourceMap(map)
  File "/home/kadir/.virtualenvs/algojig/lib/python3.10/site-packages/algosdk/source_map.py", line 24, in __init__
    self.mappings: str = source_map["mappings"]
KeyError: 'mappings'

======================================================================
ERROR: test_pass_app (tests.test_ledger.TestDebug)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kadir/algojig/tests/test_ledger.py", line 225, in test_pass_app
    self.ledger.create_app(11, approval_program=TealProgram(teal='#pragma version 6\nint 1'))
  File "/home/kadir/algojig/algojig/teal.py", line 18, in __init__
    self.compile()
  File "/home/kadir/algojig/algojig/teal.py", line 29, in compile
    self.compile_teal()
  File "/home/kadir/algojig/algojig/teal.py", line 26, in compile_teal
    self.source_map = source_map.SourceMap(map)
  File "/home/kadir/.virtualenvs/algojig/lib/python3.10/site-packages/algosdk/source_map.py", line 24, in __init__
    self.mappings: str = source_map["mappings"]
KeyError: 'mappings'

======================================================================
ERROR: test_pass_app_global_get (tests.test_ledger.TestDebug)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kadir/algojig/tests/test_ledger.py", line 257, in test_pass_app_global_get
    self.ledger.create_app(11, approval_program=TealProgram(teal='#pragma version 6\nbyte "a"\napp_global_get'))
  File "/home/kadir/algojig/algojig/teal.py", line 18, in __init__
    self.compile()
  File "/home/kadir/algojig/algojig/teal.py", line 29, in compile
    self.compile_teal()
  File "/home/kadir/algojig/algojig/teal.py", line 26, in compile_teal
    self.source_map = source_map.SourceMap(map)
  File "/home/kadir/.virtualenvs/algojig/lib/python3.10/site-packages/algosdk/source_map.py", line 24, in __init__
    self.mappings: str = source_map["mappings"]
KeyError: 'mappings'

======================================================================
ERROR: test_reject_app_global_get (tests.test_ledger.TestDebug)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kadir/algojig/tests/test_ledger.py", line 274, in test_reject_app_global_get
    self.ledger.create_app(11, approval_program=TealProgram(teal='#pragma version 6\nbyte "a"\napp_global_get'))
  File "/home/kadir/algojig/algojig/teal.py", line 18, in __init__
    self.compile()
  File "/home/kadir/algojig/algojig/teal.py", line 29, in compile
    self.compile_teal()
  File "/home/kadir/algojig/algojig/teal.py", line 26, in compile_teal
    self.source_map = source_map.SourceMap(map)
  File "/home/kadir/.virtualenvs/algojig/lib/python3.10/site-packages/algosdk/source_map.py", line 24, in __init__
    self.mappings: str = source_map["mappings"]
KeyError: 'mappings'

======================================================================
ERROR: test_pass_compile_program (tests.test_teal.TestDebug)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/kadir/algojig/tests/test_teal.py", line 16, in test_pass_compile_program
    p = TealProgram(teal='#pragma version 6\nint 1')
  File "/home/kadir/algojig/algojig/teal.py", line 18, in __init__
    self.compile()
  File "/home/kadir/algojig/algojig/teal.py", line 29, in compile
    self.compile_teal()
  File "/home/kadir/algojig/algojig/teal.py", line 26, in compile_teal
    self.source_map = source_map.SourceMap(map)
  File "/home/kadir/.virtualenvs/algojig/lib/python3.10/site-packages/algosdk/source_map.py", line 24, in __init__
    self.mappings: str = source_map["mappings"]
KeyError: 'mappings'

----------------------------------------------------------------------
Ran 18 tests in 0.989s

FAILED (errors=7)

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

Successfully merging this pull request may close these issues.

2 participants