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

[Bug]: odin package doesn't work properly #10892

Closed
xigoi opened this issue Jun 4, 2022 · 4 comments · Fixed by #11920 · May be fixed by #22012
Closed

[Bug]: odin package doesn't work properly #10892

xigoi opened this issue Jun 4, 2022 · 4 comments · Fixed by #11920 · May be fixed by #22012
Labels
bug report Something is not working properly upstream issue It is an upstream issue wontfix Issue won't be fixed

Comments

@xigoi
Copy link

xigoi commented Jun 4, 2022

Problem description

When I install the odin package and try to compile or run a valid Odin program (such as the first example in the documentation), it produces the following error:

Syntax Error: Path does not exist:

Doing the same on a non-Android device compiles the program as expected, so this is a Termux-specific issue.

What steps will reproduce the bug?

  • Install the odin package with pkg install odin
  • Create an empty directory and cd to it
  • Create a file hellope.odin with the following content:
    package main
    
    import "core:fmt"
    
    main :: proc() {
    	fmt.println("Hellope!")
    }
  • Run the command odin run .

What is the expected behavior?

The command should compile the program and output the text “Hellope!”.

System information

termux-info:

Termux Variables:
TERMUX_API_VERSION=0.50.1
TERMUX_APK_RELEASE=F_DROID
TERMUX_APP_PACKAGE_MANAGER=apt
TERMUX_APP_PID=13097
TERMUX_IS_DEBUGGABLE_BUILD=0
TERMUX_MAIN_PACKAGE_FORMAT=debian
TERMUX_VERSION=0.118.0
Packages CPU architecture:
aarch64
Subscribed repositories:
# sources.list
deb https://termux.astra.in.ua/apt/termux-main/ stable main
# sources.list.d/pointless.list
deb https://its-pointless.github.io/files/24 termux extras
Updatable packages:
All packages up to date
termux-tools version:
0.184
Android version:
11
Kernel build information:
Linux localhost 4.9.227-perf-g5de92d1 #1 SMP PREEMPT Sun May 16 21:25:04 CST 2021 aarch64 Android
Device manufacturer:
Xiaomi
Device model:
Mi 9 SE
@xigoi xigoi added the bug report Something is not working properly label Jun 4, 2022
@xigoi xigoi changed the title [Bug]: [Bug]: odin package doesn't work properly Jun 4, 2022
@j0ng4b
Copy link

j0ng4b commented Jun 4, 2022

From https://odin-lang.org/docs/install/:

Notes for Linux:: The compiler currently relies on the core and shared library collection being relative to the compiler executable. Installing the compiler in the usual sense (to /usr/local/bin or similar) is therefore not as straight forward as you need to make sure the mentioned libraries are available. As a result, it is recommended to simply explicitly invoke the compiler with /path/to/odin in your preferred build system, or add /path/to/odin to $PATH.

And I'm pretty sure that only the compiler is installed, the libraries aren't:

termux_step_make_install() {
install -Dm700 -t $TERMUX_PREFIX/bin odin
}

@xigoi
Copy link
Author

xigoi commented Jun 5, 2022

This seems to be the case. I did the following:

git clone https://github.com/odin-lang/Odin
cd Odin
git checkout dev-2022-04 # to have the matching version
cp $(which odin) .

Now, when I compile an Odin file with this copy of the compiler, it works correctly. However, when I run the produced executable, I get a new error:

error: Android 5.0 and later only support position-independent executables (-fPIE).

@j0ng4b
Copy link

j0ng4b commented Jun 5, 2022

However, when I run the produced executable, I get a new error:

This is the odin code that you've compiled? If yes, the error happens because the odin compiler isn't producing position-independent executables (-fPIE) and probably it doesn't support PIE executables: odin-lang/Odin#919

@stale
Copy link

stale bot commented Jul 20, 2022

This issue/PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix Issue won't be fixed label Jul 20, 2022
@licy183 licy183 added not stale upstream issue It is an upstream issue and removed wontfix Issue won't be fixed labels Jul 23, 2022
xtkoba added a commit that referenced this issue Sep 14, 2022
Not working at all.

Closes #10892.
termux-pacman-bot added a commit to termux-pacman/termux-packages that referenced this issue Sep 14, 2022
Not working at all.

Closes termux/termux-packages#10892.
@xtkoba xtkoba added the wontfix Issue won't be fixed label Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Something is not working properly upstream issue It is an upstream issue wontfix Issue won't be fixed
Projects
None yet
4 participants