Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Environment variable confusion

23 views
Skip to first unread message

Grayson Clark

unread,
Jun 7, 2024, 4:23:54 PM6/7/24
to tup-users
Here I have a build variant that builds using emscripten and it's giving this error about not being able to find some file or folder.
Emscripten env variables are set up properly as shown by the fact that I can run emcc.
Oddly, copy and pasting that output command into the terminal and just running it works perfectly normal. Only when it's run through tup does it give this error.
Anyone have any ideas why this might happen? Is this a me issue? Or something with tup?

Screenshot 2024-06-07 143036.png

Cheers

Guillaume @layus Maudoux

unread,
Jun 8, 2024, 2:18:01 AM6/8/24
to tup-...@googlegroups.com
I have no clue about the issue, but I would try to debug it by wrapping tour command in a script that prints available environment variables to check they match your expectations. I would also try to find which file is missing. On Linux I would prefix the command with strace. On windows maybe create a bat script and dump as much info as possible about the modified environment the command runs in.

Emery Hemingway

unread,
Jun 8, 2024, 2:44:32 AM6/8/24
to tup-...@googlegroups.com
Are you able to copy and paste the text on your terminal into an email?
That would give us a chance to diagnose it.

E.

Excerpts from Grayson Clark's message of June 7, 2024 10:35 pm:
> --
> --
> tup-users mailing list
> email: tup-...@googlegroups.com
> unsubscribe: tup-users+...@googlegroups.com
> options: http://groups.google.com/group/tup-users?hl=en
> ---
> You received this message because you are subscribed to the Google Groups "tup-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to tup-users+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/tup-users/c23b3ec3-bd07-4b46-9250-8620e91a9e06n%40googlegroups.com.
>

Grayson Clark

unread,
Jun 8, 2024, 6:39:24 PM6/8/24
to tup-users

Environment variables look correct in the modified environment. I'm able to reproduce the issue by just running a simple     : |> emcc |>   . Installing emscripten and running it through tup seems to reproduce the issue.
Somehow fixed it by prefixing my command with CMD /c. Not really sure why that fixes it though.
Have another issue with emcc - it creates an app.wasm.tmp0 file and then also deletes that during compilation I believe. Tup throws errors up about output dependencies not being declared, but if I declare it as an (extra) output dependency I get this error
[ ]   0%tup error: GetFileAttributesExW("\\?\C:\Dev\wasm_render_test\build-web\app.wasm.tmp0") failed: 0x00000002
* 0) [build-web] CMD /c emcc -g -sUSE_WEBGL2 --shell-file=configs/index.html build-web/./log.o build-web/./main.o -o build-web/./app.html

Everything does build normally but seems like tup doesn't have any mechanism for dealing with commands that produce and delete files. Maybe being able to exclude particular files/extensions from being observed by tup would be nice? I get that that sort of bypasses the whole point of tup though, so maybe tup needs to check if created files still exist at the end of some command before accepting them as a real "dependency"?

Guillaume @layus Maudoux

unread,
Jun 9, 2024, 6:17:43 AM6/9/24
to tup-...@googlegroups.com
AFAIR tup allows you to do whatever you want inside TMP dirs. Is there a way to change where emcc puts that temporary file ?

Another silly workaround is to declare it as a dependency then recreate an empty file there with an emcc wrapper. But surely there is a better alternative.
Reply all
Reply to author
Forward
0 new messages