What happens
Hi!, recently I start to solve challenges with elixir language and I’ve been using this line as my execution command
cat DATA.lst | elixir -r ludsrill.exs -e solution.main
I was asked to change it to a simpler one like:
cat DATA.lst | elixir ludsrill.exs
I want to share the solution and problems that I meet
What do you understand or find about that problem
Solution for this it’s simple, elixir language has this estructure
defmodule Solution do
def main do
# This is the main function to my code
end
end
If I want to execute this code with this line cat DATA.lst | elixir ludsrill.exs I only need to add the following line to the finish of my code
Solution.main()
# This will call my module then the main function
So far there’s no problem, however, with this changes it’s not possible pass pipeline for elixir, specific the compilation for this pipeline.
You make any workaround? What did you do?
First of all the problem that I got in pipeline was this:
To try reproduce this error I look at on builder.sh file and use exactly this command to compile my code.
In my first try I use the line and I get this error and compilation never happen
Then I decided change a little adding my stdin
As you see there’s no problem with compilation, then I think that DATA.lst file it’s necessary to compile code for elixir, to prove this I delete my DATA.lst of my project and compile the code again and I got the same error than then pipeline.
As you see it’s necessary and after all that I realized that the same problem was discussed here
The solution was to use this line to execute, which is the line that I’ve been using
cat DATA.lst | elixir -r ludsrill.exs -e solution.main
Evidences
image of error:
https://gitlab.com/autonomicmind/challenges/-/jobs/877825323
I need help with
Now I know that the command that I use is allowed, however, since I was ask to do it, I want to know if this is fine or it’s necessary wait for some changes in builders file. thanks!