Skip to content

Doesn't work when vendored #57

@jcornaz

Description

@jcornaz

This project doesn't work when vendored.

To reproduce

# Create a go project
mkdir go-libsql-vendor-bug
cd go-libsql-vendor-bug
go mod init go-libsql-vendor-bug

# Write a main file
cat << EOF >> main.go
package main

import (
        _ "github.com/tursodatabase/go-libsql"
)

func main() {
}
EOF

# Vendor
go mod tidy
go mod vendor

# Try to build (Will fail)
go build .

Error

# github.com/tursodatabase/go-libsql
vendor/github.com/tursodatabase/go-libsql/libsql.go:16:10: fatal error: libsql.h: No such file or directory
   16 | #include <libsql.h>
      |          ^~~~~~~~~~

(may be related to #21)

Workaround

One may manually copy the content of the lib directory to fix the compilation issue. However, go mod vendor will always delete the workaround.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions