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

Turn exercices 023 to 032 into practice #2199

Closed
8 tasks done
cuihtlauac opened this issue Mar 14, 2024 · 25 comments
Closed
8 tasks done

Turn exercices 023 to 032 into practice #2199

cuihtlauac opened this issue Mar 14, 2024 · 25 comments
Assignees
Labels
beginner can be done by an OCaml beginner exercise good first issue Good for newcomers help wanted outreachy Outreachy contributions and blog posts outreachy-medium You must have completed an issue marked with "outreachy" to be assigned

Comments

@cuihtlauac
Copy link
Collaborator

cuihtlauac commented Mar 14, 2024

This task consists of doing 8 exercises instead of one, as described in issues #2167, #2168, #2170, #2172, #2173, #2176, #2177, #2178, #2179 and #2180. Create 10 folders (from 023 to 032), and populate them as the others. Makes sure dune build --root . and dune test --root . answer work.

@cuihtlauac cuihtlauac added exercise outreachy Outreachy contributions and blog posts outreachy-medium You must have completed an issue marked with "outreachy" to be assigned help wanted good first issue Good for newcomers beginner can be done by an OCaml beginner labels Mar 14, 2024
@Ozyugoo
Copy link
Contributor

Ozyugoo commented Mar 14, 2024

@cuihtlauac if it is okay, I can work on this?

@cuihtlauac
Copy link
Collaborator Author

Yes, you may

@Ozyugoo
Copy link
Contributor

Ozyugoo commented Mar 14, 2024

Thank you, on it

@Ozyugoo
Copy link
Contributor

Ozyugoo commented Mar 15, 2024

Hi, please help 024 is failing "dune test --root . answer" and it is giving this error
File "answer/test/dune", line 2, characters 12-15:
2 | (test (name run) (libraries ounit2 ex))
^^^
F.

Error: lotto_select:1:cons.

File "/home/ozyugoo22/ocaml.org/practice/024/_build/default/answer/test/oUnit-lotto_select-GWTN141-10#02.log", line 2, characters 1-1:
Error: lotto_select:1:cons (in the log).

Raised at OUnitAssert.assert_failure in file "src/lib/ounit2/advanced/oUnitAssert.ml", line 45, characters 2-27
Called from OUnitRunner.run_one_test.(fun) in file "src/lib/ounit2/advanced/oUnitRunner.ml", line 83, characters 13-26

not equal

Ran: 2 tests in: 0.10 seconds.
FAILED: Cases: 2 Tried: 2 Errors: 0 Failures: 1 Skip: 0 Todo: 0 Timeouts: 0.
I don't understand what am doing wrong. Could please help me. I have been on this for hours now.

@divyankachaudhari
Copy link
Contributor

Hey @Ozyugoo :) I pulled your 024 branch from your fork and tried to reproduce the error on my end. Fortunately, I get

~/ocaml.org/practice/024 (local-024 ✘)✭ ᐅ dune test --root . answer
..                                  
Ran: 2 tests in: 0.11 seconds.
OK

Are you still encountering the error?

@Ozyugoo
Copy link
Contributor

Ozyugoo commented Mar 15, 2024

Hey @Ozyugoo :) I pulled your 024 branch from your fork and tried to reproduce the error on my end. Fortunately, I get

~/ocaml.org/practice/024 (local-024 ✘)✭ ᐅ dune test --root . answer
..                                  
Ran: 2 tests in: 0.11 seconds.
OK

Are you still encountering the error?

Yes @divyankachaudhari am still getting the error. Is there something am doing wrong? Please kindly help me.

@Ozyugoo
Copy link
Contributor

Ozyugoo commented Mar 15, 2024

@divyankachaudhari thank you, it is okay now.

@Ozyugoo
Copy link
Contributor

Ozyugoo commented Mar 15, 2024

Hi @cuihtlauac is the permutation on 025 supposed to be recursive, it was not used and it is raising unused-rec-flag error. Kindly look at the exercise again. I tried running on the top level and it worked but it is not working with dune build — root .

@cuihtlauac
Copy link
Collaborator Author

@Ozyugoo

Hi @cuihtlauac is the permutation on 025 supposed to be recursive, it was not used and it is raising unused-rec-flag error. Kindly look at the exercise again. I tried running on the top level and it worked but it is not working with dune build — root .

Can you file a PR with this? I would be easier to understand

@maha-sachin
Copy link
Contributor

@divyankachaudhari thank you, it is okay now.

@Ozyugoo, Hi can you share how you resolved it

@Ozyugoo
Copy link
Contributor

Ozyugoo commented Mar 16, 2024

@divyankachaudhari thank you, it is okay now.

@Ozyugoo, Hi can you share how you resolved it

Sorry for the late response @maha-sachin I have been having some issues with network today I can actually say that It contributed to the error.

So what I did basically was to check the code line by line, word for word and the test with top level and once it seems okay, I used another terminal to run my file.

@jahielkomu
Copy link
Contributor

@Ozyugoo @divyankachaudhari @maha-sachin Hello there.
Has anyone encountered an error of the kind No config found for file practice/61A/ex.ml. Try calling 'dune build'.ocamllsp Unbound module OUnit2 Hint: Did you mean Unit?ocamllsp ?

61A can be replaced with the corresponding number of the exercise the person was working on.

@Ozyugoo
Copy link
Contributor

Ozyugoo commented Mar 19, 2024

@Ozyugoo @divyankachaudhari @maha-sachin Hello there. Has anyone encountered an error of the kind No config found for file practice/61A/ex.ml. Try calling 'dune build'.ocamllsp Unbound module OUnit2 Hint: Did you mean Unit?ocamllsp ?

61A can be replaced with the corresponding number of the exercise the person was working on.

