Stream: compiler development

Topic: bundling modules that import blobs from paths


view this post on Zulip Richard Feldman (Jan 14 2024 at 18:12):

Brendan Hansknecht said:

How do you build a rust glue package if it depends on ../../roc_std/src/lib.rs?). You don't really want many copies of the same files, but might be stuck with that and versioning pains if we package src.

I'm not worried at all about the "many copies of the same files" part when it comes to glue :big_smile:

view this post on Zulip Richard Feldman (Jan 14 2024 at 18:13):

however, this does raise a general question about what to do with .. paths for static strings/byte lists in the context of bundling :thinking:

view this post on Zulip Richard Feldman (Jan 14 2024 at 18:13):

I'd never thought about this scenario until now, but my immediate thought is that of course the bundle should automatically include those

view this post on Zulip Richard Feldman (Jan 14 2024 at 18:13):

because otherwise in the general case, you download the bundle and it doesn't build

view this post on Zulip Richard Feldman (Jan 14 2024 at 18:13):

that's no good!

view this post on Zulip Richard Feldman (Jan 14 2024 at 18:21):

however, the paths are an interesting challenge because:

view this post on Zulip Richard Feldman (Jan 14 2024 at 18:21):

I guess we could also disallow bundling things with .. in their paths

view this post on Zulip Richard Feldman (Jan 14 2024 at 18:23):

of course, a downside of that is that if you didn't get an error sooner, you might not realize you'd included one until you went to make a release, which might be an unpleasant surprise

view this post on Zulip Brendan Hansknecht (Jan 14 2024 at 18:25):

Yeah, so bundling the compiled asset means we dont need to deal with that. Though it guess it is plausible for this to get hit in a regular package instead of a glue specific one

view this post on Zulip Richard Feldman (Jan 14 2024 at 18:25):

yeah this has to be solved regardless of glue

view this post on Zulip Notification Bot (Jan 14 2024 at 18:26):

10 messages were moved here from #ideas > specifying glue file in package module by Richard Feldman.

view this post on Zulip Richard Feldman (Jan 14 2024 at 18:27):

moved because this is a currently-unhandled edge case in the compiler :big_smile:


Last updated: Jul 06 2025 at 12:14 UTC