# Unclear instructions surrounding path resolution on #IP1

**URL:** <https://forum.codecrafters.io/t/unclear-instructions-surrounding-path-resolution-on-ip1/537>\
**Category:** Challenges\
**Tags:** challenge:shell\
**Created:** [May 29, 2024, 5:30pm UTC](https://forum.codecrafters.io/t/unclear-instructions-surrounding-path-resolution-on-ip1/537 "2024-05-29T17:30:22Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![leggettc18](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/leggettc18/32/490_2.png) [@leggettc18](https://forum.codecrafters.io/u/leggettc18)\
**Post date:** [May 29, 2024, 5:30pm UTC](https://forum.codecrafters.io/t/unclear-instructions-surrounding-path-resolution-on-ip1/537/1 "2024-05-29T17:30:22Z")

</div>

I’m stuck on Stage #IP1.

I think I might be misunderstanding something or have missed a step somewhere, It mentions that the executable should be found in the path, but the test executable is in a /tmp/ directory. It also doesn’t seem to exist on my machine but that might be because the tester removes it before I can see it.

I got the tests to pass by implementing a full path check after failing to find the exe on the path fails, but the directions don’t indicate I should need to do that. Is there an issue here or have I missed something?

---

<div class="post-metadata">

**Author:** ![WinterSunset95](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/wintersunset95/32/496_2.png) [@WinterSunset95](https://forum.codecrafters.io/u/WinterSunset95)\
**Post date:** [May 29, 2024, 7:18pm UTC](https://forum.codecrafters.io/t/unclear-instructions-surrounding-path-resolution-on-ip1/537/2 "2024-05-29T19:18:01Z")

</div>

I faced the same problem here.

Worked around that problem by checking if the command is executable if it is not in the path.

---

<div class="post-metadata">

**Author:** ![leggettc18](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/leggettc18/32/490_2.png) [@leggettc18](https://forum.codecrafters.io/u/leggettc18)\
**Post date:** [May 29, 2024, 7:23pm UTC](https://forum.codecrafters.io/t/unclear-instructions-surrounding-path-resolution-on-ip1/537/3 "2024-05-29T19:23:42Z")

</div>

Yeah I also worked around it by trying it as an absolute path if it’s not in the PATH but the instructions implied it should’ve already been there.

---

<div class="post-metadata">

**Author:** ![rohitpaulk](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/rohitpaulk/32/6_2.png) [@rohitpaulk](https://forum.codecrafters.io/u/rohitpaulk)\
**Post date:** [May 30, 2024, 9:28pm UTC](https://forum.codecrafters.io/t/unclear-instructions-surrounding-path-resolution-on-ip1/537/4 "2024-05-30T21:28:18Z")

</div>

Thanks for highlighting this everyone! Definitely a mismatch between tests & instructions here - I think we initially intended to test one thing but must’ve changed along the way for some reason.

I’m going to wait for @ryan-gang to wake up so I can ask him if we had a specific reason to go with one over the other. After that we’ll either fix either the instructions or the tests!

---

<div class="post-metadata">

**Author:** ![rohitpaulk](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/rohitpaulk/32/6_2.png) [@rohitpaulk](https://forum.codecrafters.io/u/rohitpaulk)\
**Post date:** [June 2, 2024, 2:10pm UTC](https://forum.codecrafters.io/t/unclear-instructions-surrounding-path-resolution-on-ip1/537/5 "2024-06-02T14:10:33Z")

</div>

We’re updating the tester! PR here: [Pass exe name instead of full path in run test by ryan-gang · Pull Request #18 · codecrafters-io/shell-tester · GitHub](https://github.com/codecrafters-io/shell-tester/pull/18). Should be deployed soon

---

<div class="post-metadata">

**Author:** ![rohitpaulk](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/rohitpaulk/32/6_2.png) [@rohitpaulk](https://forum.codecrafters.io/u/rohitpaulk)\
**Post date:** [June 3, 2024, 11:45am UTC](https://forum.codecrafters.io/t/unclear-instructions-surrounding-path-resolution-on-ip1/537/7 "2024-06-03T11:45:31Z")

</div>

This is fixed now!

Previously we were passing the full path (i.e. `/tmp/foo/my_exe arg`) , now we just run `my_exe arg` , and `my_exe` will be present in `PATH`.

---

<div class="post-metadata">

**Author:** ![omuhr](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/omuhr/32/560_2.png) [@omuhr](https://forum.codecrafters.io/u/omuhr)\
**Post date:** [June 3, 2024, 2:02pm UTC](https://forum.codecrafters.io/t/unclear-instructions-surrounding-path-resolution-on-ip1/537/8 "2024-06-03T14:02:03Z")

</div>

I am having trouble finding the executable and am unsure whether its on my end or not. Running ` ls -R /tmp/` shows that the /tmp/fruit/fruit/fruit/ directory is empty, is this not where `my_exe` should be?

Here is the full output of my program which just prints the output of ` ls -R /tmp/` :

> [tester::#IP1] Running tests for Stage #IP1 (Run a program)  
> [tester::#IP1] Running ./your\_shell.sh  
> [your-program] /tmp/:  
> [your-program] codecrafters-shell-target  
> [your-program] go-build498371273  
> [your-program] go-build524240018  
> [your-program] strawberry  
> [your-program] test-run2844824492  
> [your-program]  
> [your-program] /tmp/codecrafters-shell-target:  
> [your-program] CACHEDIR.TAG  
> [your-program] release  
> [your-program]  
> [your-program] /tmp/codecrafters-shell-target/release:  
> [your-program] build  
> [your-program] deps  
> [your-program] examples  
> [your-program] incremental  
> [your-program] shell-starter-rust  
> [your-program] shell-starter-rust.d  
> [your-program]  
> [your-program] /tmp/codecrafters-shell-target/release/build:  
> [your-program] anyhow-1e352edcb8dfbf5c  
> [your-program] anyhow-a152da5b52ccf273  
> [your-program] proc-macro2-085ffb844e20729e  
> [your-program] proc-macro2-2ea58b3c8269c9c6  
> [your-program] thiserror-1ce144b0733d0229  
> [your-program] thiserror-79ac027c908e4dad  
> [your-program]  
> [your-program] /tmp/codecrafters-shell-target/release/build/anyhow-1e352edcb8dfbf5c:  
> [your-program] build-script-build  
> [your-program] build\_script\_build-1e352edcb8dfbf5c  
> [your-program] build\_script\_build-1e352edcb8dfbf5c.d  
> [your-program]  
> [your-program] /tmp/codecrafters-shell-target/release/build/anyhow-a152da5b52ccf273:  
> [your-program] invoked.timestamp  
> [your-program] out  
> [your-program] output  
> [your-program] root-output  
> [your-program] stderr  
> [your-program]  
> [your-program] /tmp/codecrafters-shell-target/release/build/anyhow-a152da5b52ccf273/out:  
> [your-program] anyhow.d  
> [your-program]  
> [your-program] /tmp/codecrafters-shell-target/release/build/proc-macro2-085ffb844e20729e:  
> [your-program] build-script-build  
> [your-program] build\_script\_build-085ffb844e20729e  
> [your-program] build\_script\_build-085ffb844e20729e.d  
> [your-program]  
> [your-program] /tmp/codecrafters-shell-target/release/build/proc-macro2-2ea58b3c8269c9c6:  
> [your-program] invoked.timestamp  
> [your-program] out  
> [your-program] output  
> [your-program] root-output  
> [your-program] stderr  
> [your-program]  
> [your-program] /tmp/codecrafters-shell-target/release/build/proc-macro2-2ea58b3c8269c9c6/out:  
> [your-program] proc\_macro2.d  
> [your-program]  
> [your-program] /tmp/codecrafters-shell-target/release/build/thiserror-1ce144b0733d0229:  
> [your-program] invoked.timestamp  
> [your-program] out  
> [your-program] output  
> [your-program] root-output  
> [your-program] stderr  
> [your-program]  
> [your-program] /tmp/codecrafters-shell-target/release/build/thiserror-1ce144b0733d0229/out:  
> [your-program] thiserror.d  
> [your-program]  
> [your-program] /tmp/codecrafters-shell-target/release/build/thiserror-79ac027c908e4dad:  
> [your-program] build-script-build  
> [your-program] build\_script\_build-79ac027c908e4dad  
> [your-program] build\_script\_build-79ac027c908e4dad.d  
> [your-program]  
> [your-program] /tmp/codecrafters-shell-target/release/deps:  
> [your-program] anyhow-3fca6204e97cc146.d  
> [your-program] bytes-175ef7f639dc9387.d  
> [your-program] libanyhow-3fca6204e97cc146.rlib  
> [your-program] libanyhow-3fca6204e97cc146.rmeta  
> [your-program] libbytes-175ef7f639dc9387.rlib  
> [your-program] libbytes-175ef7f639dc9387.rmeta  
> [your-program] libproc\_macro2-7a217364744e0fab.rlib  
> [your-program] libproc\_macro2-7a217364744e0fab.rmeta  
> [your-program] libquote-96c2cb863daef7e7.rlib  
> [your-program] libquote-96c2cb863daef7e7.rmeta  
> [your-program] libsyn-ec65543b7ff1e5a3.rlib  
> [your-program] libsyn-ec65543b7ff1e5a3.rmeta  
> [your-program] libthiserror-a4a6e36992d401cf.rlib  
> [your-program] libthiserror-a4a6e36992d401cf.rmeta  
> [your-program] libthiserror\_impl-2bf23e3fdf6c1f21.so  
> [your-program] libunicode\_ident-356ca83e39e30310.rlib  
> [your-program] libunicode\_ident-356ca83e39e30310.rmeta  
> [your-program] proc\_macro2-7a217364744e0fab.d  
> [your-program] quote-96c2cb863daef7e7.d  
> [your-program] shell\_starter\_rust-14a34e66cdf1f835  
> [your-program] shell\_starter\_rust-14a34e66cdf1f835.d  
> [your-program] syn-ec65543b7ff1e5a3.d  
> [your-program] thiserror-a4a6e36992d401cf.d  
> [your-program] thiserror\_impl-2bf23e3fdf6c1f21.d  
> [your-program] unicode\_ident-356ca83e39e30310.d  
> [your-program]  
> [your-program] /tmp/codecrafters-shell-target/release/examples:  
> [your-program]  
> [your-program] /tmp/codecrafters-shell-target/release/incremental:  
> [your-program]  
> [your-program] /tmp/go-build498371273:  
> [your-program]  
> [your-program] /tmp/go-build524240018:  
> [your-program]  
> [your-program] /tmp/strawberry:  
> [your-program] strawberry  
> [your-program]  
> [your-program] /tmp/strawberry/strawberry:  
> [your-program] pear  
> [your-program]  
> [your-program] /tmp/strawberry/strawberry/pear:

---

<div class="post-metadata">

**Author:** ![rohitpaulk](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/rohitpaulk/32/6_2.png) [@rohitpaulk](https://forum.codecrafters.io/u/rohitpaulk)\
**Post date:** [June 3, 2024, 4:59pm UTC](https://forum.codecrafters.io/t/unclear-instructions-surrounding-path-resolution-on-ip1/537/9 "2024-06-03T16:59:01Z")

</div>

@omuhr the executable might not be present when the shell starts, but it should be present when the command is executed. Can you try moving your logs to when you receive the command?

Here’s what the tester does:

> <https://github.com/codecrafters-io/shell-tester/blob/72976f6dc32633b863ef005937be3d3f3199e8b9/internal/stage8.go#L27-L37>

---

<div class="post-metadata">

**Author:** ![omuhr](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/omuhr/32/560_2.png) [@omuhr](https://forum.codecrafters.io/u/omuhr)\
**Post date:** [June 4, 2024, 6:38am UTC](https://forum.codecrafters.io/t/unclear-instructions-surrounding-path-resolution-on-ip1/537/10 "2024-06-04T06:38:55Z")

</div>

I see. I’d been caching the executables in PATH at shell-start, running a check at the time the command is run works 🙂

Thanks!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [June 9, 2024, 6:39am UTC](https://forum.codecrafters.io/t/unclear-instructions-surrounding-path-resolution-on-ip1/537/11 "2024-06-09T06:39:47Z")

</div>

Closed on June 9, 2024, 6:39am UTC

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