Hi @jahielkomu are you sure you are in the right directory and the right branch you are supposed to be working on?

@jahielkomu
Copy link
Contributor

jahielkomu commented Mar 19, 2024

@Ozyugoo @divyankachaudhari @maha-sachin Hello there. Has anyone encountered an error of the kind No config found for file practice/61A/ex.ml. Try calling 'dune build'.ocamllsp Unbound module OUnit2 Hint: Did you mean Unit?ocamllsp ?
61A can be replaced with the corresponding number of the exercise the person was working on.

Hi @jahielkomu are you sure you are in the right directory and the right branch you are supposed to be working on?

Thank you for the response @Ozyugoo.

I'm in the folder kome@kome:~/Desktop/ocaml/ocaml.org/practice/001$ but then the error persists especially with files whose extension is .ml such as No config found for file practice/001/answer/impl.ml. Try calling 'dune build'.ocamllsp

I suspect I haven't done something but I don't know what.

@Ozyugoo
Copy link
Contributor

Ozyugoo commented Mar 19, 2024

What command are you issuing that is given you this error?

@jahielkomu
Copy link
Contributor

jahielkomu commented Mar 19, 2024

What command are you issuing that is given you this error?

That is the thing, I'm not running any.

And when I run dune build --root .

I get errors still

kome@kome:~/Desktop/ocaml/ocaml.org/practice/001$ dune build --root .
File "answer/test/dune", line 2, characters 28-34:
2 | (test (name run) (libraries ounit2 ex))
                                ^^^^^^
Error: Library "ounit2" not found.
-> required by _build/default/answer/test/run.exe
-> required by alias answer/test/all
-> required by alias default
File "work/test/dune", line 2, characters 28-34:
2 | (test (name run) (libraries ounit2 ex))
                                ^^^^^^
Error: Library "ounit2" not found.
-> required by _build/default/work/test/run.exe
-> required by alias work/test/all
-> required by alias default
File "dune", line 2, characters 30-36:
2 | (library (name ex) (libraries ounit2))
                                  ^^^^^^
Error: Library "ounit2" not found.
-> required by library "ex" in _build/default
-> required by _build/default/.ex.objs/native/ex.cmx
-> required by _build/default/ex.a
-> required by alias all
-> required by alias default

Please help me make sense of this and pardon me if I take much of your time.

Things I have tried.
I have re-installed everything from scratch.
I have googled but the answers are not hepful.

@Ozyugoo
Copy link
Contributor

Ozyugoo commented Mar 19, 2024

Okay, can you check each file one at a time and compare it with the sample file we were given 001 to see if everything is in place. You need to be calm to spot an error. If you didn’t see anything, create a PR with the errors you are getting let others help you to look at it. Sometimes you may have missed adding something to a particular file or missing it up since some of them have the same names.

@jahielkomu
Copy link
Contributor

Okay, can you check each file one at a time and compare it with the sample file we were given 001 to see if everything is in place. You need to be calm to spot an error. If you didn’t see anything, create a PR with the errors you are getting let others help you to look at it. Sometimes you may have missed adding something to a particular file or missing it up since some of them have the same names.

Thank you @Ozyugoo
If you check the error example in the most recent comment above, I'm running dune build --root . inside practice/001 which is one of the samples we were given.
And then No config found for file practice/001/answer/impl.ml. Try calling 'dune build'.ocamllsp is also for the sample folders we were given.

@Ozyugoo
Copy link
Contributor

Ozyugoo commented Mar 19, 2024

Are you doing this from which branch? Sorry to ask, these are things I check when I see errors and sometimes I may be in the wrong branch and it won’t work.

@jahielkomu
Copy link
Contributor

Are you doing this from which branch? Sorry to ask, these are things I check when I see errors and sometimes I may be in the wrong branch and it won’t work.

Please ask, I appreciate it.
I'm in the main branch of the forked repository.

@Ozyugoo
Copy link
Contributor

Ozyugoo commented Mar 19, 2024

Are you doing this from which branch? Sorry to ask, these are things I check when I see errors and sometimes I may be in the wrong branch and it won’t work.

Please ask, I appreciate it. I'm in the main branch of the forked repository.

Did you follow the steps provided for installation? I think you should create a PR so that others can view from there end to be sure the issue is not unique to you. Or probably understand it better and offer suggestions.

@jahielkomu
Copy link
Contributor

Are you doing this from which branch? Sorry to ask, these are things I check when I see errors and sometimes I may be in the wrong branch and it won’t work.

Please ask, I appreciate it. I'm in the main branch of the forked repository.

Did you follow the steps provided for installation? I think you should create a PR so that others can view from there end to be sure the issue is not unique to you. Or probably understand it better and offer suggestions.

Thank you @Ozyugoo
Can I ask if you ran dune build and from which directory?

@Ozyugoo
Copy link
Contributor

Ozyugoo commented Mar 21, 2024

@jahielkomu from the directory I was working on. The command issue is dune build --root .

@jahielkomu
Copy link
Contributor

@jahielkomu from the directory I was working on. The command issue is dune build --root .

@Ozyugoo thank you for your response.
Please allow me ask you one last thing.

What OS and Code editor are you using?
And please briefly outline how you installed the code base to the point of running dune build --root . and it works correctly.

Sorry for the continual bother though

@Ozyugoo
Copy link
Contributor

Ozyugoo commented Mar 21, 2024

WSL2 on Windows, VS code and vim editors and I followed this step Installation instructions on this issue to install.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
beginner can be done by an OCaml beginner exercise good first issue Good for newcomers help wanted outreachy Outreachy contributions and blog posts outreachy-medium You must have completed an issue marked with "outreachy" to be assigned
Projects
Archived in project
Development

No branches or pull requests

5 participants