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

can't use winglibs from subdirectory #5457

Closed
eladcon opened this issue Jan 17, 2024 · 1 comment · Fixed by #5550
Closed

can't use winglibs from subdirectory #5457

eladcon opened this issue Jan 17, 2024 · 1 comment · Fixed by #5550
Labels
🐛 bug Something isn't working 🛠️ compiler Compiler 📚 libraries Wing Libraries

Comments

@eladcon
Copy link
Collaborator

eladcon commented Jan 17, 2024

I tried this:

using the fifoqueue winglib which has extern functions

// ./dir/main.w
bring fifoqueue;

let q = new fifoqueue.FifoQueue();

test "" {
  q.push("x", groupId: "y");
}
// ./package.json
{
  ...
  "dependencies": {
    "@winglibs/fifoqueue": "^0.0.2"
  }
}

This happened:

/private/tmp/a3/node_modules/@winglibs/fifoqueue/aws.js must be a sub directory of /private/tmp/a3/dir
   --> node_modules/@winglibs/fifoqueue/fifo-queue.aws.w:78:3
   |
78 |   extern "./aws.js" static inflight _push(queueUrl: str, message: str, groupId: str); 
   |   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ /private/tmp/a3/node_modules/@winglibs/fifoqueue/aws.js must be a sub directory of /private/tmp/a3/dir

I expected this:

No response

Is there a workaround?

No response

Anything else?

No response

Wing Version

No response

Node.js Version

No response

Platform(s)

No response

Community Notes

  • Please vote by adding a 👍 reaction to the issue to help us prioritize.
  • If you are interested to work on this issue, please leave a comment.
@eladcon eladcon added 🐛 bug Something isn't working 🛠️ compiler Compiler labels Jan 17, 2024
@monadabot monadabot added this to Wing Jan 17, 2024
@github-project-automation github-project-automation bot moved this to 🆕 New - not properly defined in Wing Jan 17, 2024
@staycoolcall911 staycoolcall911 added the 📚 libraries Wing Libraries label Jan 24, 2024
@staycoolcall911 staycoolcall911 moved this from 🆕 New - not properly defined to 🤝 Backlog - handoff to owners in Wing Jan 24, 2024
@mergify mergify bot closed this as completed in #5550 Jan 26, 2024
mergify bot pushed a commit that referenced this issue Jan 26, 2024
…dling for extern (#5550)

### Changes
- fixes #5457
  - Partially fixed, at least
  - The error was added as a dumb limitation of the relative path calculation, which is now fixed
  - However, this error was also used to prevent the creation of wing libraries that reference extern paths outside the library itself. This limitation is unnecessary for entrypoint files, so those cases now work
- Sourcemap source paths are now relative
  - They were previously emitted as absolute for reasons I don't remember, but it seems I got it working this time
  - This should also fix sourcemaps for typescript
- when bundling, avoid encoding the bundle output and just write the raw bytes to disk
- Omit wingsdk and node internals from pretty stack traces
- Removed parens from stack trace, not convinced it is useful
- Properly handle sourcemaps for inflight clients in the sim. Previously these were useless as the context was lost between the client/server

### Before

<img width="1398" alt="image" src="https://github.com/winglang/wing/assets/1237390/102077c0-ab57-4441-9825-a382ed95af16">

### After

<img width="835" alt="image" src="https://github.com/winglang/wing/assets/1237390/c2f36bf6-a2d7-40a2-ac7d-474ad6fbe336">


*By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
@github-project-automation github-project-automation bot moved this from 🤝 Backlog - handoff to owners to ✅ Done in Wing Jan 26, 2024
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.56.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working 🛠️ compiler Compiler 📚 libraries Wing Libraries
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants